Example #1
0
        public static void WashDataToFile(string myPath)
        {
            string[]   TestString;
            List <int> myIntList = new List <int>()
            {
                2, 4, 6, 8
            };
            List <DataPoint> myDataPoint = new List <DataPoint>();

            foreach (int item in myIntList)
            {
                string temp = @"A:\data\MoodAs" + item.ToString() + ".txt";
                TestString = FileTouch.GetFileToStringSet(temp);

                for (int i = 0; i < TestString.Length; i++)
                {
                    DataPoint dataPoint = new DataPoint(TestString[i], item);
                    myDataPoint.Add(dataPoint);
                    //Console.WriteLine(dataPoint.ToString());
                }
            }
            myDataPoint.Sort();
            using (System.IO.StreamWriter file = new System.IO.StreamWriter(myPath))
            {
                foreach (DataPoint item in myDataPoint)
                {
                    // If the line doesn't contain the word 'Second', write the line to the file.
                    file.WriteLine(item.ToString());
                }
            }
        }
Example #2
0
        public DataPoint(string TimeOfPointString, int ValueOfPoint)
        {
            List <int> myIntList = new List <int>();

            myIntList = FileTouch.WashDataFromStringToInt(TimeOfPointString);
            DateTime dateTime  = new DateTime(myIntList[0], myIntList[1], myIntList[2], myIntList[3], myIntList[4], myIntList[5]);
            DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));

            this._TimeOfPoint  = (long)(dateTime - startTime).TotalMilliseconds;
            this._ValueOfPoint = ValueOfPoint;
        }