From 09b1dd03e5d67453e673789fe0826e7a25d881ab Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Thu, 24 Sep 2020 22:28:15 +0300 Subject: Allow null user on jobs. Dropped use of any user on PPC. --- .../PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs | 67 ++++++++++++---------- .../PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs | 8 ++- 2 files changed, 44 insertions(+), 31 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs index e280d5f9d..38dd569e1 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs @@ -74,39 +74,46 @@ namespace Tango.PPC.UI.ViewModels /// public async override void OnApplicationStarted() { - using (ObservablesContext db = ObservablesContext.CreateDefault()) - { - var machine = await db.Machines.FirstAsync(); + //We don't use authentication! - if (db.Users.Count() == 1 || machine.AutoLogin) - { - var user = await new UserBuilder(db).SetFirst().WithRolesAndPermissions().BuildAsync(); + //using (ObservablesContext db = ObservablesContext.CreateDefault()) + //{ + // var machine = await db.Machines.FirstAsync(); - if (!user.HasRole(Roles.PPCUser)) - { - var role = db.Roles.Single(x => x.Code == (int)Roles.PPCUser); - user.Roles.Add(role); - db.UsersRoles.Add(new BL.Entities.UsersRole() - { - User = user, - Role = role, - }); - await db.SaveChangesAsync(); - } + // if (db.Users.Count() == 1 || machine.AutoLogin) + // { + // var user = await new UserBuilder(db).SetFirst().WithRolesAndPermissions().BuildAsync(); - LogManager.Log($"Application started. Single user/Auto login detected ({user.Email}). Skipping LoginView..."); - await AuthenticationProvider.Login(user.Email, user.Password, false); - await Task.Delay(1000); - IsLoading = false; - } - else - { - LogManager.Log("Application started. Navigating to LoginView..."); - await NavigationManager.NavigateTo(NavigationView.LoginView); - await Task.Delay(1000); - IsLoading = false; - } - } + // if (!user.HasRole(Roles.PPCUser)) + // { + // var role = db.Roles.Single(x => x.Code == (int)Roles.PPCUser); + // user.Roles.Add(role); + // db.UsersRoles.Add(new BL.Entities.UsersRole() + // { + // User = user, + // Role = role, + // }); + // await db.SaveChangesAsync(); + // } + + // LogManager.Log($"Application started. Single user/Auto login detected ({user.Email}). Skipping LoginView..."); + // await AuthenticationProvider.Login(user.Email, user.Password, false); + // await Task.Delay(1000); + // IsLoading = false; + // } + // else + // { + // LogManager.Log("Application started. Navigating to LoginView..."); + // await NavigationManager.NavigateTo(NavigationView.LoginView); + // await Task.Delay(1000); + // IsLoading = false; + // } + //} + + LogManager.Log($"Application started with no authentication mode..."); + await AuthenticationProvider.Login(); + await Task.Delay(1000); + IsLoading = false; } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs index aa9689ef3..ec316989f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs @@ -92,7 +92,13 @@ namespace Tango.PPC.UI.ViewModels await Task.Delay(500); - if (AuthenticationProvider.CurrentUser != null && AuthenticationProvider.CurrentUser.HasPermission(Permissions.RunPPC)) + if (!AuthenticationProvider.AuthenticationRequired) + { + LogManager.Log("Application is ready! Navigating to home module..."); + await NavigationManager.NavigateTo(NavigationView.HomeModule); + IsLoading = false; + } + else if (AuthenticationProvider.CurrentUser != null && AuthenticationProvider.CurrentUser.HasPermission(Permissions.RunPPC)) { LogManager.Log("Application is ready! Navigating to home module..."); await NavigationManager.NavigateTo(NavigationView.HomeModule); -- cgit v1.3.1 From 17a624c8ddacc1dac4904793645d6c893f7ced77 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Thu, 24 Sep 2020 23:20:25 +0300 Subject: Changed all PPC updated to based on GUID ! --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 22675456 -> 22675456 bytes .../MachineSetup/MachineSetupManager.cs | 1 - .../MachineUpdate/IMachineUpdateManager.cs | 13 +++--- .../MachineUpdate/MachineUpdateManager.cs | 47 +++++++++------------ .../DefaultMachineDataSynchronizer.cs | 2 +- .../Tango.PPC.Common/Web/CheckForUpdateRequest.cs | 1 - .../Tango.PPC.Common/Web/DownloadUpdateRequest.cs | 2 +- .../PPC/Tango.PPC.Common/Web/LoginRequest.cs | 1 + .../Tango.PPC.Common/Web/MachineSetupRequest.cs | 1 - .../PPC/Tango.PPC.Common/Web/UpdateDBRequest.cs | 1 - .../Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs | 6 +-- .../Configurations/ProvisionMachine.xml | Bin 88354 -> 76348 bytes .../SQLExaminer/Configurations/UpdateMachine.xml | Bin 55424 -> 72920 bytes .../Controllers/PPCController.cs | 10 +++-- 15 files changed, 39 insertions(+), 46 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index f8c0132fb..aeb06fad3 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index 5cc378c9f..52724650c 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs index a2a750805..15902f629 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs @@ -247,7 +247,6 @@ namespace Tango.PPC.Common.MachineSetup } MachineSetupRequest request = new MachineSetupRequest(); - request.SerialNumber = serialNumber; request.DeviceID = await _windows_manager.GetDeviceId(); request.DeviceName = deviceName; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/IMachineUpdateManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/IMachineUpdateManager.cs index 3e3fbcc27..77646da40 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/IMachineUpdateManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/IMachineUpdateManager.cs @@ -38,9 +38,8 @@ namespace Tango.PPC.Common.MachineUpdate event EventHandler Progress; /// - /// Performs a machine update using the specified serial number and machine service address. + /// Performs a machine update. /// - /// The serial number. /// if set to true updates the embedded device firmware. /// if set to true updates the embedded device FPGA version and other parameters. /// @@ -61,24 +60,22 @@ namespace Tango.PPC.Common.MachineUpdate Task UpdateFromTFP(String fileName); /// - /// Checks if any update are available for the specified machine serial number. + /// Checks if any update are available. /// - /// The serial number. /// - Task CheckForUpdate(String serialNumber); + Task CheckForUpdate(); /// /// Checks whether it is necessary to updates all the "overwrite-able" database tables. /// - /// The serial number. /// - Task UpdateDBCheck(String serialNumber); + Task UpdateDBCheck(); /// /// Updates all the "overwrite-able" database tables. /// /// - Task UpdateDB(DbCompareResult dbCompareResult, String serialNumber); + Task UpdateDB(DbCompareResult dbCompareResult); /// /// Gets the update package file information. diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs index 4f8be0a6e..9b4462a70 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs @@ -148,12 +148,12 @@ namespace Tango.PPC.Common.MachineUpdate #region Private Methods - private Task Login(String serialNumber) + private Task Login(String machineGuid) { return _client.Login(new LoginRequest() { Mode = LoginMode.Machine, - SerialNumber = serialNumber, + MachineGuid = machineGuid, }); } @@ -609,9 +609,8 @@ namespace Tango.PPC.Common.MachineUpdate #region Public Methods /// - /// Performs a machine update using the specified serial number and machine service address. + /// Performs a machine update. /// - /// The serial number. /// if set to true updates the embedded device firmware. /// if set to true updates the embedded device FPGA version and other parameters. /// @@ -638,7 +637,7 @@ namespace Tango.PPC.Common.MachineUpdate var _newPackageTempFolder = TemporaryManager.CreateFolder(); _newPackageTempFolder.Persist = true; - String serialNumber = _machineProvider.Machine.SerialNumber; + String machineGuid = _machineProvider.Machine.Guid; try { @@ -646,7 +645,7 @@ namespace Tango.PPC.Common.MachineUpdate var machineServiceAddress = _settings.GetMachineServiceAddress(); - LogManager.Log($"Starting machine update for serial number {serialNumber}..."); + LogManager.Log($"Starting machine update..."); //Connecting to machine... LogManager.Log("Verifying machine connection and state..."); @@ -677,10 +676,9 @@ namespace Tango.PPC.Common.MachineUpdate LogManager.Log($"Connecting to machine service on {machineServiceAddress}..."); - await Login(serialNumber); + await Login(machineGuid); DownloadUpdateRequest request = new DownloadUpdateRequest(); - request.SerialNumber = serialNumber; update_response = await _client.MachineUpdate(request); @@ -804,7 +802,7 @@ namespace Tango.PPC.Common.MachineUpdate Path.Combine(_newPackageTempFolder, "Update Scripts"), update_response.DataSource, localDataSource, - serialNumber); + machineGuid); runner.Log += (x, msg) => { @@ -894,12 +892,11 @@ namespace Tango.PPC.Common.MachineUpdate } /// - /// Checks if any update are available for the specified machine serial number. + /// Checks if any update are available for the specified machine. /// - /// The serial number. /// The machine service address. /// - public Task CheckForUpdate(string serialNumber) + public Task CheckForUpdate() { return Task.Factory.StartNew(() => { @@ -909,12 +906,13 @@ namespace Tango.PPC.Common.MachineUpdate LogManager.Log($"Connecting to machine service on {machineServiceAddress}..."); - Login(serialNumber).GetAwaiter().GetResult(); + String machineGuid = _machineProvider.Machine.Guid; + + Login(machineGuid).GetAwaiter().GetResult(); LogManager.Log($"Checking if updates available..."); CheckForUpdateRequest request = new CheckForUpdateRequest(); - request.SerialNumber = serialNumber; request.Version = _app_manager.Version.ToString(); request.FirmwareVersion = _app_manager.FirmwareVersion?.ToString(); @@ -950,10 +948,9 @@ namespace Tango.PPC.Common.MachineUpdate /// /// Updates all the "overwrite-able" database tables. /// - /// The serial number. /// The machine service address. /// - public Task UpdateDB(DbCompareResult dbCompareResult, String serialNumber) + public Task UpdateDB(DbCompareResult dbCompareResult) { _updateStartDate = DateTime.UtcNow; _logs.Clear(); @@ -1034,7 +1031,7 @@ namespace Tango.PPC.Common.MachineUpdate if (item.RequiresSerialNumber) { - builder.SetMachineSerialNumber(serialNumber); + builder.SetMachineSerialNumber(_machineProvider.Machine.Guid); } builder.Synchronize(); @@ -1081,16 +1078,15 @@ namespace Tango.PPC.Common.MachineUpdate /// /// Checks whether it is necessary to updates all the "overwrite-able" database tables. /// - /// The serial number. /// The machine service address. /// - public Task UpdateDBCheck(string serialNumber) + public Task UpdateDBCheck() { return Task.Factory.StartNew(() => { var machineServiceAddress = _settings.GetMachineServiceAddress(); - LogManager.Log($"Checking if database update is required for serial number {serialNumber}..."); + LogManager.Log($"Checking if database update is required..."); LogManager.Log("Looking for update scripts configuration on application path..."); @@ -1103,10 +1099,9 @@ namespace Tango.PPC.Common.MachineUpdate LogManager.Log($"Connecting to machine service on {machineServiceAddress}..."); - Login(serialNumber).Wait(); + Login(_machineProvider.Machine.Guid).Wait(); UpdateDBRequest request = new UpdateDBRequest(); - request.SerialNumber = serialNumber; request.ApplicationVersion = _app_manager.Version.ToString(); request.FirmwareVersion = _app_manager.FirmwareVersion.ToString(); @@ -1137,7 +1132,7 @@ namespace Tango.PPC.Common.MachineUpdate if (item.RequiresSerialNumber) { - builder.SetMachineSerialNumber(serialNumber); + builder.SetMachineSerialNumber(_machineProvider.Machine.Guid); } var config = builder.Build(); @@ -1227,7 +1222,7 @@ namespace Tango.PPC.Common.MachineUpdate { _isUpdating = true; - LogManager.Log($"Starting machine update for serial number {serialNumber}..."); + LogManager.Log($"Starting machine update (TUP) for serial number {serialNumber}..."); //Connecting to machine... LogManager.Log("Verifying machine connection and state..."); @@ -1368,7 +1363,7 @@ namespace Tango.PPC.Common.MachineUpdate Path.Combine(_newPackageTempFolder, "Update Scripts"), tempDbDataSource, localDataSource, - serialNumber); + _machineProvider.Machine.Guid); runner.Log += (x, msg) => { @@ -1661,7 +1656,7 @@ namespace Tango.PPC.Common.MachineUpdate try { - var response = await CheckForUpdate(_machineProvider.Machine.SerialNumber); + var response = await CheckForUpdate(); if (response.IsUpdateAvailable || response.IsDatabaseUpdateAvailable) { LogManager.Log($"New {(response.IsDatabaseUpdateAvailable ? "database updates" : "application version")} detected ({response.Version}). Raising event..."); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Synchronization/DefaultMachineDataSynchronizer.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Synchronization/DefaultMachineDataSynchronizer.cs index ab1f8e890..645ddbdf5 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Synchronization/DefaultMachineDataSynchronizer.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Synchronization/DefaultMachineDataSynchronizer.cs @@ -452,7 +452,7 @@ namespace Tango.PPC.Common.Synchronization await this.client.Login(new LoginRequest() { Mode = LoginMode.Machine, - SerialNumber = _machineProvider.Machine.SerialNumber, + MachineGuid = _machineProvider.Machine.Guid, }); } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateRequest.cs index a93b30a59..8e13ea7c4 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateRequest.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateRequest.cs @@ -9,7 +9,6 @@ namespace Tango.PPC.Common.Web { public class CheckForUpdateRequest : WebRequestMessage { - public String SerialNumber { get; set; } public String Version { get; set; } public String FirmwareVersion { get; set; } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/DownloadUpdateRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/DownloadUpdateRequest.cs index a32d3d497..db4080dff 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/DownloadUpdateRequest.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/DownloadUpdateRequest.cs @@ -9,6 +9,6 @@ namespace Tango.PPC.Common.Web { public class DownloadUpdateRequest : WebRequestMessage { - public String SerialNumber { get; set; } + } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/LoginRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/LoginRequest.cs index f8588f6b0..9ae0d65ae 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/LoginRequest.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/LoginRequest.cs @@ -11,6 +11,7 @@ namespace Tango.PPC.Common.Web { public LoginMode Mode { get; set; } public String SerialNumber { get; set; } + public String MachineGuid { get; set; } public String Email { get; set; } public String Password { get; set; } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/MachineSetupRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/MachineSetupRequest.cs index 821828a48..a9e68df36 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/MachineSetupRequest.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/MachineSetupRequest.cs @@ -9,7 +9,6 @@ namespace Tango.PPC.Common.Web { public class MachineSetupRequest : WebRequestMessage { - public String SerialNumber { get; set; } public String DeviceID { get; set; } public String DeviceName { get; set; } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UpdateDBRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UpdateDBRequest.cs index c78f6199e..4d8433a56 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UpdateDBRequest.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UpdateDBRequest.cs @@ -9,7 +9,6 @@ namespace Tango.PPC.Common.Web { public class UpdateDBRequest : WebRequestMessage { - public String SerialNumber { get; set; } public String ApplicationVersion { get; set; } public String FirmwareVersion { get; set; } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs index d4d78dac6..23ec956a0 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs @@ -167,7 +167,7 @@ namespace Tango.PPC.UI.ViewModels return; } - var response = await MachineUpdateManager.CheckForUpdate(MachineProvider.Machine.SerialNumber); + var response = await MachineUpdateManager.CheckForUpdate(); try { @@ -208,7 +208,7 @@ namespace Tango.PPC.UI.ViewModels } else { - _db_compare_result = await MachineUpdateManager.UpdateDBCheck(MachineProvider.Machine.SerialNumber); + _db_compare_result = await MachineUpdateManager.UpdateDBCheck(); if (_db_compare_result.RequiresUpdate) { @@ -261,7 +261,7 @@ namespace Tango.PPC.UI.ViewModels try { - await MachineUpdateManager.UpdateDB(_db_compare_result, MachineProvider.Machine.SerialNumber); + await MachineUpdateManager.UpdateDB(_db_compare_result); LogManager.Log("Database update completed."); await NavigateTo(MachineUpdateView.UpdateCompletedView); } diff --git a/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/ProvisionMachine.xml b/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/ProvisionMachine.xml index 8f60372b0..f3b845010 100644 Binary files a/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/ProvisionMachine.xml and b/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/ProvisionMachine.xml differ diff --git a/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/UpdateMachine.xml b/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/UpdateMachine.xml index 540b4cad9..260448394 100644 Binary files a/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/UpdateMachine.xml and b/Software/Visual_Studio/Tango.SQLExaminer/SQLExaminer/Configurations/UpdateMachine.xml differ diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs index 4215cd175..601438d67 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs +++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs @@ -390,7 +390,11 @@ namespace Tango.MachineService.Controllers if (hasDatabaseUpdates) { response.IsDatabaseUpdateAvailable = true; - response.UpdateDBResponse = UpdateDB(new UpdateDBRequest() { SerialNumber = request.SerialNumber }); + response.UpdateDBResponse = UpdateDB(new UpdateDBRequest() + { + ApplicationVersion = request.Version, + FirmwareVersion = request.FirmwareVersion + }); } //Compare database @@ -937,11 +941,11 @@ namespace Tango.MachineService.Controllers } else if (request.Mode == LoginMode.Machine) { - var machine = db.Machines.SingleOrDefault(x => x.SerialNumber == request.SerialNumber); + var machine = db.Machines.SingleOrDefault(x => x.SerialNumber == request.SerialNumber || x.Guid == request.MachineGuid); if (machine == null) { - throw new AuthenticationException("Invalid serial number."); + throw new AuthenticationException("Invalid machine serial number or id."); } response.AccessToken = WebToken.CreateNew(MachineServiceConfig.JWT_TOKEN_SECRET, new TokenObject() -- cgit v1.3.1 From 9c59f5be697bd0a1a7992239a3701dd7670747ec Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Tue, 13 Oct 2020 08:20:23 +0300 Subject: Implemented ink waste cartridge filling emptying progress. --- Software/PMR/Messages/IFS/CartridgeState.proto | 28 ++-- .../PPC/Tango.PPC.Common/Images/cl-full.png | Bin 0 -> 3454 bytes .../PPC/Tango.PPC.Common/Images/lubricant2.png | Bin 0 -> 194234 bytes .../PPC/Tango.PPC.Common/Resources/Colors.xaml | 11 ++ .../PPC/Tango.PPC.Common/Tango.PPC.Common.csproj | 6 +- .../PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | 130 +++++++++++++++ .../PPC/Tango.PPC.UI/Views/LayoutView.xaml | 15 ++ .../Tango.Emulations/Emulators/MachineEmulator.cs | 10 +- .../Operation/IMachineOperator.cs | 16 ++ .../Operation/InkFillingStatusChangedEventArgs.cs | 14 ++ .../Tango.Integration/Operation/MachineOperator.cs | 175 +++++++++++++++++++++ .../Tango.Integration/Tango.Integration.csproj | 3 +- .../Visual_Studio/Tango.PMR/IFS/CartridgeState.cs | 58 ++++--- 13 files changed, 427 insertions(+), 39 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Images/cl-full.png create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Images/lubricant2.png create mode 100644 Software/Visual_Studio/Tango.Integration/Operation/InkFillingStatusChangedEventArgs.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels') diff --git a/Software/PMR/Messages/IFS/CartridgeState.proto b/Software/PMR/Messages/IFS/CartridgeState.proto index 72cddce67..b256f66b1 100644 --- a/Software/PMR/Messages/IFS/CartridgeState.proto +++ b/Software/PMR/Messages/IFS/CartridgeState.proto @@ -5,15 +5,25 @@ option java_package = "com.twine.tango.pmr.ifs"; enum CartridgeState { + //OT = One Trigger, meaning, the state should be sent once, then return to a none OT state. + + //States + None = 0; //Unspecified. Absent = 1; //Waste or ink cartridge not found. - Exists = 2; //Waste or ink cartridge exists. - Inserted = 3; //Waste or ink cartridge inserted. - Filling = 4; //Ink cartridge is now filling... - FillingCompleted = 5; //Ink cartridge filing completed. - Emptying = 6; //Waste cartridge is emptying... - EmptyingCompleted = 7; //Waste cartridge emptying completed. - Empty = 8; //Waste or ink cartridge is empty. - Full = 9; //Waste or ink cartridge is full. - Error = 10; //Error occurred while filling or emptying. + Present = 2; //Waste or ink cartridge present. + Inserted = 3; //Waste or ink cartridge inserted. | OT + Empty = 4; //Waste or ink cartridge is empty. + Full = 5; //Waste or ink cartridge is full. + Error = 6; //Waste or ink is in an error state. (unrelated to filling or emptying) + + //Progress + + Filling = 10; //Ink cartridge is now filling... + FillingCompleted = 11; //Ink cartridge filing completed. | OT + FillingFailed = 12; //Error occurred while ink filling. | OT + + Emptying = 20; //Waste cartridge is emptying... + EmptyingCompleted = 21; //Waste cartridge emptying completed. | OT + EmpyingFailed = 22; //Error occurred while waste emptying. | OT } \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Images/cl-full.png b/Software/Visual_Studio/PPC/Tango.PPC.Common/Images/cl-full.png new file mode 100644 index 000000000..5aaea8e6c Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Images/cl-full.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Images/lubricant2.png b/Software/Visual_Studio/PPC/Tango.PPC.Common/Images/lubricant2.png new file mode 100644 index 000000000..554c16305 Binary files /dev/null and b/Software/Visual_Studio/PPC/Tango.PPC.Common/Images/lubricant2.png differ diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Colors.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Colors.xaml index 03f4b6f36..5fdbcf5f8 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Colors.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Colors.xaml @@ -2,6 +2,17 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Tango.PPC.Common.Resources"> + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj index 87b322f04..2e0c6843e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj @@ -479,6 +479,10 @@ + + + + @@ -489,7 +493,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs index 2bb4e9286..65df72878 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -3,11 +3,16 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media; using System.Windows.Threading; +using Tango.Core; using Tango.Core.Commands; using Tango.Core.DI; using Tango.Integration.Operation; +using Tango.PMR.IFS; using Tango.PPC.Common; +using Tango.PPC.Common.Connection; using Tango.PPC.Common.Modules; using Tango.PPC.Common.Navigation; using Tango.PPC.UI.Views; @@ -31,6 +36,86 @@ namespace Tango.PPC.UI.ViewModels [TangoInject] public IPPCModuleLoader ModuleLoader { get; set; } + #region Classes + + public class CartridgeModel : ExtendedObject + { + private IMachineProvider _machineProvider; + + public CartridgeStatus Status { get; set; } + + public bool InProgress + { + get { return Status.State == CartridgeState.Filling || Status.State == CartridgeState.Emptying; } + } + + public String Message + { + get { return Status.Cartridge.Slot == PMR.Diagnostics.CartridgeSlot.Ink ? "Ink filling is in progress..." : "Waste emptying is in progress..."; } + } + + public Brush Brush + { + get + { + if (Status.Cartridge.Slot == PMR.Diagnostics.CartridgeSlot.Ink) + { + try + { + int index = Status.Cartridge.Index; + + var idsPack = _machineProvider.Machine.Configuration.IdsPacks.FirstOrDefault(x => x.PackIndex == index); + + if (idsPack != null) + { + switch (idsPack.LiquidType.Type) + { + case BL.Enumerations.LiquidTypes.Cyan: + return Application.Current.Resources["TangoCyanInkBrush"] as Brush; + case BL.Enumerations.LiquidTypes.Magenta: + return Application.Current.Resources["TangoMagentaInkBrush"] as Brush; + case BL.Enumerations.LiquidTypes.Yellow: + return Application.Current.Resources["TangoYellowInkBrush"] as Brush; + case BL.Enumerations.LiquidTypes.Black: + return Application.Current.Resources["TangoBlackInkBrush"] as Brush; + case BL.Enumerations.LiquidTypes.Lubricant: + return Application.Current.Resources["TangoLubricantBrush"] as Brush; + case BL.Enumerations.LiquidTypes.Cleaner: + return Application.Current.Resources["TangoCleanerBrush"] as Brush; + case BL.Enumerations.LiquidTypes.TransparentInk: + return Application.Current.Resources["TangoTransparentInkBrush"] as Brush; + } + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error generating ink filling brush."); + } + + return Application.Current.Resources["TangoPrimaryAccentBrush"] as Brush; + } + else + { + return Application.Current.Resources["TangoWasteBrush"] as Brush; + } + } + } + + public CartridgeModel(IMachineProvider machineProvider) + { + _machineProvider = machineProvider; + Status = new CartridgeStatus(); + } + + public void Invalidate() + { + RaisePropertyChanged(nameof(InProgress)); + RaisePropertyChanged(nameof(Status)); + } + } + + #endregion + #region Properties private bool _isMenuOpened; @@ -74,6 +159,23 @@ namespace Tango.PPC.UI.ViewModels set { _isPowerOpened = value; RaisePropertyChangedAuto(); } } + private bool _isInkFillingOrWasteEmptying; + /// + /// Gets or sets a value indicating whether ink filling or waste emptying is active. + /// + public bool IsInkFillingOrWasteEmptying + { + get { return _isInkFillingOrWasteEmptying; } + set { _isInkFillingOrWasteEmptying = value; RaisePropertyChangedAuto(); } + } + + private List _cartridges; + public List Cartridges + { + get { return _cartridges; } + set { _cartridges = value; RaisePropertyChangedAuto(); } + } + #endregion #region Commands @@ -312,6 +414,34 @@ namespace Tango.PPC.UI.ViewModels { base.OnApplicationStarted(); MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted; + MachineProvider.MachineOperator.InkFillingStatusChanged += MachineOperator_InkFillingStatusChanged; + } + + private void MachineOperator_InkFillingStatusChanged(object sender, InkFillingStatusChangedEventArgs e) + { + if (Cartridges == null) + { + Cartridges = MachineProvider.MachineOperator.InkFillingStatus.CartridgesStatuses.Select(x => new CartridgeModel(MachineProvider) { Status = x }).ToList(); + } + else + { + foreach (var cartridgeStatus in e.Status.CartridgesStatuses) + { + var model = Cartridges.SingleOrDefault(x => x.Status == cartridgeStatus); + + if (model != null) + { + model.Status = cartridgeStatus; + } + } + } + + foreach (var cartridgeModel in Cartridges) + { + cartridgeModel.Invalidate(); + } + + IsInkFillingOrWasteEmptying = Cartridges.Any(x => x.Status.State == CartridgeState.Filling || x.Status.State == CartridgeState.Emptying); } /// diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml index d428b1aba..8b701156a 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml @@ -325,6 +325,21 @@ + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index 779e110e8..5276aba8d 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -240,20 +240,20 @@ namespace Tango.Emulations.Emulators Index = i, Slot = CartridgeSlot.Ink, }, - State = CartridgeState.Exists + State = CartridgeState.Present }); } InkFillingStatus.CartridgesStatuses.Add(new CartridgeStatus() { - Cartridge = new Cartridge() { Index = 0, Slot = CartridgeSlot.WasteLower }, - State = CartridgeState.Exists + Cartridge = new Cartridge() { Index = 0, Slot = CartridgeSlot.WasteMiddle }, + State = CartridgeState.Present }); InkFillingStatus.CartridgesStatuses.Add(new CartridgeStatus() { - Cartridge = new Cartridge() { Index = 1, Slot = CartridgeSlot.WasteMiddle }, - State = CartridgeState.Exists + Cartridge = new Cartridge() { Index = 1, Slot = CartridgeSlot.WasteLower }, + State = CartridgeState.Present }); } diff --git a/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs index 8bce840d9..9bd0932e9 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs @@ -25,6 +25,7 @@ using Tango.Integration.Emergency; using Tango.PMR.MachineStatus; using Tango.PMR.ThreadLoading; using Tango.PMR.Power; +using Tango.PMR.IFS; namespace Tango.Integration.Operation { @@ -80,6 +81,11 @@ namespace Tango.Integration.Operation /// StartThreadLoadingResponse ThreadLoadingStatus { get; } + /// + /// Gets the ink filling status. + /// + InkFillingStatus InkFillingStatus { get; } + /// /// Gets or sets the firmware upgrade mode. /// @@ -245,6 +251,11 @@ namespace Tango.Integration.Operation /// event EventHandler HeadCleaningEnded; + /// + /// Occurs when the ink filling status has changed. + /// + event EventHandler InkFillingStatusChanged; + /// /// Gets or sets a value indicating whether direct the embedded device to send diagnostics messages. /// @@ -280,6 +291,11 @@ namespace Tango.Integration.Operation /// bool EnablePowerUpSequence { get; set; } + /// + /// Gets or sets a value indicating whether to enable the ink/waste filling status channel. + /// + bool EnableInkFillingStatus { get; set; } + /// /// Gets the last process parameters table sent to the embedded device. /// diff --git a/Software/Visual_Studio/Tango.Integration/Operation/InkFillingStatusChangedEventArgs.cs b/Software/Visual_Studio/Tango.Integration/Operation/InkFillingStatusChangedEventArgs.cs new file mode 100644 index 000000000..e674dc777 --- /dev/null +++ b/Software/Visual_Studio/Tango.Integration/Operation/InkFillingStatusChangedEventArgs.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PMR.IFS; + +namespace Tango.Integration.Operation +{ + public class InkFillingStatusChangedEventArgs : EventArgs + { + public InkFillingStatus Status { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 85034f278..4978a90f3 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -44,6 +44,7 @@ using System.Globalization; using Tango.PMR.Power; using Tango.PMR.ThreadLoading; using Tango.BL.DTO; +using Tango.PMR.IFS; namespace Tango.Integration.Operation { @@ -70,6 +71,7 @@ namespace Tango.Integration.Operation private bool _eventsSent; private bool _debugSent; private bool _machineStatusSent; + private bool _inkFillingStatusSent; private bool _threadLoadingSent; private static RunningJobStatus _last_job_status; private bool _isPowerDownRequestInProgress; @@ -129,6 +131,7 @@ namespace Tango.Integration.Operation JobRunsLogger.Start(); EnableEventsNotification = true; EnableMachineStatusUpdates = true; + EnableInkFillingStatus = true; EnableJobResume = true; LogEmbeddedDebuggingToFile = true; FirmwareUpgradeMode = FirmwareUpgradeModes.DFU | FirmwareUpgradeModes.TFP_PACKAGE; @@ -137,6 +140,7 @@ namespace Tango.Integration.Operation EnableJobLiquidQuantityValidation = true; FailsWithAdapter = true; ContinuousRequestTimeout = TimeSpan.FromSeconds(2); + ResetInkFllingStatus(); } /// @@ -277,6 +281,11 @@ namespace Tango.Integration.Operation /// public event EventHandler HeadCleaningEnded; + /// + /// Occurs when the ink filling status has changed. + /// + public event EventHandler InkFillingStatusChanged; + #endregion #region Properties @@ -354,6 +363,16 @@ namespace Tango.Integration.Operation private set { _machineStatus = value; RaisePropertyChangedAuto(); } } + private InkFillingStatus _inkFillingStatus; + /// + /// Gets or sets the ink filling status. + /// + public InkFillingStatus InkFillingStatus + { + get { return _inkFillingStatus; } + private set { _inkFillingStatus = value; RaisePropertyChangedAuto(); } + } + private StartThreadLoadingResponse _threadLoadingStatus; /// /// Gets the current thread loading status. @@ -499,6 +518,21 @@ namespace Tango.Integration.Operation } } + private bool _enableInkFillingStatus; + public bool EnableInkFillingStatus + { + get { return _enableInkFillingStatus; } + set + { + if (_enableInkFillingStatus != value) + { + _enableInkFillingStatus = value; + RaisePropertyChangedAuto(); + OnEnableInkFillingStatus(value); + } + } + } + private bool _enableAutomaticThreadLoading; /// /// Gets or sets a value indicating whether to enable automatic thread loading support. @@ -815,6 +849,45 @@ namespace Tango.Integration.Operation } } + /// + /// Called when the enable ink filling status has been changed. + /// + /// if set to true [value]. + protected virtual void OnEnableInkFillingStatus(bool value) + { + if (value && State == TransportComponentState.Connected && !_inkFillingStatusSent) + { + var request = new StartInkFillingStatusRequest(); + + bool responseLogged = false; + _inkFillingStatusSent = true; + + SendContinuousRequest(request, new TransportContinuousRequestConfig() { ShouldLog = true }).ObserveOn(new NewThreadScheduler()).Subscribe( + (response) => + { + OnInkFillingStatusChanged(response); + + if (!responseLogged) + { + responseLogged = true; + } + }, + (ex) => + { + _inkFillingStatusSent = false; + }, + () => + { + _inkFillingStatusSent = false; + LogManager.Log("Ink filling status response completed!?", LogCategory.Warning); + }); + } + else if (_inkFillingStatusSent) + { + _inkFillingStatusSent = false; + } + } + /// /// Called when the enable automatic thread loading has been changed /// @@ -921,6 +994,60 @@ namespace Tango.Integration.Operation } } + /// + /// Called when ink filling status has been changed. + /// + /// The response. + protected virtual void OnInkFillingStatusChanged(StartInkFillingStatusResponse response) + { + if (response.Status == null || response.Status.CartridgesStatuses == null || response.Status.CartridgesStatuses.Count == 0) return; + + int index = -1; + bool raiseChange = false; + + foreach (var remoteCartridge in response.Status.CartridgesStatuses) + { + index++; + + if (remoteCartridge.Cartridge == null) + { + LogManager.Log($"Remote cartridge arrived with null cartridge at position [{index}] and will be ignored.", LogCategory.Error); + continue; + } + + var localCartridge = InkFillingStatus.CartridgesStatuses.SingleOrDefault(x => x.Cartridge.Index == remoteCartridge.Cartridge.Index && x.Cartridge.Slot == remoteCartridge.Cartridge.Slot); + + if (localCartridge != null) + { + if (localCartridge.State != remoteCartridge.State) + { + localCartridge.State = remoteCartridge.State; + LogManager.Log($"{localCartridge.Cartridge.Slot} Cartridge '{localCartridge.Cartridge.Index}' state changed: '{localCartridge.State}' => '{remoteCartridge.State}'."); + } + + if (remoteCartridge.Cartridge.Tag != null) + { + LogManager.Log($"{localCartridge.Cartridge.Slot} Cartridge '{localCartridge.Cartridge.Index}' Tag arrived:\n{remoteCartridge.Cartridge.Tag.ToJsonString()}"); + } + + localCartridge.Message = remoteCartridge.Message; + localCartridge.ProgressPercentage = remoteCartridge.ProgressPercentage; + + raiseChange = true; + } + else + { + LogManager.Log($"Could not locate local cartridge with slot '{remoteCartridge.Cartridge.Slot}' and index '{remoteCartridge.Cartridge.Index}'.", LogCategory.Error); + } + } + + if (raiseChange) + { + RaisePropertyChanged(nameof(InkFillingStatus)); + InkFillingStatusChanged?.Invoke(this, new InkFillingStatusChangedEventArgs() { Status = InkFillingStatus }); + } + } + /// /// Called when the machine state has been changed. /// @@ -1267,6 +1394,7 @@ namespace Tango.Integration.Operation } ResetEvents(); + ResetInkFllingStatus(); await base.Disconnect(); } @@ -1318,6 +1446,7 @@ namespace Tango.Integration.Operation OnEnableEventsNotification(EnableEventsNotification); OnEnableMachineStatusUpdatesChanged(EnableMachineStatusUpdates); OnEnableAutomaticThreadLoadingChanged(EnableAutomaticThreadLoading); + OnEnableInkFillingStatus(EnableInkFillingStatus); if (EnablePowerUpSequence) { @@ -1351,6 +1480,52 @@ namespace Tango.Integration.Operation #region Private Methods + private void ResetInkFllingStatus() + { + if (InkFillingStatus == null) + { + var status = new InkFillingStatus(); + + for (int i = 0; i < 8; i++) + { + status.CartridgesStatuses.Add(new CartridgeStatus() + { + Cartridge = new Cartridge() + { + Index = i, + Slot = CartridgeSlot.Ink, + }, + State = CartridgeState.Absent + }); + } + + status.CartridgesStatuses.Add(new CartridgeStatus() + { + Cartridge = new Cartridge() { Index = 0, Slot = CartridgeSlot.WasteMiddle }, + State = CartridgeState.Absent + }); + + status.CartridgesStatuses.Add(new CartridgeStatus() + { + Cartridge = new Cartridge() { Index = 1, Slot = CartridgeSlot.WasteLower }, + State = CartridgeState.Absent + }); + + InkFillingStatus = status; + } + else + { + foreach (var cartridge in InkFillingStatus.CartridgesStatuses) + { + cartridge.ProgressPercentage = 0; + cartridge.Message = String.Empty; + cartridge.State = CartridgeState.Absent; + } + } + + InkFillingStatusChanged?.Invoke(this, new InkFillingStatusChangedEventArgs() { Status = InkFillingStatus }); + } + private void SaveCachedJobOperation(Job job) { try diff --git a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj index 7efd29d0a..591cd282a 100644 --- a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj +++ b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj @@ -121,6 +121,7 @@ + @@ -220,7 +221,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.PMR/IFS/CartridgeState.cs b/Software/Visual_Studio/Tango.PMR/IFS/CartridgeState.cs index 815d7b370..6b2daa8f7 100644 --- a/Software/Visual_Studio/Tango.PMR/IFS/CartridgeState.cs +++ b/Software/Visual_Studio/Tango.PMR/IFS/CartridgeState.cs @@ -22,12 +22,13 @@ namespace Tango.PMR.IFS { static CartridgeStateReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "ChRDYXJ0cmlkZ2VTdGF0ZS5wcm90bxINVGFuZ28uUE1SLklGUyqoAQoOQ2Fy", - "dHJpZGdlU3RhdGUSCAoETm9uZRAAEgoKBkFic2VudBABEgoKBkV4aXN0cxAC", - "EgwKCEluc2VydGVkEAMSCwoHRmlsbGluZxAEEhQKEEZpbGxpbmdDb21wbGV0", - "ZWQQBRIMCghFbXB0eWluZxAGEhUKEUVtcHR5aW5nQ29tcGxldGVkEAcSCQoF", - "RW1wdHkQCBIICgRGdWxsEAkSCQoFRXJyb3IQCkIZChdjb20udHdpbmUudGFu", - "Z28ucG1yLmlmc2IGcHJvdG8z")); + "ChRDYXJ0cmlkZ2VTdGF0ZS5wcm90bxINVGFuZ28uUE1SLklGUyrPAQoOQ2Fy", + "dHJpZGdlU3RhdGUSCAoETm9uZRAAEgoKBkFic2VudBABEgsKB1ByZXNlbnQQ", + "AhIMCghJbnNlcnRlZBADEgkKBUVtcHR5EAQSCAoERnVsbBAFEgkKBUVycm9y", + "EAYSCwoHRmlsbGluZxAKEhQKEEZpbGxpbmdDb21wbGV0ZWQQCxIRCg1GaWxs", + "aW5nRmFpbGVkEAwSDAoIRW1wdHlpbmcQFBIVChFFbXB0eWluZ0NvbXBsZXRl", + "ZBAVEhEKDUVtcHlpbmdGYWlsZWQQFkIZChdjb20udHdpbmUudGFuZ28ucG1y", + "Lmlmc2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.IFS.CartridgeState), }, null)); @@ -36,6 +37,9 @@ namespace Tango.PMR.IFS { } #region Enums + /// + ///OT = One Trigger, meaning, the state should be sent once, then return to a none OT state. + /// public enum CartridgeState { /// ///Unspecified. @@ -46,41 +50,49 @@ namespace Tango.PMR.IFS { /// [pbr::OriginalName("Absent")] Absent = 1, /// - ///Waste or ink cartridge exists. + ///Waste or ink cartridge present. /// - [pbr::OriginalName("Exists")] Exists = 2, + [pbr::OriginalName("Present")] Present = 2, /// - ///Waste or ink cartridge inserted. + ///Waste or ink cartridge inserted. | OT /// [pbr::OriginalName("Inserted")] Inserted = 3, /// - ///Ink cartridge is now filling... + ///Waste or ink cartridge is empty. /// - [pbr::OriginalName("Filling")] Filling = 4, + [pbr::OriginalName("Empty")] Empty = 4, /// - ///Ink cartridge filing completed. + ///Waste or ink cartridge is full. /// - [pbr::OriginalName("FillingCompleted")] FillingCompleted = 5, + [pbr::OriginalName("Full")] Full = 5, /// - ///Waste cartridge is emptying... + ///Waste or ink is in an error state. (unrelated to filling or emptying) /// - [pbr::OriginalName("Emptying")] Emptying = 6, + [pbr::OriginalName("Error")] Error = 6, /// - ///Waste cartridge emptying completed. + ///Ink cartridge is now filling... /// - [pbr::OriginalName("EmptyingCompleted")] EmptyingCompleted = 7, + [pbr::OriginalName("Filling")] Filling = 10, /// - ///Waste or ink cartridge is empty. + ///Ink cartridge filing completed. | OT /// - [pbr::OriginalName("Empty")] Empty = 8, + [pbr::OriginalName("FillingCompleted")] FillingCompleted = 11, /// - ///Waste or ink cartridge is full. + ///Error occurred while ink filling. | OT + /// + [pbr::OriginalName("FillingFailed")] FillingFailed = 12, + /// + ///Waste cartridge is emptying... + /// + [pbr::OriginalName("Emptying")] Emptying = 20, + /// + ///Waste cartridge emptying completed. | OT /// - [pbr::OriginalName("Full")] Full = 9, + [pbr::OriginalName("EmptyingCompleted")] EmptyingCompleted = 21, /// - ///Error occurred while filling or emptying. + ///Error occurred while waste emptying. | OT /// - [pbr::OriginalName("Error")] Error = 10, + [pbr::OriginalName("EmpyingFailed")] EmpyingFailed = 22, } #endregion -- cgit v1.3.1