ClassFlowPostProcessing.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #pragma once
  2. #include "ClassFlow.h"
  3. #include "ClassFlowMakeImage.h"
  4. #include "ClassFlowCNNGeneral.h"
  5. #include "ClassFlowCNNGeneral.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 DecimalShiftInitial;
  28. int Nachkomma;
  29. general *digit_roi;
  30. general *analog_roi;
  31. string name;
  32. };
  33. class ClassFlowPostProcessing :
  34. public ClassFlow
  35. {
  36. protected:
  37. std::vector<NumberPost*> NUMBERS;
  38. bool UpdatePreValueINI;
  39. int PreValueAgeStartup;
  40. bool ErrorMessage;
  41. bool IgnoreLeadingNaN; // SPEZIALFALL für User Gustl
  42. ClassFlowCNNGeneral* flowAnalog;
  43. ClassFlowCNNGeneral* flowDigit;
  44. string FilePreValue;
  45. ClassFlowMakeImage *flowMakeImage;
  46. bool LoadPreValue(void);
  47. string ShiftDecimal(string in, int _decShift);
  48. string ErsetzteN(string, float _prevalue);
  49. float checkDigitConsistency(float input, int _decilamshift, bool _isanalog, float _preValue);
  50. string RundeOutput(float _in, int _anzNachkomma);
  51. void InitNUMBERS();
  52. void handleDecimalSeparator(string _decsep, string _value);
  53. void handleMaxRateValue(string _decsep, string _value);
  54. public:
  55. bool PreValueUse;
  56. ClassFlowPostProcessing(std::vector<ClassFlow*>* lfc, ClassFlowCNNGeneral *_analog, ClassFlowCNNGeneral *_digit);
  57. bool ReadParameter(FILE* pfile, string& aktparamgraph);
  58. bool doFlow(string time);
  59. string getReadout(int _number);
  60. string getReadoutParam(bool _rawValue, bool _noerror, int _number = 0);
  61. string getReadoutError(int _number = 0);
  62. string getReadoutRate(int _number = 0);
  63. string getReadoutTimeStamp(int _number = 0);
  64. void SavePreValue();
  65. string GetPreValue(std::string _number = "");
  66. void SetPreValue(float zw, string _numbers, bool _extern = false);
  67. std::vector<NumberPost*> GetNumbers(){return NUMBERS;};
  68. string name(){return "ClassFlowPostProcessing";};
  69. };