Beispiel #1
0
 public Mid_2(ref RawData r, ref Mid_1 m1)
 {
     rd      = r; mid1 = m1;
     mid2    = new int[rd.Cols];
     MaxStep = r.tpsn;
     rlist   = new R1pnList();
     FirstMakeR1PN();
     sw = new StreamWriter(Common.debugpath + "\\" + "MID2.txt");
     printRList();
 }
Beispiel #2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (step == 0)  //Mid-1
            {
                timer1.Enabled = false;

                // make SPC data.
                rd.makeSPC_PerSP_APerSP();
                rd.printSPC_PerSP_APerSP();

                // make Mid-1
                md1 = new Mid_1(ref rd);
                md1.printMid1();
                string str = txtCurDir.Text + "\\" + cmbJoblist.SelectedItem.ToString();
                if (File.Exists(str))
                {
                    md1.printToExcel(str, "Mid-1");
                }
                md1.Close();

                timer1.Enabled = true;
                GC.Collect();
                StatusProgress.Value = 1 * 100 / 10;
                statusLabel1.Text    = "Mid-2 Start...............";
            }
            else if (step == 1)  //Mid-2
            {
                timer1.Enabled = false;
                md2            = new Mid_2(ref rd, ref md1);
                md2.Run();
                string str = txtCurDir.Text + "\\" + cmbJoblist.SelectedItem.ToString();
                if (File.Exists(str))
                {
                    md2.printToExcel(str, "Mid-2");
                }
                md2.Close();
                timer1.Enabled = true;
                GC.Collect();
                StatusProgress.Value = 2 * 100 / 10;
                statusLabel1.Text    = "Mid3-1 Start...............";
            }
            else if (step == 2) //Mid3-1
            {
                timer1.Enabled = false;
                md3_1          = new Mid_3_1(ref rd);
                string str = txtCurDir.Text + "\\" + cmbJoblist.SelectedItem.ToString();
                if (File.Exists(str))
                {
                    md3_1.printToExcel(str, "Mid3-1");
                }
                md3_1.Close();
                timer1.Enabled = true;
                GC.Collect();
                StatusProgress.Value = 3 * 100 / 10;
                statusLabel1.Text    = "Mid3-2 Start...............";
            }
            else if (step == 3)//Mid3-2
            {
                timer1.Enabled = false;
                md3_2          = new Mid_3_2(ref rd);
                string str = txtCurDir.Text + "\\" + cmbJoblist.SelectedItem.ToString();
                if (File.Exists(str))
                {
                    md3_2.printToExcel(str, "Mid3-2");
                }
                md3_2.Close();
                timer1.Enabled = true;
                GC.Collect();
                StatusProgress.Value = 4 * 100 / 10;
                statusLabel1.Text    = "Mid3-3 Start...............";
            }
            else if (step == 4) //Mid3-3
            {
                timer1.Enabled = false;
                md3_3          = new Mid_3_3(ref rd);
                string str = txtCurDir.Text + "\\" + cmbJoblist.SelectedItem.ToString();
                if (File.Exists(str))
                {
                    md3_3.printToExcel(str, "Mid3-3");
                }
                md3_3.Close();
                timer1.Enabled = true;
                GC.Collect();
                StatusProgress.Value = 5 * 100 / 10;
                statusLabel1.Text    = "Mid3-4 Start...............";
            }
            else if (step == 5) //Mid3-4
            {
                timer1.Enabled = false;
                md3_4          = new Mid_3_4(ref md3_3);
                string str = txtCurDir.Text + "\\" + cmbJoblist.SelectedItem.ToString();
                if (File.Exists(str))
                {
                    md3_4.printToExcel(str, "Mid3-4");
                }
                md3_4.Close();
                timer1.Enabled = true;
                GC.Collect();
                StatusProgress.Value = 6 * 100 / 10;
                statusLabel1.Text    = "Mid4-1 Start...............";
            }
            else if (step == 6)//Mid4-1
            {
                timer1.Enabled = false;
                md4_1          = new Mid_4_1(ref rd);
                string str = txtCurDir.Text + "\\" + cmbJoblist.SelectedItem.ToString();
                if (File.Exists(str))
                {
                    md4_1.printToExcel(str, "Mid4-1");
                }
                md4_1.Close();
                timer1.Enabled = true;
                GC.Collect();
                StatusProgress.Value = 7 * 100 / 10;
                statusLabel1.Text    = "Mid4-2 Start...............";
            }
            else if (step == 7)//Mid4-2
            {
                timer1.Enabled = false;
                md4_2          = new Mid_4_2(ref rd, ref md4_1);
                string str = txtCurDir.Text + "\\" + cmbJoblist.SelectedItem.ToString();
                if (File.Exists(str))
                {
                    md4_2.printToExcel(str, "Mid4-2");
                }
                md4_2.Close();
                timer1.Enabled = true;
                GC.Collect();
                StatusProgress.Value = 8 * 100 / 10;
                statusLabel1.Text    = "Mid4-3 Start...............";
            }
            else if (step == 8)//Mid4-3
            {
                timer1.Enabled = false;
                md4_3          = new Mid_4_3_new1(ref rd, ref md4_1, ref md4_2);
                string str = txtCurDir.Text + "\\" + cmbJoblist.SelectedItem.ToString();
                if (File.Exists(str))
                {
                    md4_3.printToExcel(str, "Mid4-3");
                }
                md4_3.Close();
                timer1.Enabled = true;
                GC.Collect();
                StatusProgress.Value = 9 * 100 / 10;
                statusLabel1.Text    = "ResultDB Start...............";
            }
            else if (step == 9)//Result DB
            {
                timer1.Enabled = false;
                resDB          = new ResultDB(this);
                string str = txtCurDir.Text + "\\" + cmbJoblist.SelectedItem.ToString();
                if (File.Exists(str))
                {
                    resDB.printToExcel(str, "Result DB");
                }
                resDB.Close();
                timer1.Enabled = true;
                GC.Collect();
                StatusProgress.Value = 10 * 100 / 10;
            }
            else if (step == 10)
            {
                StatusProgress.Value = 100;
                statusLabel1.Text    = "Completion";
                timer1.Enabled       = false;
                GOSTOP             = false;
                btnCalc.Text       = "GO";
                cmbJoblist.Enabled = true;
                button1.Enabled    = true;
                btnReload.Enabled  = true;
                step = 0;
                GC.Collect();
            }
            step++;
        }