Example #1
0
        public override void SaveToFile(string prefix, ViewElementTypes vet)
        {
            string to_save = ToString();

            byte[]     to_write = Encoding.Default.GetBytes(to_save);
            FileStream fs       = new FileStream(prefix + FileSufix + ".csv", FileMode.OpenOrCreate, FileAccess.Write);

            fs.SetLength(0);
            fs.Write(to_write, 0, to_write.Length);
            fs.Flush();
            fs.Close();
        }
Example #2
0
        public override string ToString(ViewElementTypes vet)
        {
            string ret = "";
            string separator;

            switch (vet)
            {
            case ViewElementTypes.CSV_scom:
                separator = ";";
                break;

            case ViewElementTypes.CSV_com:
                separator = ",";
                break;

            default:
                separator = " ";
                break;
            }
            //separator = ""+System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator.ToCharArray()[0];
            //int i = 0;
            int ind = 0;

            if (BlankStart != null)
            {
                for (int i = 0; i < BlankStart.Length; i++, ind++)
                {
                    PutString(ref ret, ind, BlankStart[i], -1, separator);
                }
                ret += serv.Endl;
            }
            for (int i = 0; i < Dt.Length; i++, ind++)
            {
                PutString(ref ret, ind, Dt[i], Disp.GetLyByLocalPixel(Sn, i + 1), separator);
            }

            if (BlankEnd != null)
            {
                ret += serv.Endl;
                for (int i = 0; i < BlankEnd.Length; i++, ind++)
                {
                    PutString(ref ret, ind, BlankEnd[i], 1, separator);
                }
            }

            /*double sum = 0;
             * for (i = 0; i < Dt.Length; i++)
             *  sum += Dt[i];
             * ret += serv.Endl + "Среднее: " + (sum / Dt.Length) + serv.Endl;
             */
            return(ret);
        }
Example #3
0
        public override string ToString(ViewElementTypes vet)
        {
            string ret = "";

            int[] ss = Dt.GetSensorSizes();
            for (int s = 0; s < ss.Length; s++)
            {
                double[] k = Dt.GetK(s);
                ret += "Линейка№" + (s + 1) + " длина:" + ss[s] + serv.Endl +
                       "      Коэффициенты [";
                for (int i = 0; i < k.Length; i++)
                {
                    ret += " " + k[i] + " ";
                }
                ret += "]" + serv.Endl;
            }
            return(ret);
        }
Example #4
0
 public override void SaveToFile(string prefix, ViewElementTypes vet)
 {
     //throw new NotImplementedException();
 }
Example #5
0
 public override string ToString(ViewElementTypes vet)
 {
     return(Dt);
 }
Example #6
0
 public override string ToString(ViewElementTypes vet)
 {
     return(Dt.ToString() + (char)0xD + (char)0xA +
            " Линейный максимум: " + MaxLevel + (char)0xD + (char)0xA +
            " Уровень зашкала: " + OverLevel);
 }
Example #7
0
 abstract public void SaveToFile(string prefix, ViewElementTypes vet);
Example #8
0
 abstract public string ToString(ViewElementTypes vet);