switched from qsettings to json added editng of actors
This commit is contained in:
parent
b04fbfb5bc
commit
df27b622a0
141 changed files with 4402 additions and 5068 deletions
25
src/sensors/sunsensor.cpp
Normal file
25
src/sensors/sunsensor.cpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#include "sunsensor.h"
|
||||
|
||||
SunSensorSource::SunSensorSource(double lat, double lon, QObject *parent): QObject(parent), sun_(lat, lon)
|
||||
{
|
||||
connect(&timer, SIGNAL(timeout()), this, SLOT(doTick()));
|
||||
}
|
||||
|
||||
void SunSensorSource::run()
|
||||
{
|
||||
connect(&timer, SIGNAL(timeout()), this, SLOT(doTick()));
|
||||
timer.setInterval(10000); //10s
|
||||
timer.start();
|
||||
doTick();
|
||||
}
|
||||
|
||||
|
||||
void SunSensorSource::abort()
|
||||
{
|
||||
if(timer.isActive())timer.stop();
|
||||
}
|
||||
|
||||
void SunSensorSource::doTick()
|
||||
{
|
||||
stateChanged(Sensor(Sensor::TYPE_SUN_ALTITUDE, 0, static_cast<float>(sun_.altitude())));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue