ClassFlowControll.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #pragma once
  2. #ifndef CLASSFLOWCONTROLL_H
  3. #define CLASSFLOWCONTROLL_H
  4. #include <string>
  5. #include <mutex>
  6. #include "ClassFlow.h"
  7. #include "ClassFlowTakeImage.h"
  8. #include "ClassFlowAlignment.h"
  9. #include "ClassFlowCNNGeneral.h"
  10. #include "ClassFlowPostProcessing.h"
  11. #ifdef ENABLE_MQTT
  12. #include "ClassFlowMQTT.h"
  13. #endif //ENABLE_MQTT
  14. #ifdef ENABLE_INFLUXDB
  15. #include "ClassFlowInfluxDB.h"
  16. #include "ClassFlowInfluxDBv2.h"
  17. #endif //ENABLE_INFLUXDB
  18. #ifdef ENABLE_WEBHOOK
  19. #include "ClassFlowWebhook.h"
  20. #endif //ENABLE_WEBHOOK
  21. #include "ClassFlowCNNGeneral.h"
  22. class ClassFlowControll :
  23. public ClassFlow
  24. {
  25. protected:
  26. std::vector<ClassFlow*> FlowControll;
  27. ClassFlowPostProcessing* flowpostprocessing;
  28. ClassFlowAlignment* flowalignment;
  29. ClassFlowCNNGeneral* flowanalog;
  30. ClassFlowCNNGeneral* flowdigit;
  31. // ClassFlowDigit* flowdigit;
  32. ClassFlowTakeImage* flowtakeimage;
  33. ClassFlow* CreateClassFlow(std::string _type);
  34. bool AutoStart;
  35. float AutoInterval;
  36. void SetInitialParameter(void);
  37. std::string aktstatusWithTime;
  38. std::string aktstatus;
  39. std::mutex statusMutex; // status is written by the flow task and read by HTTP handlers
  40. void setStatus(const std::string &_status, const std::string &_statusWithTime);
  41. int aktRunNr;
  42. public:
  43. ClassFlowControll();
  44. ~ClassFlowControll() override;
  45. bool SetupModeActive;
  46. void InitFlow(std::string config);
  47. bool doFlow(string time);
  48. void doFlowTakeImageOnly(string time);
  49. bool getStatusSetupModus(){return SetupModeActive;};
  50. string getReadout(bool _rawvalue, bool _noerror, int _number);
  51. string getReadoutAll(int _type);
  52. bool UpdatePrevalue(std::string _newvalue, std::string _numbers, bool _extern);
  53. string GetPrevalue(std::string _number = "");
  54. bool ReadParameter(FILE* pfile, string& aktparamgraph);
  55. string getJSON();
  56. const std::vector<NumberPost*> &getNumbers();
  57. string getNumbersName();
  58. string TranslateAktstatus(std::string _input);
  59. #ifdef ALGROI_LOAD_FROM_MEM_AS_JPG
  60. void DigitDrawROI(CImageBasis *_zw);
  61. void AnalogDrawROI(CImageBasis *_zw);
  62. #endif
  63. esp_err_t GetJPGStream(std::string _fn, httpd_req_t *req);
  64. esp_err_t SendRawJPG(httpd_req_t *req);
  65. std::string doSingleStep(std::string _stepname, std::string _host);
  66. bool getIsAutoStart();
  67. void setAutoStartInterval(long &_interval);
  68. std::string getActStatusWithTime();
  69. std::string getActStatus();
  70. void setActStatus(std::string _aktstatus);
  71. std::vector<HTMLInfo*> GetAllDigit();
  72. std::vector<HTMLInfo*> GetAllAnalog();
  73. t_CNNType GetTypeDigit();
  74. t_CNNType GetTypeAnalog();
  75. #ifdef ENABLE_MQTT
  76. bool StartMQTTService();
  77. #endif //ENABLE_MQTT
  78. int CleanTempFolder();
  79. string name(){return "ClassFlowControll";};
  80. };
  81. #endif