public void Initialize(PLCInfo plc) { foreach (var light in plc.lights) { LED led = new LED(); led.Name = light.Key; led.ReadOnly = light.Value.ReadOnly; led.State = light.Value.Checked; if (light.Value.Checked) { led.BackColor = Color.Gold; } else { led.BackColor = Color.Transparent; } led.Size = new System.Drawing.Size(light.Value.Width, light.Value.Height); led.Location = light.Value.Position; if (led.Name[0] == 'I') { led.Click += LightsClick; InputControls.Add(light.Key, led); } else if (led.Name[0] == 'Q') { OutputControls.Add(light.Key, led); } else { StatusControls.Add(light.Key, led); } } }
public PLC(string filePath) { Info = new PLCInfo(filePath); _IOModule.Initialize(Info); InputModule = ComponentsForModule.InputControls; OutputModule = ComponentsForModule.OutputControls; CpuModule = ComponentsForModule.StatusControls; CPU.Memory.Data.Init(InputModule, OutputModule); }
public PLCDetailDeviceSettings(PLCInfo plcInfo) { PLCDeviceType = plcInfo.PLCDeviceType; HasControlRelayResultStatus = plcInfo.HasControlRelayResultStatus; HeaderName = plcInfo.PLCHeaderName; DeviceNumber = plcInfo.DeviceNumber; DigitalSwitchNumber = plcInfo.DigitalSwitchNumber; RelayNumber = plcInfo.RelayNumber; }
public PLCDeviceInfo(PLCInfo plcInfo, string portName) { PLCDeviceType = plcInfo.PLCDeviceType; HasControlRelayResultStatus = plcInfo.HasControlRelayResultStatus; HeaderName = plcInfo.PLCHeaderName; DeviceNumber = plcInfo.DeviceNumber; DigitalSwitchNumber = plcInfo.DigitalSwitchNumber; RelayNumber = plcInfo.RelayNumber; UpdatePortName(portName); InitEditCommand(); InitOpenLogFileCommand(); InitChangedDeviceNumberCommand(); InitQuerySwitchStatusCommand(); InitQueryRelayStatusCommand(); }
public void AddDetailDevice(PLCInfo plcInfo) { PLCDetailDevicesSettings.Add(new PLCDetailDeviceSettings(plcInfo)); }