Beispiel #1
0
 public void Copy(CMonData src)
 {
     for (int i = 0; i < GAN_LENGTH; i++)
     {
         Gan[i] = src.Gan[i];
     }
     for (int i = 0; i < XIAN_LENGTH; i++)
     {
         Xian[i] = src.Xian[i];
     }
     for (int i = 0; i < CHE_LENGTH; i++)
     {
         Che[i] = src.Che[i];
     }
 }
Beispiel #2
0
        public CMonitor(CSettings settings)
        {
            commonSettings = settings.GetCommonSettings();
            g_jifennum     = commonSettings.SignConfig.GanJiFen;
            x_jifennum     = commonSettings.SignConfig.XianJiFen;
            if (g_jifennum < 2 || g_jifennum > 100)
            {
                g_jifennum = 2;
            }
            if (x_jifennum < 2 || x_jifennum > 100)
            {
                x_jifennum = 2;
            }

            signLen = new SignLength();

            signLen.GAN_LENGTH  = ganlen = commonSettings.SignConfig.GanLength;
            signLen.XIAN_LENGTH = xianlen = commonSettings.SignConfig.XianLength;
            signLen.CHE_LENGTH  = chelen = commonSettings.SignConfig.CheLength;

            mondata      = new CMonData(signLen);
            mondata_cur  = new CMonData(signLen);
            mondata_old  = new CMonData(signLen);
            g_jifenQueue = new List <CSignals>(g_jifennum);
            x_jifenQueue = new List <CSignals>(x_jifennum);

            adminPBGan  = settings.SignConfig.AdminPBGan;
            adminPBXian = settings.SignConfig.AdminPBXian;
            adminQFGan  = settings.SignConfig.AdminQFGan;
            adminQFXian = settings.SignConfig.AdminQFXian;
            PBChe       = settings.SignConfig.PBChe;
            PBGan       = settings.SignConfig.PBGan;
            PBXian      = settings.SignConfig.PBXian;

            ganpos  = commonSettings.SignConfig.GanPosition;
            xianpos = commonSettings.SignConfig.XianPosition;
            chepos  = commonSettings.SignConfig.ChePosition;

            ApplyCommonSettings();

            mythread = new Thread(Monitor);
            regobj   = new ArrayList();
        }
Beispiel #3
0
        static void Main()
        {
            MotorSignalSettings settings = (MotorSignalSettings)Util.ModuleConfig.GetSettings(new MotorSignalSettings().GetType(), "MotorSignal.config");

            signLen             = new SignLength();
            signLen.GAN_LENGTH  = settings.SignConfig.GanLength;
            signLen.XIAN_LENGTH = settings.SignConfig.XianLength;
            signLen.CHE_LENGTH  = settings.SignConfig.CheLength;
            oldData             = new CMonData(signLen);
            //SimForm simForm = new SimForm();
            IMonitor monitor = new MotorMonitor(settings);
            //monitor.HotKeyHandle = simForm.Handle;
            //monitor.RegMonitor(simForm);
            Program p = new Program();

            monitor.RegMonitor(p);
            monitor.Start();
            //Application.Run(simForm);
        }
Beispiel #4
0
 abstract public void Notify(Signal.CMonData data);