private void buttonCalib100A_Click(object sender, EventArgs e)
        {
            // Send commands for calibration
            CommandFormerClass cm = new CommandFormerClass(ConfigClass.startSeq, ConfigClass.deviceAddr);

            cm.ReturnACK();
            cm.AppendDischarger100AOn();
            cm.AppendWaitForMs(2000);
            cm.AppendDataRecorderTask(0, 2, 0, 150, DateTime.Now.AddSeconds(2)); // Take into consideration 2 sec wait above
            cm.AppendWaitForMs(1000);
            cm.AppendDischarger100AOffS1();
            cm.AppendWaitForMs(200);
            cm.AppendDischarger100AOffS2();
            var data = cm.GetFinalCommandList();

            SerialDriver.Send(data, SuccessCallbackCurrent100A, FailCallback);

            // Now enable GW INSTEC recording

            Point pt = new Point(Convert.ToInt32(dataGridView1.Rows[0].Cells[0].Value), Convert.ToInt32(dataGridView1.Rows[0].Cells[1].Value));

            Cursor.Position = pt;
            mouse_event(MOUSEEVENTF_LEFTDOWN, pt.X, pt.Y, 0, 0);
            mouse_event(MOUSEEVENTF_LEFTUP, pt.X, pt.Y, 0, 0);
            Thread.Sleep(100);
            // Configrm recording
            pt = new Point(Convert.ToInt32(dataGridView1.Rows[1].Cells[0].Value), Convert.ToInt32(dataGridView1.Rows[1].Cells[1].Value));
            Cursor.Position = pt;
            mouse_event(MOUSEEVENTF_LEFTDOWN, pt.X, pt.Y, 0, 0);
            mouse_event(MOUSEEVENTF_LEFTUP, pt.X, pt.Y, 0, 0);
            Thread.Sleep(2900);
            // Disable measures
            pt = new Point(Convert.ToInt32(dataGridView1.Rows[0].Cells[0].Value), Convert.ToInt32(dataGridView1.Rows[0].Cells[1].Value));
            Cursor.Position = pt;
            mouse_event(MOUSEEVENTF_LEFTDOWN, pt.X, pt.Y, 0, 0);
            mouse_event(MOUSEEVENTF_LEFTUP, pt.X, pt.Y, 0, 0);
        }
Exemplo n.º 2
0
 private void buttonDebugDischarger100AOffS2_Click(object sender, EventArgs e)
 {
     com.AppendDischarger100AOffS2();
     textBoxDebugInstructionPool.Text += "Discharger100AOff S2\r\n";
     FormCustomConsole.WriteLine("Discharger100AOff S2");
 }