public PrimOmron(XmlNode xmlNode) { //xmlNode turn to _config if (xmlNode != null) { _config = XMLHelper.XMLToObject(xmlNode, typeof(OmronConfig)) as OmronConfig; } else { return; } _dataConfigs.ListDataConfig = new List <DataConfig>(); if (!string.IsNullOrEmpty(_config.DataTablePath)) { ImportDataTable(_config.DataTablePath); } PrimDebugUI = new PrimDebugControl(); PrimConfigUI = new PrimConfigControl(this); PrimOutputUI = new PrimOutputControl(); _omronUdp = new OmronUDP(); PrimConnStat = PrimConnState.Other; PrimRunStat = PrimRunState.Other; ((PrimConfigControl)PrimConfigUI).SetPrimConnState(PrimConnStat); ((PrimConfigControl)PrimConfigUI).SetPrimRunState(PrimRunStat); ((PrimConfigControl)PrimConfigUI).OnMonitorVariableChanged -= OnMonitorVariableChanged_Handle; ((PrimConfigControl)PrimConfigUI).OnMonitorVariableChanged += OnMonitorVariableChanged_Handle; }
public PrimOmron() { _config = new OmronConfig(); _dataConfigs.ListDataConfig = new List <DataConfig>(); if (!string.IsNullOrEmpty(_config.DataTablePath)) { ImportDataTable(_config.DataTablePath); } PrimDebugUI = new PrimDebugControl(); PrimConfigUI = new PrimConfigControl(this); PrimOutputUI = new PrimOutputControl(); _omronUdp = new OmronUDP(); PrimConnStat = PrimConnState.Other; PrimRunStat = PrimRunState.Other; ((PrimConfigControl)PrimConfigUI).SetPrimConnState(PrimConnStat); ((PrimConfigControl)PrimConfigUI).SetPrimRunState(PrimRunStat); ((PrimConfigControl)PrimConfigUI).OnMonitorVariableChanged -= OnMonitorVariableChanged_Handle; ((PrimConfigControl)PrimConfigUI).OnMonitorVariableChanged += OnMonitorVariableChanged_Handle; }