示例#1
0
        public TestProcess(Form1 form)
        {
            formbase = form;

            testdoc = form.test;
            ovencfg = new IniHandler(Path.Combine(Util.basedir, "oven.ini"), "");

            trigger = new SwitchS200("S7214");
            //trigger1 = new SwitchSER("TRIGGER1");
            //trigger2 = new SwitchSER("TRIGGER2");
            //trigger3 = new SwitchSER("TRIGGER3");
            //trigger4 = new SwitchSER("TRIGGER4");
            wd1529 = new WD1529("WD1529");
            bath300A = new BathCTRJ("CTRJ-300A");
            bathN35A = new BathCTRJ("CTRJ-35A");
            if (!bath300A.bInUse && !Util.ISDEBUG)
                MessageBox.Show("连接CTRJ-300A 恒温槽失败,请检查串口设置后重试", "连接失败");
            if (!bathN35A.bInUse && !Util.ISDEBUG)
                MessageBox.Show("连接CTRJ-N35A 恒温槽失败,请检查串口设置后重试", "连接失败");

            if (!wd1529.bInUse || !trigger.bInUse)//!trigger1.bInUse || !trigger2.bInUse || !trigger3.bInUse || !trigger4.bInUse)
            {
                if (!wd1529.bInUse && !Util.ISDEBUG)
                    MessageBox.Show("连接FLUKE 1529失败,请检查串口设置后重试", "连接失败");
                //if ((!trigger1.bInUse || !trigger2.bInUse || !trigger3.bInUse || !trigger4.bInUse) && !Util.ISDEBUG)
                //    MessageBox.Show("连接开关检测模块失败,请检查串口设置后重试", "连接失败");

                if (!trigger.bInUse && !Util.ISDEBUG)
                    MessageBox.Show("连接S7-200 开关检测模块失败,请检查串口设置(9600/8/EVEN/1STOP)后重试, S7-200 地址为2,连接I0.0-I0.3)", "连接失败");
                if (!Util.ISDEBUG)
                    Process.GetCurrentProcess().Kill();
            }
        }
示例#2
0
        public Form1()
        {
            if (!File.Exists("C:\\blank.htm"))
            {
                File.WriteAllText("C:\\blank.htm", "<html><head>blank></head><body></body></html>");
            }
            InitializeComponent();
            zedallprobes.GraphPane.Title.Text = "各探头阻值()";
            zedallprobes.IsShowPointValues = true;
            btn_start.Enabled = true;
            saveFileDialog1.AddExtension = true;
            saveFileDialog1.CheckPathExists = true;
            saveFileDialog1.OverwritePrompt = true;
            saveFileDialog1.ValidateNames = true;
            saveFileDialog1.DefaultExt = ".rec";
            saveFileDialog1.Filter = "Record File(*.rec)|*.rec|All Files(*.*)|*.*";
            saveFileDialog1.FileName = "";

            openFileDialog1.CheckFileExists = true;
            openFileDialog1.Multiselect = false;
            openFileDialog1.ValidateNames = true;
            openFileDialog1.Filter = "Record File(*.rec)|*.rec|All Files(*.*)|*.*";
            openFileDialog1.DefaultExt = ".rec";
            openFileDialog1.FileName = "";

            cb_probetype.SelectedIndex = 0;
            cb_probetype.SelectedValueChanged += new EventHandler(cb_temprange_SelectedValueChanged);

            
            this.webBrowser1.IsWebBrowserContextMenuEnabled = false;
            this.webBrowser1.AllowWebBrowserDrop = false;
            //this.webBrowser1.ScrollBarsEnabled = false;
            this.webBrowser1.WebBrowserShortcutsEnabled = false;
            try
            {
                this.webBrowser1.ObjectForScripting = this;
                
            }
            catch
            {
            }
            this.Text = this.Text + "(" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + ")";
            LoadDefaultRecordPage();

            test = new TestDocument();
            process = new TestProcess(this);
            input_dlg = new Input();
            
            msg_dlg = new MsgDlg();
            NewToolStripMenuItem_Click(null, null);
            this.webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted);
            backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorker1_DoWork);
            backgroundWorker1.WorkerSupportsCancellation = true;
            backgroundWorker1.WorkerReportsProgress = true;
            backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker1_RunWorkerCompleted);
        }
示例#3
0
        public TestProcess(Form1 form)
        {
            formbase = form;

            testdoc = form.test;
            ovencfg = new IniHandler(Path.Combine(Util.basedir, "oven.ini"), "");
            
            Scanner sc148;
            Scanner sc4012;
            Scanner2560 sc2560 = new Scanner2560("FLUKE2560");
            ThermBridge dq700 = new DQF700("F700");
            ThermBridge dq1560;
            if (dq700.bInUse)
            {
                bridge = dq700;
                sc148 = new ScannerSB148("SB148");
                sc4012 = new ScannerST4012A("ST4012A");
                if (sc148.bInUse || sc4012.bInUse)
                {
                    if (sc148.bInUse && sc4012.bInUse)
                    {

//                        if (DialogResult.Yes == MessageBox.Show("同时发现扫描器SB148 和 ST4012A.\n 按‘是’选择SB148\n按‘否’选择ST4012A", "选择扫描器", MessageBoxButtons.YesNo))
//                            scanner = sc148;
//                        else
                            scanner = sc4012;
                        return;
                    }
                    if (sc148.bInUse)
                        scanner = sc148;
                    else
                        scanner = sc4012;
                    return;
                }
                    MessageBox.Show("连接SB158或ST4012A扫描开关失败,请检查连接后重试", "连接失败");
            }
            else
            {
                dq1560 = new FL1560("FLUKE1560", sc2560);
                if (dq1560.bInUse)
                {
                    bridge = dq1560;
                    scanner = sc2560;
                    return;
                }
                MessageBox.Show("连接F700测温电桥或FLUKE1560失败,请检查连接后重试", "连接失败");
            }
            if (!Util.ISDEBUG)
            {
                Process.GetCurrentProcess().Kill();
            }
            
        }
示例#4
0
        public TestProcess(Form1 form)
        {
            formbase = form;

            testdoc = form.test;
            ovencfg = new IniHandler(Path.Combine(Util.basedir, "oven.ini"), "");

            trigger = new SwitchS200("S7214");
            //trigger1 = new SwitchSER("TRIGGER1");
            //trigger2 = new SwitchSER("TRIGGER2");
            //trigger3 = new SwitchSER("TRIGGER3");
            //trigger4 = new SwitchSER("TRIGGER4");
            wd1529   = new WD1529("WD1529");
            bath300A = new BathCTRJ("CTRJ-300A");
            bathN35A = new BathCTRJ("CTRJ-35A");
            if (!bath300A.bInUse && !Util.ISDEBUG)
            {
                MessageBox.Show("连接CTRJ-300A 恒温槽失败,请检查串口设置后重试", "连接失败");
            }
            if (!bathN35A.bInUse && !Util.ISDEBUG)
            {
                MessageBox.Show("连接CTRJ-N35A 恒温槽失败,请检查串口设置后重试", "连接失败");
            }

            if (!wd1529.bInUse || !trigger.bInUse)//!trigger1.bInUse || !trigger2.bInUse || !trigger3.bInUse || !trigger4.bInUse)
            {
                if (!wd1529.bInUse && !Util.ISDEBUG)
                {
                    MessageBox.Show("连接FLUKE 1529失败,请检查串口设置后重试", "连接失败");
                }
                //if ((!trigger1.bInUse || !trigger2.bInUse || !trigger3.bInUse || !trigger4.bInUse) && !Util.ISDEBUG)
                //    MessageBox.Show("连接开关检测模块失败,请检查串口设置后重试", "连接失败");

                if (!trigger.bInUse && !Util.ISDEBUG)
                {
                    MessageBox.Show("连接S7-200 开关检测模块失败,请检查串口设置(9600/8/EVEN/1STOP)后重试, S7-200 地址为2,连接I0.0-I0.3)", "连接失败");
                }
                if (!Util.ISDEBUG)
                {
                    Process.GetCurrentProcess().Kill();
                }
            }
        }
示例#5
0
 public DocTool(TestDocument datadoc)
 {
     _testdoc = datadoc;
 }
示例#6
0
 public DocTool(TestDocument datadoc)
 {
     _testdoc = datadoc;
 }