Beispiel #1
0
        public static void test3()
        {
            MyAccessDriver a = new MyAccessDriver("C:/Users/tzhou9/Desktop/Adpater Practice/Data/db1_0804_2015_010100.mdb");

            string strCom = "Select * from FRURawData1026";

            OleDbDataReader reader = a.ExecuteSQL(strCom);
            List<MyMeasurement> measurements = new List<MyMeasurement>();
            while (reader.Read())
            {
                DateTime sampleDateTime = DateTime.Parse(reader["Sample_Date&Time"].ToString());
                double measurementValue = Convert.ToDouble(reader["FinalFreq"]);
                MyMeasurement newMeasurement = new MyMeasurement();
                newMeasurement.sampleTime = new GSF.Ticks(sampleDateTime);
                newMeasurement.pointID = 97;
                newMeasurement.value = (float)measurementValue;
                measurements.Add(newMeasurement);

            }

            LocalOutputAdapter local = new LocalOutputAdapter();
            local.MyProcessMeasurements(measurements);

            Console.WriteLine("finish");
        }
Beispiel #2
0
        public static void test()
        {
            MyAccessDriver a = new MyAccessDriver("C:/Users/tzhou9/Desktop/Adpater Practice/Data/db1_0804_2015_010100.mdb");
            string strCom = "Select * from FRURawData1026 where Index < 40000 and Index > 30000";
            OleDbDataReader reader = a.ExecuteSQL(strCom);
            List<IMeasurement> measurements = new List<IMeasurement>();
            while (reader.Read())
            {
                DateTime sampleDateTime = DateTime.Parse(reader["Sample_Date&Time"].ToString());
                double measurementValue = Convert.ToDouble(reader["FinalFreq"]);

                IMeasurement newMeasurement = new Measurement();
                newMeasurement.Timestamp = new GSF.Ticks(sampleDateTime);
                measurements.Add(newMeasurement);

                //newMeasurement.AdjustedValue = measurementValue;
                //newMeasurement.Key = MeasurementKey.LookUpBySignalID(Guid.Parse("895ef95e-46a4-11e5-a8c0-b8ca3ab306c3"));
                //MessageBox.Show(MeasurementKey.LookUpBySignalID(Guid.Parse("895ef95e-46a4-11e5-a8c0-b8ca3ab306c3")).ID.ToString());
            }

            LocalOutputAdapter local = new LocalOutputAdapter();
            local.Run(measurements.ToArray());
            Console.WriteLine("finish");
        }