private void jbc_UserError(long stationID, Cerror err) { if (this.InvokeRequired) { this.Invoke(new JBC_API.UserErrorEventHandler(jbc_UserError), new object[] { stationID, err }); return; } Cerror.cErrorCodes errorCode = err.GetCode(); Cerror.cCommErrorCodes commErrorCode = err.GetCommErrorCode(); string sErrorMsg = ""; string sCommErrorMsg = ""; string sErrorText = ""; sErrorMsg = System.Convert.ToString(errorCode.ToString()); sCommErrorMsg = System.Convert.ToString(commErrorCode.ToString()); LogAdd(string.Format("Error: {0} Error Comm: {1}", sErrorMsg, sCommErrorMsg)); LogAdd(string.Format("Error of station {0} code: {1} msg: {2}", stationID.ToString(), err.GetCode(), err.GetMsg())); }
public void event_UserError(long stationID, Cerror err) { log("# Error in station ID: " + stationID.ToString() + " Msg: " + err.GetMsg()); log("# Ex: " + err.Message); }
private void jbc_UserError(long stationID, Cerror err) { //For Each stn As tStation In stationList // If stn.ID = stationID Then // ' #edu# show error only if it is found // ' get station data from station list // Dim sStationData As String = "" // Dim model = stn.stationModel // Dim name = stn.stationName // sStationData = getResStr(confStationId) & " " & model & " - " & name // Dim errorCode As JBC_Connect.Cerror.cErrorCodes = err.GetCode() // Dim commErrorCode As JBC_Connect.Cerror.cCommErrorCodes = err.GetCommErrorCode() // Dim sErrorMsg As String = "" // Dim sCommErrorMsg As String = "" // Dim sErrorText As String = "" // Select Case errorCode // Case JBC_Connect.Cerror.cErrorCodes.STATION_ID_NOT_FOUND // sErrorMsg = getResStr(ueSTATION_ID_NOT_FOUND) // Case JBC_Connect.Cerror.cErrorCodes.CONTINUOUS_MODE_ON_WITHOUT_PORTS // sErrorMsg = getResStr(ueCONTINUOUS_MODE_ON_WITHOUT_PORTS) // Case JBC_Connect.Cerror.cErrorCodes.PORT_NOT_IN_RANGE // sErrorMsg = getResStr(uePORT_NOT_IN_RANGE) // Case JBC_Connect.Cerror.cErrorCodes.INVALID_STATION_NAME // sErrorMsg = getResStr(ueINVALID_STATION_NAME) // Case JBC_Connect.Cerror.cErrorCodes.TEMPERATURE_OUT_OF_RANGE // sErrorMsg = getResStr(ueTEMPERATURE_OUT_OF_RANGE) // Case JBC_Connect.Cerror.cErrorCodes.STATION_ID_OVERFLOW // sErrorMsg = getResStr(ueSTATION_ID_OVERFLOW) // Case JBC_Connect.Cerror.cErrorCodes.POWER_LIMIT_OUT_OF_RANGE // sErrorMsg = getResStr(uePOWER_LIMIT_OUT_OF_RANGE) // Case JBC_Connect.Cerror.cErrorCodes.TOOL_NOT_SUPPORTED // sErrorMsg = getResStr(ueTOOL_NOT_SUPPORTED) // Case JBC_Connect.Cerror.cErrorCodes.FUNCTION_NOT_SUPPORTED // sErrorMsg = getResStr(ueFUNCTION_NOT_SUPPORTED) // Case JBC_Connect.Cerror.cErrorCodes.COMMUNICATION_ERROR // sErrorMsg = getResStr(ueCOMMUNICATION_ERROR) // End Select // Select Case commErrorCode // Case JBC_Connect.Cerror.cCommErrorCodes.NO_COMM_ERROR // 'sCommErrorMsg = getResStr(ceNO_COMM_ERROR) // Case JBC_Connect.Cerror.cCommErrorCodes.BCC // sCommErrorMsg = getResStr(ceBCC) // Case JBC_Connect.Cerror.cCommErrorCodes.FRAME_FORMAT // sCommErrorMsg = getResStr(ceFRAME_FORMAT) // Case JBC_Connect.Cerror.cCommErrorCodes.OUT_OF_RANGE // sCommErrorMsg = getResStr(ceOUT_OF_RANGE) // Case JBC_Connect.Cerror.cCommErrorCodes.COMMAND_REJECTED // sCommErrorMsg = getResStr(ceCOMMAND_REJECTED) // Case JBC_Connect.Cerror.cCommErrorCodes.CONTROL_MODE_REQUIRED // sCommErrorMsg = getResStr(ceCONTROL_MODE_REQUIRED) // Case JBC_Connect.Cerror.cCommErrorCodes.INCORRECT_SEQUENCY // sCommErrorMsg = getResStr(ceINCORRECT_SEQUENCY) // Case JBC_Connect.Cerror.cCommErrorCodes.FLASH_WRITE_ERROR // sCommErrorMsg = getResStr(ceFLASH_WRITE_ERROR) // Case JBC_Connect.Cerror.cCommErrorCodes.CONTROL_MODE_ALREADY_ACTIVATED // sCommErrorMsg = getResStr(ceCONTROL_MODE_ALREADY_ACTIVATED) // Case JBC_Connect.Cerror.cCommErrorCodes.NOT_VALID_HARDWARE // sCommErrorMsg = getResStr(ceNOT_VALID_HARDWARE) // End Select // If sErrorMsg <> "" Then // If sErrorText <> "" Then sErrorText = sErrorText & vbCrLf // sErrorText = sErrorText & getResStr(ueErrorId) & getResStr(gralValueSeparatorId) & sErrorMsg // End If // If sCommErrorMsg <> "" Then // If sErrorText <> "" Then sErrorText = sErrorText & vbCrLf // sErrorText = sErrorText & getResStr(ceErrorId) & getResStr(gralValueSeparatorId) & sCommErrorMsg // End If // If sErrorText <> "" Then // MsgBox(sErrorText, MsgBoxStyle.OkOnly, sStationData) // End If // Exit For ' #edu 28/05/2014 // End If //Next //' #edu# //'MsgBox("Error of station " & stationID & ". Code: " & err.GetCode() & " -> " & err.GetMsg()) }