1234567891011121314151617181920212223242526272829303132333435363738 |
- 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.USB
- {
- internal class USB : DecodeView
- {
- public override IProtocolView ProtocolView => new USBSetControl();
- public override ITriggerSerialView TriggerSerialView => new USBTriggerSetControl();
- public override SerialProtocolType ProtocolType => SerialProtocolType.USB;
- public override void DrawDecodeInfo(Graphics graphics, Rectangle rectangle, IProtocolPrsnt prsnt, Color ForeColor, Font font)
- {
- if (prsnt is USBDecodePrsnt decodePrsnt)
- {
- TextRenderer.DrawText(graphics, decodePrsnt.SignalRate switch
- {
- ProtocolUSB.SignalRate.LowRate => "USB 1.0",
- ProtocolUSB.SignalRate.FullRate => "USB 1.1",
- ProtocolUSB.SignalRate.HighRate => "USB 2.0",
- _ => "USB 1.0",
- }, font, GetRowRectangle(0), ForeColor, TextFormatFlags.Right | TextFormatFlags.VerticalCenter);
- TextRenderer.DrawText(graphics, $"{decodePrsnt.Source1}->{SIHelper.ValueChangeToSI(decodePrsnt.Source1Threshold, 2, "V")}", font, GetRowRectangle(1), ForeColor, TextFormatFlags.Left | TextFormatFlags.VerticalCenter);
- TextRenderer.DrawText(graphics, $"{decodePrsnt.Source2}->{SIHelper.ValueChangeToSI(decodePrsnt.Source2Threshold, 2, "V")}", font, GetRowRectangle(2), ForeColor, TextFormatFlags.Left | TextFormatFlags.VerticalCenter);
- }
- }
- }
- }
|