| | |
| | | </ProjectReference> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <Content Include="gts.dll" /> |
| | | <Content Include="gts.dll"> |
| | | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
| | | </Content> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <None Include="GTS800.cfg" /> |
| | | <None Include="GTS800.cfg"> |
| | | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| | | </None> |
| | | <None Include="packages.config" /> |
| | | </ItemGroup> |
| | | <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
| | |
| | | using Bro.Common.Model; |
| | | using Bro.UI.Model.Winform; |
| | | using static Bro.Common.Helper.EnumHelper; |
| | | using Bro.Common.Interface; |
| | | using Bro.Common.Base; |
| | | |
| | | namespace Bro.UI.Device.Winform |
| | | { |
| | |
| | | public CtrlMotionCardIOStatus() |
| | | { |
| | | InitializeComponent(); |
| | | InitIOEvent(); |
| | | } |
| | | private IDevice Device { get; set; } |
| | | |
| | | protected MotionCardBase MotionCard |
| | | { |
| | | get => Device as MotionCardBase; |
| | | } |
| | | |
| | | |
| | | public CtrlMotionCardIOStatus(List<IOItem> monitorValues) |
| | | public CtrlMotionCardIOStatus(IDevice device, List<IOItem> monitorValues) |
| | | { |
| | | InitializeComponent(); |
| | | Device = device; |
| | | _monitorValues = monitorValues; |
| | | InitIOEvent(); |
| | | } |
| | | |
| | | private void InitIOEvent() |
| | | { |
| | | foreach (var ctr in groupBoxIOOut.Controls) |
| | | { |
| | | if (ctr is IOIndicatorCtrl ioOut) |
| | | { |
| | | ioOut.OnIODoubleClick += IoOut_DoubleClick; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void IoOut_DoubleClick(string desc, bool isOn) |
| | | { |
| | | var index = Convert.ToInt16(desc.Substring(3)); |
| | | MotionCard.WriteOutput(index, isOn ? IOValue.FALSE : IOValue.TRUE); |
| | | } |
| | | |
| | | private void RefreshIOStatus(object sender, EventArgs e) |
| | |
| | | |
| | | } |
| | | |
| | | CtrlMotionCardIOStatus ctrlMotionCardIOStatus = new CtrlMotionCardIOStatus(MotionCard.MonitorValues); |
| | | CtrlMotionCardIOStatus ctrlMotionCardIOStatus = new CtrlMotionCardIOStatus(Device, MotionCard.MonitorValues); |
| | | //ctrlMotionCardIOStatus.Dock = DockStyle.Fill; |
| | | flowLayoutPanel2.Controls.Add(ctrlMotionCardIOStatus); |
| | | } |
| | |
| | | this.plStatus.Size = new System.Drawing.Size(24, 24); |
| | | this.plStatus.TabIndex = 0; |
| | | this.plStatus.Paint += new System.Windows.Forms.PaintEventHandler(this.plStatus_Paint); |
| | | this.plStatus.DoubleClick += new System.EventHandler(this.plStatus_DoubleClick); |
| | | // |
| | | // lblDesc |
| | | // |
| | |
| | | this.lblDesc.TabIndex = 1; |
| | | this.lblDesc.Text = "XXXX"; |
| | | this.lblDesc.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; |
| | | this.lblDesc.DoubleClick += new System.EventHandler(this.lblDesc_DoubleClick); |
| | | // |
| | | // IOIndicatorCtrl |
| | | // |
| | |
| | | g.FillPolygon(Brushes.White, regionBlink); |
| | | } |
| | | } |
| | | |
| | | public event Action<string,bool> OnIODoubleClick; |
| | | |
| | | private void lblDesc_DoubleClick(object sender, EventArgs e) |
| | | { |
| | | if (IsOn != null) |
| | | { |
| | | OnIODoubleClick?.Invoke(Desc,IsOn.Value); |
| | | } |
| | | } |
| | | |
| | | private void plStatus_DoubleClick(object sender, EventArgs e) |
| | | { |
| | | if (IsOn != null) |
| | | { |
| | | OnIODoubleClick?.Invoke(Desc, IsOn.Value); |
| | | } |
| | | } |
| | | } |
| | | } |