public static int WriteTestSummary(TestCoreMessages.TypeMessage type, string message) { switch (type) { case TestCoreMessages.TypeMessage.ERROR: //rTxtBox.BackColor = Color.DarkRed; Console.ForegroundColor = ConsoleColor.Red; break; case TestCoreMessages.TypeMessage.WARNING: //rTxtBox.BackColor = Color.DarkBlue; Console.ForegroundColor = ConsoleColor.Cyan; break; case TestCoreMessages.TypeMessage.SUCCESS: //rTxtBox.BackColor = Color.DarkGreen; Console.ForegroundColor = ConsoleColor.Green; break; default: break; } //rTxtBox.AppendText("\n" + "[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "] - " + message); Debug.WriteLine("\n" + "[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "] - " + message); return(0); }
public void NotifyUI(TestCoreMessages.TypeMessage typeMessage, string message = null) { callback(typeMessage, message); if (logLocalTestSummary) { if (typeMessage != TestCoreMessages.TypeMessage.UPDATE_TEST_PERCENTUAL) { log.Info(message); } } }
public int WriteTestSummary(TestCoreMessages.TypeMessage type, string message) { if (this.rTxtBox.InvokeRequired) { SetTextCallback d = new SetTextCallback(WriteTestSummary); this.Invoke(d, new object[] { type, message }); } else { switch (type) { case TestCoreMessages.TypeMessage.ERROR: rTxtBox.BackColor = Color.DarkRed; flagTestFail = true; break; case TestCoreMessages.TypeMessage.WARNING: if (!flagTestFail) { rTxtBox.BackColor = Color.DarkBlue; } break; case TestCoreMessages.TypeMessage.SUCCESS: if (!flagTestFail) { rTxtBox.BackColor = Color.DarkGreen; } break; case TestCoreMessages.TypeMessage.CANCELED_BY_USER: case TestCoreMessages.TypeMessage.UPDATE_DGV_TRACKID: dgvTrackId_update(message); break; case TestCoreMessages.TypeMessage.REQUEST_USER_ACTION: ShowMessageBox(rm.GetString("uiUserActionRequired"), message); break; case TestCoreMessages.TypeMessage.START_CAMERA: startCamera(); break; case TestCoreMessages.TypeMessage.STOP_CAMERA: stopCamera(); break; case TestCoreMessages.TypeMessage.GET_FRAME_LED_ON: AutomatedInspection.captureFrameWithLedTurnedOn(); break; case TestCoreMessages.TypeMessage.GET_FRAME_LED_OFF: AutomatedInspection.captureFrameWithLedTurnedOff(); break; case TestCoreMessages.TypeMessage.PROCESS_DETECTION: AutomatedInspection.processLedDetection(); break; case TestCoreMessages.TypeMessage.UPDATE_TEST_PERCENTUAL: if (tc.runTest) { tsBtnExecution.Text = "Executing... " + message + "%"; } break; default: break; } if (type != TestCoreMessages.TypeMessage.UPDATE_TEST_PERCENTUAL) { rTxtBox.AppendText("\n" + "[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "] - " + message); rTxtBox.ScrollToCaret(); } } return(0); }