Exemplo n.º 1
0
        static void Main(string[] args)
        {
            // Define top-level exception handlers

            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
            Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);

            SeparatorImpl            separatorImpl = null;
            SeparatorResourceManager SepResMgr     = null;

            try
            {
                // Initialise the application log file
                string sTemp = GetCurrentTimeStamp();
                sTemp += ROBOSEP_LOG_FILENAME;
#if false
                LogFile.GetInstance().Initialise(GetLogsPath(), "robosep_ui.log");
#else
                LogFile.GetInstance().Initialise(GetLogsPath(), sTemp);
                WorkingLofFileName = GetLogsPath() + @"\" + sTemp;
#endif
                // Create the Separator layer
                separatorImpl = SeparatorImpl.GetInstance();
                if (separatorImpl != null)
                {
                    SeparatorImpl.isLogFileClose = false;
                    // Register the Separator service
                    separatorImpl.RegisterLayerServices();

                    SepResMgr = SeparatorResourceManager.GetInstance();

                    // Start the UI layer (Operator Console is the local instrument console)
                    Thread.CurrentThread.Name = "OperatorConsole";
                    //FrmOperatorConsole aOperatorConsole = new FrmOperatorConsole();
                    //Application.Run(aOperatorConsole);

                    //FrmCWJMain theCWJMainCon = new FrmCWJMain();
                    //Application.Run(theCWJMainCon);
                    Application.Run(RoboSep_UserConsole.getInstance());
                }
            }
            catch (Exception ex)
            {
                LogFile.LogException(TraceLevel.Error, ex);
            }
            finally
            {
                // Shutdown the Separator layer
                if (separatorImpl != null)
                {
                    separatorImpl.ShutdownInstrument();
                }

                SeparatorImpl.GetInstance().CloseLogFileSystem();
            }
        }
Exemplo n.º 2
0
 public static SeparatorImpl GetInstance()
 {
     if (theSeparatorImpl == null)
     {
         try
         {
             theSeparatorImpl = new SeparatorImpl();
         }
         catch
         {
             theSeparatorImpl = null;
         }
     }
     return(theSeparatorImpl);
 }