private void button_Axis_Refresh_Click(object sender, EventArgs e) { int i = 0; panel_Axis.Controls.Clear(); cboAxisName.Items.Clear(); if (_StationM != null && !string.IsNullOrEmpty(_StationM.strStationName)) { for (i = 0; i < _StationM.intUseAxisCount; i++) { if (i == 0) { AxisSetLabelControl axisL = new AxisSetLabelControl(); panel_Axis.Controls.Add(axisL); axisL.Location = new Point(42, 5); } AxisSetConfigControl setC = new AxisSetConfigControl(); panel_Axis.Controls.Add((Control)setC); setC.Location = new Point(3, 32 + i * setC.Height + i * 5); setC.AxisSet = _StationM.arrAxis[i]; cboAxisName.Items.Add(_StationM.arrAxis[i].AxisName); } intAxisControlCount = _StationM.intUseAxisCount; } }
private void SetAxisUI_Load(object sender, EventArgs e) { if (_Worker._Config.axisArray != null) { int i = 0; if (i == 0) { AxisSetLabelControl axisL = new AxisSetLabelControl(); Panel_SetAxis.Controls.Add(axisL); axisL.Location = new Point(42, 5); } while (i < _Worker._Config.axisArray.Count) { AxisSetConfigControl setC = new AxisSetConfigControl(); Panel_SetAxis.Controls.Add((Control)setC); setC.Location = new Point(3, 32 + i * setC.Height + i * 5); setC.AxisSet = _Worker._Config.axisArray[i]; i++; } } }
public void InitForm() { try { int i = 0; if (_StationM != null && !string.IsNullOrEmpty(_StationM.strStationName)) { for (i = 0; i < intAxisControlCount; i++) { if (i == 0) { AxisSetLabelControl axisL = new AxisSetLabelControl(); panel_Axis.Controls.Add(axisL); axisL.Location = new Point(42, 5); } AxisSetConfigControl setC = new AxisSetConfigControl(); panel_Axis.Controls.Add((Control)setC); setC.Location = new Point(3, 32 + i * setC.Height + i * 5); setC.AxisSet = _StationM.arrAxis[i]; cboAxisName.Items.Add(_StationM.arrAxis[i].AxisName); } if (cboAxisName.Items.Count > 0) { cboAxisName.SelectedIndex = 0; } for (i = 0; i < intInputControlCount; i++) { if (i == 0) { IOInputSetLabelControl ioinlab = new IOInputSetLabelControl(); panel_InputIo.Controls.Add(ioinlab); ioinlab.Location = new Point(3, 1); } IOSetPanelControl inputIo = new IOSetPanelControl(); panel_InputIo.Controls.Add((Control)inputIo); inputIo.Location = new Point(3, 27 + i * inputIo.Height + i * 5); inputIo.IO = _StationM.arrInputIo[i]; } for (i = 0; i < intOutputControlCount; i++) { if (i == 0) { IOOutputSetLabelControl iooutlb = new IOOutputSetLabelControl(); panel_OutputIo.Controls.Add(iooutlb); iooutlb.Location = new Point(3, 1); } IOSetPanelControl outputIo = new IOSetPanelControl(); panel_OutputIo.Controls.Add((Control)outputIo); outputIo.Location = new Point(3, 27 + i * outputIo.Height + i * 5); outputIo.IO = _StationM.arrOutputIo[i]; } int m = 0; for (i = 0; i < intPointControlCount; i++) { if (i == 0) { PointLabel = new PointDetailedSetUILabelControl(_StationM, intAxisControlCount); panel_Point.Controls.Add((Control)PointLabel); PointLabel.Location = new Point(85, 18); } if (_StationM.arrPoint[i].tag_BeginPointAggregateList != null) { foreach (PointAggregate pa in _StationM.arrPoint[i].tag_BeginPointAggregateList) { if (IsAdd(pa) == true) { PointSetControl setP = new PointSetControl(); panel_Point.Controls.Add((Control)setP); setP.Location = new Point(17, 53 + (m) * setP.Height + m * 5); setP.intAxisCount = intAxisControlCount; setP.PointAggregate = pa; tag_PointAggregateList.Add(pa); m++; } } } if (IsAdd(_StationM.arrPoint[i]) == true) { PointSetControl setP1 = new PointSetControl(); panel_Point.Controls.Add((Control)setP1); setP1.Location = new Point(17, 53 + (m) * setP1.Height + m * 5); setP1.intAxisCount = intAxisControlCount; setP1.PointAggregate = _StationM.arrPoint[i]; tag_PointAggregateList.Add(_StationM.arrPoint[i]); m++; } if (_StationM.arrPoint[i].tag_EndPointAggregateList != null) { foreach (PointAggregate pa in _StationM.arrPoint[i].tag_EndPointAggregateList) { if (IsAdd(pa) == true) { PointSetControl setP = new PointSetControl(); panel_Point.Controls.Add((Control)setP); setP.Location = new Point(17, 53 + (m) * setP.Height + m * 5); setP.intAxisCount = intAxisControlCount; setP.PointAggregate = pa; tag_PointAggregateList.Add(pa); m++; } } } } } } catch (Exception mess) { LogOutControl.OutLog(mess.Message, 0); } }