156 void setMV(
double MV);
197 void setDropThreshold(
int dropThreshold);
346 void checkTemperature();
351 QTimer *timerMVCheck_{
nullptr};
352 QTimer *timerTempChange_{
nullptr};
353 int numberOfCheck_{10};
355 int intervalMVCheck_{10 * 1000};
356 int intervalTempChange_{10 * 1000};
357 double temperature_{};
358 double permitedMaxTemp_{280.0};
362 double ignoreLower_{-10.0};
363 double ignoreUpper_{10.0};
364 QPair<double, double> ignoreTempRange_{240.0, 260.0};
365 double tempChangeThreshold_{1.0};
366 QVector<double> vTempHistory_{};
367 QVector<double> vTempChangeData_{};
368 bool isMVupper_{
false};
369 bool isEnableTempChangeRange_{
false};
373 int dropThreshold_{10};
378 bool isTemperatureChanged();
390 double diffTemp()
const;
398 double diffTemp(
double temp1,
double temp2)
const;
404 void addTemperature(
double temp);
412 double movingAverage (QVector<double> data,
int wsize);
Class representing summary information of data.
Definition: datasummary.h:17
The Safety class ensures the safe operation of the system. This class monitors the temperature and ot...
Definition: safety.h:22
void start()
Starts the safety monitoring.
Definition: safety.cpp:202
void checkNumberChanged(int number)
Signal emitted when the check number has been changed.
void logMsgWithColor(QString msg, QColor color)
Signal emitted when a log message with a specific color is generated.
void permitedMaxTempChanged(double maxtemp)
Signal emitted when the permitted maximum temperature has been changed.
double getIgnoreUpper() const
Getter function for the upper bound of the ignored temperature range.
Definition: safety.cpp:224
double getIgnoreLower() const
Getter function for the lower bound of the ignored temperature range.
Definition: safety.cpp:223
void setIgnoreUpper(double upper)
Sets the upper limit for ignoring temperature changes.
Definition: safety.cpp:250
void NumberOfCheckChanged(int number)
Signal emitted when the number of checks has been changed.
void startTempChangeCheck(int checknumber)
Signal emitted when the temperature change check is started.
double getMVLower() const
Getter function for the lower bound of the manipulated variable.
void setMVUpper(double MVupper)
Sets the upper limit of the manipulated variable (MV).
Definition: safety.cpp:235
QTimer * getTimerTempChangeCheck() const
Getter function for the timer object used for the temperature change check.
Definition: safety.cpp:227
double getTemperature() const
Getter function for the current temperature.
Definition: safety.cpp:218
void stop()
Stops the safety monitoring.
Definition: safety.cpp:208
void setIntervalTempChange(int inteerval)
Sets the interval for checking the temperature change.
Definition: safety.cpp:244
void dangerSignal(int type)
Signal emitted when a danger is detected.
bool isTimerTempChangeCheckRunning() const
Checks whether the timer for checking the temperature change is running.
Definition: safety.cpp:215
void dropSignal()
Signal emitted when temperature is droped.
void setCheckNumber(int number)
Sets the check number.
Definition: safety.cpp:238
void setIgnoreLower(double lower)
Sets the lower limit for ignoring temperature changes.
Definition: safety.cpp:249
QTimer * getTimerMVCheck() const
Getter function for the timer object used for the manipulated variable check.
Definition: safety.cpp:226
void logMsg(QString msg)
Signal emitted when a log message is generated.
int getIntervalTempChange() const
Getter function for the interval of the temperature change check.
Definition: safety.cpp:231
void setTempChangeThreshold(double temp)
Sets the threshold of temperature change.
Definition: safety.cpp:239
void escapeTempCheckChange(int sign)
Signal emitted when the temperature change check is cancelled.
void checkTempDrop()
Check whether the temperature has droped the last temperature.
Definition: safety.cpp:61
double getPermitedMaxTemp() const
Getter function for the permitted maximum temperature.
Definition: safety.cpp:219
QPair< double, double > getIgnoreTempRange() const
Getter function for the ignored temperature range.
Definition: safety.cpp:225
void setPermitedMaxTemp(double maxtemp)
Sets the maximum permitted temperature.
Definition: safety.cpp:234
void intervalMVCheckChanged(int interval)
Signal emitted when the interval for the MV check has been changed.
void setMV(double MV)
Sets the value of the manipulated variable (MV).
Definition: safety.cpp:236
void MVUpperChanged(double MVupper)
Signal emitted when the MV upper limit has been changed.
double getMV() const
Getter function for the current value of the manipulated variable.
Definition: safety.cpp:221
double getTempChangeThreshold() const
Getter function for the threshold of temperature change.
Definition: safety.cpp:222
bool isTimerMVCheckRunning() const
Checks whether the timer for checking the manipulated variable (MV) is running.
Definition: safety.cpp:214
void checkTempChange()
Checks whether the temperature has changed above the threshold value.
Definition: safety.cpp:92
void setIsSTC(bool isSTC)
Sets the enable to execute tempChangeCheck method in STC mode.
Definition: safety.cpp:259
int getCheckNumber() const
Getter function for the current check number.
Definition: safety.cpp:229
void setEnableTempChangeRange(bool enable)
Enables or disables the temperature change range.
Definition: safety.cpp:248
void intervalTempChangeChanged(int interval)
Signal emitted when the interval for the temperature change check has been changed.
int getNumberOfCheck() const
Getter function for the number of temperature checks.
Definition: safety.cpp:228
void setIgnoreTempRange(double temp, double lower, double upper)
Sets the temperature range for ignoring temperature changes.
Definition: safety.cpp:251
void MVupperReachedUpperLimit()
Signal emitted when the MV upper limit has reached its upper limit.
~Safety()
Destroys the Safety object.
Definition: safety.cpp:25
void setNumberOfCheck(int number)
Sets the number of check for the safety condition.
Definition: safety.cpp:237
int getIntervalMVCheck() const
Getter function for the interval of the manipulated variable check.
Definition: safety.cpp:230
double getMVUpper() const
Getter function for the upper bound of the manipulated variable.
Definition: safety.cpp:220
void setIntervalMVCheck(int interval)
Sets the interval for checking the manipulated variable (MV).
Definition: safety.cpp:240
void tempChangeThresholdChanged(double temp)
Signal emitted when the temperature change threshold has been changed.
Header file for the DataSummary class.