diff --git a/command.cpp b/command.cpp new file mode 100644 index 0000000..8b0da2b --- /dev/null +++ b/command.cpp @@ -0,0 +1,6 @@ +#include "command.h" + +Command::Command() +{ + +} diff --git a/command.h b/command.h new file mode 100644 index 0000000..bfd7e70 --- /dev/null +++ b/command.h @@ -0,0 +1,13 @@ +#ifndef COMMAND_H +#define COMMAND_H + +#include + +class Command +{ +public: + Command(); + virtual void exec() = 0; +}; + +#endif // COMMAND_H diff --git a/datapollcommand.h b/datapollcommand.h new file mode 100644 index 0000000..b5cc84d --- /dev/null +++ b/datapollcommand.h @@ -0,0 +1,18 @@ +#ifndef DATAPOLLCOMMAND_H +#define DATAPOLLCOMMAND_H + +#include + +#include "command.h" +#include "src/MLX90640_API.h" + +class DataPollCommand : public QObject, public Command +{ +protected: + MLX90640* _thermal; +public: + DataPollCommand(MLX90640* thermal) : _thermal(thermal){} + void exec() override {_thermal->getData();} +}; + +#endif // DATAPOLLCOMMAND_H diff --git a/doc/Untitled.mdj b/doc/Untitled.mdj index 1c28feb..4e59490 100644 --- a/doc/Untitled.mdj +++ b/doc/Untitled.mdj @@ -28,7 +28,7 @@ }, "font": "Arial;13;0", "left": 320, - "top": 64, + "top": 112, "width": 321, "height": 128 }, @@ -155,6 +155,24 @@ "height": 13, "text": "+imageVect: Qvector", "horizontalAlignment": 0 + }, + { + "_type": "UMLAttributeView", + "_id": "AAAAAAGIcTLGGCpSOuc=", + "_parent": { + "$ref": "AAAAAAGIa8Lw9oUFMSc=" + }, + "model": { + "$ref": "AAAAAAGIcTLGDipPZho=" + }, + "fillColor": "#d8e1f8", + "font": "Arial;13;0", + "left": 413, + "top": 301, + "width": 160.7861328125, + "height": 13, + "text": "«signal»+dataReady", + "horizontalAlignment": 0 } ], "fillColor": "#d8e1f8", @@ -162,7 +180,7 @@ "left": 408, "top": 281, "width": 170.7861328125, - "height": 23 + "height": 38 }, { "_type": "UMLOperationCompartmentView", @@ -186,7 +204,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": 413, - "top": 309, + "top": 324, "width": 160.7861328125, "height": 13, "text": "+readData()", @@ -204,7 +222,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": 413, - "top": 324, + "top": 339, "width": 160.7861328125, "height": 13, "text": "+fuzzyInit()", @@ -222,7 +240,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": 413, - "top": 339, + "top": 354, "width": 160.7861328125, "height": 13, "text": "+...()", @@ -232,7 +250,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": 408, - "top": 304, + "top": 319, "width": 170.7861328125, "height": 53 }, @@ -277,7 +295,7 @@ "left": 408, "top": 256, "width": 170.7861328125, - "height": 101, + "height": 116, "nameCompartment": { "$ref": "AAAAAAGIa8Lw9YUAWS8=" }, @@ -324,7 +342,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": -464, - "top": 16, + "top": 112, "height": 13 }, { @@ -336,7 +354,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;1", "left": 77, - "top": 111, + "top": 159, "width": 41.919921875, "height": 13, "text": "i2cif" @@ -351,7 +369,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": -464, - "top": 16, + "top": 112, "width": 73.67724609375, "height": 13, "text": "(from Model)" @@ -366,7 +384,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": -464, - "top": 16, + "top": 112, "height": 13, "horizontalAlignment": 1 } @@ -374,7 +392,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": 72, - "top": 104, + "top": 152, "width": 51.919921875, "height": 25, "stereotypeLabel": { @@ -402,7 +420,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": 72, - "top": 129, + "top": 177, "width": 51.919921875, "height": 10 }, @@ -418,7 +436,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": 72, - "top": 139, + "top": 187, "width": 51.919921875, "height": 10 }, @@ -435,7 +453,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": -232, - "top": 8, + "top": 56, "width": 10, "height": 10 }, @@ -452,7 +470,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": -232, - "top": 8, + "top": 56, "width": 10, "height": 10 } @@ -461,7 +479,7 @@ "font": "Arial;13;0", "containerChangeable": true, "left": 72, - "top": 104, + "top": 152, "width": 51.919921875, "height": 45, "nameCompartment": { @@ -510,7 +528,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": -307, - "top": -283, + "top": -187, "height": 13 }, { @@ -522,7 +540,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;1", "left": 341, - "top": 95, + "top": 143, "width": 80.57080078125, "height": 13, "text": "i2cDriver" @@ -537,7 +555,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": -307, - "top": -283, + "top": -187, "width": 73.67724609375, "height": 13, "text": "(from Model)" @@ -552,7 +570,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": -307, - "top": -283, + "top": -187, "height": 13, "horizontalAlignment": 1 } @@ -560,7 +578,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": 336, - "top": 88, + "top": 136, "width": 90.57080078125, "height": 25, "stereotypeLabel": { @@ -588,7 +606,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": 336, - "top": 113, + "top": 161, "width": 90.57080078125, "height": 10 }, @@ -614,7 +632,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": 341, - "top": 128, + "top": 176, "width": 80.57080078125, "height": 13, "text": "+read()", @@ -632,7 +650,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": 341, - "top": 143, + "top": 191, "width": 80.57080078125, "height": 13, "text": "+write()", @@ -642,7 +660,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": 336, - "top": 123, + "top": 171, "width": 90.57080078125, "height": 38 }, @@ -659,7 +677,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": -184, - "top": -40, + "top": 8, "width": 10, "height": 10 }, @@ -676,7 +694,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": -184, - "top": -40, + "top": 8, "width": 10, "height": 10 } @@ -685,7 +703,7 @@ "font": "Arial;13;0", "containerChangeable": true, "left": 336, - "top": 88, + "top": 136, "width": 90.57080078125, "height": 73, "nameCompartment": { @@ -734,7 +752,7 @@ "fillColor": "#ffffcd", "font": "Arial;13;0", "left": -400, - "top": -256, + "top": -160, "width": 64.32080078125, "height": 13, "text": "«interface»" @@ -748,7 +766,7 @@ "fillColor": "#ffffcd", "font": "Arial;13;1", "left": 461, - "top": 150, + "top": 198, "width": 61.419921875, "height": 13, "text": "i2cDriver" @@ -763,7 +781,7 @@ "fillColor": "#ffffcd", "font": "Arial;13;0", "left": -400, - "top": -256, + "top": -160, "width": 73.67724609375, "height": 13, "text": "(from Model)" @@ -778,7 +796,7 @@ "fillColor": "#ffffcd", "font": "Arial;13;0", "left": -400, - "top": -256, + "top": -160, "height": 13, "horizontalAlignment": 1 } @@ -786,7 +804,7 @@ "fillColor": "#ffffcd", "font": "Arial;13;0", "left": 456, - "top": 143, + "top": 191, "width": 71.419921875, "height": 25, "stereotypeLabel": { @@ -815,7 +833,7 @@ "fillColor": "#ffffcd", "font": "Arial;13;0", "left": -200, - "top": -128, + "top": -80, "width": 10, "height": 10 }, @@ -832,7 +850,7 @@ "fillColor": "#ffffcd", "font": "Arial;13;0", "left": -200, - "top": -128, + "top": -80, "width": 10, "height": 10 }, @@ -849,7 +867,7 @@ "fillColor": "#ffffcd", "font": "Arial;13;0", "left": -200, - "top": -128, + "top": -80, "width": 10, "height": 10 }, @@ -866,7 +884,7 @@ "fillColor": "#ffffcd", "font": "Arial;13;0", "left": -200, - "top": -128, + "top": -80, "width": 10, "height": 10 } @@ -875,7 +893,7 @@ "font": "Arial;13;0", "containerChangeable": true, "left": 456, - "top": 120, + "top": 168, "width": 71.419921875, "height": 49, "stereotypeDisplay": "icon", @@ -919,7 +937,7 @@ "visible": false, "font": "Arial;13;0", "left": 453, - "top": 111, + "top": 159, "height": 13, "alpha": 1.5707963267948966, "distance": 15, @@ -940,7 +958,7 @@ "visible": null, "font": "Arial;13;0", "left": 454, - "top": 96, + "top": 144, "height": 13, "alpha": 1.5707963267948966, "distance": 30, @@ -961,7 +979,7 @@ "visible": false, "font": "Arial;13;0", "left": 452, - "top": 140, + "top": 188, "height": 13, "alpha": -1.5707963267948966, "distance": 15, @@ -979,7 +997,7 @@ "$ref": "AAAAAAGIa8QVSYYxUNI=" }, "lineStyle": 1, - "points": "427:132;479.7099609375:133.19528537326389", + "points": "427:180;479.7099609375:181.19528537326389", "showVisibility": true, "nameLabel": { "$ref": "AAAAAAGIa8RX94afZfc=" @@ -1194,7 +1212,7 @@ "visible": false, "font": "Arial;13;0", "left": 475, - "top": 383, + "top": 390, "height": 13, "alpha": 1.5707963267948966, "distance": 15, @@ -1215,7 +1233,7 @@ "visible": null, "font": "Arial;13;0", "left": 460, - "top": 383, + "top": 389, "height": 13, "alpha": 1.5707963267948966, "distance": 30, @@ -1236,7 +1254,7 @@ "visible": false, "font": "Arial;13;0", "left": 504, - "top": 384, + "top": 391, "height": 13, "alpha": -1.5707963267948966, "distance": 15, @@ -1256,7 +1274,7 @@ }, "visible": false, "font": "Arial;13;0", - "left": 474, + "left": 475, "top": 390, "height": 13, "alpha": 0.5235987755982988, @@ -1277,8 +1295,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 461, - "top": 387, + "left": 462, + "top": 388, "height": 13, "alpha": 0.7853981633974483, "distance": 40, @@ -1320,7 +1338,7 @@ "visible": false, "font": "Arial;13;0", "left": 475, - "top": 376, + "top": 391, "height": 13, "alpha": -0.5235987755982988, "distance": 30, @@ -1339,8 +1357,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 461, - "top": 378, + "left": 462, + "top": 393, "height": 13, "alpha": -0.7853981633974483, "distance": 40, @@ -1359,8 +1377,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 502, - "top": 373, + "left": 503, + "top": 387, "height": 13, "alpha": 0.5235987755982988, "distance": 25, @@ -1405,7 +1423,7 @@ "$ref": "AAAAAAGIa8Tz14iuRiI=" }, "lineStyle": 1, - "points": "489:423;491:357", + "points": "490:423;491:372", "showVisibility": true, "nameLabel": { "$ref": "AAAAAAGIa8UNv4m/G9A=" @@ -1599,7 +1617,7 @@ "top": 444, "width": 229.4169921875, "height": 13, - "text": "+minValue: float", + "text": "+minValue", "horizontalAlignment": 0 }, { @@ -1617,7 +1635,7 @@ "top": 459, "width": 229.4169921875, "height": 13, - "text": "+maxValue: float", + "text": "+maxValue", "horizontalAlignment": 0 } ], @@ -2185,7 +2203,7 @@ "top": 324, "width": 173.04345703125, "height": 13, - "text": "+Color encode(value: float)", + "text": "+Color encode(value)", "horizontalAlignment": 0 } ], @@ -3898,6 +3916,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": -752, + "top": 96, "height": 13 }, { @@ -3909,7 +3928,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;1", "left": 173, - "top": 103, + "top": 151, "width": 114.8671875, "height": 13, "text": "i2cDriverSingleton" @@ -3924,6 +3943,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": -752, + "top": 96, "width": 73.67724609375, "height": 13, "text": "(from Model)" @@ -3938,6 +3958,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": -752, + "top": 96, "height": 13, "horizontalAlignment": 1 } @@ -3945,7 +3966,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": 168, - "top": 96, + "top": 144, "width": 124.8671875, "height": 25, "stereotypeLabel": { @@ -3983,7 +4004,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": 173, - "top": 126, + "top": 174, "width": 114.8671875, "height": 13, "text": "+driver: i2cif", @@ -3993,7 +4014,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": 168, - "top": 121, + "top": 169, "width": 124.8671875, "height": 23 }, @@ -4009,7 +4030,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": 168, - "top": 144, + "top": 192, "width": 124.8671875, "height": 10 }, @@ -4026,6 +4047,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": -376, + "top": 48, "width": 10, "height": 10 }, @@ -4042,6 +4064,7 @@ "fillColor": "#d8e1f8", "font": "Arial;13;0", "left": -376, + "top": 48, "width": 10, "height": 10 } @@ -4050,7 +4073,7 @@ "font": "Arial;13;0", "containerChangeable": true, "left": 168, - "top": 96, + "top": 144, "width": 124.8671875, "height": 58, "nameCompartment": { @@ -4091,7 +4114,7 @@ "visible": false, "font": "Arial;13;0", "left": 476, - "top": 192, + "top": 216, "height": 13, "alpha": 1.5707963267948966, "distance": 15, @@ -4112,7 +4135,7 @@ "visible": null, "font": "Arial;13;0", "left": 461, - "top": 192, + "top": 216, "height": 13, "alpha": 1.5707963267948966, "distance": 30, @@ -4133,7 +4156,7 @@ "visible": false, "font": "Arial;13;0", "left": 505, - "top": 193, + "top": 217, "height": 13, "alpha": -1.5707963267948966, "distance": 15, @@ -4151,7 +4174,7 @@ "$ref": "AAAAAAGIa8Lw9YT/lhc=" }, "lineStyle": 1, - "points": "492:255;491:143", + "points": "492:255;491:191", "showVisibility": true, "nameLabel": { "$ref": "AAAAAAGIcRdgPUKHFdA=" @@ -4185,7 +4208,7 @@ "visible": false, "font": "Arial;13;0", "left": 145, - "top": 133, + "top": 181, "height": 13, "alpha": 1.5707963267948966, "distance": 15, @@ -4206,7 +4229,7 @@ "visible": null, "font": "Arial;13;0", "left": 146, - "top": 148, + "top": 196, "height": 13, "alpha": 1.5707963267948966, "distance": 30, @@ -4227,7 +4250,7 @@ "visible": false, "font": "Arial;13;0", "left": 144, - "top": 104, + "top": 152, "height": 13, "alpha": -1.5707963267948966, "distance": 15, @@ -4248,7 +4271,7 @@ "visible": false, "font": "Arial;13;0", "left": 141, - "top": 134, + "top": 182, "height": 13, "alpha": 0.5235987755982988, "distance": 30, @@ -4269,7 +4292,7 @@ "visible": false, "font": "Arial;13;0", "left": 139, - "top": 147, + "top": 195, "height": 13, "alpha": 0.7853981633974483, "distance": 40, @@ -4290,7 +4313,7 @@ "visible": false, "font": "Arial;13;0", "left": 145, - "top": 107, + "top": 155, "height": 13, "alpha": -0.5235987755982988, "distance": 25, @@ -4311,7 +4334,7 @@ "visible": false, "font": "Arial;13;0", "left": 150, - "top": 134, + "top": 182, "height": 13, "alpha": -0.5235987755982988, "distance": 30, @@ -4331,7 +4354,7 @@ "visible": false, "font": "Arial;13;0", "left": 152, - "top": 147, + "top": 195, "height": 13, "alpha": -0.7853981633974483, "distance": 40, @@ -4351,7 +4374,7 @@ "visible": false, "font": "Arial;13;0", "left": 145, - "top": 107, + "top": 155, "height": 13, "alpha": 0.5235987755982988, "distance": 25, @@ -4370,6 +4393,7 @@ }, "visible": false, "font": "Arial;13;0", + "top": 48, "width": 10, "height": 10 }, @@ -4384,6 +4408,7 @@ }, "visible": false, "font": "Arial;13;0", + "top": 48, "width": 10, "height": 10 } @@ -4396,7 +4421,7 @@ "$ref": "AAAAAAGIcRZ+syJhnrU=" }, "lineStyle": 1, - "points": "167:125;124:126", + "points": "167:173;124:174", "showVisibility": true, "nameLabel": { "$ref": "AAAAAAGIcRfPgknhFU0=" @@ -4455,7 +4480,7 @@ "visible": false, "font": "Arial;13;0", "left": 313, - "top": 133, + "top": 181, "height": 13, "alpha": 1.5707963267948966, "distance": 15, @@ -4476,7 +4501,7 @@ "visible": null, "font": "Arial;13;0", "left": 313, - "top": 148, + "top": 196, "height": 13, "alpha": 1.5707963267948966, "distance": 30, @@ -4497,7 +4522,7 @@ "visible": false, "font": "Arial;13;0", "left": 314, - "top": 103, + "top": 151, "height": 13, "alpha": -1.5707963267948966, "distance": 15, @@ -4515,7 +4540,7 @@ "$ref": "AAAAAAGIa8QVSYYxUNI=" }, "lineStyle": 1, - "points": "335:124;293:124", + "points": "335:172;293:172", "showVisibility": true, "nameLabel": { "$ref": "AAAAAAGIcRfmkE5fq9M=" @@ -4535,7 +4560,7 @@ }, "font": "Arial;13;0", "left": 528, - "top": 96, + "top": 144, "width": 82.8798828125, "height": 40, "text": "Paradigme fonctionnel" @@ -4561,8 +4586,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 359, - "top": 400, + "left": 356, + "top": 407, "height": 13, "alpha": 1.5707963267948966, "distance": 15, @@ -4582,8 +4607,8 @@ }, "visible": null, "font": "Arial;13;0", - "left": 349, - "top": 389, + "left": 346, + "top": 396, "height": 13, "alpha": 1.5707963267948966, "distance": 30, @@ -4603,8 +4628,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 380, - "top": 423, + "left": 375, + "top": 430, "height": 13, "alpha": -1.5707963267948966, "distance": 15, @@ -4624,7 +4649,7 @@ }, "visible": false, "font": "Arial;13;0", - "left": 313, + "left": 315, "top": 444, "height": 13, "alpha": 0.5235987755982988, @@ -4645,7 +4670,7 @@ }, "visible": false, "font": "Arial;13;0", - "left": 305, + "left": 308, "top": 433, "height": 13, "alpha": 0.7853981633974483, @@ -4666,7 +4691,7 @@ }, "visible": false, "font": "Arial;13;0", - "left": 328, + "left": 330, "top": 467, "height": 13, "alpha": -0.5235987755982988, @@ -4687,8 +4712,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 407, - "top": 357, + "left": 396, + "top": 372, "height": 13, "alpha": -0.5235987755982988, "distance": 30, @@ -4707,8 +4732,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 397, - "top": 349, + "left": 386, + "top": 363, "height": 13, "alpha": -0.7853981633974483, "distance": 40, @@ -4727,8 +4752,8 @@ }, "visible": false, "font": "Arial;13;0", - "left": 429, - "top": 374, + "left": 418, + "top": 389, "height": 13, "alpha": 0.5235987755982988, "distance": 25, @@ -4773,7 +4798,7 @@ "$ref": "AAAAAAGIcQ9LEcl+zlM=" }, "lineStyle": 1, - "points": "304:479;437:357", + "points": "306:479;426:372", "showVisibility": true, "nameLabel": { "$ref": "AAAAAAGIcRpl75Pnmrg=" @@ -4809,6 +4834,500 @@ "headQualifiersCompartment": { "$ref": "AAAAAAGIcRpl75PxOes=" } + }, + { + "_type": "UMLClassView", + "_id": "AAAAAAGIcSHkoQ5wqfk=", + "_parent": { + "$ref": "AAAAAAFF+qBtyKM79qY=" + }, + "model": { + "$ref": "AAAAAAGIcSHkoA5unh8=" + }, + "subViews": [ + { + "_type": "UMLNameCompartmentView", + "_id": "AAAAAAGIcSHkoQ5x6ic=", + "_parent": { + "$ref": "AAAAAAGIcSHkoQ5wqfk=" + }, + "model": { + "$ref": "AAAAAAGIcSHkoA5unh8=" + }, + "subViews": [ + { + "_type": "LabelView", + "_id": "AAAAAAGIcSHkoQ5ynjM=", + "_parent": { + "$ref": "AAAAAAGIcSHkoQ5x6ic=" + }, + "visible": false, + "fillColor": "#d8e1f8", + "font": "Arial;13;0", + "left": -272, + "top": -192, + "height": 13 + }, + { + "_type": "LabelView", + "_id": "AAAAAAGIcSHkoQ5zAJc=", + "_parent": { + "$ref": "AAAAAAGIcSHkoQ5x6ic=" + }, + "fillColor": "#d8e1f8", + "font": "Arial;13;1", + "left": 61, + "top": 239, + "width": 80.57080078125, + "height": 13, + "text": "Conv" + }, + { + "_type": "LabelView", + "_id": "AAAAAAGIcSHkoQ50KYE=", + "_parent": { + "$ref": "AAAAAAGIcSHkoQ5x6ic=" + }, + "visible": false, + "fillColor": "#d8e1f8", + "font": "Arial;13;0", + "left": -272, + "top": -192, + "width": 73.67724609375, + "height": 13, + "text": "(from Model)" + }, + { + "_type": "LabelView", + "_id": "AAAAAAGIcSHkoQ51BLQ=", + "_parent": { + "$ref": "AAAAAAGIcSHkoQ5x6ic=" + }, + "visible": false, + "fillColor": "#d8e1f8", + "font": "Arial;13;0", + "left": -272, + "top": -192, + "height": 13, + "horizontalAlignment": 1 + } + ], + "fillColor": "#d8e1f8", + "font": "Arial;13;0", + "left": 56, + "top": 232, + "width": 90.57080078125, + "height": 25, + "stereotypeLabel": { + "$ref": "AAAAAAGIcSHkoQ5ynjM=" + }, + "nameLabel": { + "$ref": "AAAAAAGIcSHkoQ5zAJc=" + }, + "namespaceLabel": { + "$ref": "AAAAAAGIcSHkoQ50KYE=" + }, + "propertyLabel": { + "$ref": "AAAAAAGIcSHkoQ51BLQ=" + } + }, + { + "_type": "UMLAttributeCompartmentView", + "_id": "AAAAAAGIcSHkoQ52u2Y=", + "_parent": { + "$ref": "AAAAAAGIcSHkoQ5wqfk=" + }, + "model": { + "$ref": "AAAAAAGIcSHkoA5unh8=" + }, + "fillColor": "#d8e1f8", + "font": "Arial;13;0", + "left": 56, + "top": 257, + "width": 90.57080078125, + "height": 10 + }, + { + "_type": "UMLOperationCompartmentView", + "_id": "AAAAAAGIcSHkoQ53mDs=", + "_parent": { + "$ref": "AAAAAAGIcSHkoQ5wqfk=" + }, + "model": { + "$ref": "AAAAAAGIcSHkoA5unh8=" + }, + "subViews": [ + { + "_type": "UMLOperationView", + "_id": "AAAAAAGIcSJAxhmPrww=", + "_parent": { + "$ref": "AAAAAAGIcSHkoQ53mDs=" + }, + "model": { + "$ref": "AAAAAAGIcSJAuBl37sw=" + }, + "fillColor": "#d8e1f8", + "font": "Arial;13;0", + "left": 61, + "top": 272, + "width": 80.57080078125, + "height": 13, + "text": "+toHex()", + "horizontalAlignment": 0 + }, + { + "_type": "UMLOperationView", + "_id": "AAAAAAGIcSJgfBweNCA=", + "_parent": { + "$ref": "AAAAAAGIcSHkoQ53mDs=" + }, + "model": { + "$ref": "AAAAAAGIcSJgcxwGcBk=" + }, + "fillColor": "#d8e1f8", + "font": "Arial;13;0", + "left": 61, + "top": 287, + "width": 80.57080078125, + "height": 13, + "text": "+toString()", + "horizontalAlignment": 0 + } + ], + "fillColor": "#d8e1f8", + "font": "Arial;13;0", + "left": 56, + "top": 267, + "width": 90.57080078125, + "height": 38 + }, + { + "_type": "UMLReceptionCompartmentView", + "_id": "AAAAAAGIcSHkoQ54Vj8=", + "_parent": { + "$ref": "AAAAAAGIcSHkoQ5wqfk=" + }, + "model": { + "$ref": "AAAAAAGIcSHkoA5unh8=" + }, + "visible": false, + "fillColor": "#d8e1f8", + "font": "Arial;13;0", + "left": -136, + "top": -96, + "width": 10, + "height": 10 + }, + { + "_type": "UMLTemplateParameterCompartmentView", + "_id": "AAAAAAGIcSHkoQ55/1U=", + "_parent": { + "$ref": "AAAAAAGIcSHkoQ5wqfk=" + }, + "model": { + "$ref": "AAAAAAGIcSHkoA5unh8=" + }, + "visible": false, + "fillColor": "#d8e1f8", + "font": "Arial;13;0", + "left": -136, + "top": -96, + "width": 10, + "height": 10 + } + ], + "fillColor": "#d8e1f8", + "font": "Arial;13;0", + "containerChangeable": true, + "left": 56, + "top": 232, + "width": 90.57080078125, + "height": 73, + "nameCompartment": { + "$ref": "AAAAAAGIcSHkoQ5x6ic=" + }, + "attributeCompartment": { + "$ref": "AAAAAAGIcSHkoQ52u2Y=" + }, + "operationCompartment": { + "$ref": "AAAAAAGIcSHkoQ53mDs=" + }, + "receptionCompartment": { + "$ref": "AAAAAAGIcSHkoQ54Vj8=" + }, + "templateParameterCompartment": { + "$ref": "AAAAAAGIcSHkoQ55/1U=" + } + }, + { + "_type": "UMLAssociationView", + "_id": "AAAAAAGIcSICXxdPBfQ=", + "_parent": { + "$ref": "AAAAAAFF+qBtyKM79qY=" + }, + "model": { + "$ref": "AAAAAAGIcSICXhdLEqc=" + }, + "subViews": [ + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGIcSICXxdQ3/Y=", + "_parent": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + }, + "model": { + "$ref": "AAAAAAGIcSICXhdLEqc=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 112, + "top": 207, + "height": 13, + "alpha": 1.5707963267948966, + "distance": 15, + "hostEdge": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + }, + "edgePosition": 1 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGIcSICXxdRzyc=", + "_parent": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + }, + "model": { + "$ref": "AAAAAAGIcSICXhdLEqc=" + }, + "visible": null, + "font": "Arial;13;0", + "left": 127, + "top": 206, + "height": 13, + "alpha": 1.5707963267948966, + "distance": 30, + "hostEdge": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + }, + "edgePosition": 1 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGIcSICXxdSYV8=", + "_parent": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + }, + "model": { + "$ref": "AAAAAAGIcSICXhdLEqc=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 83, + "top": 208, + "height": 13, + "alpha": -1.5707963267948966, + "distance": 15, + "hostEdge": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + }, + "edgePosition": 1 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGIcSICXxdTwaU=", + "_parent": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + }, + "model": { + "$ref": "AAAAAAGIcSICXhdMejw=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 113, + "top": 216, + "height": 13, + "alpha": 0.5235987755982988, + "distance": 30, + "hostEdge": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + }, + "edgePosition": 2 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGIcSICXxdUjkE=", + "_parent": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + }, + "model": { + "$ref": "AAAAAAGIcSICXhdMejw=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 127, + "top": 218, + "height": 13, + "alpha": 0.7853981633974483, + "distance": 40, + "hostEdge": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + }, + "edgePosition": 2 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGIcSICXxdVyKg=", + "_parent": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + }, + "model": { + "$ref": "AAAAAAGIcSICXhdMejw=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 86, + "top": 213, + "height": 13, + "alpha": -0.5235987755982988, + "distance": 25, + "hostEdge": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + }, + "edgePosition": 2 + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGIcSICXxdWL5U=", + "_parent": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + }, + "model": { + "$ref": "AAAAAAGIcSICXhdNPBQ=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 113, + "top": 198, + "height": 13, + "alpha": -0.5235987755982988, + "distance": 30, + "hostEdge": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + } + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGIcSICXxdXhv0=", + "_parent": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + }, + "model": { + "$ref": "AAAAAAGIcSICXhdNPBQ=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 126, + "top": 195, + "height": 13, + "alpha": -0.7853981633974483, + "distance": 40, + "hostEdge": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + } + }, + { + "_type": "EdgeLabelView", + "_id": "AAAAAAGIcSICXxdYtt4=", + "_parent": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + }, + "model": { + "$ref": "AAAAAAGIcSICXhdNPBQ=" + }, + "visible": false, + "font": "Arial;13;0", + "left": 85, + "top": 203, + "height": 13, + "alpha": 0.5235987755982988, + "distance": 25, + "hostEdge": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + } + }, + { + "_type": "UMLQualifierCompartmentView", + "_id": "AAAAAAGIcSICXxdZ/5Y=", + "_parent": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + }, + "model": { + "$ref": "AAAAAAGIcSICXhdMejw=" + }, + "visible": false, + "font": "Arial;13;0", + "width": 10, + "height": 10 + }, + { + "_type": "UMLQualifierCompartmentView", + "_id": "AAAAAAGIcSICXxdab+w=", + "_parent": { + "$ref": "AAAAAAGIcSICXxdPBfQ=" + }, + "model": { + "$ref": "AAAAAAGIcSICXhdNPBQ=" + }, + "visible": false, + "font": "Arial;13;0", + "width": 10, + "height": 10 + } + ], + "font": "Arial;13;0", + "head": { + "$ref": "AAAAAAGIcSHkoQ5wqfk=" + }, + "tail": { + "$ref": "AAAAAAGIa8NX1YUx3ts=" + }, + "lineStyle": 1, + "points": "98:197;99:231", + "showVisibility": true, + "nameLabel": { + "$ref": "AAAAAAGIcSICXxdQ3/Y=" + }, + "stereotypeLabel": { + "$ref": "AAAAAAGIcSICXxdRzyc=" + }, + "propertyLabel": { + "$ref": "AAAAAAGIcSICXxdSYV8=" + }, + "showEndOrder": "hide", + "tailRoleNameLabel": { + "$ref": "AAAAAAGIcSICXxdTwaU=" + }, + "tailPropertyLabel": { + "$ref": "AAAAAAGIcSICXxdUjkE=" + }, + "tailMultiplicityLabel": { + "$ref": "AAAAAAGIcSICXxdVyKg=" + }, + "headRoleNameLabel": { + "$ref": "AAAAAAGIcSICXxdWL5U=" + }, + "headPropertyLabel": { + "$ref": "AAAAAAGIcSICXxdXhv0=" + }, + "headMultiplicityLabel": { + "$ref": "AAAAAAGIcSICXxdYtt4=" + }, + "tailQualifiersCompartment": { + "$ref": "AAAAAAGIcSICXxdZ/5Y=" + }, + "headQualifiersCompartment": { + "$ref": "AAAAAAGIcSICXxdab+w=" + } } ] }, @@ -4899,6 +5418,15 @@ }, "name": "imageVect", "type": "Qvector" + }, + { + "_type": "UMLAttribute", + "_id": "AAAAAAGIcTLGDipPZho=", + "_parent": { + "$ref": "AAAAAAGIa8Lw9IT9+0g=" + }, + "name": "dataReady", + "stereotype": "signal" } ], "operations": [ @@ -4963,6 +5491,34 @@ }, "navigable": "navigable" } + }, + { + "_type": "UMLAssociation", + "_id": "AAAAAAGIcSICXhdLEqc=", + "_parent": { + "$ref": "AAAAAAGIa8NX1IUv4V8=" + }, + "end1": { + "_type": "UMLAssociationEnd", + "_id": "AAAAAAGIcSICXhdMejw=", + "_parent": { + "$ref": "AAAAAAGIcSICXhdLEqc=" + }, + "reference": { + "$ref": "AAAAAAGIa8NX1IUv4V8=" + } + }, + "end2": { + "_type": "UMLAssociationEnd", + "_id": "AAAAAAGIcSICXhdNPBQ=", + "_parent": { + "$ref": "AAAAAAGIcSICXhdLEqc=" + }, + "reference": { + "$ref": "AAAAAAGIcSHkoA5unh8=" + }, + "navigable": "navigable" + } } ] }, @@ -5167,10 +5723,7 @@ "_parent": { "$ref": "AAAAAAGIcQcO13bpixU=" }, - "name": "minValue", - "type": { - "$ref": "AAAAAAGIa8WXkI4+sZk=" - } + "name": "minValue" }, { "_type": "UMLAttribute", @@ -5178,10 +5731,7 @@ "_parent": { "$ref": "AAAAAAGIcQcO13bpixU=" }, - "name": "maxValue", - "type": { - "$ref": "AAAAAAGIa8WXkI4+sZk=" - } + "name": "maxValue" } ], "operations": [ @@ -5323,10 +5873,7 @@ "_parent": { "$ref": "AAAAAAGIcQvKeJuGCxs=" }, - "name": "value", - "type": { - "$ref": "AAAAAAGIa8WXkI4+sZk=" - } + "name": "value" } ] } @@ -5587,6 +6134,32 @@ } } ] + }, + { + "_type": "UMLClass", + "_id": "AAAAAAGIcSHkoA5unh8=", + "_parent": { + "$ref": "AAAAAAFF+qBWK6M3Z8Y=" + }, + "name": "Conv", + "operations": [ + { + "_type": "UMLOperation", + "_id": "AAAAAAGIcSJAuBl37sw=", + "_parent": { + "$ref": "AAAAAAGIcSHkoA5unh8=" + }, + "name": "toHex" + }, + { + "_type": "UMLOperation", + "_id": "AAAAAAGIcSJgcxwGcBk=", + "_parent": { + "$ref": "AAAAAAGIcSHkoA5unh8=" + }, + "name": "toString" + } + ] } ] }, diff --git a/pollingtimer.cpp b/pollingtimer.cpp new file mode 100644 index 0000000..b3527fc --- /dev/null +++ b/pollingtimer.cpp @@ -0,0 +1,24 @@ +#include "pollingtimer.h" +#include + +void PollingTimer::start(){ + shouldRun = true; +} + +void PollingTimer::stop(){ + shouldRun = false; +} + +void PollingTimer::doLoop(){ + std::chrono::steady_clock::time_point begin; + std::chrono::steady_clock::time_point end; + + while(shouldRun){ + begin = std::chrono::steady_clock::now(); + _c->exec(); + end = std::chrono::steady_clock::now(); + std::this_thread::sleep_for( + std::chrono::microseconds((this->timeout) + - std::chrono::duration_cast(end - begin).count())); + } +} diff --git a/pollingtimer.h b/pollingtimer.h new file mode 100644 index 0000000..e0ebbcf --- /dev/null +++ b/pollingtimer.h @@ -0,0 +1,26 @@ +#ifndef POLLINGTIMER_H +#define POLLINGTIMER_H + +#include +#include +#include + +#include "command.h" + +class PollingTimer +{ +protected: + std::atomic shouldRun; + std::thread* myThread; + + Command* _c; + + unsigned int timeout; + void doLoop(); +public: + PollingTimer(Command* c) : shouldRun(false), _c(c){} + void start(); + void stop(); +}; + +#endif // POLLINGTIMER_H diff --git a/thermaldatarenderer.cpp b/thermaldatarenderer.cpp new file mode 100644 index 0000000..8495fc5 --- /dev/null +++ b/thermaldatarenderer.cpp @@ -0,0 +1,6 @@ +#include "thermaldatarenderer.h" + +ThermalDataRenderer::ThermalDataRenderer() +{ + +} diff --git a/thermaldatarenderer.h b/thermaldatarenderer.h new file mode 100644 index 0000000..178672b --- /dev/null +++ b/thermaldatarenderer.h @@ -0,0 +1,18 @@ +#ifndef THERMALDATARENDERER_H +#define THERMALDATARENDERER_H + +#include +#include +#include + +class ThermalDataRenderer +{ + bool direct = false; + QVector renderBuffer; + float minValue = 0.0f; + float maxValue = 0.0f; +public: + ThermalDataRenderer(); +}; + +#endif // THERMALDATARENDERER_H diff --git a/thermi2c.pro b/thermi2c.pro index 0903ee7..e11953d 100644 --- a/thermi2c.pro +++ b/thermi2c.pro @@ -15,11 +15,14 @@ TARGET = thermi2c CONFIG += sailfishapp SOURCES += src/thermi2c.cpp \ + command.cpp \ + pollingtimer.cpp \ src/mlx90640_API.cpp \ src/mlx90640_I2C_Driver.cpp \ src/conv.cpp \ src/i2cdriversingleton.cpp \ - src/i2cif.cpp + src/i2cif.cpp \ + thermaldatarenderer.cpp DISTFILES += qml/thermi2c.qml \ qml/cover/CoverPage.qml \ @@ -44,8 +47,12 @@ CONFIG += sailfishapp_i18n TRANSLATIONS += translations/thermi2c-de.ts HEADERS += \ + command.h \ + datapollcommand.h \ + pollingtimer.h \ src/mlx90640_API.h \ src/mlx90640_I2C_Driver.h \ src/conv.h \ src/i2cdriversingleton.h \ - src/i2cif.h + src/i2cif.h \ + thermaldatarenderer.h