TDGage.cs 1.86 KB
Newer Older
潘栩锋's avatar
潘栩锋 committed
1
using FLY.Integrated.Server.OBJProxy;
2
using FLY.OBJComponents.Server.OBJProxy;
潘栩锋's avatar
潘栩锋 committed
3
using FLY.OBJComponents.Server;
4 5 6 7 8 9 10
using FObjBase;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
潘栩锋's avatar
潘栩锋 committed
11
using FLY.Integrated.Server.Model;
12

潘栩锋's avatar
潘栩锋 committed
13
namespace FLY.Integrated.Server
14
{
潘栩锋's avatar
潘栩锋 committed
15
    public class TDGage 
16 17 18 19
    {
        public string mParamDirectory;//参数目录 m_path;//数据文件的 根目录默认是 Gage1
        public string mName;//名字 如:gage0

潘栩锋's avatar
潘栩锋 committed
20 21
        public SysParam mSysParam;
        public IntegratedSystem mData;
22

潘栩锋's avatar
潘栩锋 committed
23 24 25
        Model.DbModel mDbModel;
        public Model.HistoryDb mHistoryDb;
        public WarningSystem mWarning;
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46

        public TDGage(string nam)
        {
            mName = nam;
            mParamDirectory = mName;// @"D:\" + m_name;

            if (!System.IO.Directory.Exists(mParamDirectory))
            {
                System.IO.Directory.CreateDirectory(mParamDirectory);
            }
            System.Environment.CurrentDirectory = mParamDirectory;

            Init1();

        }
        #region Init登陆服务器初始化----------------------------------------------------
        /// <summary>
        /// 第1步, 加载本地数据
        /// </summary>
        public void Init1()
        {
潘栩锋's avatar
潘栩锋 committed
47 48
            mSysParam = new SysParam();
            mData = new IntegratedSystem();
49

潘栩锋's avatar
潘栩锋 committed
50 51 52 53
            //---------------------------------------------------------------------------------------------------------------
            //数据库
            mDbModel = new DbModel();
            mDbModel.Init();
54

潘栩锋's avatar
潘栩锋 committed
55 56 57
            mHistoryDb = new HistoryDb();
            mHistoryDb.Init(mDbModel);
            mHistoryDb.KeepDBSize(mSysParam.DBKeepMonth);
58

潘栩锋's avatar
潘栩锋 committed
59
            mWarning = new WarningSystem(mHistoryDb.ErrorBuffer);
60

潘栩锋's avatar
潘栩锋 committed
61
            mData.Init(mHistoryDb, mWarning);
62 63 64 65


        }
        #endregion
潘栩锋's avatar
潘栩锋 committed
66

67 68
    }
}