WidgetPrsnt.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // Copyright (c) UESTC. All Rights Reserved
  2. // <author>QC</author>
  3. // <date>2022/4/14</date>
  4. namespace Uestc.Auto6.Dso.Core
  5. {
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Drawing;
  9. using Uestc.Auto6.Dso.ComModel;
  10. using Uestc.Auto6.Dso.Core.Tools;
  11. public class WidgetPrsnt
  12. {
  13. private static Int32 _Combo = 0;
  14. public static Int32 Combo
  15. {
  16. get => _Combo;
  17. set
  18. {
  19. if (_Combo != value)
  20. {
  21. _Combo = value;
  22. Hardware.HdCmdFactory.Push(ComModel.HdCmd.Combo);
  23. }
  24. }
  25. }
  26. public static Action<Int32, Int32>? SetMousePosHandler { get; set; }
  27. public static Action<UInt32, Int32>? MouseEventHandler { get; set; }
  28. public static Action<Byte, Int32>? KeyboradEventHandler { get; set; }
  29. //public static void SetColor(ChannelId id, Color color)
  30. //{
  31. // ColorConfig.Default[id.ToString()] = color;
  32. // if (DsoModel.Default.TryGetChannel(id, out var cm))
  33. // {
  34. // cm.DrawColor = color;
  35. // }
  36. //}
  37. //public static Color GetColor(ChannelId id)
  38. //{
  39. // if (DsoModel.Default.TryGetChannel(id, out var cm))
  40. // {
  41. // return cm.DrawColor;
  42. // }
  43. // return ColorConfig.Default[id.ToString()];
  44. //}
  45. //public static Int32 ColorLength => ColorConfig.Default.Count;
  46. //public static IReadOnlyCollection<ColorInfo> Colors => ColorConfig.Default.Colors;
  47. //public static void ResetColor()
  48. //{
  49. // ColorConfig.Default.Reset();
  50. // foreach (var id in ChannelId.GetValues<ChannelId>())
  51. // {
  52. // if (DsoModel.Default.TryGetChannel(id, out var cm))
  53. // {
  54. // cm.DrawColor = ColorConfig.Default[id.ToString()];
  55. // }
  56. // }
  57. //}
  58. }
  59. }