ClassFlowPostProcessing.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #pragma once
  2. #ifndef CLASSFFLOWPOSTPROCESSING_H
  3. #define CLASSFFLOWPOSTPROCESSING_H
  4. #include "ClassFlow.h"
  5. #include "ClassFlowTakeImage.h"
  6. #include "ClassFlowCNNGeneral.h"
  7. #include "ClassFlowDefineTypes.h"
  8. #include <string>
  9. #include <mutex>
  10. class ClassFlowPostProcessing :
  11. public ClassFlow
  12. {
  13. protected:
  14. std::mutex preValueMutex; // PreValue is set from HTTP/MQTT tasks while the flow task post-processes
  15. bool UpdatePreValueINI;
  16. int PreValueAgeStartup;
  17. bool ErrorMessage;
  18. ClassFlowCNNGeneral* flowAnalog;
  19. ClassFlowCNNGeneral* flowDigit;
  20. string FilePreValue;
  21. ClassFlowTakeImage *flowTakeImage;
  22. bool LoadPreValue(void);
  23. string ShiftDecimal(string in, int _decShift);
  24. string ErsetzteN(string, double _prevalue);
  25. double checkDigitConsistency(double input, int _decilamshift, bool _isanalog, double _preValue);
  26. void InitNUMBERS();
  27. void handleDecimalSeparator(string _decsep, string _value);
  28. void handleMaxRateValue(string _decsep, string _value);
  29. void handleDecimalExtendedResolution(string _decsep, string _value);
  30. void handleMaxRateType(string _decsep, string _value);
  31. void handleAnalogToDigitTransitionStart(string _decsep, string _value);
  32. void handleAllowNegativeRate(string _decsep, string _value);
  33. void handleIgnoreLeadingNaN(string _decsep, string _value);
  34. void handleContinuousLastDigit(string _decsep, string _value);
  35. void handleChangeRateThreshold(string _decsep, string _value);
  36. void handlecheckDigitIncreaseConsistency(std::string _decsep, std::string _value);
  37. void WriteDataLog(int _index);
  38. public:
  39. bool PreValueUse;
  40. std::vector<NumberPost*> NUMBERS;
  41. ClassFlowPostProcessing(std::vector<ClassFlow*>* lfc, ClassFlowCNNGeneral *_analog, ClassFlowCNNGeneral *_digit);
  42. virtual ~ClassFlowPostProcessing();
  43. bool ReadParameter(FILE* pfile, string& aktparamgraph);
  44. bool doFlow(string time);
  45. string getReadout(int _number);
  46. string getReadoutParam(bool _rawValue, bool _noerror, int _number = 0);
  47. string getReadoutError(int _number = 0);
  48. string getReadoutRate(int _number = 0);
  49. string getReadoutTimeStamp(int _number = 0);
  50. void SavePreValue();
  51. string getJsonFromNumber(int i, std::string _lineend);
  52. string GetPreValue(std::string _number = "");
  53. bool SetPreValue(double zw, string _numbers, bool _extern = false);
  54. std::string GetJSON(std::string _lineend = "\n");
  55. std::string getNumbersName();
  56. void UpdateNachkommaDecimalShift();
  57. std::vector<NumberPost*>* GetNumbers(){return &NUMBERS;};
  58. string name(){return "ClassFlowPostProcessing";};
  59. };
  60. #endif //CLASSFFLOWPOSTPROCESSING_H