Esempio n. 1
0
        public Mid_3_2(ref RawData rawdata)
        {
            rd     = rawdata;
            t      = new Mid_3_2_Table(rd.Rows, rd.tpsn);
            mid3_2 = new int[rd.Cols];
            Array.Clear(mid3_2, 0, mid3_2.Length);
            sw = new StreamWriter(Common.debugpath + "\\" + "MID3_2.txt");

            // make Mid3-2-table
            int cindex = 0;

            for (int r = 0; r < rd.Rows; r++)
            {
                cindex = 0;
                for (int c = 0; c < rd.Cols; c++)
                {
                    if (rd.rawdata[r, c] > 0)
                    {
                        t.Set(r, cindex, rd.PerSP[c]);
                        cindex++;
                        if (cindex == rd.tpsn)
                        {
                            break;
                        }
                    }
                }
            }

            // make AVERAGE
            t.makeAVERAGE();

            t.printTable(ref sw);

            // make mid3-2
            intmin = ((int)(t.maxavg / Common.GpspInterval)) * Common.GpspInterval;
            intmax = intmin + Common.GpspInterval;
            Array.Clear(mid3_2, 0, mid3_2.Length);
            for (int c = 0; c < rd.Cols; c++)
            {
                if (rd.PerSP[c] >= intmin && rd.PerSP[c] < intmax)
                {
                    mid3_2[c] = 1;
                }
            }
            sw.WriteLine("MID3_2_Table: interval lower : " + intmin.ToString());
            sw.WriteLine("MID3_2_Table: interval upper : " + intmax.ToString());

            Common.printArray("MID3_2 Array: ", mid3_2, ref sw);
        }
Esempio n. 2
0
 public void Close()
 {
     sw.Close();
     t = null;
 }