Error Handling; Setting The Port Name - Mini-Circuits ISC-2425-25+ Quick Start Manual

Hide thumbs Also See for ISC-2425-25+:
Table of Contents

Advertisement

3.2.1.1

Error handling

The Qt framework has a mechanism called signals and slots, which allows different objects to communicate with one
another. In this case it is used for the error-handling of the serial port.
Here the 'errorOccurred' signal of the QSerialPort 'SG_port' is connected to the slot function 'serialport_
error_handler' of 'this' instance of the MainWindow class.
The error handler function looks like this:
If the error type of the serial port is 'NoError' or 'TimeoutError', it is ignored and the error handler function exits early.
NoError means everything is all good, and the TimeoutError can occasionally be a false alarm raised by function like
Sweep, which simply requires a bit of time to respond.
All other errors spawn a pop-up message with the error and close the serial port. This is done by re-using the
'on_pushButton_disconnect_clicked' slot function which would normally be called when pressing the disconnect button
in the GUI.
3.2.1.2

Setting the port name

Setting the default port name is a two-part action.
First a list of ports is generated by the 'update_port_list' function. This fills the ports comboBox in the GUI with viable
port names. This is covered in detail in chapter 3.2.2.1 – Updating the port list .
Then, as a default value, the first item in the comboBox is set as the (placeholder) port name parameter for the serial
port, so that it has something to work with from the get-go. This part re-uses the on_comboBox_ ports_activated slot
function, which is called whenever the user chooses an item in the comboBox. This is covered in a bit more detail in
chapter 3.3.1 - Ports comboBox.
AN-50-008
Rev: OR
This document and its contents are the property of Mini-Circuits.
DCO-000822
(03/07/22)
File: AN-50-008.docx
Page 9 of 26

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ISC-2425-25+ and is the answer not in the manual?

Questions and answers

Related Products for Mini-Circuits ISC-2425-25+

Table of Contents