Exemplo n.º 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     Set.Lot      lot      = new Set.Lot();
     Set.Products products = new Set.Products();
     MessageBox.Show(lot.req_lot_update(text_lot_lot.Text, model_id, com_line_txt1, text_lot_amount.Text,
                                        text_lot_speed.Text, text_lot_failrate.Text, com_color_txt1, txt_model_temp.Text, txt_model_humid.Text, "ehddn", "0"));
     MessageBox.Show(products.Products_update(txt, com_line_txt1, text_lot_lot.Text, text_lot_amount.Text));
 }
Exemplo n.º 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            int ee = 12;

            grid_lot_select.Rows.Clear();
            Set.Lot lot           = new Set.Lot();
            string  lot_info_list = lot.req_lot_select("0");



            string[] lot_info_list_division = lot_info_list.Split(new char[] { ',' });

            string[] lot_all_info_list_division = lot_info_list.Split(new char[] { '\n' });

            for (int i = 0; i < lot_all_info_list_division.Length; i++)
            {
                if (i == 0)
                {
                    ee = 0;
                }
                else
                {
                    ee = 12 * i;
                }
                TBL_lot_id.Add(lot_info_list_division[ee + 0]);
                TBL_model_id.Add(lot_info_list_division[ee + 1]);
                TBL_line_id.Add(lot_info_list_division[ee + 2]);
                TBL_total_product_count.Add(lot_info_list_division[ee + 3]);
                TBL_speed.Add(lot_info_list_division[ee + 4]);
                TBL_product_fail_rate.Add(lot_info_list_division[ee + 5]);
                TBL_product_color.Add(lot_info_list_division[ee + 6]);
                TBL_temp.Add(lot_info_list_division[ee + 7]);
                TBL_humid.Add(lot_info_list_division[ee + 8]);
                TBL_operid.Add(lot_info_list_division[ee + 9]);
                TBL_working_state.Add(lot_info_list_division[ee + 10]);
            }

            int w = 0; // , 기준 나뉘어진 요소들의 갯수

            for (int j = 1; j < lot_all_info_list_division.Length; j++)
            {
                grid_lot_select.Rows.Add();
            }

            for (int j = 0; j < lot_all_info_list_division.Length; j++)
            {
                for (int h = 0; h < 12; h++)
                {
                    grid_lot_select[h, j].Value = lot_info_list_division[w];
                    w++;
                }
            }
        }
Exemplo n.º 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < TBL_lot_id.Count; i++)
            {
                if (text_select_lot.Text == TBL_lot_id[i])
                {
                    int all_time = Convert.ToInt32(TBL_total_product_count[i]) * Convert.ToInt32(TBL_speed[i]);
                    int minit    = all_time / 60;
                    int second   = all_time % 60;

                    if (MessageBox.Show("아래의 작업지시 내용을 추가하시겠습니까?\n작업명 = \t" + TBL_lot_id[i] + "\n모델명 = \t" + TBL_model_id[i] + "\n라인 = \t" + TBL_line_id[i] + "\n생산량 = \t" +
                                        TBL_total_product_count[i] + "\n속도 = \t" + TBL_speed[i] + "\n불량률 = \t" + TBL_product_fail_rate[i] + "\n색깔 = \t" + TBL_product_color[i] + "\n온도 = \t" + TBL_temp[i] + "\n습도 = \t" + TBL_humid[i] + "\n작업자 = \t" +
                                        "" + TBL_operid[i] + "\n예상소요시간 = \t" + minit + "분 " + second + "초", "작업지시 확인", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        MessageBox.Show("추가되었습니다.");

                        Set.Line line = new Set.Line();
                        Set.Lot  lot  = new Set.Lot();
                        MessageBox.Show(lot.req_lot_select(TBL_lot_id[i]));

                        //monitor         =    new Control_Form_Monitoring(this);
                        //monitor.Show();

                        if (TBL_line_id[i] == "L#1")
                        {
                            Thread_Class.Class1.unfail_1 = "0";
                            Thread_Class.Class1.fail_1   = "0";
                            monitor_index = 1;
                            fm.control_Form_Monitoring1.grid_monitoring[2, 0].Value = "작업중";
                            fm.control_Form_Monitoring1.grid_monitoring[1, 0].Value = TBL_model_id[i];
                            fm.control_Form_Monitoring1.grid_monitoring[3, 0].Value = TBL_lot_id[i];
                            fm.control_Form_Monitoring1.line         = "L#1";
                            Thread_Class.Class1.Line1                = "L#1";
                            fm.control_Form_Monitoring1.lot_id       = TBL_lot_id[i];
                            Thread_Class.Class1.Lot1                 = TBL_lot_id[i];
                            fm.control_Form_Monitoring1.model_name   = TBL_model_id[i];
                            Thread_Class.Class1.Model_Name1          = TBL_model_id[i];
                            fm.control_Form_Monitoring1.amount       = TBL_total_product_count[i];
                            Thread_Class.Class1.Amount1              = TBL_total_product_count[i];
                            fm.control_Form_Monitoring1.ing_speed    = TBL_speed[i];
                            Thread_Class.Class1.speed1               = TBL_speed[i];
                            fm.control_Form_Monitoring1.finish_speed = minit + "분 " + second + "초";
                            Thread_Class.Class1.time1                = minit + "분" + second + "초";
                            Thread_Class.Class1.Temp1                = TBL_temp[i];
                            Thread_Class.Class1.Humid1               = TBL_humid[i];
                            Thread_Class.Class1.Oper_id1             = Form_login.oper_name;
                            Thread Index1 = new Thread(new ThreadStart(OUTPUT1));
                            line.Line_Update(TBL_lot_id[i], TBL_line_id[i], TBL_operid[i]);
                            Index1.Start();

                            Delay(1000 * (Convert.ToInt32(TBL_speed[i]) * Convert.ToInt32(TBL_total_product_count[i])));
                            fm.control_Form_Monitoring1.grid_monitoring[2, 0].Value = "대기중";
                            fm.control_Form_Monitoring1.grid_monitoring[1, 0].Value = "";
                            fm.control_Form_Monitoring1.grid_monitoring[3, 0].Value = "";

                            //fm.control_Form_Monitoring1.textBox1.Text = fm.control_Form_Monitoring1.line + "," + fm.control_Form_Monitoring1.lot_id + "," + fm.control_Form_Monitoring1.model_name +
                            //    "," + fm.control_Form_Monitoring1.amount + "," + fm.control_Form_Monitoring1.ing_speed + "," + fm.control_Form_Monitoring1.finish_speed + ",";
                        }
                        else if (TBL_line_id[i] == "L#2")
                        {
                            Thread_Class.Class2.unfail_2 = "0";
                            Thread_Class.Class2.fail_2   = "0";
                            fm.control_Form_Monitoring1.grid_monitoring[2, 1].Value = "작업중";
                            fm.control_Form_Monitoring1.grid_monitoring[1, 1].Value = TBL_model_id[i];
                            fm.control_Form_Monitoring1.grid_monitoring[3, 1].Value = TBL_lot_id[i];
                            fm.control_Form_Monitoring1.line         = "L#2";
                            Thread_Class.Class2.Line2                = "L#2";
                            fm.control_Form_Monitoring1.lot_id       = TBL_lot_id[i];
                            Thread_Class.Class2.Lot2                 = TBL_lot_id[i];
                            fm.control_Form_Monitoring1.model_name   = TBL_model_id[i];
                            Thread_Class.Class2.Model_Name2          = TBL_model_id[i];
                            fm.control_Form_Monitoring1.amount       = TBL_total_product_count[i];
                            Thread_Class.Class2.Amount2              = TBL_total_product_count[i];
                            fm.control_Form_Monitoring1.ing_speed    = TBL_speed[i];
                            Thread_Class.Class2.speed2               = TBL_speed[i];
                            fm.control_Form_Monitoring1.finish_speed = minit + "분 " + second + "초";
                            Thread_Class.Class2.time2                = minit + "분" + second + "초";
                            Thread_Class.Class2.temp2                = TBL_temp[i];
                            Thread_Class.Class2.humid2               = TBL_humid[i];
                            Thread_Class.Class2.Oper_id2             = Form_login.oper_name;
                            Thread Index1 = new Thread(new ThreadStart(OUTPUT2));
                            Index1.Start();

                            Delay(1000 * (Convert.ToInt32(TBL_speed[i]) * Convert.ToInt32(TBL_total_product_count[i])));
                            fm.control_Form_Monitoring1.grid_monitoring[2, 1].Value = "대기중";
                            fm.control_Form_Monitoring1.grid_monitoring[1, 1].Value = "";
                            fm.control_Form_Monitoring1.grid_monitoring[3, 1].Value = "";

                            //fm.control_Form_Monitoring1.textBox1.Text = fm.control_Form_Monitoring1.line + "," + fm.control_Form_Monitoring1.lot_id + "," + fm.control_Form_Monitoring1.model_name +
                            //    "," + fm.control_Form_Monitoring1.amount + "," + fm.control_Form_Monitoring1.ing_speed + "," + fm.control_Form_Monitoring1.finish_speed + ",";
                        }
                        else if (TBL_line_id[i] == "L#3")
                        {
                            Thread_Class.Class3.unfail_3 = "0";
                            Thread_Class.Class3.fail_3   = "0";
                            fm.control_Form_Monitoring1.grid_monitoring[2, 2].Value = "작업중";
                            fm.control_Form_Monitoring1.grid_monitoring[1, 2].Value = TBL_model_id[i];
                            fm.control_Form_Monitoring1.grid_monitoring[3, 2].Value = TBL_lot_id[i];
                            fm.control_Form_Monitoring1.line         = "L#3";
                            Thread_Class.Class3.Line3                = "L#3";
                            fm.control_Form_Monitoring1.lot_id       = TBL_lot_id[i];
                            Thread_Class.Class3.Lot3                 = TBL_lot_id[i];
                            fm.control_Form_Monitoring1.model_name   = TBL_model_id[i];
                            Thread_Class.Class3.Model_Name3          = TBL_model_id[i];
                            fm.control_Form_Monitoring1.amount       = TBL_total_product_count[i];
                            Thread_Class.Class3.Amount3              = TBL_total_product_count[i];
                            fm.control_Form_Monitoring1.ing_speed    = TBL_speed[i];
                            Thread_Class.Class3.speed3               = TBL_speed[i];
                            fm.control_Form_Monitoring1.finish_speed = minit + "분 " + second + "초";
                            Thread_Class.Class3.time3                = minit + "분" + second + "초";
                            Thread_Class.Class3.Temp3                = TBL_temp[i];
                            Thread_Class.Class3.Humid3               = TBL_humid[i];
                            Thread_Class.Class3.Oper_id3             = Form_login.oper_name;
                            Thread Index1 = new Thread(new ThreadStart(OUTPUT3));
                            Index1.Start();
                            Delay(1000 * (Convert.ToInt32(TBL_speed[i]) * Convert.ToInt32(TBL_total_product_count[i])));
                            fm.control_Form_Monitoring1.grid_monitoring[2, 2].Value = "대기중";
                            fm.control_Form_Monitoring1.grid_monitoring[1, 2].Value = "";
                            fm.control_Form_Monitoring1.grid_monitoring[3, 2].Value = "";
                        }
                    }
                    else
                    {
                        MessageBox.Show("취소되었습니다.");
                    }
                }
            }
        }