Commit 6a7bd24a authored by Pavel Vainerman's avatar Pavel Vainerman

(IO): fixed bug 'uninitialized time value'

parent af5ffad1
...@@ -289,19 +289,7 @@ namespace uniset ...@@ -289,19 +289,7 @@ namespace uniset
USensorInfo( USensorInfo&& ) = default; USensorInfo( USensorInfo&& ) = default;
USensorInfo& operator=(USensorInfo&& ) = default; USensorInfo& operator=(USensorInfo&& ) = default;
USensorInfo(): d_value(1), d_off_value(0) USensorInfo();
{
d_si.id = uniset::DefaultObjectId;
d_si.node = uniset::DefaultObjectId;
default_val = 0;
value = default_val;
real_value = default_val;
dbignore = false;
undefined = false;
blocked = false;
supplier = uniset::DefaultObjectId;
}
virtual ~USensorInfo() {} virtual ~USensorInfo() {}
USensorInfo(IOController_i::SensorIOInfo& r); USensorInfo(IOController_i::SensorIOInfo& r);
......
...@@ -590,7 +590,27 @@ IOController::USensorInfo::operator=(IOController_i::SensorIOInfo& r) ...@@ -590,7 +590,27 @@ IOController::USensorInfo::operator=(IOController_i::SensorIOInfo& r)
(*this) = r; (*this) = r;
return *this; return *this;
} }
// ----------------------------------------------------------------------------------------
IOController::USensorInfo::USensorInfo(): d_value(1), d_off_value(0)
{
d_si.id = uniset::DefaultObjectId;
d_si.node = uniset::DefaultObjectId;
default_val = 0;
value = default_val;
real_value = default_val;
dbignore = false;
undefined = false;
blocked = false;
supplier = uniset::DefaultObjectId;
// стоит ли выставлять текущее время
// Мы теряем возможность понять (по tv_sec=0),
// что значение ещё ни разу никем не менялось
auto tm = uniset::now_to_timespec();
tv_sec = tm.tv_sec;
tv_nsec = tm.tv_nsec;
}
// ----------------------------------------------------------------------------------------
IOController::USensorInfo& IOController::USensorInfo&
IOController::USensorInfo::operator=(IOController_i::SensorIOInfo* r) IOController::USensorInfo::operator=(IOController_i::SensorIOInfo* r)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment