void uiTimer_Tick(object sender, EventArgs e) { if (bootup.IsAlive) { return; } uiTimer.Stop(); if (boot_ok == 0) { App p = Application.Current as App; MessageBox.Show(StringResource.str("bootfail")); bootmsg.Clear(); bootup = new Thread(PackerBoot); bootup.IsBackground = false; bootup.Start(); uiTimer.Start(); } else { App p = (Application.Current as App); StringResource.SetLanguage(); p.SwitchTo("runmode"); this.Visibility = Visibility.Hidden; p.agent.Action((byte)(0x80 + p.packers[0]._pack_id), "stop"); p.agent.Action(p.packers[0].vib_addr, "stop"); } }
private void btn_language_Click(object sender, RoutedEventArgs e) { if (StringResource.language == "zh-CN") { StringResource.SetLanguage("en-US"); WTRegedit("locale", "en-US"); } else { StringResource.SetLanguage("zh-CN"); WTRegedit("locale", "zh-CN"); } UpdateDisplay(false); }
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(); }