private void diReadButton_2ActionPerformed(java.awt.event.ActionEvent evt) {
int deviceID = 0;
DataType.Rd4DeviceInfoWindow = true; // dressup Firmware value for display
try
{
deviceID = Integer.parseInt( diDevIdSpinner_2.getModel().getValue().toString() );
GUIManager.RefreshDeviceInfo_2( deviceID, devInformationFrame );
/* new MessageBoxOK( "Read OK",
"Device ID " + deviceID + " @ " + serialMaster.params.getPortName(),
MessageBox.IconType.INFO, this.getFrame() ); */
// ReadCompleteMsgBox.setVisible(true);
// ReadCompleteMsgBox.ReadSuccessfulFrame bx = new ReadCompleteMsgBox.ReadSuccessfulFrame();
// bx.setVisible(true);
// ReadSuccessfulFrame.setVisible(true);
CstMsgBox box = new CstMsgBox(devInformationFrame,true);
box.displayCstMsgBox("Read successful, device ID" + deviceID);
}
catch (ModbusException ex)
{
/* new MessageBoxOK( "Read Failed",
"Device ID " + deviceID + " @ " + serialMaster.params.getPortName()
//+ "\n" + ex.getMessage()
+ "\nPlease try again.",
MessageBox.IconType.EXCLAMATION, null );*/
CstMsgBox box = new CstMsgBox(devInformationFrame,true);
box.displayCstMsgBox("Read failed, device ID" + deviceID);
}
catch (NullPointerException ex)
{
/*new MessageBoxOK( "Read Failed", "No device is detected",
MessageBox.IconType.CRITICAL, null );*/
CstMsgBox box = new CstMsgBox(devInformationFrame,true);
box.displayCstMsgBox("Read failed, no device is detected !");
}
}