public FormMainLab() { InitializeComponent(); // _pipeServer = new PipeServer(); // _pipeServer.PipeMessage += new DelegateMessage(PipesMessageHandler); GlobeVal.myglobefile = new ClassGlobeFile(); GlobeVal.mysys = new ClassSys(); m_Global.mNIsBaseUnit = true; //MessageBox.Show(System.Windows.Forms.Application.StartupPath.ToString()); if (Directory.Exists(System.Windows.Forms.Application.StartupPath + "\\AppleLabJ") == false) { Directory.CreateDirectory(System.Windows.Forms.Application.StartupPath + "\\AppleLabJ"); } if (File.Exists(System.Windows.Forms.Application.StartupPath + "\\AppleLabJ" + "\\sys\\globe.ini") == true) { GlobeVal.myglobefile = GlobeVal.myglobefile.DeSerializeNow(System.Windows.Forms.Application.StartupPath + "\\AppleLabJ" + "\\sys\\globe.ini"); } if (File.Exists(System.Windows.Forms.Application.StartupPath + "\\AppleLabJ" + "\\sys\\setup.ini") == true) { GlobeVal.mysys = GlobeVal.mysys.DeSerializeNow(System.Windows.Forms.Application.StartupPath + "\\AppleLabJ" + "\\sys\\setup.ini"); } m_Global.mycls = new ItemSignalStation(Convert.ToInt32(GlobeVal.myglobefile.machinekind)); m_Global.mycls.ChannelCount = GlobeVal.mysys.ChannelCount; for (int i = 0; i < GlobeVal.mysys.ChannelCount; i++) { m_Global.mycls.ChannelControl[i] = GlobeVal.mysys.ChannelControl[i]; m_Global.mycls.ChannelDimension[i] = GlobeVal.mysys.ChannelDimension[i]; m_Global.mycls.ChannelRange[i] = GlobeVal.mysys.ChannelRange[i]; m_Global.mycls.ChannelSampling[i] = GlobeVal.mysys.ChannelSamplemode[i]; } if (GlobeVal.myglobefile.controllerkind == 0) { myarm = new CDsp(); } if (GlobeVal.myglobefile.controllerkind == 1) { myarm = new CDsp(); } fdata = new MainForm(); topbackcolor = Color.WhiteSmoke; }
public FormMainLab() { InitializeComponent(); GlobeVal.mysys = new ClassSys(); //MessageBox.Show(System.Windows.Forms.Application.StartupPath.ToString()); if (Directory.Exists(System.Windows.Forms.Application.StartupPath + "\\AppleLabJ") == false) { Directory.CreateDirectory(System.Windows.Forms.Application.StartupPath + "\\AppleLabJ"); } if (File.Exists(System.Windows.Forms.Application.StartupPath + "\\AppleLabJ" + "\\sys\\setup.ini") == true) { GlobeVal.mysys = GlobeVal.mysys.DeSerializeNow(System.Windows.Forms.Application.StartupPath + "\\AppleLabJ" + "\\sys\\setup.ini"); } CComLibrary.GlobeVal.languageselect = GlobeVal.mysys.language; if (CComLibrary.GlobeVal.languageselect == 0) { CComLibrary.GlobeVal.mylanguage.SetLanguage(LanguageEnum.LanguageCN); } else { CComLibrary.GlobeVal.mylanguage.SetLanguage(LanguageEnum.LanguageEN); } m_Global.mycls = new ItemSignalStation(Convert.ToInt32(GlobeVal.mysys.machinekind)); m_Global.mycls.ChannelCount = GlobeVal.mysys.ChannelCount; for (int i = 0; i < GlobeVal.mysys.ChannelCount; i++) { m_Global.mycls.ChannelControl[i] = GlobeVal.mysys.ChannelControl[i]; m_Global.mycls.ChannelDimension[i] = GlobeVal.mysys.ChannelDimension[i]; m_Global.mycls.ChannelRange[i] = GlobeVal.mysys.ChannelRange[i]; m_Global.mycls.ChannelSampling[i] = GlobeVal.mysys.ChannelSamplemode[i]; m_Global.mycls.ChannelControlChannel[i] = GlobeVal.mysys.ChannelControlChannel[i]; m_Global.mycls.ChannelName[i] = GlobeVal.mysys.ChannelName[i]; } if (GlobeVal.mysys.controllerkind == 0) { if (GlobeVal.mysys.machinekind == 3) { marmcan = new CArmCan(); mybcontrol = marmcan; } else { marm = new CArm(); mybcontrol = marm; } } if (GlobeVal.mysys.controllerkind == 1) { mdoli = new CDOLI(); mybcontrol = mdoli; } if (GlobeVal.mysys.controllerkind == 2) { mdsp = new CDsp(); mybcontrol = mdsp; } if (GlobeVal.mysys.controllerkind == 3) { mybcontrol = new C电机(); } fdata = new MainForm(); topbackcolor = Color.WhiteSmoke; if (GlobeVal.mysys.demo == true) { tlprecord.Visible = true; } else { tlprecord.Visible = false; } mouseHook.MouseMove += new MouseEventHandler(mouseHook_MouseMove); mouseHook.MouseDown += new MouseEventHandler(mouseHook_MouseDown); mouseHook.MouseUp += new MouseEventHandler(mouseHook_MouseUp); keyboardHook.KeyDown += new KeyEventHandler(keyboardHook_KeyDown); keyboardHook.KeyUp += new KeyEventHandler(keyboardHook_KeyUp); keyboardReplayHook.KeyDown += new KeyEventHandler(KeyboardReplayHook_KeyDown); keyboardReplayHook.KeyUp += new KeyEventHandler(KeyboardReplayHook_KeyUp); }