add warnings
This commit is contained in:
@@ -225,12 +225,18 @@ PISystemTime PITimeMeasurer::elapsed() const {
|
|||||||
// PISystemTime::Frequency
|
// PISystemTime::Frequency
|
||||||
|
|
||||||
PISystemTime PISystemTime::Frequency::toSystemTime() const {
|
PISystemTime PISystemTime::Frequency::toSystemTime() const {
|
||||||
if (value_hz <= 0.) return PISystemTime();
|
if (value_hz <= 0.) {
|
||||||
|
piCout << "[PISystemTime::Frequency] toSystemTime() warning: invalid hertz" << value_hz;
|
||||||
|
return PISystemTime();
|
||||||
|
}
|
||||||
return PISystemTime::fromSeconds(1. / value_hz);
|
return PISystemTime::fromSeconds(1. / value_hz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PISystemTime::Frequency PISystemTime::Frequency::fromSystemTime(const PISystemTime & st) {
|
PISystemTime::Frequency PISystemTime::Frequency::fromSystemTime(const PISystemTime & st) {
|
||||||
if (st == PISystemTime()) return Frequency();
|
if (st == PISystemTime()) {
|
||||||
|
piCout << "[PISystemTime::Frequency] fromSystemTime() warning: null frequency";
|
||||||
|
return Frequency();
|
||||||
|
}
|
||||||
return Frequency(1. / st.toSeconds());
|
return Frequency(1. / st.toSeconds());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user