public App() { System.Diagnostics.Process[] pses = System.Diagnostics.Process.GetProcessesByName("ioex-cs"); if (pses.Length > 0) { // System.Diagnostics.Process.GetCurrentProcess().Kill(); // return; } if (Environment.CommandLine.IndexOf("/debug") > 0) { NodeAgent.IsDebug = true; } StringResource.SetLanguage(); //app_cfg = new XmlConfig(ProdNum.baseDir +"\\app_config.xml"); app_cfg = new SqlConfig("app"); app_cfg.LoadConfigFromFile(); curr_cfg = app_cfg.Current; agent = new NodeAgent(); packers = new List <UIPacker>(); for (int i = 0; i < Int32.Parse(curr_cfg.Element("machine_number").Value); i++) { UIPacker p = new UIPacker(i, agent); p.agent = agent; p.InitConfig(); packers.Add(p); } singlewnd = new SingleMode(Int32.Parse(curr_cfg.Element("node_number").Value)); runwnd = new RunMode(Int32.Parse(curr_cfg.Element("node_number").Value)); histwnd = new ProdHistory(); helpwnd = new Help(); kbdwnd = new kbd(); bottomwnd = new BottomWnd(); alertwnd = new AlertWnd(); alertwnd.UpdateUI(); //load alert configuration which is in app_config.xml too pwdwnd = new PwdWnd(); engwnd = new EngConfigWnd(); configwnd = new ConfigMenuWnd(); prodwnd = new ProdWnd(); prodnum = new ProdNum(); }
public App() { System.Diagnostics.Process[] pses = System.Diagnostics.Process.GetProcessesByName("ioex-cs"); if (pses.Length > 0) { // System.Diagnostics.Process.GetCurrentProcess().Kill(); // return; } if (Environment.CommandLine.IndexOf("/debug") > 0) NodeAgent.IsDebug = true; StringResource.SetLanguage(); //app_cfg = new XmlConfig(ProdNum.baseDir +"\\app_config.xml"); app_cfg = new SqlConfig("app"); app_cfg.LoadConfigFromFile(); curr_cfg = app_cfg.Current; agent = new NodeAgent(); packers = new List<UIPacker>(); for (int i = 0; i < Int32.Parse(curr_cfg.Element("machine_number").Value); i++) { UIPacker p = new UIPacker(i, agent); p.agent = agent; p.InitConfig(); packers.Add(p); } singlewnd = new SingleMode(Int32.Parse(curr_cfg.Element("node_number").Value)); runwnd = new RunMode(Int32.Parse(curr_cfg.Element("node_number").Value)); histwnd = new ProdHistory(); helpwnd = new Help(); kbdwnd = new kbd(); bottomwnd = new BottomWnd(); alertwnd = new AlertWnd(); alertwnd.UpdateUI(); //load alert configuration which is in app_config.xml too pwdwnd = new PwdWnd(); engwnd = new EngConfigWnd(); configwnd = new ConfigMenuWnd(); prodwnd = new ProdWnd(); prodnum = new ProdNum(); }
public void SwitchTo(string mode) { if (mode == "history") { histwnd.UpdateDisplay(); histwnd.UpdateList(); histwnd.Show(); histwnd.BringToFront(); return; } if (mode == "alert") { alertwnd.UpdateUI(); alertwnd.Show(); alertwnd.BringIntoView(); return; } if (mode == "bottom") { bottomwnd.Show(); bottomwnd.UpdateDisplay(); bottomwnd.BringIntoView(); return; } if (mode == "password") { pwdwnd.Show(); pwdwnd.BringIntoView(); return; } if (mode == "engineer") { engwnd.InitDisplay(); engwnd.Show(); engwnd.BringIntoView(); return; } singlewnd.Hide(); histwnd.Hide(); helpwnd.Hide(); runwnd.Hide(); alertwnd.Hide(); bottomwnd.Hide(); pwdwnd.Hide(); engwnd.Hide(); kbdwnd.Hide(); configwnd.Hide(); if (mode == "configmenu") { configwnd.Show(); configwnd.BringIntoView(); return; } if (mode == "product") { mode = "singlemode"; } if (mode == "runmode") { runwnd.Show(); if (runwnd.btn_allstart.Visibility == Visibility.Hidden) { MessageBox.Show(StringResource.str("license")); } runwnd.UpdateSysConfigUI(); runwnd.BringIntoView(); return; } if (mode == "singlemode") { singlewnd.Show(); singlewnd.UpdateUI(); singlewnd.BringIntoView(); return; } if (mode == "helpmode") { helpwnd.Show(); helpwnd.BringIntoView(); return; } }