switched from qsettings to json added editng of actors

This commit is contained in:
Carl Klemm 2019-06-06 21:19:12 +02:00
parent b04fbfb5bc
commit df27b622a0
141 changed files with 4402 additions and 5068 deletions

25
src/sensors/sunsensor.cpp Normal file
View 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())));
}