//static ~DBDataLayer()
        //{
        //    // do your work here
        //    _db.Dispose();
        //}

        public static void AddData(int indexItem, DataStruct data)
        {
            DBItemData temp = new DBItemData()
            {
                Time     = (XDate)data.time, Index = indexItem,
                Temper1  = data.temper1, Temper2 = data.temper2,
                Pressure = data.pressure, Level = data.level
            };

            AddData(indexItem, temp);
        }
Example #2
0
        public void AddData(DataStruct data)
        {
            XDate time = data.time;

            if (_isUpdateData)
            {
                _singleGraph[0].UpdateData(data.temper1, time);
                _singleGraph[1].UpdateData(data.temper2, time);
                _singleGraph[2].UpdateData(data.pressure, time);
                _singleGraph[3].UpdateData(data.level, time);
            }
            if (_isUpdateAxis)
            {
                DateTime to   = data.time;
                DateTime from = to.AddSeconds(-_visibleSeconds);
                UpdateAxis(from, to);
            }
        }
Example #3
0
        private void pollTimer_Tick(object sender, EventArgs e)
        {
            DateTime curTime = DateTime.Now;

            for (int i = 0; i < ItemCount; i++)
            {
                int temper1  = rnd.Next(-5, 55);
                int temper2  = rnd.Next(-5, 55);
                int pressure = rnd.Next(0, 10);
                int level    = rnd.Next(0, 20);

                DataStruct ds = new DataStruct()
                {
                    temper1  = temper1, temper2 = temper2,
                    pressure = pressure, level = level,
                    time     = curTime
                };

                _itemControl[i].UpdateItemData(temper1, temper2, pressure, level);
                _itemGraph[i].AddData(ds);
                DBDataLayer.AddData(i, ds);
            }
        }