예제 #1
0
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     TimerStatusBar.Stop();
     if (SEL.CBExportAutomatically.Checked)
     {
         SEL.SaveLog(Application.StartupPath + "\\SystemLog.log");
     }
     if (InferenceThread.IsAlive)
     {
         InferenceThread.Abort();
     }
     if (StatusThread.IsAlive)
     {
         StatusThread.Abort();
     }
     Core_unit.Dispose();
 }
예제 #2
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     TimerStatusBar.Start();
     SEL = new System_Event_Log();
     SEL.Show();
     SEL.Visible = false;
     SEL.LBEvents.Items.Add("System Event log initilized.  " + DateTime.Now.ToString());
     CheckRegistry();
     //if (DBConnection.checkInfo())
     //    Application.Exit();
     //else
     //    DBConnection.InitilizeConnection();
     CurrentUser  = new Control_User();
     StatusThread = new Thread(new ThreadStart(StatusCheck));
     StatusThread.Start();
     CI                 = new Console_Interface();
     CI.Dock            = DockStyle.Top;
     CI.VisibleChanged += new EventHandler(OnConsole_Visibility_Changed);
     CI.MdiParent       = this;
     CI.Show();
     CI.Visible             = false;
     Core_unit              = new Core(Application.StartupPath);
     Core_unit.Main.TExtRef = CI.RTBConsole;
     CI.Core_Unit_Ref       = Core_unit;
     Core_unit.CompileCode();
     Communicator = new CommunicationManager();
     Ts           = new Transport_Status();
     Ts.Show();
     Ts.Visible = false;
     Core_unit.LoadVariablesData();
     InferenceThread = new Thread(new ThreadStart(RunInference));
     //InferenceThread.Start();//must be started and aborted from the channel controller
     CommunicationManager.CurrentHex = "13";
     R = new Random();
     InvisiblePreview = new test();
 }