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

            cm.ReturnACK();
            cm.AppendDischarger10AOn();
            cm.AppendWaitForMs(2000);
            cm.AppendDataRecorderTask(0, 2, 0, 300, DateTime.Now.AddSeconds(2)); // Take into consideration 2 sec wait above
            cm.AppendWaitForMs(2000);
            cm.AppendDischarger10AOffS1();
            cm.AppendWaitForMs(200);
            cm.AppendDischarger10AOffS2();
            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(3900);
            // 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);
        }
Esempio n. 2
0
 private void buttonDebugDischarger10AOffS1_Click(object sender, EventArgs e)
 {
     com.AppendDischarger10AOffS1();
     textBoxDebugInstructionPool.Text += "Discharger10AOff S1\r\n";
     FormCustomConsole.WriteLine("Discharger10AOff S1");
 }