ClassFlowPostProcessing.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #pragma once
  2. #include "ClassFlow.h"
  3. #include "ClassFlowMakeImage.h"
  4. #include "ClassFlowAnalog.h"
  5. #include "ClassFlowDigit.h"
  6. #include <string>
  7. struct NumberPost {
  8. // int PreValueAgeStartup;
  9. float MaxRateValue;
  10. bool useMaxRateValue;
  11. bool ErrorMessage;
  12. bool PreValueOkay;
  13. bool AllowNegativeRates;
  14. bool checkDigitIncreaseConsistency;
  15. time_t lastvalue;
  16. string timeStamp;
  17. float FlowRateAct; // m3 / min
  18. float PreValue; // letzter Wert, der gut ausgelesen wurde
  19. float Value; // letzer ausgelesener Wert, inkl. Korrekturen
  20. string ReturnRawValue; // Rohwert (mit N & führenden 0)
  21. string ReturnValue; // korrigierter Rückgabewert, ggf. mit Fehlermeldung
  22. string ReturnPreValue; // korrigierter Rückgabewert ohne Fehlermeldung
  23. string ReturnValueNoError;
  24. string ErrorMessageText; // Fehlermeldung bei Consistency Check
  25. int AnzahlAnalog;
  26. int AnzahlDigital;
  27. int DecimalShift;
  28. int Nachkomma;
  29. // ClassFlowAnalog* ANALOG;
  30. // ClassFlowDigit* DIGIT;
  31. digit *digit_roi;
  32. analog *analog_roi;
  33. string name;
  34. };
  35. class ClassFlowPostProcessing :
  36. public ClassFlow
  37. {
  38. protected:
  39. std::vector<NumberPost*> NUMBERS;
  40. bool UpdatePreValueINI;
  41. bool PreValueUse;
  42. int PreValueAgeStartup;
  43. // bool AllowNegativeRates;
  44. // float MaxRateValue;
  45. // bool useMaxRateValue;
  46. bool ErrorMessage;
  47. // bool PreValueOkay;
  48. // bool checkDigitIncreaseConsistency;
  49. // int DecimalShift;
  50. // time_t lastvalue;
  51. // float FlowRateAct; // m3 / min
  52. ClassFlowAnalog* flowAnalog;
  53. ClassFlowDigit* flowDigit;
  54. string FilePreValue;
  55. ClassFlowMakeImage *flowMakeImage;
  56. bool LoadPreValue(void);
  57. string ShiftDecimal(string in, int _decShift);
  58. string ErsetzteN(string, float _prevalue);
  59. float checkDigitConsistency(float input, int _decilamshift, bool _isanalog, float _preValue);
  60. string RundeOutput(float _in, int _anzNachkomma);
  61. void InitNUMBERS();
  62. void handleDecimalSeparator(string _decsep, string _value);
  63. public:
  64. ClassFlowPostProcessing(std::vector<ClassFlow*>* lfc);
  65. bool ReadParameter(FILE* pfile, string& aktparamgraph);
  66. bool doFlow(string time);
  67. string getReadout(int _number);
  68. string getReadoutParam(bool _rawValue, bool _noerror, int _number = 0);
  69. string getReadoutError(int _number = 0);
  70. string getReadoutRate(int _number = 0);
  71. string getReadoutTimeStamp(int _number = 0);
  72. void SavePreValue();
  73. string GetPreValue(std::string _number = "");
  74. void SetPreValue(float zw, string _numbers);
  75. std::vector<NumberPost*> GetNumbers(){return NUMBERS;};
  76. string name(){return "ClassFlowPostProcessing";};
  77. };