using Prism.Mvvm; using System; using TeamAAS_VP.Core.PLCs; using TeamAAS_VP.Core.Sfis; namespace TeamAAS_VP.Models { public class BgSfisConfig : BindableBase { private bool _IsEnabled; public bool IsEnabled { get { return _IsEnabled; } set { SetProperty(ref _IsEnabled, value); } } private bool _DryRun = true; public bool DryRun { get { return _DryRun; } set { SetProperty(ref _DryRun, value); } } public string ServiceUrl { get; set; } = string.Empty; public string SoapNamespace { get; set; } = "http://tempuri.org/"; public string ProgramId { get; set; } = string.Empty; public string ProgramPassword { get; set; } = string.Empty; public string Device { get; set; } = "780546"; public string OperatorId { get; set; } = string.Empty; public string OperatorPassword { get; set; } = string.Empty; public string TspName { get; set; } = "TeamAAS-VP"; private bool _PassEnabled = true; public bool PassEnabled { get { return _PassEnabled; } set { SetProperty(ref _PassEnabled, value); } } private bool _UploadEnabled; public bool UploadEnabled { get { return _UploadEnabled; } set { SetProperty(ref _UploadEnabled, value); } } public string PlcSfisPassSignalDevice { get; set; } = "M104"; public string PlcSfisUploadSignalDevice { get; set; } = "M105"; public string PlcSfisPassOkBitDevice { get; set; } = "M106"; public string PlcSfisPassNgBitDevice { get; set; } = "M107"; public string PlcSfisPassReceiveBitDevice { get; set; } = "M108"; public string PlcSfisUploadOkBitDevice { get; set; } = "M109"; public string PlcSfisUploadNgBitDevice { get; set; } = "M110"; public string PlcSfisUploadReceiveBitDevice { get; set; } = "M111"; public int CheckRouteType { get; set; } = 1; public string GetVersionType { get; set; } = "1"; public string GetVersionChkData { get; set; } public string GetVersionChkData2 { get; set; } public int ResultStatus { get; set; } = 1; public string InputDataPassType { get; set; } = "EF-MO_WEB"; public string InputDataAoiLocTag { get; set; } = "EF-AOILOC-0"; public int InputDataType { get; set; } = 1; public string DefaultMoNumber { get; set; } = string.Empty; public int TimeoutMs { get; set; } = 30000; public bool AutoLogin { get; set; } = true; public bool AutoLogoutOnExit { get; set; } = true; public SfisConfig ToSfisConfig() { return new SfisConfig { Enabled = IsEnabled, DryRun = DryRun, ServiceUrl = ServiceUrl ?? string.Empty, SoapNamespace = SoapNamespace ?? "http://tempuri.org/", ProgramId = ProgramId ?? string.Empty, ProgramPassword = ProgramPassword ?? string.Empty, Device = Device ?? string.Empty, OperatorId = OperatorId ?? string.Empty, OperatorPassword = OperatorPassword ?? string.Empty, TspName = TspName ?? "TeamAAS-VP", PassEnabled = PassEnabled, UploadEnabled = UploadEnabled, CheckRouteType = CheckRouteType, GetVersionType = GetVersionType ?? "1", GetVersionChkData = GetVersionChkData, GetVersionChkData2 = GetVersionChkData2, ResultStatus = ResultStatus, InputDataPassType = InputDataPassType ?? "EF-MO_WEB", InputDataAoiLocTag = InputDataAoiLocTag ?? "EF-AOILOC-0", InputDataType = InputDataType, DefaultMoNumber = DefaultMoNumber, TimeoutMs = TimeoutMs, AutoLogin = AutoLogin, AutoLogoutOnExit = AutoLogoutOnExit }; } public PlcSfisFeedback ToPlcSfisFeedback() { return new PlcSfisFeedback { PassOkBitDevice = PlcSfisPassOkBitDevice, PassNgBitDevice = PlcSfisPassNgBitDevice, PassReceiveBitDevice = PlcSfisPassReceiveBitDevice, UploadOkBitDevice = PlcSfisUploadOkBitDevice, UploadNgBitDevice = PlcSfisUploadNgBitDevice, UploadReceiveBitDevice = PlcSfisUploadReceiveBitDevice }; } } }