Example #1
0
        public void SDI1930()
        {
            Logger.EnableLogger();
            var s = new HDBSeries(1930,TimeInterval.Daily ,HDBServer.LCHDB2);

            s.Read(new DateTime(2015, 4, 1), new DateTime(2015,4, 5));

            Assert.IsTrue(s.TimeInterval == TimeInterval.Daily);
            Assert.AreEqual(5,s.Count);
            Assert.AreEqual(1084.17, s["2015-4-5"].Value,.2);
            /*
                     DATETIME,     SDI_1930
            04/02/2015 00:00,      1084.79
            04/03/2015 00:00,      1084.69
            04/04/2015 00:00,      1084.37
            04/05/2015 00:00,      1084.17
            04/06/2015 00:00,      1084.06
            04/07/2015 00:00,      1083.93
            04/08/2015 00:00,      1083.65
            04/09/2015 00:00,      1083.47
            04/10/2015 00:00,      1083.25
            04/11/2015 00:00,      1082.98
            04/12/2015 00:00,      1082.85
            04/13/2015 00:00,      1082.63
            04/14/2015 00:00,      1082.38
            04/15/2015 00:00,      1082.23
            04/16/2015 00:00,      1081.91
             */
        }
Example #2
0
        /// <summary>
        /// CreateFromConnectionString is used when calling Update to
        /// update a portion of the record for this series.
        /// </summary>
        /// <returns></returns>
        protected override Series CreateFromConnectionString()
        {
            string svr = ConnectionStringUtility.GetToken(ConnectionString, "server", "");
            m_server = (HDBServer)Enum.Parse(typeof(HDBServer), svr);
            m_sdi = ConnectionStringUtility.GetIntFromConnectionString(ConnectionString, "sdi");

            string sinterval = ConnectionStringUtility.GetToken(ConnectionString, "TimeInterval", "");
            TimeInterval = (TimeInterval)Enum.Parse(typeof(TimeInterval), sinterval);

            HDBSeries s = new HDBSeries(m_sdi,TimeInterval, m_server);
            return s;
        }
Example #3
0
        /// <summary>
        /// CreateFromConnectionString is used when calling Update to
        /// update a portion of the record for this series.
        /// </summary>
        /// <returns></returns>
        protected override Series CreateFromConnectionString()
        {
            string svr = ConnectionStringUtility.GetToken(ConnectionString, "server", "");

            m_server = (HDBServer)Enum.Parse(typeof(HDBServer), svr);
            m_sdi    = ConnectionStringUtility.GetIntFromConnectionString(ConnectionString, "sdi");

            string sinterval = ConnectionStringUtility.GetToken(ConnectionString, "TimeInterval", "");

            TimeInterval = (TimeInterval)Enum.Parse(typeof(TimeInterval), sinterval);

            HDBSeries s = new HDBSeries(m_sdi, TimeInterval, m_server);

            return(s);
        }