FISManager.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. using FISLib;
  2. using FISLib.AfterSales;
  3. using FISLib.Connect;
  4. using FISLib.Hardware;
  5. using FISLib.LiveVideo;
  6. using FISLib.Remedical;
  7. using FISLib.Test;
  8. using FISLib.Upgrade;
  9. using FISLib.Vid;
  10. using System;
  11. using System.Reflection;
  12. using System.Windows;
  13. using Vinno.FIS.Sonopost.Common;
  14. using Vinno.FIS.Sonopost.Managers.Interfaces;
  15. using Vinno.FIS.Sonopost.Settings;
  16. using Vinno.IUS.Common.Log;
  17. using Vinno.vCloud.FIS.CrossPlatform.Windows;
  18. using Vinno.vCloud.FIS.CrossPlatform.Windows.Hardware;
  19. namespace Vinno.FIS.Sonopost.Managers
  20. {
  21. internal class FISManager : SonopostManager, IFISManager
  22. {
  23. private UltrasoundMachineInfo _ultrasoundMachineInfo;
  24. public UltrasoundMachineInfo UltrasoundMachineInfo
  25. {
  26. get => _ultrasoundMachineInfo;
  27. }
  28. public IHardwareService FISHardwareService
  29. {
  30. get => FISIMPL.FISIMPL.GetService<IHardwareService>();
  31. }
  32. public ITestService FISTestService
  33. {
  34. get => FISIMPL.FISIMPL.GetService<ITestService>();
  35. }
  36. public IConnectionService FISConnectionService
  37. {
  38. get => FISIMPL.FISIMPL.GetService<IConnectionService>();
  39. }
  40. public IRemedicalService FISRemedicalService
  41. {
  42. get => FISIMPL.FISIMPL.GetService<IRemedicalService>();
  43. }
  44. public ILiveVideoService FISLiveVideoService
  45. {
  46. get => FISIMPL.FISIMPL.GetService<ILiveVideoService>();
  47. }
  48. public IUpgraderService FISUpgraderService
  49. {
  50. get => FISIMPL.FISIMPL.GetService<IUpgraderService>();
  51. }
  52. public IAfterSalesService FISAfterSalesService
  53. {
  54. get => FISIMPL.FISIMPL.GetService<IAfterSalesService>();
  55. }
  56. public IVidService FISVidService
  57. {
  58. get => FISIMPL.FISIMPL.GetService<IVidService>();
  59. }
  60. public FISManager()
  61. {
  62. FISWin.Initialize(SonopostConstants.DataFolder);
  63. var machineId = CpuInfo.MachineId;
  64. var cpuName = CpuInfo.CPUName;
  65. var currentVersion = Assembly.GetExecutingAssembly()?.GetName()?.Version.ToString();
  66. #if DEBUG
  67. currentVersion = "1.7.54.26288";
  68. machineId = "Test-" + machineId;
  69. #endif
  70. var modelType = SonopostSystemSettings.Instance.ModelType;
  71. if (string.IsNullOrWhiteSpace(modelType))
  72. {
  73. Logger.WriteLineWarn($"Model Type is Null From Setting File,Will Use SP-0002 Instead.");
  74. modelType = "SP-0002";
  75. }
  76. _ultrasoundMachineInfo = new UltrasoundMachineInfo("", "", true, string.Empty, modelType, currentVersion, "1.0.0.0", cpuName, (int)SystemParameters.PrimaryScreenWidth, (int)SystemParameters.PrimaryScreenHeight, SonopostConstants.DataFolder, SonopostConstants.DataFolder, FISLoginSourceV2.PC, FISPlatform.Windows, false, "", "", "sonopost");
  77. FISIMPL.FISIMPL.SetUltrasoundMachineInfo(_ultrasoundMachineInfo);
  78. FISIMPL.FISIMPL.Start(machineId, FISPlatform.Windows, false);
  79. }
  80. public override void DoDispose()
  81. {
  82. try
  83. {
  84. FISIMPL.FISIMPL.Stop();
  85. }
  86. catch (Exception ex)
  87. {
  88. Logger.WriteLineError($"FISManager DoDispose Error:{ex}");
  89. }
  90. base.DoDispose();
  91. }
  92. }
  93. }