Ejemplo n.º 1
0
        // Test connection to audit database
        private void button6_Click(object sender, EventArgs e)
        {
            label5.Text = "Wait...";
            label5.Update();

            try
            {
                if (double.TryParse(AuditDb.CheckService(), out double result))
                {
                    if (result >= Constants.RequiredWebserviceVersion)
                    {
                        label5.Text = string.Format("Connection successful. Webservice version: {0:0.00}", result);
                    }
                    else
                    {
                        label5.Text = string.Format("Bad version. Needed {0:0.00} but found {1:0.00}", Constants.RequiredWebserviceVersion, result);
                    }
                }
                else
                {
                    label5.Text = "Connection failed. Service or internet connection may be down";
                }
            }
            catch (Exception ex)
            {
                label5.Text = ex.Message.Substring(0, Math.Min(100, ex.Message.Length - 1));
            }
        }
Ejemplo n.º 2
0
        // Newest button
        private void button10_Click(object sender, EventArgs e)
        {
            TestGroupIndex = 0;
            var s = AuditDb.QueryTestsByGroup(textBox2.Text, TestGroups[TestGroupIndex]);

            textBox3.Text = s;
            UpdateButtonState();
        }
Ejemplo n.º 3
0
        private void comboBox1_DropDown(object sender, EventArgs e)
        {
            textBox6.Clear();
            List <string> names = AuditDb.QueryTestNames(textBox4.Text);

            names.Sort();
            comboBox1.DataSource = names;
        }
Ejemplo n.º 4
0
        // Older
        private void button12_Click(object sender, EventArgs e)
        {
            if (++TestGroupIndex == TestGroups.Count)
            {
                TestGroupIndex = TestGroups.Count - 1;
            }

            var s = AuditDb.QueryTestsByGroup(textBox2.Text, TestGroups[TestGroupIndex]);

            textBox3.Text = s;
            UpdateButtonState();;
        }
Ejemplo n.º 5
0
        // Query button
        private void button4_Click(object sender, EventArgs e)
        {
            if (comboBox1.SelectedIndex == -1)
            {
                return;
            }

            string testName = comboBox1.GetItemText(comboBox1.SelectedItem);

            if (testName == null || testName == "")
            {
                return;
            }

            textBox6.Text = AuditDb.QueryStatsByTest(textBox4.Text, comboBox1.GetItemText(comboBox1.SelectedItem), textBox5.Text, checkBox1.Checked, checkBox2.Checked);
        }
Ejemplo n.º 6
0
        private void SubmitToAuditDb(Guid testGroup, int channelIndex, TestBase tb, TestResult tr)
        {
            AuditData d = new AuditData()
            {
                ProductId    = Form1.AppSettings.ProductId.ToString(),
                SerialNumber = Tm.LocalStash.ContainsKey("SerialNumber") ? Tm.LocalStash["SerialNumber"] : "0",
                SessionName  = Form1.AppSettings.SessionName,
                Channel      = (channelIndex == 0 ? "Left" : "Right"),
                Name         = tb.Name,
                TestGroup    = testGroup.ToString(),
                TestFile     = Form1.SettingsFile,
                TestFileMd5  = ComputeMd5(Form1.AppSettings),
                Time         = DateTime.Now,
                PassFail     = tr.Pass,
                ResultString = tr.StringValue[channelIndex],
                Result       = (float)tr.Value[channelIndex],
                TestLimits   = tb.GetTestLimits(),
                Email        = Form1.AppSettings.AuditDbEmail
            };

            AuditDb.SubmitAuditData(d);
        }
Ejemplo n.º 7
0
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                TestGroups = AuditDb.QueryGroupsBySerialNumber(textBox2.Text, textBox1.Text);

                UpdateButtonState();
                if (TestGroups.Count > 0)
                {
                    var s = AuditDb.QueryTestsByGroup(textBox2.Text, TestGroups[0]);
                    textBox3.Text = s;
                    return;
                }

                textBox3.Text = "No results found.";
            }
            catch (Exception ex)
            {
                string s = "Web service call failed exception: " + ex.Message;
                Log.WriteLine(LogType.Database, s);
                MessageBox.Show(s);
            }
        }
Ejemplo n.º 8
0
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                TestGroups = AuditDb.QueryGroupsBySerialNumber(textBox2.Text, textBox1.Text);

                // Need to limit rate webservice rate to no more than one call per second
                Thread.Sleep(1000);

                UpdateButtonState();
                if (TestGroups.Count > 0)
                {
                    var s = AuditDb.QueryTestsByGroup(textBox2.Text, TestGroups[0]);
                    textBox3.Text = s;
                    return;
                }

                textBox3.Text = "No results found.";
            }
            catch (Exception ex)
            {
                MessageBox.Show("Web service call failed: " + ex.Message);
            }
        }