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(); } public ITestService FISTestService { get => FISIMPL.FISIMPL.GetService(); } public IConnectionService FISConnectionService { get => FISIMPL.FISIMPL.GetService(); } public IRemedicalService FISRemedicalService { get => FISIMPL.FISIMPL.GetService(); } public ILiveVideoService FISLiveVideoService { get => FISIMPL.FISIMPL.GetService(); } public IUpgraderService FISUpgraderService { get => FISIMPL.FISIMPL.GetService(); } public IAfterSalesService FISAfterSalesService { get => FISIMPL.FISIMPL.GetService(); } public IVidService FISVidService { get => FISIMPL.FISIMPL.GetService(); } 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(); } } }