Beispiel #1
0
        public void printToExcel(string path1, string sheetname)
        {
            ExcelWrapper ew = new ExcelWrapper();

            if (ew.Open(path1) == false)
            {
                return;
            }
            Excel.Worksheet mySheet;
            mySheet = ew.CreateSheet(sheetname);
            if (mySheet == null)
            {
                ew.Close(); return;
            }
            string s = "A1:HA" + (Common.POSN + 100).ToString();

            mySheet.Range[s].Clear();
            ew.printLine();
            ew.printLine("MID4_2_Table (Count MX/MN Table) Print ------------------------------------");
            string [] h = new string [] { "POSN", "MX+A%SP", "MX-A%SP", "MN+A%SP", "MN-A%SP" };
            for (int i = 0; i < h.Length; i++)
            {
                ew.print(h[i]);
            }
            ew.printLine();
            for (int i = 0; i < rd.Rows; i++)
            {
                ew.print((i + 1).ToString("####0"));
                for (int j = 0; j < 4; j++)
                {
                    ew.print(Count_MxMn[i, j].ToString("####0"));
                }
                ew.printLine();
            }
            ew.printLine();
            //ew.printLine("MID4_2_Table sum ------------------------------------");
            ew.print("SUM");
            for (int j = 0; j < 4; j++)
            {
                ew.print(Sumval[j].ToString("####0"));
            }
            ew.printLine();
            //ew.printLine("MID4_2_Table AVERAGE ------------------------------------");
            ew.print("Average");
            for (int j = 0; j < 4; j++)
            {
                ew.print(Avg[j].ToString("##0.00"));
            }
            ew.printLine();
            //ew.printLine("MID4_2_Table DIGITs ------------------------------------");
            ew.print("DIGITs");
            for (int j = 0; j < 4; j++)
            {
                ew.print(digit[j].ToString("##0"));
            }
            ew.printLine();
            ew.printLine();
            ew.Save();
            ew.Close();
        }
Beispiel #2
0
        public void printToExcel(string path1, string sheetname)
        {
            ExcelWrapper ew = new ExcelWrapper();

            if (ew.Open(path1) == false)
            {
                return;
            }
            Excel.Worksheet mySheet;
            mySheet = ew.CreateSheet(sheetname);
            if (mySheet == null)
            {
                ew.Close(); return;
            }
            mySheet.Range["A1:HA500"].Clear();
            ew.printLine();
            ew.printListPercent(rlist);
            ew.printLine();
            ew.printArrayPercent("MID3-4 : %SP values (this means how many times does each %SP appear in the List)", temp);
            ew.printLine();
            ew.printLine("max %SP value : " + maxSpcCount.ToString());
            ew.printLine();
            ew.printArrayPercent("MID3-4 :(Choose %SPs' that have max %SP value) ", perTemp);
            ew.printLine();

            for (int i = 0; i < perTemp.Length; i++)
            {
                if (perTemp[i] > 0)
                {
                    // get interval
                    double intmin, intmax;
                    intmax = (i + 1) * Common.GpspInterval;
                    intmin = intmax - Common.GpspInterval;

                    string pns = "";
                    pns  = "Interval(%SP): " + (intmin).ToString("###0.0") + "% ~ " + intmax.ToString("###0.0") + "%    , ";
                    pns += " PN's : ";
                    // get PNs between intmax and intmin
                    for (int j = 0; j < rd.Cols; j++)
                    {
                        double persp = rd.PerSP[j];
                        if (persp > intmin && persp <= intmax)
                        {
                            pns += ((j + 1).ToString()) + " ";
                        }
                    }
                    ew.printLine(pns);
                }
            }
            ew.printLine();
            ew.printArray("MID3_4: Result:", mid3_4);
            ew.printLine();
            ew.printLine();
            ew.printArray("MID3_4: RANK:", rank3_4);
            ew.printLine();
            ew.Save();
            ew.Close();
        }
Beispiel #3
0
 public void printPercentToExcel(ExcelWrapper ew)
 {
     ew.printLine("R1pnList print()-----------start----------------");
     foreach (R1pn r1 in rList)
     {
         r1.printPercentToExcel(ew);
     }
     ew.printLine("R1pnList print()------------end---------------");
 }
Beispiel #4
0
        public void printPercentToExcel(ExcelWrapper ew)
        {
            //sw.Write(indexofbaseR1pn.ToString() + " ");
            string line = "";

            line  = "Count: " + cp.ToString() + " ";
            line += "List: ";
            for (int i = 0; i < cp; i++)
            {
                line += ((r1pn[i] + 1) * Common.GpspInterval).ToString() + " ";
            }
            ew.printLine(line);
        }
Beispiel #5
0
        public void printToExcel(string path1, string sheetname)
        {
            ExcelWrapper ew = new ExcelWrapper();

            if (ew.Open(path1) == false)
            {
                return;
            }
            Excel.Worksheet mySheet;
            mySheet = ew.CreateSheet(sheetname);
            if (mySheet == null)
            {
                ew.Close(); return;
            }
            mySheet.Range["A1:HA200"].Clear();

/*
 *          ew.printLine("MID3_2_Table Print ------------------------------------");
 *          for (int i = 0; i < t.Rows; i++)
 *          {
 *              for (int j = 0; j < t.Cols; j++)
 *              {
 *                  ew.print(t.table[i, j].ToString("##0.0"));
 *              }
 *              ew.printLine();
 *          }
 *          ew.printLine();
 */
            ew.printLine("MID3_2_Table AVERAGE ------------------------------------");
            for (int j = 0; j < t.Cols; j++)
            {
                ew.print(t.avg[j].ToString("##0.00"));
            }
            ew.printLine();
            ew.printLine();
            // sw.WriteLine("MID3_2_Table: MaxIndex : "+maxindex.ToString());
            ew.printLine("MID3_2_Table: MaxAVG : " + t.maxavg.ToString("####0.00"));
            ew.printLine("MID3_2_Table: interval lower : " + intmin.ToString());
            ew.printLine("MID3_2_Table: interval upper : " + intmax.ToString());

            ew.printLine();
            ew.printArray("MID3_2: Result:", mid3_2);
            ew.printLine();
            ew.Save();
            ew.Close();
        }
Beispiel #6
0
        public void printToExcel(string path1, string sheetname)
        {
            ExcelWrapper ew = new ExcelWrapper();

            if (ew.Open(path1) == false)
            {
                return;
            }
            Excel.Worksheet mySheet;
            mySheet = ew.CreateSheet(sheetname);
            if (mySheet == null)
            {
                ew.Close(); return;
            }
            mySheet.Range["A1:HA200"].Clear();
            ew.printLine();
            int[] temp = new int[rd.Cols];
            if (mid3_1_Count == 1)
            {
                for (int i = 0; i < rd.Cols; i++)
                {
                    temp[i] = mid3_1[0, i];
                }
                ew.printArray("Mid-3-1: Result: ", temp);
            }
            else
            {
                for (int k = 0; k < mid3_1_Count; k++)
                {
                    for (int i = 0; i < rd.Cols; i++)
                    {
                        temp[i] = mid3_1[k, i];
                    }
                    ew.printArray("Mid-3-1-" + (k + 1).ToString() + ": Result: ", temp);
                }
            }
            ew.printLine();

            ew.printLine("MID3 RANK:");
            ew.printLine();
            ew.printArray("RANK:", rank);
            ew.printLine();

            ew.Save();
            ew.Close();
        }
Beispiel #7
0
        public void printToExcel(string path1, string sheetname)
        {
            ExcelWrapper ew = new ExcelWrapper();

            if (ew.Open(path1) == false)
            {
                return;
            }
            Excel.Worksheet mySheet;
            mySheet = ew.CreateSheet(sheetname);
            if (mySheet == null)
            {
                ew.Close(); return;
            }
            mySheet.Range["A1:HA200"].Clear();
            ew.printLine();
            ew.printArray("MID4_1 :Rawdata %SP ", rd.PerSP);
            ew.printLine("MID4_1: Average %SP : " + rd.APerSP.ToString("#####0.00"));
            ew.printLine();
            ew.printArray("MID4_1 :MX/MN", mx_mn);
            ew.printLine();

            // pn list
            string[] header = new string[] { "MX+A%SP PN's List", "MX-A%SP PN's List", "MN+A%SP PN's List", "MN-A%SP PN's List" };
            int      index  = 0;

            foreach (R1pn r1 in rlist.rList)
            {
                ew.printLine(header[index] + " : " + r1.getString());
                index++;
                if (index == 4)
                {
                    break;
                }
            }
            ew.printLine();

            ew.printArray("MID4_1: Result:", mid4_1);
            ew.printLine();

            ew.Save();
            ew.Close();
        }
Beispiel #8
0
        public void printToExcel(string path1, string sheetname)
        {
            ExcelWrapper ew = new ExcelWrapper();

            if (ew.Open(path1) == false)
            {
                return;
            }
            Excel.Worksheet mySheet;
            mySheet = ew.CreateSheet(sheetname);
            if (mySheet == null)
            {
                ew.Close(); return;
            }
            mySheet.Range["A1:HA200"].Clear();
            ew.printLine();
            ew.printArray("MID4_3: Result:", mid4_3);
            ew.printLine();
            ew.Save();
            ew.Close();
        }
Beispiel #9
0
        public void printToExcel(string path1, string sheetname)
        {
            ExcelWrapper ew = new ExcelWrapper();

            if (ew.Open(path1) == false)
            {
                return;
            }
            Excel.Worksheet mySheet;
            mySheet = ew.CreateSheet(sheetname);
            if (mySheet == null)
            {
                ew.Close(); return;
            }
            mySheet.Range["A1:HA200"].Clear();
            ew.printLine();
            ew.printLine("MID3_3_Table SPC ------------------------------------");
            ew.print(" PN ");
            for (int j = 0; j < mid3_3_table.Cols; j++)
            {
                ew.print(((j + 1) * Common.GpspInterval).ToString("##0"));
            }
            ew.printLine();
            ew.print("SPC");
            for (int j = 0; j < mid3_3_table.Cols; j++)
            {
                ew.print(mid3_3_table.spc[j].ToString("##0"));
            }
            ew.printLine();
            ew.printLine();
            ew.printLine("MID3_3_Table spcIndex : " + mid3_3_table.spcindex.ToString() + ", max PN : " + ((mid3_3_table.spcindex + 1) * Common.GpspInterval).ToString());
            ew.printLine("MID3_3_Table spcmax value   : " + mid3_3_table.spcmax.ToString());
            ew.printLine();
            ew.Save();
            ew.Close();
        }
Beispiel #10
0
        public void printToExcel(string path1, string sheetname)
        {
            ExcelWrapper ew = new ExcelWrapper();

            if (ew.Open(path1) == false)
            {
                return;
            }
            Excel.Worksheet mySheet;
            mySheet = ew.CreateSheet(sheetname);
            if (mySheet == null)
            {
                ew.Close(); return;
            }
            mySheet.Range["A1:AZ40"].Clear();
            int[] temp = new int[Cols];
            for (int i = 0; i < Cols; i++)
            {
                temp[i] = i + 1;
            }
            ew.printArrayLine("PN", temp);
            ew.printArrayLine("MID-1 ", form.md1.mid1);
            ew.printArrayLine("MID-2 ", form.md2.mid2);
            for (int k = 0; k < form.md3_1.mid3_1_Count; k++)
            {
                for (int i = 0; i < Cols; i++)
                {
                    temp[i] = form.md3_1.mid3_1[k, i];
                }
                if (form.md3_1.mid3_1_Count == 1)
                {
                    ew.printArrayLine("MID3-1", temp);
                }
                else
                {
                    ew.printArrayLine("MID3-1-" + (k + 1).ToString(), temp);
                }
            }
            ew.printArrayLine("MID3-2 ", form.md3_2.mid3_2);
            ew.printArrayLine("MID3-4 ", form.md3_4.mid3_4);
            ew.printArrayLine("MID4-1 ", form.md4_1.mid4_1);
            ew.printArrayLine("MID4-3 ", form.md4_3.mid4_3);
            ew.printArrayLine("SUM ", rsum, 1);
            ew.printLine("");
            string biggiest = (form.rd.tpsn + 2).ToString() + "th biggist value is " + ThreshVal.ToString();

            for (int i = 0; i < Cols; i++)
            {
                temp[i] = 0;
            }
            int k1 = 0;

            for (int i = 0; i < Cols; i++)
            {
                if (rsum[i] >= ThreshVal)
                {
                    temp[k1++] = (i + 1);
                }
            }
            ew.printArrayLine(biggiest, temp);
            ew.printLine();

            // print : pn list
            temp = new int[Cols];
            for (int i = 0; i < Cols; i++)
            {
                temp[i] = i + 1;
            }
            ew.printArrayLine("PN", temp);
            // print rank of totalsum
            rankSum = new int[rsum.Length];
            Common.makeRankArray(ref rsum, ref rankSum);
            ew.printArrayLine("Total_Sum", rankSum);

            // Rank Print
            // Mid 1
            //ew.print("MID 1");
            //ew.printRankArray("MID1:Rank", form.rd.spc,1);
            //ew.printLine();
            int[] mid1Rank = new int[Cols];
            Common.makeRankArray(ref form.rd.spc, ref mid1Rank);
            ew.printArrayLine("MID-1", mid1Rank);
            // MID 3-1
            ew.printArrayLine("MID3-1", form.md3_1.rank);
            int[] mid1_mid3_1 = new int[Cols];
            for (int i = 0; i < Cols; i++)
            {
                mid1_mid3_1[i] = mid1Rank[i] + form.md3_1.rank[i];
            }
            ew.printArrayLine("MID-1 & MID3-1", mid1_mid3_1);
            ew.printLine();


            // Mid 2
            //ew.print("MID 2");
            //ew.printRankArray("MID2:Rank (sort by PN's count in the List)", form.md2.temp, 1);
            //ew.printLine();
            int[] mid2Rank = new int[Cols];
            Common.makeRankArray(ref form.md2.temp, ref mid2Rank);
            ew.printArrayLine("MID-2", mid2Rank);

            // Mid3-4
            ew.printArrayLine("MID3-4", form.md3_4.rank3_4);
            int[] mid2_mid3_4 = new int[Cols];
            for (int i = 0; i < Cols; i++)
            {
                mid2_mid3_4[i] = mid2Rank[i] + form.md3_4.rank3_4[i];
            }
            ew.printArrayLine("MID-2 & MID3-4", mid2_mid3_4);
            ew.printLine();

            ew.printArrayLine("MID3-2 ", form.md3_2.mid3_2);
            ew.printArrayLine("MID4-1 ", form.md4_1.mid4_1);
            ew.printArrayLine("MID4-3 ", form.md4_3.mid4_3);
            int[] mid3_2mid4_1mid4_3 = new int[Cols];
            for (int i = 0; i < Cols; i++)
            {
                mid3_2mid4_1mid4_3[i] = form.md3_2.mid3_2[i] + form.md4_1.mid4_1[i] + form.md4_3.mid4_3[i];
            }
            ew.printArrayLine("MID3-2,Mid4-2 & Mid4-3", mid3_2mid4_1mid4_3, 1);
            ew.printLine();
            //print final result
            int[] finalresult = new int[Cols];
            for (int i = 0; i < Cols; i++)
            {
                finalresult[i] = rankSum[i] + mid1_mid3_1[i] + mid2_mid3_4[i] + mid3_2mid4_1mid4_3[i];
            }
            ew.printArrayLine("FINAL RESULT", finalresult, 1);

            // print pn
            for (int i = 0; i < Cols; i++)
            {
                temp[i] = i + 1;
            }
            ew.printArrayLine("PN", temp);

            // Final Sort
            int [] finalsort  = new int[Cols];
            int[]  finalorder = new int[Cols];
            Array.Copy(finalresult, temp, Cols);
            Array.Sort(temp);
            Array.Clear(finalorder, 0, Cols);
            int prank = 1, rank = 1, cur = 0;

            for (int i = 0; i < Cols; i++)
            {
                if (i > 0)
                {
                    if (temp[i] == temp[i - 1])
                    {
                        continue;
                    }
                }
                prank = rank;
                for (int j = 0; j < Cols; j++)
                {
                    if (finalresult[j] == temp[i])
                    {
                        finalsort[j] = prank; finalorder[cur++] = j + 1;   rank++;
                    }
                }
            }
            ew.printArrayLine("Final Rank", finalsort, 1);
            ew.printLine();
            ew.printArrayLine("Final PN's Order", finalorder, 1);

            ew.Save();
            ew.Close();
        }
Beispiel #11
0
        public void printToExcel(string path1, string sheetname)
        {
            ExcelWrapper ew = new ExcelWrapper();

            if (ew.Open(path1) == false)
            {
                return;
            }
            Excel.Worksheet mySheet;
            mySheet = ew.CreateSheet(sheetname);
            if (mySheet == null)
            {
                ew.Close(); return;
            }
            mySheet.Range["A1:HA200"].Clear();
            mySheet.Range["A1:AZ4000"].Clear();
            ew.printLine();

            ew.printLine("Mid_1(RawData.SPC) Print ------------------------------------");
            ew.printArray("MID1 :(SPC, sum of 1's ) ", rd.spc);
            ew.printLine("Mid_1(Max SPC value) : " + maxSPC);
            ew.printLine("Mid_1(sum of SPC) : " + sumofSPC);
            string pns = "";

            for (int i = 0; i < rd.spc.Length; i++)
            {
                if (rd.spc[i] >= maxSPC)
                {
                    pns = pns + (i + 1).ToString() + " ";
                }
            }
            ew.print("Mid_1(Max PN's) : " + pns);
            ew.printLine();
            ew.printLine("Mid_1(RawData %SPC) Print ------------------------------------");
            ew.printArray("MID1 :(%SP) ", rd.PerSP);
            ew.printLine("MID1 :(A%SP):" + rd.APerSP.ToString("######0.00"));
            ew.printLine();
            ew.printRankArray("MID1 : Rank ", rd.spc);
            ew.printLine();

            ew.printArray("MID1 :(Mid_1) ", mid1);
            ew.printLine();

            // Print Raw Data

            /*
             * ew.printLine();
             * ew.printLine("Mid_1(RawData Print) ------------------------------------");
             * ew.print("POSN");
             * for (int i = 0; i < rd.Cols; i++)
             *  ew.print((i + 1).ToString());
             * ew.printLine();
             *
             * for (int i = 0; i < rd.Rows; i++)
             * {
             *  ew.print((i + 1).ToString());
             *  for (int j = 0; j < rd.Cols; j++)
             *  {
             *      if (rd.rawdata[i, j]==0)
             *          ew.print(" ");
             *      else
             *          ew.print(rd.rawdata[i, j].ToString());
             *  }
             *  ew.printLine();
             *  if (i % 100 == 0)
             *      Console.WriteLine(" MID1: Print Line: " + i.ToString());
             * }
             * ew.printLine();
             */
            ew.Save();
            ew.Close();
        }
        public void printToExcel(string path1, string sheetname)
        {
            ExcelWrapper ew = new ExcelWrapper();

            if (ew.Open(path1) == false)
            {
                return;
            }
            Excel.Worksheet mySheet;
            mySheet = ew.CreateSheet(sheetname);
            if (mySheet == null)
            {
                ew.Close(); return;
            }
            mySheet.Range["A1:AZ400"].Clear();
            ew.printLine();

            // Print Data
            // MX List
            string one = "";

            ew.printLine("MX PN List :  (PN, %SP) ,  Count: " + MXPlusCount.ToString());
            for (int i = 0; i < MXPlusCount; i++)
            {
                one = one + "(" + (MXPlusPN[i] + 1).ToString() + ":" + MXPlus[i].ToString("#####0.00") + ") ";
                if (i > 0 && i % 5 == 0)
                {
                    ew.printLine(one);
                    one = "";
                }
            }
            if (one != "")
            {
                ew.printLine(one);
            }
            // MN List
            ew.printLine();
            one = "";
            ew.printLine("MN PN List :  (PN, %SP),  Count: " + MXMinusCount.ToString());
            for (int i = 0; i < MXMinusCount; i++)
            {
                one = one + "(" + (MXMinusPN[i] + 1).ToString() + ":" + (MXMinus[i] * -1).ToString("#####0.00") + ") ";
                if (i > 0 && i % 5 == 0)
                {
                    ew.printLine(one);
                    one = "";
                }
            }
            if (one != "")
            {
                ew.printLine(one);
            }
            ew.printLine();

            // average
            //ew.printLine("AveMX%SP = " + MXavg.ToString("#######0.00") + "  Range:+/-" + (variation * 100).ToString() + "% (" + lower1.ToString("######0.00") + "~" + upper1.ToString("######0.00") + ")");
            //ew.printLine("AveMN%SP = " + (MNAvg * -1).ToString("#######0.00") + "  Range:+/-" + (variation * 100).ToString() + "% (" + (lower2 * -1).ToString("######0.00") + "~" + (upper2 * -1).ToString("######0.00") + ")");
            ew.printLine("AveMX%SP = " + MXavg.ToString("#######0.00"));
            ew.printLine("AveMN%SP = " + (MNAvg * -1).ToString("#######0.00"));
            // pn list
            ew.printLine();
            one = "MX%SP Selected PNs' List : ";
            for (int i = 0; i < MXselectCount; i++)
            {
                one = one + (MXselectPN[i] + 1).ToString() + " ";
            }
            ew.printLine(one);

            one = "MN%SP Selected PNs' List : ";
            for (int i = 0; i < MNselectCount; i++)
            {
                one = one + (MNselectPN[i] + 1).ToString() + " ";
            }
            ew.printLine(one);
            ew.printLine();

            ew.printArray("MID4_3: Result:", mid4_3);
            ew.printLine();
            ew.Save();
            ew.Close();
        }