public CMonData(SignLength signLen) { GAN_LENGTH = signLen.GAN_LENGTH; XIAN_LENGTH = signLen.XIAN_LENGTH; CHE_LENGTH = signLen.CHE_LENGTH; Gan = new CSignals(SignalType.GAN, RAW_LENGTH); Xian = new CSignals(SignalType.XIAN, RAW_LENGTH); Che = new CSignals(SignalType.CHE, RAW_LENGTH); }
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(); }
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); }