|
OmronPID
|
The MainWindow class represents the main window of the application. More...
#include <mainwindow.h>
Public Slots | |
| void | makePlot () |
| makePlot Slot function to generate plot | |
| void | updateTemperature (double temperature) |
| updateTemperature Slot function to update the temperature display | |
| void | updateMV (double MV) |
| updateMV Slot function to update the MV display (MV means output power) | |
| void | updateSV (double SV) |
| updateSV Slot function to update the set value (SV) display | |
| void | updateMVupper (double MVupper) |
| updateMVupper Slot function to update the upper limit of the MV display | |
| void | updateMVlower (double MVlower) |
| updateMVlower Slot function to update the lower limit of MV display | |
| void | updatePID_P (double PID_P) |
| updatePID_I Slot function to update the PID controller's integral (I) gain value display | |
| void | updatePID_I (double PID_I) |
| updatePID_I Slot function to update the PID controller's integral (I) gain value display | |
| void | updatePID_D (double PID_D) |
| updatePID_D Slot function to update the PID controller's derivative (D) gain value display | |
| void | updateStatus () |
| updateStatus Slot function to update the status display | |
| void | finishSendAT (int atFlag) |
| finishSendAT Slot function to handle the completion of sending AT command to device | |
| void | finishSendSV (double SV) |
| finishSendSV Slot function to handle the completion of sending the set value (SV) to the device | |
| void | catchLogMsg (const QString &msg) |
| catchLogMsg Slot function to catch a log message emitted by a thread and add it to the application log window | |
| void | catchLogMsgWithColor (const QString &msg, QColor color) |
| catchLogMsg Slot function to catch a log message emitted by a thread and add it to the application log window | |
| void | connectDevice () |
| connectDevice Slot function to handle device connection | |
| void | connectFailed () |
| connectFailed Slot function to handle device connection failure | |
| void | catchDanger (int type) |
| catchDanger Slot function to handle a dangerous situation detected by the Safety class | |
| void | updateCheckNumber (int checkNumber) |
| updateCheckNumber Slot function to update the number of temperature checks that have been performed | |
| void | cathcEscapeTempCheckChange (int sign) |
| cathcEscapeTempCheckChange Slot function to handle changes in the escape temperature check checkbox | |
| void | catchStartTempChangeCheck (int checknumber) |
| catchStartTempChangeCheck Slot function to handle the start of a temperature change check | |
Public Member Functions | |
| MainWindow (QWidget *parent=0) | |
| Constructor for MainWindow class. | |
| ~MainWindow () | |
| Destructor for MainWindow class. | |
| void | LogMsg (QString str, bool newLine=true) |
| Logs a message to the GUI log. | |
| void | findSeriesPortDevices () |
| Finds all available serial port devices. | |
The MainWindow class represents the main window of the application.
|
explicit |
Constructor for MainWindow class.
Constructor for the MainWindow class.
| parent | The parent QWidget. |
| parent | The parent QWidget. |
| MainWindow::~MainWindow | ( | ) |
Destructor for MainWindow class.
|
slot |
catchDanger Slot function to handle a dangerous situation detected by the Safety class
Handles the detection of a danger signal.
| type | The type of danger detected |
This function is called when a danger signal is detected based on the type parameter:
type is 0, it indicates that the maximum allowed temperature has been exceeded.type is 1, it indicates that even though the MV output is at the maximum, the temperature change is less than the threshold.type is 2, it indicates that the temperature has dropped below the threshold.type is 3, it indicates that the temperature continued to drop for some intervals.type is any other value, it indicates a general danger signal.This function displays a log message describing the detected danger signal. It also updates the UI to indicate the emergency stop, displaying the current date and time in the message field and applying styling to highlight it. Finally, it calls the Quit() function to perform the necessary actions for an emergency stop.
| type | The type of danger signal that was detected. |
|
slot |
catchLogMsg Slot function to catch a log message emitted by a thread and add it to the application log window
Receives a log message and passes it to the LogMsg function.
| msg | The log message to add |
This function is a slot that is connected to the log message signal. It receives a log message and passes it to the LogMsg function to be displayed in the log text area.
| msg | The log message. |
|
slot |
catchLogMsg Slot function to catch a log message emitted by a thread and add it to the application log window
Receives a log message with a specified color and passes it to the LogMsg function.
This function is a slot that is connected to the log message with color signal. It receives a log message along with a color and passes it to the LogMsg function to be displayed in the log text area with the specified color.
|
slot |
catchStartTempChangeCheck Slot function to handle the start of a temperature change check
Handles the start of TempChangeCheck mode.
| checknumber | The number of the check being started |
This function is called when the system starts the TempChangeCheck mode based on the checknumber parameter. If checknumber is 0, it indicates that the current MV has reached the MV upper threshold, and the TempChangeCheck mode is initiated. Otherwise, it indicates that the system is in TempChangeCheck mode with the specified number of checks.
This function updates the UI to display the appropriate color, and it displays a log message indicating the start of TempChangeCheck mode.
| checknumber | The number of checks in the TempChangeCheck mode. |
|
slot |
cathcEscapeTempCheckChange Slot function to handle changes in the escape temperature check checkbox
Handles the escape from TempChangeCheck mode.
| sign | The sign of the change (1 for checked, -1 for unchecked) |
This function is called when the system escapes from the TempChangeCheck mode based on the sign parameter:
sign is 0, it indicates that the current MV has decreased below the MVupper threshold.sign is 1, it indicates that the current temperature is within the ignore range.sign is any other value, it indicates a general escape from TempChangeCheck mode.This function updates the UI to display the appropriate color, and it displays a log message indicating the reason for the escape from TempChangeCheck mode.
| sign | The sign indicating the reason for the escape from TempChangeCheck mode. |
|
slot |
connectDevice Slot function to handle device connection
Connects to the Omron temperature control device.
This function is called when the device is successfully connected. It updates the UI to reflect the connection status, displays a log message indicating the connection, and performs necessary UI updates and settings.
|
slot |
connectFailed Slot function to handle device connection failure
Handles the failure to connect to the Omron temperature control device.
This function is called when the connection to the device fails. It updates the UI to reflect the connection status, displays a log message indicating the failure, and re-enables the COM port selection.
|
slot |
finishSendAT Slot function to handle the completion of sending AT command to device
Handles the completion of the AT (Automatic Tuning) command.
| atFlag | The flag indicating whether the command was sent successfully |
This function is called when the AT command is sent to the temperature control device and the command execution is completed. The atFlag parameter indicates the result of the AT command:
atFlag is 1, the AT command was set to 100% and the Set Point is disabled.atFlag is 2, the AT command was set to 40% and the Set Point is disabled.atFlag is any other value, the AT command is set to none and the Set Point is enabled. This function updates the UI elements accordingly and displays a log message indicating the result of the AT command.| atFlag | The result of the AT command. |
|
slot |
finishSendSV Slot function to handle the completion of sending the set value (SV) to the device
Handles the completion of setting the target temperature (SV).
| SV | The set value that was sent |
This function is called when the target temperature (SV) is set and the command execution is completed. The SV parameter represents the value of the target temperature. This function displays a log message indicating the target temperature that was set.
| SV | The value of the target temperature that was set. |
| void MainWindow::LogMsg | ( | QString | str, |
| bool | newLine = true |
||
| ) |
|
slot |
makePlot Slot function to generate plot
Generates a plot.
This function is called to generate a plot based on the current temperature and set temperature. It retrieves the current date and time, retrieves the temperature values, and calls the "fillDataAndPlot" function to update the plot data.
|
slot |
updateCheckNumber Slot function to update the number of temperature checks that have been performed
Updates the check number for temperature change.
| checkNumber | The number of checks performed |
This function is a slot that is connected to the check number update signal. It displays a log message indicating the current number of temperature checks being performed.
| checkNumber | The current number of temperature checks. |
|
slot |
updateMV Slot function to update the MV display (MV means output power)
Updates the displayed manipulated variable (MV) value.
| MV | The new measured value to display. |
This function is a slot that is connected to the MV update signal. It updates the displayed MV value in the user interface with the provided MV value.
| MV | The new MV value to be displayed. |
|
slot |
updateMVlower Slot function to update the lower limit of MV display
Updates the lower range of the manipulated variable (MV).
| MVlower | The new lower limit to display |
This function is a slot that is connected to the MV lower range update signal. It updates the lower range of the MV in the user interface with the provided MV lower value.
| MVlower | The new lower range of the MV. |
|
slot |
updateMVupper Slot function to update the upper limit of the MV display
Updates the upper range of the manipulated variable (MV) and the corresponding plot range.
| MVupper | The new upper limit to display |
This function is a slot that is connected to the MV upper range update signal. It updates the upper range of the MV in the user interface and adjusts the plot range accordingly.
| MVupper | The new upper range of the MV. |
|
slot |
updatePID_D Slot function to update the PID controller's derivative (D) gain value display
Updates the displayed derivative gain (D) value of the PID controller.
| PID_D | The new D gain value to display void updatePID_D(double PID_D); |
This function is a slot that is connected to the PID D value update signal. It updates the displayed D value in the user interface with the provided PID D value.
| PID_D | The new PID D value to be displayed. |
|
slot |
updatePID_I Slot function to update the PID controller's integral (I) gain value display
Updates the displayed integral gain (I) value of the PID controller.
| PID_I | The new I gain value to display |
This function is a slot that is connected to the PID I value update signal. It updates the displayed I value in the user interface with the provided PID I value.
| PID_I | The new PID I value to be displayed. |
|
slot |
updatePID_I Slot function to update the PID controller's integral (I) gain value display
Updates the displayed proportional gain (P) value of the PID controller.
| PID_I | The new I gain value to display |
This function is a slot that is connected to the PID P value update signal. It updates the displayed P value in the user interface with the provided PID P value.
| PID_P | The new PID P value to be displayed. |
|
slot |
updateStatus Slot function to update the status display
Updates the status display with the current data update timestamp.
This function is a slot that is connected to the status update signal. It updates the status display with the current data update timestamp.
|
slot |
updateSV Slot function to update the set value (SV) display
Updates the displayed set value (SV).
| SV | The new set value to display |
This function is a slot that is connected to the SV update signal. It updates the displayed SV value in the user interface with the provided SV value.
| SV | The new SV value to be displayed. |
|
slot |
updateTemperature Slot function to update the temperature display
Updates the displayed temperature value.
| temperature | The new temperature value to display |
This function is a slot that is connected to the temperature update signal. It updates the displayed temperature value in the user interface with the provided temperature value.
| temperature | The new temperature value to be displayed. |