16 #include "../tools/errorhandler.hpp" 17 #include "../tools/toolbox.hpp" 18 #include "../tools/MathToolbox.hpp" 19 #include "../datatypes/Scan.hpp" 20 #include "../datatypes/Object.hpp" 21 #include "../datatypes/Msg.hpp" 22 #include "../datatypes/Measurement.hpp" 23 #include "../datatypes/Fields.hpp" 24 #include "../datatypes/EvalCases.hpp" 25 #include "../datatypes/EvalCaseResults.hpp" 26 #include "../devices/LD_MRS.hpp" 69 Scan* scan =
dynamic_cast<Scan*
>(&data);
91 ntpTime.
second = unixTime.tv_sec + 0x83AA7E80;
92 ntpTime.
fraction = (uint32_t)( (
double)(unixTime.tv_usec+1) * (
double)(1LL<<32) * 1.0e-6 );
110 UINT32 sleepTimeMs = 2000;
111 usleep(sleepTimeMs * 1000);
115 now.tv_sec = 946681200;
127 printInfoMessage(
"LdmrsNtpTimeApp::changeThreadFunction(): Successfully set the NTP time.",
true);
132 printError(
"LdmrsNtpTimeApp::changeThreadFunction(): Failed to set NTP time!");
138 printError(
"LdmrsNtpTimeApp::changeThreadFunction(): Failed to get a valid pointer to the MRS, aborting!");
void printError(std::string message)
ntp_time_t convertUnixTimeToNtpTime(struct timeval &unixTime)
devices::BasicDevice * getFirstDeviceByType(Sourcetype type)
#define printInfoMessage(a, b)
LdmrsNtpTimeApp(Manager *manager)
const Time & getStartTimestamp() const
void changeThreadFunction(bool &endThread, UINT16 &waitTimeMs)
virtual ~LdmrsNtpTimeApp()
const ScannerInfo * getScannerInfoByDeviceId(UINT8 id) const
bool setNtpTime(UINT32 seconds, UINT32 fractionalSec)
std::string toLongString() const
void setData(BasicData &data)
SickThread< LdmrsNtpTimeApp,&LdmrsNtpTimeApp::changeThreadFunction > m_changeThread