ClassFlowPostProcessing.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. int PreValueAgeStartup;
  42. bool ErrorMessage;
  43. ClassFlowAnalog* flowAnalog;
  44. ClassFlowDigit* flowDigit;
  45. string FilePreValue;
  46. ClassFlowMakeImage *flowMakeImage;
  47. bool LoadPreValue(void);
  48. string ShiftDecimal(string in, int _decShift);
  49. string ErsetzteN(string, float _prevalue);
  50. float checkDigitConsistency(float input, int _decilamshift, bool _isanalog, float _preValue);
  51. string RundeOutput(float _in, int _anzNachkomma);
  52. void InitNUMBERS();
  53. void handleDecimalSeparator(string _decsep, string _value);
  54. void handleMaxRateValue(string _decsep, string _value);
  55. public:
  56. bool PreValueUse;
  57. ClassFlowPostProcessing(std::vector<ClassFlow*>* lfc);
  58. bool ReadParameter(FILE* pfile, string& aktparamgraph);
  59. bool doFlow(string time);
  60. string getReadout(int _number);
  61. string getReadoutParam(bool _rawValue, bool _noerror, int _number = 0);
  62. string getReadoutError(int _number = 0);
  63. string getReadoutRate(int _number = 0);
  64. string getReadoutTimeStamp(int _number = 0);
  65. void SavePreValue();
  66. string GetPreValue(std::string _number = "");
  67. void SetPreValue(float zw, string _numbers, bool _extern = false);
  68. std::vector<NumberPost*> GetNumbers(){return NUMBERS;};
  69. string name(){return "ClassFlowPostProcessing";};
  70. };