12345678910111213141516171819202122232425262728293031323334353637 |
- using System.Drawing;
- using System.Windows.Forms;
- using Uestc.Auto6.Dso.ComModel;
- using Uestc.Auto6.Dso.Core;
- using Uestc.Auto6.Dso.Core.Decode;
- using Uni_Trend.MSO7000X.Common.Helper;
- namespace Uestc.Auto6.Dso.Protocol.NRZ
- {
- public class NRZ : DecodeView
- {
- public override IProtocolView ProtocolView => new NRZSetControl();
- public override ITriggerSerialView TriggerSerialView => new NRZTriggerSetControl();
- public override SerialProtocolType ProtocolType => SerialProtocolType.NRZ;
- public override void DrawDecodeInfo(Graphics graphics, Rectangle rectangle, IProtocolPrsnt prsnt, Color foreColor, Font font)
- {
- if (prsnt is NRZDecodePrsnt decodePrsnt)
- {
- if (decodePrsnt.SignalType == ProtocolNRZ.SignalType.Difference)
- {
- TextRenderer.DrawText(graphics, $"{decodePrsnt.Source1}-{decodePrsnt.Source2}:{SIHelper.ValueChangeToSI(decodePrsnt.Threshold, 2, "V")}", font, GetRowRectangle(1), foreColor, TextFormatFlags.Left | TextFormatFlags.VerticalCenter);
- }
- else
- {
- TextRenderer.DrawText(graphics, $"{decodePrsnt.Source1}:{SIHelper.ValueChangeToSI(decodePrsnt.Threshold, 2, "V")}", font, GetRowRectangle(1), foreColor, TextFormatFlags.Left | TextFormatFlags.VerticalCenter);
- }
- TextRenderer.DrawText(graphics, $"{decodePrsnt.MSB_LSB}", font, GetRowRectangle(2), foreColor, TextFormatFlags.Left | TextFormatFlags.VerticalCenter);
- TextRenderer.DrawText(graphics, $"{SIHelper.ValueChangeToSI(decodePrsnt.RealSignalRate, 2, "bps")}", font, GetRowRectangle(2), foreColor, TextFormatFlags.Right | TextFormatFlags.VerticalCenter);
- }
- }
- }
- }
|