ClassFlowPostProcessing.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 ErrorMessage;
  44. ClassFlowAnalog* flowAnalog;
  45. ClassFlowDigit* flowDigit;
  46. string FilePreValue;
  47. ClassFlowMakeImage *flowMakeImage;
  48. bool LoadPreValue(void);
  49. string ShiftDecimal(string in, int _decShift);
  50. string ErsetzteN(string, float _prevalue);
  51. float checkDigitConsistency(float input, int _decilamshift, bool _isanalog, float _preValue);
  52. string RundeOutput(float _in, int _anzNachkomma);
  53. void InitNUMBERS();
  54. void handleDecimalSeparator(string _decsep, string _value);
  55. void handleMaxRateValue(string _decsep, string _value);
  56. public:
  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. };