12345678910111213141516171819202122232425262728293031323334353637 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Uestc.Auto6.Dso.Core;
- using Uestc.Auto6.Dso.ComModel;
- using System.Drawing;
- using Uestc.Auto6.Dso.Core.Decode;
- using System.Windows.Forms;
- using Uni_Trend.MSO7000X.Common.Helper;
- namespace Uestc.Auto6.Dso.Protocol.ARINC429
- {
- internal class ARINC429 : DecodeView
- {
- public override IProtocolView ProtocolView => new ARINC429SetControl();
- public override ITriggerSerialView TriggerSerialView => new ARINC429TriggerSetControl();
- public override SerialProtocolType ProtocolType => SerialProtocolType.ARINC429;
- public override void DrawDecodeInfo(Graphics graphics, Rectangle rectangle, IProtocolPrsnt prsnt, Color ForeColor, Font font)
- {
- if (prsnt is ARINC429DecodePrsnt decodePrsnt)
- {
- TextRenderer.DrawText(graphics, SIHelper.ValueChangeToSI(decodePrsnt.CustomBaud, 2, "bps"), font, GetRowRectangle(2), ForeColor, TextFormatFlags.Right | TextFormatFlags.VerticalCenter);
- TextRenderer.DrawText(graphics, decodePrsnt.InputMode == ProtocolARINC429.InputMode.Diff?$"{decodePrsnt.Source}-{decodePrsnt.SourceL}" :decodePrsnt.Source.ToString(), font, GetRowRectangle(0), ForeColor, TextFormatFlags.Right | TextFormatFlags.VerticalCenter);
- TextRenderer.DrawText(graphics,$"H:{SIHelper.ValueChangeToSI(decodePrsnt.ThresholdH,2,"V")} L:{SIHelper.ValueChangeToSI(decodePrsnt.ThresholdL,2,"V")}" , font, GetRowRectangle(1), ForeColor, TextFormatFlags.Left | TextFormatFlags.VerticalCenter);
- TextRenderer.DrawText(graphics, decodePrsnt.DecodeMode switch
- {
- ProtocolARINC429.DecodeMode.Mode_8_23_1=>"23bit",
- ProtocolARINC429.DecodeMode.Mode_8_2_19_1=>"19bit",
- _=>"19bit",
- }, font, GetRowRectangle(2), ForeColor, TextFormatFlags.Left | TextFormatFlags.Top);
- }
- }
- }
- }
|