コード例 #1
0
        public IValueSet GetValues(ITime time, string linkID)
        {
            // covert time to a DateTime data type
            TimeStamp timestamp = (TimeStamp)time;
            DateTime  dt        = CalendarConverter.ModifiedJulian2Gregorian(
                (double)timestamp.ModifiedJulianDay);

            // write datetime to log file
            StreamWriter sr = new StreamWriter("hydrolink_log.txt", true);

            sr.WriteLine("get values request for time: " + dt.ToLongDateString()
                         + " " + dt.ToLongTimeString());
            sr.Flush();

            //get scalar set
            IValueSet values = _buffervalues[linkID].GetValues(time);

            // write value set to log file
            ScalarSet ss = (ScalarSet)values;

            sr.Write("values set: ");
            sr.Flush();
            for (int i = 0; i < ss.Count; ++i)
            {
                sr.Write(" " + ss.GetScalar(i).ToString() + " ");
                sr.Flush();
            }
            sr.Write("\n");
            sr.Close();
            return(values);
        }
コード例 #2
0
ファイル: ScalarSetTest.cs プロジェクト: msruzy/hydronumerics
 public void GetScalar()
 {
     Assert.AreEqual(1.0, scalarSet.GetScalar(0));
     Assert.AreEqual(2.0, scalarSet.GetScalar(1));
     Assert.AreEqual(3.0, scalarSet.GetScalar(2));
 }