Exemple #1
0
        private void GetMeasuremntsForBoxOrPallet()
        {
            boxes = new List <string>();

            foreach (var line in rTxtBox.Lines)
            {
                if (line.Trim() != "")
                {
                    boxes.Add(line.Trim());
                }
            }

            if (!radioBox.Checked)
            {
                boxes = SqlOpeations.GetBoxesIdFromPalletId(boxes.ToArray());
            }
            if (boxes.Count > 0)
            {
                measurementsDictionary = SqlOpeations.GetMeasurementsForBoxes(boxes.ToArray());
            }
            else
            {
                MessageBox.Show("Brak tego ID w bazie.");
                button2.Enabled = false;
            }
        }
Exemple #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            modelSPecification = excelOperations.loadExcel();
            modelSPecification = SqlOpeations.AddModelOpticalSpecFromDb(modelSPecification);

            user        = System.Configuration.ConfigurationManager.AppSettings["Podpis"];
            defaultPath = System.Configuration.ConfigurationManager.AppSettings["Folder"];
#if DEBUG
            chart1.Visible = true;
#endif
        }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!radioButtonOrder.Checked)
            {
                GetMeasuremntsForBoxOrPallet();
            }
            else
            {
                List <string> ordersList = new List <string>();
                foreach (var item in rTxtBox.Lines)
                {
                    string order = item.Trim();
                    if (order != "")
                    {
                        ordersList.Add(order);
                    }
                }
                measurementsDictionary = SqlOpeations.GetMeasurementsForOrderNo(ordersList);
            }

            if (measurementsDictionary.Count > 0)
            {
                if (SdcmCalculation.CheckTestMeasurements(measurementsDictionary, modelSPecification, ref currentModel, dataGridView1, labelInfo))
                {
                    button2.Enabled  = true;
                    panel1.BackColor = Color.Lime;

#if DEBUG
                    Charting.DrawHistogramChart(chart1, measurementsDictionary.Select(val => val.Value.Vf).ToList(), modelSPecification[currentModel].Vf_Min, modelSPecification[currentModel].Vf_Max);
#endif
                    if (!IfThisModelIsTridonic(currentModel))
                    {
                        MessageBox.Show("To nie jest model Tridoic!");
                        button2.Enabled = false;
                    }
                }
                else
                {
                    button2.Enabled = false;
                }

                //Charting.DrawHistogramChart(chart1, measurementsDictionary.Select(val => val.Value.Lm).ToList(), modelSPecification[currentModel].Lm_Min, modelSPecification[currentModel].Lm_Max);
            }
            else
            {
                MessageBox.Show("Brak tego ID w bazie.");
                button2.Enabled = false;
            }
        }