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
				
			
		
							
								
								
									
										45
									
								
								src/actors/sensoractor.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								src/actors/sensoractor.h
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,45 @@ | |||
| #pragma once | ||||
| #include "actor.h" | ||||
| #include "../sensors/sensor.h" | ||||
| 
 | ||||
| class SensorActor : public Actor | ||||
| { | ||||
|     Q_OBJECT | ||||
| public: | ||||
| 
 | ||||
|     static constexpr uint8_t SLOPE_UP   = 0; | ||||
|     static constexpr uint8_t SLOPE_DOWN = 1; | ||||
|     static constexpr uint8_t SLOPE_BOTH = 2; | ||||
| 
 | ||||
| private: | ||||
|     Sensor sensor_; | ||||
|     uint8_t sloap_ = SLOPE_UP; | ||||
|     float threshold_ = 0; | ||||
| 
 | ||||
| public slots: | ||||
|      | ||||
|     void sensorEvent(Sensor sensor); | ||||
| 
 | ||||
|     void setSloap(uint8_t sloap); | ||||
|     void setSensor(const Sensor sensor); | ||||
|     void setThreshold( float threshold ); | ||||
| 
 | ||||
| public: | ||||
| 
 | ||||
|     SensorActor(const Sensor sensor, QObject* parent = nullptr); | ||||
|     SensorActor(QObject* parent = nullptr); | ||||
|     Sensor getSensor(){return sensor_;} | ||||
|     virtual QString getName(); | ||||
|     virtual ~SensorActor(){} | ||||
| 
 | ||||
|     float getThreshold(); | ||||
|     uint8_t getSloap(); | ||||
|      | ||||
|     virtual void store(QJsonObject& json); | ||||
|     virtual void load(const QJsonObject& json); | ||||
|      | ||||
|     virtual void store(QString subsecton, QSettings* settings); | ||||
|     virtual void load(QString subsecton, QSettings* settings); | ||||
| }; | ||||
| 
 | ||||
| 
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue