123456789101112131415161718192021222324252627282930313233343536 |
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Uestc.Auto6.Dso.ComModel;
- using Uestc.Auto6.Dso.Core;
- using Uestc.Auto6.Dso.Core.Decode;
- using Uni_Trend.MSO7000X.Common.Helper;
- using System.Windows.Forms;
- namespace Uestc.Auto6.Dso.Protocol.MIL
- {
- internal class MIL : DecodeView
- {
- public override IProtocolView ProtocolView => new MILSetControl();
- public override ITriggerSerialView TriggerSerialView => new MILTriggerSetControl();
- public override SerialProtocolType ProtocolType => SerialProtocolType.MIL;
- public override void DrawDecodeInfo(Graphics graphics, Rectangle rectangle, IProtocolPrsnt prsnt, Color ForeColor, Font font)
- {
- if (prsnt is MILDecodePrsnt decodePrsnt)
- {
- TextRenderer.DrawText(graphics, SIHelper.ValueChangeToSI(decodePrsnt.RealSignalRate, 2, "bps"), font, GetRowRectangle(), ForeColor, TextFormatFlags.Right | TextFormatFlags.VerticalCenter);
- String tempstr = decodePrsnt.Source.ToString();
- if(decodePrsnt.Polarity == ProtocolMIL.Polarity.Neg)
- {
- tempstr += "⬇";
- }
- TextRenderer.DrawText(graphics, tempstr, font, GetRowRectangle(1), ForeColor, TextFormatFlags.Left | TextFormatFlags.VerticalCenter);
- TextRenderer.DrawText(graphics, SIHelper.ValueChangeToSI(decodePrsnt.Threshold, 2, "V"), font, GetRowRectangle(1), ForeColor, TextFormatFlags.Right | TextFormatFlags.VerticalCenter);
- }
- }
- }
- }
|