static Program() { sysinfo = new SysConfig(); testdata = new DataMgr(); lst_rxinfo = new List<RxInfo>(); lst_rsinfo = new List<RsInfo>(); for (int i = 0; i < sysinfo.iRxCnts; i++) lst_rxinfo.Add(new RxInfo(i + 1)); for (int i = 0; i < sysinfo.iRsCnts; i++) lst_rsinfo.Add(new RsInfo(i + 1)); syswnd = new SysConfigWnd(); rxwnd = new RxConfigWnd(); rswnd = new RsConfigWnd(); mcfgwnd = new MainConfigWnd(); DeviceMgr.Dummy(); }
static RunWnd() { syscfg = new SysConfig(); // ShowCursor(0); }
public void pc_cmd(string cmd) { SysConfig syscfg = Program.sysinfo; if (cmd == "S") { task.Stop();//STOP; need reply //todo return; } if (cmd == "H") { // DeviceMgr.Reset();//reset return; } Match m; m = reg_mode.Match(cmd); if (m.Success) { oper_mode = m.Groups[1].Value; return; } m = reg_statistic.Match(cmd); if (m.Success) { syscfg.iFilter = Convert.ToInt32(m.Groups[1].Value); return; } m = reg_filter.Match(cmd); if (m.Success) { if (m.Groups[1].Value == "2") { syscfg.sFilterType = "filtertype3"; } else if (m.Groups[1].Value == "1") { syscfg.sFilterType = "filtertype2"; } else { syscfg.sFilterType = "filtertype1"; } return; } m = reg_ix.Match(cmd); if (m.Success) {/* * //todo * if (currRx.iIx == 0) //1mA * if (currRx.iIx == 1) //10mA * if (currRx.iIx == 2) //0.1A * if (currRx.iIx == 3) //0.3A * if (currRx.iIx == 4) //1A * if (currRx.iIx == 5) //5A */ double myIx = double.Parse(m.Groups[1].Value) / 1000; if (myIx >= 3) { Program.lst_rxinfo[0].iIx = 5; } else if (myIx >= 0.65) { Program.lst_rxinfo[0].iIx = 4; } else if (myIx >= 0.2) { Program.lst_rxinfo[0].iIx = 3; } else if (myIx >= 0.05) { Program.lst_rxinfo[0].iIx = 2; } else if (myIx >= 0.005) { Program.lst_rxinfo[0].iIx = 1; } else if (myIx >= 0.0005) { Program.lst_rxinfo[0].iIx = 0; } else { Program.lst_rxinfo[0].iIx = -1; } return; } m = reg_delay.Match(cmd); if (m.Success) { syscfg.iMeasDelay = Convert.ToInt32(m.Groups[1].Value); return; } m = reg_meastimes.Match(cmd); if (m.Success) { syscfg.iMeasTimes = Convert.ToInt32(m.Groups[1].Value); return; } m = reg_sampletimes.Match(cmd); if (m.Success) { syscfg.iSampleTimes = Convert.ToInt32(m.Groups[1].Value); return; } m = reg_measure.Match(cmd); if (m.Success) { syscfg.iMeasTimes = Convert.ToInt32(m.Groups[1].Value); Program.mainwnd.Invoke(new Action <object, EventArgs>(this.statusBar1_StartStopClick), new object[] { 0, 0 }); //task.Start(); return; } m = reg_rsa.Match(cmd); if (m.Success) //A mode { Program.lst_rsinfo[0].dValue = Convert.ToDouble(m.Groups[1].Value); Program.lst_rxinfo[0].cStdChan = 'A'; DeviceMgr.ReportHeader(syscfg.iMeasTimes); for (int i = 0; i < syscfg.iMeasTimes; i++) { DeviceMgr.ReportData(i + 1, 10.01234566); Thread.Sleep(1000); } return; } m = reg_rsb.Match(cmd); if (m.Success) //B mode { Program.lst_rsinfo[0].dValue = Convert.ToDouble(m.Groups[1].Value); Program.lst_rxinfo[0].cStdChan = 'B'; return; } }