ClassFlowPostProcessing.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 ReturnValueNoError; // korrigierter Rückgabewert ohne Fehlermeldung
  23. string ErrorMessageText; // Fehlermeldung bei Consistency Check
  24. int AnzahlAnalog;
  25. int AnzahlDigital;
  26. int DecimalShift;
  27. // ClassFlowAnalog* ANALOG;
  28. // ClassFlowDigit* DIGIT;
  29. digit *digit_roi;
  30. analog *analog_roi;
  31. string name;
  32. };
  33. class ClassFlowPostProcessing :
  34. public ClassFlow
  35. {
  36. protected:
  37. std::vector<NumberPost*> NUMBERS;
  38. bool UpdatePreValueINI;
  39. bool PreValueUse;
  40. int PreValueAgeStartup;
  41. // bool AllowNegativeRates;
  42. // float MaxRateValue;
  43. // bool useMaxRateValue;
  44. bool ErrorMessage;
  45. // bool PreValueOkay;
  46. // bool checkDigitIncreaseConsistency;
  47. // int DecimalShift;
  48. // time_t lastvalue;
  49. // float FlowRateAct; // m3 / min
  50. ClassFlowAnalog* flowAnalog;
  51. ClassFlowDigit* flowDigit;
  52. string FilePreValue;
  53. ClassFlowMakeImage *flowMakeImage;
  54. bool LoadPreValue(void);
  55. string ShiftDecimal(string in, int _decShift);
  56. string ErsetzteN(string, float _prevalue);
  57. float checkDigitConsistency(float input, int _decilamshift, bool _isanalog, float _preValue);
  58. string RundeOutput(float _in, int _anzNachkomma);
  59. void InitNUMBERS();
  60. void handleDecimalSeparator(string _decsep, string _value);
  61. public:
  62. ClassFlowPostProcessing(std::vector<ClassFlow*>* lfc);
  63. bool ReadParameter(FILE* pfile, string& aktparamgraph);
  64. bool doFlow(string time);
  65. string getReadout(int _number);
  66. string getReadoutParam(bool _rawValue, bool _noerror, int _number = 0);
  67. string getReadoutError(int _number = 0);
  68. string getReadoutRate(int _number = 0);
  69. string getReadoutTimeStamp(int _number = 0);
  70. void SavePreValue();
  71. string GetPreValue(std::string _number = "");
  72. void SetPreValue(float zw, string _numbers);
  73. std::vector<NumberPost*> GetNumbers(){return NUMBERS;};
  74. string name(){return "ClassFlowPostProcessing";};
  75. };