Ejemplo n.º 1
0
        private void MultiSetting_Load(object sender, EventArgs e)
        {
            switch (mGlobal.language)
            {
            case "Spanish":
                cul = CultureInfo.CreateSpecificCulture("es");
                break;

            case "Korean":
                cul = CultureInfo.CreateSpecificCulture("ko-KR");
                break;

            case "Japanese":
                cul = CultureInfo.CreateSpecificCulture("ja-JP");
                break;

            default:
                cul = CultureInfo.CreateSpecificCulture("en");
                break;
            }

            this.Text          = res_nam.GetString("MultiSetting", cul);
            btnCheckAll.Text   = res_nam.GetString("Check All", cul);
            btnScanDevice.Text = res_nam.GetString("Scan Device", cul);
            btnOk.Text         = res_nam.GetString("Ok", cul);


            CenterToScreen();
            dev35 = Device35.DelInstance();
            dev35 = Device35.Instance;
            btnScanDevice_Click(sender, e);
        }
Ejemplo n.º 2
0
 public GeneralInfo35(string s)
 {
     hostport = s;
     InitializeComponent();
     dev_general          = Device35.DelInstance();
     dev_general          = Device35.Instance;
     dev_general.Channels = new Channel[4];
     for (int i = 0; i < 4; i++)
     {
         dev_general.Channels[i] = new Channel();
     }
 }
Ejemplo n.º 3
0
        public SetFirmware()
        {
            InitializeComponent();

            device35 = Device35.DelInstance();
            device35 = Device35.Instance;

            device35.Channels = new Channel[4];
            for (int i = 0; i < 4; i++)
            {
                device35.Channels[i] = new Channel();
            }
        }
Ejemplo n.º 4
0
        public Setting35()
        {
            InitializeComponent();

            device35 = Device35.DelInstance();
            device35 = Device35.Instance;

            device35.Channels = new Channel[4];
            for (int i = 0; i < 4; i++)
            {
                device35.Channels[i] = new Channel();
            }

            saveGraph = Graph.DelInstance();
            saveGraph = Graph.Instance;

            mGlobal.unitFromFile = false;
        }
Ejemplo n.º 5
0
        private void Calib35_Load(object sender, EventArgs e)
        {
            switch (mGlobal.language)
            {
            case "Spanish":
                cul = CultureInfo.CreateSpecificCulture("es-ES");
                break;

            case "Korean":
                cul = CultureInfo.CreateSpecificCulture("ko-KR");
                break;

            case "Japanese":
                cul = CultureInfo.CreateSpecificCulture("ja-JP");
                break;

            default:
                cul = CultureInfo.CreateSpecificCulture("en-US");
                break;
            }

            label1.Text     = res_man.GetString("Chanel", cul);
            label4.Text     = res_man.GetString("Unit", cul);
            label2.Text     = res_man.GetString("Data offset", cul);
            btnSetting.Text = res_man.GetString("Write Setting", cul);


            cbbChannel.Items.Clear();

            string channel1 = "";
            string channel2 = "";
            string channel3 = "";
            string channel4 = "";

            dv35          = Device35.DelInstance();
            dv35          = Device35.Instance;
            dv35.Channels = new Channel[4];
            for (int i = 0; i < 4; i++)
            {
                dv35.Channels[i] = new Channel();
            }

            dv35.USBOpen(host);

            //HIDFunction.hid_SetNonBlocking(dv35.dev, 1);

            Thread.Sleep(200);

            byte[] buf = new byte[64];
            dv35.readSettingDevice();
            if (dv35.byteLogging == 68)
            {
                MessageBox.Show("Logger is recording. Please stop to calibrate");
                dv35.Close();
                this.Close();
            }
            dv35.readInfo4Device(ref buf);
            Thread.Sleep(2000);
            dv35.readSettingChannel();

            dv35.Close();

            byte[] temp1 = new byte[7];
            for (int i = 0; i < 7; i++)
            {
                if (buf[2 + i] != 0)
                {
                    temp1[i] = buf[2 + i];
                }
            }
            channel1 += Encoding.UTF8.GetString(temp1);

            byte[] temp2 = new byte[7];
            for (int i = 0; i < 7; i++)
            {
                if (buf[9 + i] != 0)
                {
                    temp2[i] = buf[9 + i];
                }
            }
            channel2 += Encoding.UTF8.GetString(temp2);

            byte[] temp3 = new byte[7];
            for (int i = 0; i < 7; i++)
            {
                if (buf[16 + i] != 0)
                {
                    temp3[i] = buf[16 + i];
                }
            }
            channel3 += Encoding.UTF8.GetString(temp3);

            byte[] temp4 = new byte[7];
            for (int i = 0; i < 7; i++)
            {
                if (buf[23 + i] != 0)
                {
                    temp4[i] = buf[23 + i];
                }
            }
            channel4 += Encoding.UTF8.GetString(temp4);

            if (channel1 == "PEXO-37")
            {
                cbbChannel.Items.Add("1");
                channels[0].unit = dv35.Channels[0].Unit;
            }
            else if (channel1 == "PEXO-40")
            {
                cbbChannel.Items.Add("1");
                channels[0].unit = 2;
            }

            if (channel2 == "PEXO-37")
            {
                cbbChannel.Items.Add("2");
                channels[1].unit = dv35.Channels[1].Unit;
            }
            else if (channel2 == "PEXO-40")
            {
                cbbChannel.Items.Add("2");
                channels[1].unit = 2;
            }

            if (channel3 == "PEXO-37")
            {
                cbbChannel.Items.Add("3");
                channels[2].unit = dv35.Channels[2].Unit;
            }
            else if (channel3 == "PEXO-40")
            {
                cbbChannel.Items.Add("3");
                channels[2].unit = 2;
            }

            if (channel4 == "PEXO-37")
            {
                cbbChannel.Items.Add("4");
                channels[3].unit = dv35.Channels[3].Unit;
            }
            else if (channel4 == "PEXO-40")
            {
                cbbChannel.Items.Add("4");
                channels[3].unit = 2;
            }

            //cbbChannel.Text = cbbChannel.Items[0].ToString();
            //cbbSign.Text = cbbSign.Items[0].ToString();
            cbbUnit.DropDownStyle = ComboBoxStyle.DropDownList;

            if (cbbUnit.Items.Count > 0)
            {
                cbbUnit.Text = cbbUnit.Items[0].ToString();
            }
            if (cbbChannel.Items.Count > 0)
            {
                cbbChannel.Text = cbbChannel.Items[0].ToString();
            }
        }
Ejemplo n.º 6
0
 public GeneralInfo35()
 {
     InitializeComponent();
     dev_general = Device35.DelInstance();
     dev_general = Device35.Instance;
 }
Ejemplo n.º 7
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            dataGridView1.Rows.Clear();
            string str_device   = "";
            int    numofChannel = 0;
            int    count        = 0;

            for (int i = 0; i < getDeviceInfo.activeDeviceListAl.Count; i++)
            {
                dev_dashboard35 = Device35.DelInstance();
                dev_dashboard35 = Device35.Instance;
                str_device      = getDeviceInfo.activeDeviceListAl[i].ToString();
                if (getDeviceInfo.activeDeviceListAl[i].ToString().Contains("Pexo35 Custm HID"))
                {
                    dev_dashboard35.USBOpen(str_device);

                    dev_dashboard35.readLocation();
                    dev_dashboard35.readDescription();
                    dev_dashboard35.readSerial();
                    dev_dashboard35.readSettingDevice();

                    dev_dashboard35.Channels = new Channel[4];
                    for (int k = 0; k < 4; k++)
                    {
                        dev_dashboard35.Channels[k] = new Channel();
                    }
                    dev_dashboard35.readSettingChannel();


                    for (int j = 0; j < 4; j++)
                    {
                        if (dev_dashboard35.Channels[j].Sensor == 3)
                        {
                            numofChannel += 3;
                        }
                        else if (dev_dashboard35.Channels[j].Sensor != 0)
                        {
                            numofChannel += 1;
                        }
                    }


                    for (int j = 0; j < 4; j++)
                    {
                        if (dev_dashboard35.byteLogging == 0x44)
                        {
                            arrUnit[i, j] = mGlobal.IntToUnit_Dashboard35(dev_dashboard35.Channels[j].Unit, dev_dashboard35.Channels[j].Sensor);
                        }
                        else
                        {
                            arrUnit[i, j] = "--";
                        }
                        if (!dev_dashboard35.Channels[j].NoAlarm)
                        {
                            arrMax[i, j] = (double)dev_dashboard35.Channels[j].AlarmMax / 10.0;
                            arrMin[i, j] = (double)dev_dashboard35.Channels[j].AlarmMin / 10.0;
                        }
                        else
                        {
                            arrMax[i, j] = 65535;
                            arrMin[i, j] = 65535;
                        }
                    }


                    dataGridView1.Rows.Add("", "");
                    dataGridView1.Rows[count].Cells[0].Value = count.ToString();
                    dataGridView1.Rows[count].Cells[1].Value = getDeviceInfo.activeDeviceListAl[i].ToString();
                    dataGridView1.Rows[count].Cells[2].Value = dev_dashboard35.Location;
                    dataGridView1.Rows[count].Cells[3].Value = dev_dashboard35.Description;
                    dataGridView1.Rows[count].Cells[4].Value = dev_dashboard35.Serial;

                    count += 1;

                    dev_dashboard35.Close();
                }
            }
            if (btnStart.Text == "Run")
            {
                btnStart.Text  = "Stop";
                timer1.Enabled = true;
            }
            else
            {
                btnStart.Text  = "Run";
                timer1.Enabled = false;
            }

            if (count == 0)
            {
                btnGraph.Enabled = false;
                btnStart.Enabled = false;
            }
        }
Ejemplo n.º 8
0
        private void EmailSetting_Load(object sender, EventArgs e)
        {
            CenterToScreen();
            switch (mGlobal.language)
            {
            case "Spanish":
                cul = CultureInfo.CreateSpecificCulture("es-ES");
                break;

            case "Korean":
                cul = CultureInfo.CreateSpecificCulture("ko-KR");
                break;

            case "Japanese":
                cul = CultureInfo.CreateSpecificCulture("ja-JP");
                break;

            default:
                cul = CultureInfo.CreateSpecificCulture("en-US");
                break;
            }


            emailDevice = Device35.DelInstance();
            emailDevice = Device35.Instance;
            byte[] buf    = new byte[600];
            string emails = "";

            string[] email;

            //emailDevice.USBOpen(host);
            for (int i = 0; i < 10; i++)
            {
                emailDevice.USBOpen(host);
                byte[] data = new byte[64];
                if (!emailDevice.readEmailSetting(ref data, i + 1))
                {
                    MessageBox.Show(res_man.GetString("Read Email Setting fail", cul));
                    emailDevice.Close();
                    return;
                }
                else
                {
                    for (int j = 0; j < 60; j++)
                    {
                        buf[60 * i + j] = data[j + 2];
                    }
                }
                emailDevice.Close();
            }

            //emailDevice.Close();
            int count = 0;

            for (int i = 0; i < buf.Length; i++)
            {
                if (buf[i] != 255 && buf[i] != 0)
                {
                    count += 1;
                }
            }

            emails = mGlobal.ArrayToStr(ref buf, 0, count);
            email  = emails.Split(';');
            //textBox1.Text = email[0];
            richTextBox1.Clear();
            for (int i = 0; i < email.Length; i++)
            {
                richTextBox1.Text += email[i] + Environment.NewLine;
            }

            if (richTextBox1.Text != "")
            {
                richTextBox1.Text = richTextBox1.Text.Substring(0, richTextBox1.Text.Length - 1);
            }


            //Read SMS
            byte[] SMSlist = new byte[200];
            for (int i = 0; i < 5; i++)
            {
                emailDevice.USBOpen(host);
                byte[] data = new byte[44];
                if (!emailDevice.readSMSSetting(ref data, i + 1))
                {
                    MessageBox.Show("Read SMS Setting fail");
                    emailDevice.Close();
                    return;
                }
                else
                {
                    for (int j = 0; j < 40; j++)
                    {
                        SMSlist[40 * i + j] = data[j + 2]; //bo report + byte length
                    }
                }
                emailDevice.Close();
            }
            rtxtSMS.Clear();

            byte[] singleSMS = new byte[20];
            for (int i = 0; i < 10; i++)
            {
                Array.Copy(SMSlist, i * 20, singleSMS, 0, 20);
                string singleText = Encoding.ASCII.GetString(singleSMS).Replace('\0', ' ').Trim();
                if (singleText.Length > 0)
                {
                    rtxtSMS.Text += singleText + Environment.NewLine;
                }
            }

            string FileName = "";

            FileName = mGlobal.app_patch(FileName);

            FileName += "\\dataEmail.txt";

            if (System.IO.File.Exists(FileName))
            {
                btnRead.Enabled = true;
            }
            else
            {
                btnRead.Enabled = false;
            }
        }