PCIe.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows.Forms;
  8. using Uestc.Auto6.Dso.ComModel;
  9. using Uestc.Auto6.Dso.Core;
  10. using Uestc.Auto6.Dso.Core.Decode;
  11. using Uni_Trend.MSO7000X.Common.Helper;
  12. namespace Uestc.Auto6.Dso.Protocol.PCIe
  13. {
  14. internal class PCIe : DecodeView
  15. {
  16. public override IProtocolView ProtocolView => new PCIeSetControl();
  17. public override ITriggerSerialView TriggerSerialView => new PCIeTriggerSetControl();
  18. public override SerialProtocolType ProtocolType => SerialProtocolType.PCIe;
  19. public override void DrawDecodeInfo(Graphics graphics, Rectangle rectangle, IProtocolPrsnt prsnt, Color ForeColor, Font font)
  20. {
  21. if (prsnt is PCIeDecodePrsnt decodePrsnt)
  22. {
  23. TextRenderer.DrawText(graphics, decodePrsnt.SignalInput.ToString(), font, GetRowRectangle(), ForeColor, TextFormatFlags.Right | TextFormatFlags.VerticalCenter);
  24. TextRenderer.DrawText(graphics, decodePrsnt.Version switch
  25. {
  26. ComModel.ProtocolPCIe.PCIeVersion.PCIeV1_0 => "PCIe 1.0",
  27. ComModel.ProtocolPCIe.PCIeVersion.PCIeV2_0 => "PCIe 2.0",
  28. _ => "PCIe 1.0",
  29. }, font, GetRowRectangle(1), ForeColor, TextFormatFlags.Left | TextFormatFlags.VerticalCenter) ;
  30. TextRenderer.DrawText(graphics,Uni_Trend.MSO7000X.Common.Helper.SIHelper.ValueChangeToSI(decodePrsnt.Threshold,2,"V"), font, GetRowRectangle(1), ForeColor, TextFormatFlags.Right | TextFormatFlags.VerticalCenter);
  31. }
  32. }
  33. }
  34. }