|
| void | permitedMaxTempChanged (double maxtemp) |
| | Signal emitted when the permitted maximum temperature has been changed.
|
| |
| void | MVUpperChanged (double MVupper) |
| | Signal emitted when the MV upper limit has been changed.
|
| |
|
void | MVupperReachedUpperLimit () |
| | Signal emitted when the MV upper limit has reached its upper limit.
|
| |
| void | NumberOfCheckChanged (int number) |
| | Signal emitted when the number of checks has been changed.
|
| |
| void | checkNumberChanged (int number) |
| | Signal emitted when the check number has been changed.
|
| |
| void | tempChangeThresholdChanged (double temp) |
| | Signal emitted when the temperature change threshold has been changed.
|
| |
| void | dangerSignal (int type) |
| | Signal emitted when a danger is detected.
|
| |
| void | dropSignal () |
| | Signal emitted when temperature is droped.
|
| |
| void | intervalMVCheckChanged (int interval) |
| | Signal emitted when the interval for the MV check has been changed.
|
| |
| void | intervalTempChangeChanged (int interval) |
| | Signal emitted when the interval for the temperature change check has been changed.
|
| |
| void | escapeTempCheckChange (int sign) |
| | Signal emitted when the temperature change check is cancelled.
|
| |
| void | startTempChangeCheck (int checknumber) |
| | Signal emitted when the temperature change check is started.
|
| |
| void | logMsg (QString msg) |
| | Signal emitted when a log message is generated.
|
| |
| void | logMsgWithColor (QString msg, QColor color) |
| | Signal emitted when a log message with a specific color is generated.
|
| |
|
| | Safety (DataSummary *data) |
| | Constructs a new Safety object.
|
| |
|
| ~Safety () |
| | Destroys the Safety object.
|
| |
| double | getTemperature () const |
| | Getter function for the current temperature.
|
| |
| double | getPermitedMaxTemp () const |
| | Getter function for the permitted maximum temperature.
|
| |
| double | getMVLower () const |
| | Getter function for the lower bound of the manipulated variable.
|
| |
| double | getMVUpper () const |
| | Getter function for the upper bound of the manipulated variable.
|
| |
| double | getMV () const |
| | Getter function for the current value of the manipulated variable.
|
| |
| int | getNumberOfCheck () const |
| | Getter function for the number of temperature checks.
|
| |
| int | getCheckNumber () const |
| | Getter function for the current check number.
|
| |
| int | getIntervalMVCheck () const |
| | Getter function for the interval of the manipulated variable check.
|
| |
| int | getIntervalTempChange () const |
| | Getter function for the interval of the temperature change check.
|
| |
| double | getTempChangeThreshold () const |
| | Getter function for the threshold of temperature change.
|
| |
| double | getIgnoreUpper () const |
| | Getter function for the upper bound of the ignored temperature range.
|
| |
| double | getIgnoreLower () const |
| | Getter function for the lower bound of the ignored temperature range.
|
| |
| QPair< double, double > | getIgnoreTempRange () const |
| | Getter function for the ignored temperature range.
|
| |
| QTimer * | getTimerMVCheck () const |
| | Getter function for the timer object used for the manipulated variable check.
|
| |
| QTimer * | getTimerTempChangeCheck () const |
| | Getter function for the timer object used for the temperature change check.
|
| |
| void | setPermitedMaxTemp (double maxtemp) |
| | Sets the maximum permitted temperature.
|
| |
| void | setMVUpper (double MVupper) |
| | Sets the upper limit of the manipulated variable (MV).
|
| |
| void | setMV (double MV) |
| | Sets the value of the manipulated variable (MV).
|
| |
| void | setNumberOfCheck (int number) |
| | Sets the number of check for the safety condition.
|
| |
| void | setCheckNumber (int number) |
| | Sets the check number.
|
| |
| void | setTempChangeThreshold (double temp) |
| | Sets the threshold of temperature change.
|
| |
| void | setIgnoreUpper (double upper) |
| | Sets the upper limit for ignoring temperature changes.
|
| |
| void | setIgnoreLower (double lower) |
| | Sets the lower limit for ignoring temperature changes.
|
| |
| void | setIgnoreTempRange (double temp, double lower, double upper) |
| | Sets the temperature range for ignoring temperature changes.
|
| |
|
void | setDropThreshold (int dropThreshold) |
| |
| void | checkTempChange () |
| | Checks whether the temperature has changed above the threshold value.
|
| |
|
void | checkTempDrop () |
| | Check whether the temperature has droped the last temperature.
|
| |
| void | setEnableTempChangeRange (bool enable) |
| | Enables or disables the temperature change range.
|
| |
| void | setIntervalMVCheck (int interval) |
| | Sets the interval for checking the manipulated variable (MV).
|
| |
| void | setIntervalTempChange (int inteerval) |
| | Sets the interval for checking the temperature change.
|
| |
| void | setIsSTC (bool isSTC) |
| | Sets the enable to execute tempChangeCheck method in STC mode.
|
| |
|
void | start () |
| | Starts the safety monitoring.
|
| |
|
void | stop () |
| | Stops the safety monitoring.
|
| |
| bool | isTimerMVCheckRunning () const |
| | Checks whether the timer for checking the manipulated variable (MV) is running.
|
| |
| bool | isTimerTempChangeCheckRunning () const |
| | Checks whether the timer for checking the temperature change is running.
|
| |
The Safety class ensures the safe operation of the system. This class monitors the temperature and other parameters of the system to ensure that they remain within safe limits. If any parameter goes outside its safe range, the Safety class takes appropriate action to bring it back within range. The class also provides a number of properties that can be used to configure its behavior.
| void Safety::checkTempChange |
( |
| ) |
|
Checks whether the temperature has changed above the threshold value.
Check if the temperature has changed more than the threshold value. This function checks if the temperature has changed more than the threshold value during the specified time interval. If the temperature has changed less than the threshold value, it emits a danger signal and stops the temperature change check timer and MV check timer.
- Note
- This function must be called periodically by a QTimer object.
This function periodically checks if the temperature has changed more than the threshold value during the specified time interval. If the temperature has changed less than the threshold value, it emits a danger signal and stops the temperature change check timer and MV check timer. The function starts by acquiring the current temperature and checking if it's within the ignore range. If the temperature is within the ignore range, the function clears variables, stops the timer, and emits the escapeTempCheckChange signal with the argument 1, indicating that the temperature change check has been escaped. If the temperature is outside the ignore range, the function checks if the conditions for stopping the temperature change check have been met. The conditions are: if the check number is equal to or greater than the number of checks minus one, or if the MV is not in the upper limit, or if the temperature is within the ignore range. If any of these conditions is true, the function clears variables, stops the timer, and emits the escapeTempCheckChange signal with the argument 0 if the MV is not in the upper limit, or 1 if the MV is in the upper limit. If none of the stopping conditions is met, the function starts the check and pushes temperature data into the vTempChangeData_ vector. The function sets the timer and increments the check number. If the check number is less than the number of checks, the function returns. When the check is completed, the function calculates the differences between adjacent temperature values, calculates the moving average, and checks if it's below the threshold. If it's below the threshold, the function emits the dangerSignal with the argument 1, indicating a dangerous situation. The function then clears variables, stops the timer, and resets the check number.