Exemple #1
0
        private SiDriverState Startup()
        {
            SiDriverState currentState = SiDriverState.STARTUP.Send(writer, siHandler)
                                         .Receive(messageQueue, writer, siHandler);

            return(currentState);
        }
Exemple #2
0
 public void Run()
 {
     try
     {
         SiDriverState currentState = StartupBootstrap();
         while (IsAlive(currentState))
         {
             GecoSiLogger.StateChanged(currentState.GetType().Name);
             currentState = currentState.Receive(messageQueue, writer, siHandler);
         }
         if (currentState.IsError())
         {
             siHandler.NotifyError(CommStatus.FatalError, currentState.Status());
         }
     }
     catch (ThreadInterruptedException e)
     {
         // normal way out
     }
     catch (Exception e)
     {
         e.PrintStackTrace();
         GecoSiLogger.Error(" #run# " + e);
     }
     finally
     {
         Stop();
     }
 }
Exemple #3
0
 private bool IsAlive(SiDriverState currentState)
 {
     return(thread.IsAlive && !currentState.IsError());
 }