ClassFlowPostProcessing.h 2.5 KB

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