123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- using FISLib;
- using FISLib.AfterSales;
- using FISLib.Connect;
- using FISLib.Hardware;
- using FISLib.LiveVideo;
- using FISLib.Remedical;
- using FISLib.Test;
- using FISLib.Upgrade;
- using FISLib.Vid;
- using System;
- using System.Reflection;
- using System.Windows;
- using Vinno.FIS.Sonopost.Common;
- using Vinno.FIS.Sonopost.Managers.Interfaces;
- using Vinno.FIS.Sonopost.Settings;
- using Vinno.IUS.Common.Log;
- using Vinno.vCloud.FIS.CrossPlatform.Windows;
- using Vinno.vCloud.FIS.CrossPlatform.Windows.Hardware;
- namespace Vinno.FIS.Sonopost.Managers
- {
- internal class FISManager : SonopostManager, IFISManager
- {
- private UltrasoundMachineInfo _ultrasoundMachineInfo;
- public UltrasoundMachineInfo UltrasoundMachineInfo
- {
- get => _ultrasoundMachineInfo;
- }
- public IHardwareService FISHardwareService
- {
- get => FISIMPL.FISIMPL.GetService<IHardwareService>();
- }
- public ITestService FISTestService
- {
- get => FISIMPL.FISIMPL.GetService<ITestService>();
- }
- public IConnectionService FISConnectionService
- {
- get => FISIMPL.FISIMPL.GetService<IConnectionService>();
- }
- public IRemedicalService FISRemedicalService
- {
- get => FISIMPL.FISIMPL.GetService<IRemedicalService>();
- }
- public ILiveVideoService FISLiveVideoService
- {
- get => FISIMPL.FISIMPL.GetService<ILiveVideoService>();
- }
- public IUpgraderService FISUpgraderService
- {
- get => FISIMPL.FISIMPL.GetService<IUpgraderService>();
- }
- public IAfterSalesService FISAfterSalesService
- {
- get => FISIMPL.FISIMPL.GetService<IAfterSalesService>();
- }
- public IVidService FISVidService
- {
- get => FISIMPL.FISIMPL.GetService<IVidService>();
- }
- public FISManager()
- {
- FISWin.Initialize(SonopostConstants.DataFolder);
- var machineId = CpuInfo.MachineId;
- var cpuName = CpuInfo.CPUName;
- var currentVersion = Assembly.GetExecutingAssembly()?.GetName()?.Version.ToString();
- #if DEBUG
- currentVersion = "1.7.54.26288";
- machineId = "Test-" + machineId;
- #endif
- var modelType = SonopostSystemSettings.Instance.ModelType;
- if (string.IsNullOrWhiteSpace(modelType))
- {
- Logger.WriteLineWarn($"Model Type is Null From Setting File,Will Use SP-0002 Instead.");
- modelType = "SP-0002";
- }
- _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");
- FISIMPL.FISIMPL.SetUltrasoundMachineInfo(_ultrasoundMachineInfo);
- FISIMPL.FISIMPL.Start(machineId, FISPlatform.Windows, false);
- }
- public override void DoDispose()
- {
- try
- {
- FISIMPL.FISIMPL.Stop();
- }
- catch (Exception ex)
- {
- Logger.WriteLineError($"FISManager DoDispose Error:{ex}");
- }
- base.DoDispose();
- }
- }
- }
|