//##################################################################################################// public void initialize() { try { mm = new MultiMeter("U3606A"); current = new List <double>(); } catch (Exception ex) { MessageBox.Show("MultiMeter U3606A ==> Error: " + ex.Message); } }
public void error() { Trace.WriteLine("mm ==> In Function error."); //get the failure state STATE.states state = queue.Dequeue(); //if it is not fatal error, then try to fix it. //TO-DO //if it is fatal error queue.Enqueue(STATE.states.exit); try { mm = null; } catch { } }
public void error() { Trace.WriteLine("mm ==> In Function error."); //get the failure state STATE.states state = queue.Dequeue(); //if it is not fatal error, then try to fix it. //TO-DO //if it is fatal error queue.Enqueue(STATE.states.exit); try { mm = null; current.Clear(); } catch { } }
//##################################################################################################// public void initialize() { Trace.WriteLine("mm ==> In Function initialize."); try { mm = new MultiMeter("U3606A"); current = new List <double>(); StateStatus(new StateMachineEventArgs(true, STATE.states.initialize, "mm ==> init succeed")); } catch (Exception ex) { Trace.WriteLine("mm ==> Error: " + ex.Message); //not try to fix the error in this class, directly go to the erorr handler. queue.Clear(); queue.TrimExcess(); queue.Enqueue(STATE.states.error); queue.Enqueue(STATE.states.initialize); StateStatus(new StateMachineEventArgs(false, STATE.states.initialize, "mm ==> init failed: " + ex.Message)); } }
//##################################################################################################// public void initialize() { Trace.WriteLine("mm ==> In Function initialize."); try { mm = new MultiMeter("U3606A"); current = new List<double>(); StateStatus(new StateMachineEventArgs(true, STATE.states.initialize, "mm ==> init succeed")); } catch (Exception ex) { Trace.WriteLine("tp ==> Error: " + ex.Message); //not try to fix the error in this class, directly go to the erorr handler. queue.Clear(); queue.TrimExcess(); queue.Enqueue(STATE.states.error); queue.Enqueue(STATE.states.initialize); StateStatus(new StateMachineEventArgs(false, STATE.states.initialize, "mm ==> init failed: " + ex.Message)); } }