示例#1
0
        private void loadCombos()
        {
            numCrunch mars   = new numCrunch();
            DataTable result = mars.configLoad();

            try
            {
                int count = result.Rows.Count;
                for (int i = 0; i < count; i++)
                {
                    comboBox1.Items.Add(result.Rows[i][1].ToString());
                    comboBox2.Items.Add(result.Rows[i][1].ToString());
                    comboBox3.Items.Add(result.Rows[i][1].ToString());
                }

                comboBox1.SelectedIndex = Properties.Settings.Default.Index1;
                comboBox2.SelectedIndex = Properties.Settings.Default.Index2;
                comboBox3.SelectedIndex = Properties.Settings.Default.Index3;
            }
            catch (Exception e)
            {
                MessageBox.Show("Failed to load Combo Boxes \r \r"
                                + "Here's Why.... \r \r" + e.ToString());
            }
        }
示例#2
0
        private void FillLabels()
        {
            fillit = crunch1.configLoad();

            label1.Text  = fillit.Rows[0][1].ToString();
            label2.Text  = fillit.Rows[1][1].ToString();
            label3.Text  = fillit.Rows[2][1].ToString();
            label4.Text  = fillit.Rows[3][1].ToString();
            label5.Text  = fillit.Rows[4][1].ToString();
            label6.Text  = fillit.Rows[5][1].ToString();
            label7.Text  = fillit.Rows[6][1].ToString();
            label8.Text  = fillit.Rows[7][1].ToString();
            label9.Text  = fillit.Rows[8][1].ToString();
            label10.Text = fillit.Rows[9][1].ToString();
            label11.Text = fillit.Rows[10][1].ToString();
            label12.Text = fillit.Rows[11][1].ToString();
            label13.Text = fillit.Rows[12][1].ToString();
            label14.Text = fillit.Rows[13][1].ToString();
            label15.Text = fillit.Rows[14][1].ToString();
            label16.Text = fillit.Rows[15][1].ToString();
            label25.Text = fillit.Rows[24][1].ToString();
            label26.Text = fillit.Rows[25][1].ToString();
            label27.Text = fillit.Rows[26][1].ToString();
            label28.Text = fillit.Rows[27][1].ToString();
            label29.Text = fillit.Rows[28][1].ToString();
            label30.Text = fillit.Rows[29][1].ToString();
            label31.Text = fillit.Rows[30][1].ToString();
            label32.Text = fillit.Rows[31][1].ToString();
            label17.Text = fillit.Rows[32][1].ToString();
            label18.Text = fillit.Rows[33][1].ToString();
            label19.Text = fillit.Rows[34][1].ToString();
            label20.Text = fillit.Rows[35][1].ToString();
        }
示例#3
0
        private void FillLabels()
        {
            numCrunch crunch1 = new numCrunch();
            DataTable fillit  = new DataTable();

            fillit = crunch1.configLoad();

            chkBoxSensor1.Text  = fillit.Rows[0][1].ToString();
            chkBoxSensor2.Text  = fillit.Rows[1][1].ToString();
            chkBoxSensor3.Text  = fillit.Rows[2][1].ToString();
            chkBoxSensor4.Text  = fillit.Rows[3][1].ToString();
            chkBoxSensor5.Text  = fillit.Rows[4][1].ToString();
            chkBoxSensor6.Text  = fillit.Rows[5][1].ToString();
            chkBoxSensor7.Text  = fillit.Rows[6][1].ToString();
            chkBoxSensor8.Text  = fillit.Rows[7][1].ToString();
            chkBoxSensor9.Text  = fillit.Rows[8][1].ToString();
            chkBoxSensor10.Text = fillit.Rows[9][1].ToString();
            chkBoxSensor11.Text = fillit.Rows[10][1].ToString();
            chkBoxSensor12.Text = fillit.Rows[11][1].ToString();
            chkBoxSensor13.Text = fillit.Rows[12][1].ToString();
            chkBoxSensor14.Text = fillit.Rows[13][1].ToString();
            chkBoxSensor15.Text = fillit.Rows[14][1].ToString();
            chkBoxSensor16.Text = fillit.Rows[15][1].ToString();
            chkBoxSensor17.Text = fillit.Rows[16][1].ToString();
            chkBoxSensor18.Text = fillit.Rows[17][1].ToString();
            chkBoxSensor19.Text = fillit.Rows[18][1].ToString();
            chkBoxSensor20.Text = fillit.Rows[19][1].ToString();
            chkBoxSensor21.Text = fillit.Rows[20][1].ToString();
            chkBoxSensor22.Text = fillit.Rows[21][1].ToString();
            chkBoxSensor23.Text = fillit.Rows[22][1].ToString();
            chkBoxSensor24.Text = fillit.Rows[23][1].ToString();
            chkBoxSensor25.Text = fillit.Rows[24][1].ToString();
            chkBoxSensor26.Text = fillit.Rows[25][1].ToString();
            chkBoxSensor27.Text = fillit.Rows[26][1].ToString();
            chkBoxSensor28.Text = fillit.Rows[27][1].ToString();
            chkBoxSensor29.Text = fillit.Rows[28][1].ToString();
            chkBoxSensor30.Text = fillit.Rows[29][1].ToString();
            chkBoxSensor31.Text = fillit.Rows[30][1].ToString();
            chkBoxSensor32.Text = fillit.Rows[31][1].ToString();
        }
示例#4
0
        private DataTable getValues1(bool[] chkItems, string query)
        {
            DataTable NameTable = new DataTable();
            numCrunch names     = new numCrunch();

            NameTable = names.configLoad();


            DataTable chartTable = new DataTable();

            chartTable = get(query);
            for (int i = 0; i < chkItems.Length; i++)
            {
                if (chkItems[i] == true)
                {
                    if (i < 32)
                    {
                        chartTable.Columns[i + 1].ColumnName = NameTable.Rows[i][1].ToString();
                        addSeries(NameTable.Rows[i][1].ToString());
                    }
                }
            }
            return(chartTable);
        }
示例#5
0
        /// <summary>
        /// Gets a List of type Trim with all the sensor trim and enabled values as
        /// properties in each object type Trim.
        /// </summary>
        /// <returns>List of type Trim with each list item having two properties
        /// "Enabled" = bool and "Trim" = double </returns>
        public List <Trim> GetValues()
        {
            numCrunch   pluto    = new numCrunch();
            DataTable   result   = pluto.configLoad();
            List <Trim> procTrim = new List <Trim>();

            try
            {
                int count = result.Rows.Count;
                for (int i = 0; i < 16; i++)
                {
                    Trim temp = new Trim();
                    if (i == 16)
                    {
                        temp.Enabled   = Convert.ToBoolean(result.Rows[i + 1][4]);
                        temp.TrimValue = Convert.ToDouble(result.Rows[i + 1][3].ToString());
                    }
                    else if (i == 17)
                    {
                        temp.Enabled   = Convert.ToBoolean(result.Rows[i - 1][4]);
                        temp.TrimValue = Convert.ToDouble(result.Rows[i - 1][3].ToString());
                    }
                    else if (i == 18)
                    {
                        temp.Enabled   = Convert.ToBoolean(result.Rows[i + 1][4]);
                        temp.TrimValue = Convert.ToDouble(result.Rows[i + 1][3].ToString());
                    }
                    else if (i == 19)
                    {
                        temp.Enabled   = Convert.ToBoolean(result.Rows[i - 1][4]);
                        temp.TrimValue = Convert.ToDouble(result.Rows[i - 1][3].ToString());
                    }
                    else if (i == 20)
                    {
                        temp.Enabled   = Convert.ToBoolean(result.Rows[i + 1][4]);
                        temp.TrimValue = Convert.ToDouble(result.Rows[i + 1][3].ToString());
                    }
                    else if (i == 21)
                    {
                        temp.Enabled   = Convert.ToBoolean(result.Rows[i - 1][4]);
                        temp.TrimValue = Convert.ToDouble(result.Rows[i - 1][3].ToString());
                    }
                    else if (i == 22)
                    {
                        temp.Enabled   = Convert.ToBoolean(result.Rows[i + 1][4]);
                        temp.TrimValue = Convert.ToDouble(result.Rows[i + 1][3].ToString());
                    }
                    else if (i == 23)
                    {
                        temp.Enabled   = Convert.ToBoolean(result.Rows[i - 1][4]);
                        temp.TrimValue = Convert.ToDouble(result.Rows[i - 1][3].ToString());
                    }
                    else
                    {
                        temp.Enabled   = Convert.ToBoolean(result.Rows[i][4]);
                        temp.TrimValue = Convert.ToDouble(result.Rows[i][3].ToString());
                    }
                    procTrim.Add(temp);
                }
                return(procTrim);
            }
            catch (Exception e)
            {
                System.Windows.Forms.MessageBox.Show("Failed to get Trim Values and Enables \r \n"
                                                     + "Here's Why.... \r \n" + e.ToString());
                return(null);
            }
        }
示例#6
0
        private void loadThem()
        {
            numCrunch pluto  = new numCrunch();
            DataTable result = pluto.configLoad();

            try
            {
                int count = result.Rows.Count;
                for (int i = 0; i < count; i++)
                {
                    textBox101.Text = Convert.ToDecimal(result.Rows[0][3]).ToString("0");
                    textBox102.Text = Convert.ToDecimal(result.Rows[1][3]).ToString("0");
                    textBox103.Text = Convert.ToDecimal(result.Rows[2][3]).ToString("0");
                    textBox104.Text = Convert.ToDecimal(result.Rows[3][3]).ToString("0");
                    textBox105.Text = Convert.ToDecimal(result.Rows[4][3]).ToString("0");
                    textBox106.Text = Convert.ToDecimal(result.Rows[5][3]).ToString("0");
                    textBox107.Text = Convert.ToDecimal(result.Rows[6][3]).ToString("0");
                    textBox108.Text = Convert.ToDecimal(result.Rows[7][3]).ToString("0");
                    textBox109.Text = Convert.ToDecimal(result.Rows[8][3]).ToString("0");
                    textBox110.Text = Convert.ToDecimal(result.Rows[9][3]).ToString("0");
                    textBox111.Text = Convert.ToDecimal(result.Rows[10][3]).ToString("0");
                    textBox112.Text = Convert.ToDecimal(result.Rows[11][3]).ToString("0");
                    textBox113.Text = Convert.ToDecimal(result.Rows[12][3]).ToString("0");
                    textBox114.Text = Convert.ToDecimal(result.Rows[13][3]).ToString("0");
                    textBox115.Text = Convert.ToDecimal(result.Rows[14][3]).ToString("0");
                    textBox116.Text = Convert.ToDecimal(result.Rows[15][3]).ToString("0");
                    textBox117.Text = Convert.ToDecimal(result.Rows[16][3]).ToString("0");
                    textBox118.Text = Convert.ToDecimal(result.Rows[17][3]).ToString("0");
                    textBox119.Text = Convert.ToDecimal(result.Rows[18][3]).ToString("0");
                    textBox120.Text = Convert.ToDecimal(result.Rows[19][3]).ToString("0");
                    textBox121.Text = Convert.ToDecimal(result.Rows[20][3]).ToString("0");
                    textBox122.Text = Convert.ToDecimal(result.Rows[21][3]).ToString("0");
                    textBox123.Text = Convert.ToDecimal(result.Rows[22][3]).ToString("0");
                    textBox124.Text = Convert.ToDecimal(result.Rows[23][3]).ToString("0");


                    textBox125.Text = Convert.ToDecimal(result.Rows[24][3]).ToString("0");
                    textBox126.Text = Convert.ToDecimal(result.Rows[25][3]).ToString("0");
                    textBox127.Text = Convert.ToDecimal(result.Rows[26][3]).ToString("0");
                    textBox128.Text = Convert.ToDecimal(result.Rows[27][3]).ToString("0");
                    textBox129.Text = Convert.ToDecimal(result.Rows[28][3]).ToString("0");
                    textBox130.Text = Convert.ToDecimal(result.Rows[29][3]).ToString("0");
                    textBox131.Text = Convert.ToDecimal(result.Rows[30][3]).ToString("0");
                    textBox132.Text = Convert.ToDecimal(result.Rows[31][3]).ToString("0");

                    textBox125.Visible = false;
                    textBox126.Visible = false;
                    textBox127.Visible = false;
                    textBox128.Visible = false;
                    textBox129.Visible = false;
                    textBox130.Visible = false;
                    textBox131.Visible = false;
                    textBox132.Visible = false;
                    label40.Visible    = false;
                    label41.Visible    = false;
                    checkBox25.Visible = false;
                    checkBox26.Visible = false;
                    checkBox27.Visible = false;
                    checkBox28.Visible = false;
                    checkBox29.Visible = false;
                    checkBox30.Visible = false;
                    checkBox31.Visible = false;
                    checkBox32.Visible = false;

                    //
                    textBox1.Text  = result.Rows[0][1].ToString();
                    textBox2.Text  = result.Rows[1][1].ToString();
                    textBox3.Text  = result.Rows[2][1].ToString();
                    textBox4.Text  = result.Rows[3][1].ToString();
                    textBox5.Text  = result.Rows[4][1].ToString();
                    textBox6.Text  = result.Rows[5][1].ToString();
                    textBox7.Text  = result.Rows[6][1].ToString();
                    textBox8.Text  = result.Rows[7][1].ToString();
                    textBox9.Text  = result.Rows[8][1].ToString();
                    textBox10.Text = result.Rows[9][1].ToString();
                    textBox11.Text = result.Rows[10][1].ToString();
                    textBox12.Text = result.Rows[11][1].ToString();
                    textBox13.Text = result.Rows[12][1].ToString();
                    textBox14.Text = result.Rows[13][1].ToString();
                    textBox15.Text = result.Rows[14][1].ToString();
                    textBox16.Text = result.Rows[15][1].ToString();
                    textBox17.Text = result.Rows[16][1].ToString();
                    textBox18.Text = result.Rows[17][1].ToString();
                    textBox19.Text = result.Rows[18][1].ToString();
                    textBox20.Text = result.Rows[19][1].ToString();
                    textBox21.Text = result.Rows[20][1].ToString();
                    textBox22.Text = result.Rows[21][1].ToString();
                    textBox23.Text = result.Rows[22][1].ToString();
                    textBox24.Text = result.Rows[23][1].ToString();
                    textBox25.Text = result.Rows[24][1].ToString();
                    textBox26.Text = result.Rows[25][1].ToString();
                    textBox27.Text = result.Rows[26][1].ToString();
                    textBox28.Text = result.Rows[27][1].ToString();
                    textBox29.Text = result.Rows[28][1].ToString();
                    textBox30.Text = result.Rows[29][1].ToString();
                    textBox31.Text = result.Rows[30][1].ToString();
                    textBox32.Text = result.Rows[31][1].ToString();
                    textBox33.Text = result.Rows[32][1].ToString();
                    textBox34.Text = result.Rows[33][1].ToString();
                    textBox35.Text = result.Rows[34][1].ToString();
                    textBox36.Text = result.Rows[35][1].ToString();



                    //
                    checkBox1.Checked  = (bool)result.Rows[0][4];
                    checkBox2.Checked  = (bool)result.Rows[1][4];
                    checkBox3.Checked  = (bool)result.Rows[2][4];
                    checkBox4.Checked  = (bool)result.Rows[3][4];
                    checkBox5.Checked  = (bool)result.Rows[4][4];
                    checkBox6.Checked  = (bool)result.Rows[5][4];
                    checkBox7.Checked  = (bool)result.Rows[6][4];
                    checkBox8.Checked  = (bool)result.Rows[7][4];
                    checkBox9.Checked  = (bool)result.Rows[8][4];
                    checkBox10.Checked = (bool)result.Rows[9][4];
                    checkBox11.Checked = (bool)result.Rows[10][4];
                    checkBox12.Checked = (bool)result.Rows[11][4];
                    checkBox13.Checked = (bool)result.Rows[12][4];
                    checkBox14.Checked = (bool)result.Rows[13][4];
                    checkBox15.Checked = (bool)result.Rows[14][4];
                    checkBox16.Checked = (bool)result.Rows[15][4];
                    checkBox17.Checked = (bool)result.Rows[16][4];
                    checkBox18.Checked = (bool)result.Rows[17][4];
                    checkBox19.Checked = (bool)result.Rows[18][4];
                    checkBox20.Checked = (bool)result.Rows[19][4];
                    checkBox21.Checked = (bool)result.Rows[20][4];
                    checkBox22.Checked = (bool)result.Rows[21][4];
                    checkBox23.Checked = (bool)result.Rows[22][4];
                    checkBox24.Checked = (bool)result.Rows[23][4];
                    checkBox25.Checked = (bool)result.Rows[24][4];
                    checkBox26.Checked = (bool)result.Rows[25][4];
                    checkBox27.Checked = (bool)result.Rows[26][4];
                    checkBox28.Checked = (bool)result.Rows[27][4];
                    checkBox29.Checked = (bool)result.Rows[28][4];
                    checkBox30.Checked = (bool)result.Rows[29][4];
                    checkBox31.Checked = (bool)result.Rows[30][4];
                    checkBox32.Checked = (bool)result.Rows[31][4];
                    checkBox33.Checked = (bool)result.Rows[32][4];
                    checkBox34.Checked = (bool)result.Rows[33][4];
                    checkBox35.Checked = (bool)result.Rows[34][4];
                    checkBox36.Checked = (bool)result.Rows[35][4];
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("Failed to load Controls \r \r"
                                + "Here's Why.... \r \r" + e.ToString());
            }
        }