Пример #1
0
        public CMonitor()
        {
            settings = (SignalSettings)Util.ModuleConfig.GetSettings(settings.GetType(), "signal.config");
            jifennum = settings.Jifennum;
            if (jifennum < 3 || jifennum > 100)
            {
                jifennum = 3;
            }
            mondata_s     = new CMonData();
            mondata_l     = new CMonData();
            mondata_s_cur = new CMonData();
            mondata_l_cur = new CMonData();
            mondata_s_old = new CMonData();
            mondata_l_old = new CMonData();
            jifenQueue_s  = new List <CMonData>(jifennum);
            jifenQueue_l  = new List <CMonData>(jifennum);
            mrevent       = new ManualResetEvent(false);
            mythread      = new Thread(Monitor);
            delaytime     = settings.Delaytime;
            lvbodelaytime = settings.Lvbodelaytime;
            regobj        = new ArrayList();
            lbgan         = new ulong[9];
            adminpb       = new CMonData();
            adminqf       = new CMonData();
            for (int i = 0; i < 9; i++)
            {
                lbgan[i] = 0;
            }
            Che_Type = CheType.SmallCar; //注意此处为public变量,赋值时会做一系列同步操作
            gan_l    = settings.BigCar.Gan;
            gan_s    = settings.SmallCar.Gan;
            xian_l   = settings.BigCar.Xian;
            xian_s   = settings.SmallCar.Xian;
            switch (Che_Type)
            {
            case CheType.SmallCar:
                che = settings.SmallCar.Che;
                break;

            case CheType.BigCar:
                che = settings.BigCar.Che;
                break;

            case CheType.Other:
                che = settings.SmallCar.Che;
                break;
            }
            che        = settings.SmallCar.Che;
            modarray_s = new CMonData[jifennum];
            modarray_l = new CMonData[jifennum];
            for (int i = 0; i < jifennum; i++)
            {
                modarray_s[i] = new CMonData();
                modarray_l[i] = new CMonData();
            }
        }
Пример #2
0
        public CSimIO(IntPtr HotKeyHandle)
        {
            settings   = (SignalSettings)Util.ModuleConfig.GetSettings(settings.GetType(), "signal.config");
            b_gan_loc  = settings.BigCar.Gan;
            b_xian_loc = settings.BigCar.Xian;
            b_che_loc  = settings.BigCar.Che;
            s_gan_loc  = settings.SmallCar.Gan;
            s_xian_loc = settings.SmallCar.Xian;
            s_che_loc  = settings.SmallCar.Che;
            _carType   = settings.CarType;

            _hkapp = new CHotkeyApp(HotKeyHandle, this);
            _hkapp.StartHotkey();
        }