public DebugUI(FrameUI frm, Work _work) { frameUI = frm; worker = _work; InitializeComponent(); this.Dock = DockStyle.Fill; UiInit(); sationModelPanelControl.tag_Work = worker; debugOffsetControl.tag_work = worker; // Input IO点加入 for (int i = 0; i < 100; i++) { IOInputStatusControl pvale = new IOInputStatusControl(null); pvale.Location = new Point(5, 24 + 28 * i); tag_IOinputStatusList.Add(pvale); pvale.Visible = false; plIOmessage.Controls.Add(pvale); } // Outpu IO点加入 for (int i = 0; i < 100; i++) { IOOutputStatusControl pvale = new IOOutputStatusControl(null, OutIOStationSelect); pvale.Location = new Point(200, 24 + 28 * i); tag_IOIOoutputStatus.Add(pvale); pvale.Visible = false; plIOmessage.Controls.Add(pvale); } }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { //IOinput组件加载到界面 int m = 0; plIOmessage.Controls.Clear(); StationModule sm = StationManage.FindStation(comboBox_IO.Text); for (int i = 0; i < sm.intUseInputIoCount && i < sm.arrInputIo.Count; i++) { IOInputStatusControl ioinput = new IOInputStatusControl(sm.arrInputIo[i]); { ioinput.Location = new Point(5, 24 + 28 * i); plIOmessage.Controls.Add(ioinput); } arrInputIo = sm.arrInputIo[i]; m = i + 1; } int n = 0; //IOoutput组件加载到界面 for (int i = 0; i < sm.intUseOutputIoCount && i < sm.arrOutputIo.Count; i++) { IOOutputStatusControl iooutput = new IOOutputStatusControl(sm.arrOutputIo[i], OutIOStationSelect); iooutput.Location = new Point(200, 24 + 40 * i); plIOmessage.Controls.Add(iooutput); arrOutputIo = sm.arrOutputIo[i]; n = i + 1; } NewCtrlCardIO.tag_IO_refresh = 10; }
private void IORefreshStation() { int m = 0; // plIOmessage.Controls.Clear(); if (tag_StationModule == null) { return; } for (int i = 0; i < tag_StationModule.intUseInputIoCount && i < tag_StationModule.arrInputIo.Count; i++) { IOInputStatusControl ioinput = tag_IOinputStatusList[i]; ioinput.IOinputStatus_Load(tag_StationModule.arrInputIo[i]); ioinput.Visible = true; m = i; } for (int i = m; i < tag_IOinputStatusList.Count; i++) { tag_IOinputStatusList[i].Visible = false; } //IOoutput组件加载到界面 for (int i = 0; i < tag_StationModule.intUseOutputIoCount && i < tag_StationModule.arrOutputIo.Count; i++) { IOOutputStatusControl iooutput = tag_IOIOoutputStatus[i]; iooutput.IOoutputStatus_Load(tag_StationModule.arrOutputIo[i]); iooutput.Visible = true; m = i; } for (int i = m; i < tag_IOinputStatusList.Count; i++) { tag_IOIOoutputStatus[i].Visible = false; } }
private void button_InputSelect_Click(object sender, EventArgs e) { int i = 0; int j = 0; panel_IO.Controls.Clear(); foreach (StationModule sm in StationManage._Config.arrWorkStation) { foreach (IOParameter ioP in sm.arrInputIo) { IOInputStatusControl ioinput = new IOInputStatusControl(ioP); string car = ioP.CardNum.ToString(); string scar = GetCarId(); if ((scar == car) || scar == "-1") { ioinput.Location = new Point(i % 4 * 160, i / 4 * 30); panel_IO.Controls.Add(ioinput); i++; } } } }
private void IoAllShow_Load(object sender, EventArgs e) { if (StationManage._Config == null || StationManage._Config.arrWorkStation == null) { return; } int i = 0; int j = 0; tabPage2.Controls.Add(ioSet1); tabPage3.Controls.Add(ioAssign1); tabPage4.Controls.Add(outIOAssign1); foreach (StationModule sm in StationManage._Config.arrWorkStation) { comboBox_Stat.Items.Add(sm.strStationName); } List <object> listObject = new List <object>(); foreach (StationModule sm in StationManage._Config.arrWorkStation) { foreach (IOParameter ioP in sm.arrInputIo) { if (IoisInList(listObject, ioP)) { continue; } listObject.Add(ioP); IOInputStatusControl ioinput = new IOInputStatusControl(ioP); ioinput.Location = new Point(i % 4 * 160, i / 4 * 30); panel_IO.Controls.Add(ioinput); i++; } foreach (IOParameter ioP in sm.arrOutputIo) { if (IoisInList(listObject, ioP)) { continue; } listObject.Add(ioP); IOOutputStatusControl ioinput = new IOOutputStatusControl(ioP, null); string car = ioP.CardNum.ToString(); ioinput.Location = new Point(0, j * 30); panel_out.Controls.Add(ioinput); j++; } } }