From 09c780fd78c43291f7298f854770fbb47d014f02 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 23 Aug 2018 14:50:40 +0300 Subject: improve (fix?) job abort handling --- Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Software') diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index 7b95c9c4d..fe34f5139 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -304,10 +304,10 @@ void JobAbortFunc(MessageContainer* requestContainer) SendChars((char*)container_buffer, container_size); abort_job_request__free_unpacked(request,NULL); //We keep the job request until it is done - if (CurrentJobRequest!= NULL) - job_request__free_unpacked(CurrentJobRequest,NULL); JobAbortedByUser = true; EndState(CurrentJob, "Job Aborted by user"); + if (CurrentJobRequest!= NULL) + job_request__free_unpacked(CurrentJobRequest,NULL); CurrentJob = NULL; CurrentJobRequest = NULL; -- cgit v1.3.1 From 4e81425d99f39b8edc10660d72566c6c1408810d Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 23 Aug 2018 14:52:22 +0300 Subject: changes on other computers --- Software/Embedded_SW/Embedded/.cproject | 2 +- .../Embedded/Communication/CommunicationTask.c | 10 +- .../Embedded_SW/Embedded/Drivers/FPGA/FPGA_Comm.h | 6 + .../Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c | 13 +- .../Embedded/Drivers/Flash_Memory/Flash_Memory.c | 101 +- .../Embedded/Drivers/Flash_Memory/Flash_Memory.h | 2 +- .../Drivers/I2C_Communication/DAC/Blower.h | 12 +- .../Embedded_SW/Embedded/Drivers/Motors/Motor.c | 9 +- .../Embedded_SW/Embedded/Drivers/Motors/Motor.h | 4 +- .../Embedded/Drivers/USB_Communication/USBCDCD.c | 12 +- Software/Embedded_SW/Embedded/Include.h | 2 + Software/Embedded_SW/Embedded/Main.c | 4 + .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 7 +- .../Modules/Diagnostics/DiagnosticActions.c | 154 + .../Embedded/Modules/Diagnostics/Diagnostics.h | 1 + .../Modules/Diagnostics/DiagnosticsHoming.c | 14 +- .../Modules/Diagnostics/DiagnosticsJogging.c | 55 +- .../Embedded_SW/Embedded/Modules/IDS/IDS_init.c | 2 + .../Modules/Stubs_Handler/Stub_Cartridge.c | 53 +- .../Modules/Stubs_Handler/Stub_Dispenser.c | 1 + .../Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c | 9 +- .../Modules/Stubs_Handler/Stub_SpeedSensor.c | 1 + .../Stubs Collection/stubs/Ext_Flash_RW_Buf.cs | 6 +- .../Build/Shortcuts/Machine Emulator.lnk | Bin 1455 -> 1471 bytes .../Build/Shortcuts/Machine Studio.lnk | Bin 1516 -> 1532 bytes .../Build/Shortcuts/Proto Compiler GUI.lnk | Bin 1448 -> 1464 bytes .../Installers/DB_PACK/sqlexaminer.msi | Bin 0 -> 14254080 bytes .../VS Extensions/TargetFrameworkMigrator.vsix | Bin 0 -> 54448 bytes .../Properties/AssemblyInfo.cs | 2 +- .../Tango.MachineStudio.ColorLab.csproj | 2 +- .../ViewModels/MainViewVM.cs | 131 +- .../Views/MainView.xaml | 6 +- .../Properties/AssemblyInfo.cs | 2 +- .../Tango.MachineStudio.DB.csproj | 2 +- .../ViewModels/MainViewVM.cs | 77 +- .../Tango.MachineStudio.DB/Views/MainDBView.xaml | 14 + .../Properties/AssemblyInfo.cs | 2 +- .../Tango.MachineStudio.DataCapture.csproj | 11 +- .../Tango.MachineStudio.DataCapture/app.config | 14 + .../packages.config | 1 + .../Navigation/DeveloperNavigationManager.cs | 2 +- .../Properties/AssemblyInfo.cs | 2 +- .../Tango.MachineStudio.Developer.csproj | 14 +- .../ViewModelLocator.cs | 2 +- .../ViewModels/MainViewVM.cs | 474 +- .../Views/JobView.xaml | 6 +- .../Views/JobView.xaml.cs | 2 +- .../Views/MachineJobSelectionView.xaml | 271 +- .../Views/MainView.xaml | 2 +- .../Tango.MachineStudio.Developer/app.config | 4 + .../Properties/AssemblyInfo.cs | 2 +- .../Tango.MachineStudio.HardwareDesigner.csproj | 2 +- .../ViewModels/MainViewVM.cs | 761 +--- .../Views/MainView.xaml | 78 +- .../Modules/Tango.MachineStudio.Logging/App.config | 4 + .../Properties/AssemblyInfo.cs | 2 +- .../Tango.MachineStudio.Logging.csproj | 2 +- .../ViewModels/EventsViewVM.cs | 74 +- .../AutoComplete/MachineVersionsProvider.cs | 2 +- .../Properties/AssemblyInfo.cs | 2 +- .../Tango.MachineStudio.MachineDesigner.csproj | 16 +- .../ViewModels/MachineVersionDialogVM.cs | 4 +- .../ViewModels/MainViewVM.cs | 268 +- .../Views/MachineView.xaml | 1 - .../Views/MainView.xaml | 9 +- .../Tango.MachineStudio.MachineDesigner/app.config | 14 + .../packages.config | 1 + .../Properties/AssemblyInfo.cs | 2 +- .../Tango.MachineStudio.Stubs.csproj | 11 +- .../ViewModels/MainViewVM.cs | 7 +- .../Modules/Tango.MachineStudio.Stubs/app.config | 10 + .../Tango.MachineStudio.Stubs/packages.config | 1 + .../Tango.MachineStudio.Synchronization.csproj | 2 +- .../Editors/BlowerElementEditor.xaml | 19 +- .../Editors/BreakSensorElementEditor.xaml | 19 +- .../Editors/ControllerElementEditor.xaml | 19 +- .../Editors/DancerElementEditor.xaml | 19 +- .../Editors/DigitalInElementEditor.xaml | 19 +- .../Editors/DigitalOutElementEditor.xaml | 19 +- .../Editors/DispenserElementEditor.xaml | 22 +- .../Editors/JobRunnerElementEditor.xaml | 19 +- .../Editors/MeterElementEditor.xaml | 19 +- .../Editors/MonitorElementEditor.xaml | 19 +- .../Editors/MotorElementEditor.xaml | 21 +- .../Editors/MotorGroupElementEditor.xaml | 19 +- .../Editors/MultiGraphElementEditor.xaml | 17 +- .../Editors/PidElementEditor.xaml | 19 +- .../Editors/ProcessParametersElementEditor.xaml | 19 +- .../Editors/SingleGraphElementEditor.xaml | 17 +- .../Editors/SpeedSensorElementEditor.xaml | 19 +- .../Editors/ThreadMotionElementEditor.xaml | 19 +- .../Editors/WinderElementEditor.xaml | 19 +- .../Properties/AssemblyInfo.cs | 2 +- .../PropertiesTemplates/JobRunnerTemplate.xaml | 4 +- .../ProcessParametersTemplate.xaml | 2 +- .../Tango.MachineStudio.Technician.csproj | 11 +- .../TechItems/BlowerItem.cs | 3 +- .../TechItems/BreakSensorItem.cs | 3 +- .../TechItems/DancerItem.cs | 2 +- .../TechItems/DispenserItem.cs | 2 +- .../TechItems/JobRunnerItem.cs | 1 + .../TechItems/MotorGroupItem.cs | 2 +- .../TechItems/MotorItem.cs | 2 +- .../TechItems/PidItem.cs | 2 +- .../TechItems/ProcessParametersItem.cs | 18 +- .../TechItems/SpeedSensorItem.cs | 2 +- .../TechItems/TechItem.cs | 4 +- .../TechItems/WinderItem.cs | 2 +- .../ViewModels/MachineTechViewVM.cs | 159 +- .../Views/MachineTechView.xaml.cs | 2 +- .../Tango.MachineStudio.Technician/app.config | 10 + .../Tango.MachineStudio.Technician/packages.config | 1 + .../Properties/AssemblyInfo.cs | 2 +- .../Tango.MachineStudio.UsersAndRoles.csproj | 2 +- .../ViewModels/MainViewVM.cs | 52 +- .../AutoComplete/MachinesProvider.cs | 2 +- .../Controls/LoadingPanel.cs | 37 + .../EventLogging/DefaultEventLogger.cs | 1 - .../Tango.MachineStudio.Common/IStudioViewModel.cs | 22 +- .../Modules/IStudioModuleLoader.cs | 5 + .../Navigation/INavigationBlocker.cs | 28 + .../Navigation/INavigationManager.cs | 98 +- .../Navigation/INavigationObjectReceiver.cs | 21 + .../Navigation/INavigationResultProvider.cs | 28 + .../Properties/AssemblyInfo.cs | 2 +- .../Resources/MaterialDesign.xaml | 1 + .../StudioApplication/IStudioApplicationManager.cs | 12 +- .../Tango.MachineStudio.Common/StudioViewModel.cs | 175 +- .../Tango.MachineStudio.Common.csproj | 15 +- .../Tango.MachineStudio.Common/Themes/Generic.xaml | 31 + .../Threading/IDispatcherProvider.cs | 26 + .../Tango.MachineStudio.Common/app.config | 4 + .../Tango.MachineStudio.Publisher/App.config | 8 + .../Tango.MachineStudio.Publisher.csproj | 2 +- .../Tango.MachineStudio.UI/App.config | 12 +- .../Tango.MachineStudio.UI/App.xaml.cs | 15 +- .../DefaultAuthenticationProvider.cs | 43 +- .../Tango.MachineStudio.UI/MainWindow.xaml | 2 +- .../Modules/DefaultStudioModuleLoader.cs | 25 +- .../Navigation/DefaultNavigationManager.cs | 369 +- .../Properties/AssemblyInfo.cs | 2 +- .../DefaultStudioApplicationManager.cs | 47 +- .../Tango.MachineStudio.UI.csproj | 9 +- .../Threading/DefaultDispatcherProvider.cs | 46 + .../Tango.MachineStudio.UI/ViewModelLocator.cs | 6 + .../ViewModels/LoadingViewVM.cs | 9 +- .../ViewModels/LoginViewVM.cs | 41 +- .../ViewModels/MachineSerialViewVM.cs | 2 +- .../ViewModels/MainViewVM.cs | 30 +- .../ViewModels/UpdateViewVM.cs | 3 + .../Tango.MachineStudio.UI/Views/LoginView.xaml | 43 +- .../Tango.MachineStudio.UI/Views/MainView.xaml | 3 +- .../Tango.MachineStudio.UI/Views/MainView.xaml.cs | 14 +- .../Tango.MachineStudio.UpdateService.csproj | 2 +- .../Tango.MachineStudio.UpdateService/Web.config | 9 +- .../Tango.MachineStudio.Updater/MainWindow.xaml.cs | 16 +- .../Tango.MachineStudio.Updater.csproj | 2 +- .../Notes/Tango.Notes/Tango.Notes.csproj | 2 +- .../Tango.PPC.Jobs/Properties/AssemblyInfo.cs | 2 +- .../Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj | 2 +- .../PPC/Modules/Tango.PPC.Jobs/app.config | 4 + .../Properties/AssemblyInfo.cs | 2 +- .../Tango.PPC.MachineSettings.csproj | 2 +- .../Modules/Tango.PPC.MachineSettings/app.config | 4 + .../Properties/AssemblyInfo.cs | 2 +- .../Tango.PPC.Synchronization.csproj | 2 +- .../Modules/Tango.PPC.Synchronization/app.config | 4 + .../Connection/DefaultMachineProvider.cs | 2 +- .../EventLogging/DefaultEventLogger.cs | 1 - .../MachineSetup/MachineSetupManager.cs | 2 +- .../PPC/Tango.PPC.Common/PPCViewModel.cs | 4 +- .../Tango.PPC.Common/Properties/AssemblyInfo.cs | 2 +- .../PPC/Tango.PPC.Common/Tango.PPC.Common.csproj | 2 +- .../Visual_Studio/PPC/Tango.PPC.Common/app.config | 4 + .../PPC/Tango.PPC.Publisher/App.config | 4 + .../Tango.PPC.Publisher/Tango.PPC.Publisher.csproj | 2 +- Software/Visual_Studio/PPC/Tango.PPC.UI/App.config | 12 + .../Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs | 7 +- .../DefaultAuthenticationProvider.cs | 2 +- .../PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs | 2 +- .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 6 +- .../Threading/DefaultDispatcherProvider.cs | 46 + .../PPC/Tango.PPC.UI/ViewModelLocator.cs | 2 +- .../Tango.PPC.UpdateService.csproj | 2 +- .../PPC/Tango.PPC.UpdateService/Web.config | 7 +- .../PPC/Tango.PPC.Updater/Tango.PPC.Updater.csproj | 2 +- Software/Visual_Studio/Resources/PortsList.xlsx | Bin 35151 -> 36478 bytes .../ICSharpCode.AvalonEdit.csproj | 2 +- .../MaterialDesignColors.Wpf.csproj | 2 +- .../MaterialDesignThemes.Wpf.csproj | 2 +- .../RealTimeGraphEx/Properties/AssemblyInfo.cs | 2 +- .../RealTimeGraphEx/RealTimeGraphExBase.cs | 2 + .../Tango.AutoComplete/Properties/AssemblyInfo.cs | 2 +- .../Tango.AutoComplete/Tango.AutoComplete.csproj | 2 +- .../Tango.AnimatedGif/Tango.AnimatedGif.csproj | 2 +- .../Visual_Studio/Tango.BL/Entities/ActionType.cs | 1 + .../Visual_Studio/Tango.BL/Entities/Address.cs | 2 + .../Entities/ApplicationDisplayPanelVersion.cs | 1 + .../Entities/ApplicationFirmwareVersion.cs | 1 + .../Tango.BL/Entities/ApplicationOsVersion.cs | 1 + .../Tango.BL/Entities/CartridgeType.cs | 1 + .../Tango.BL/Entities/ColorCatalog.cs | 1 + .../Visual_Studio/Tango.BL/Entities/ColorSpace.cs | 4 + .../Tango.BL/Entities/Configuration.cs | 4 + .../Visual_Studio/Tango.BL/Entities/Contact.cs | 2 + .../Visual_Studio/Tango.BL/Entities/Customer.cs | 1 + .../Tango.BL/Entities/DispenserType.cs | 1 + .../Tango.BL/Entities/EmbeddedFirmwareVersion.cs | 1 + .../Visual_Studio/Tango.BL/Entities/EventType.cs | 2 + .../Tango.BL/Entities/EventTypesCategory.cs | 1 + .../Tango.BL/Entities/EventTypesGroup.cs | 1 + .../Visual_Studio/Tango.BL/Entities/FiberShape.cs | 1 + .../Visual_Studio/Tango.BL/Entities/FiberSynth.cs | 1 + .../Tango.BL/Entities/HardwareBlower.cs | 22 + .../Tango.BL/Entities/HardwareBlowerType.cs | 1 + .../Tango.BL/Entities/HardwareBreakSensor.cs | 22 + .../Tango.BL/Entities/HardwareBreakSensorType.cs | 1 + .../Tango.BL/Entities/HardwareDancer.cs | 22 + .../Tango.BL/Entities/HardwareDancerType.cs | 1 + .../Tango.BL/Entities/HardwareMotor.cs | 22 + .../Tango.BL/Entities/HardwareMotorType.cs | 1 + .../Tango.BL/Entities/HardwarePidControl.cs | 22 + .../Tango.BL/Entities/HardwarePidControlType.cs | 1 + .../Tango.BL/Entities/HardwareSpeedSensor.cs | 22 + .../Tango.BL/Entities/HardwareSpeedSensorType.cs | 1 + .../Tango.BL/Entities/HardwareWinder.cs | 22 + .../Tango.BL/Entities/HardwareWinderType.cs | 1 + .../Visual_Studio/Tango.BL/Entities/HtmlPage.cs | 1 + .../Tango.BL/Entities/IdsPackFormula.cs | 1 + Software/Visual_Studio/Tango.BL/Entities/Job.cs | 2 + .../Tango.BL/Entities/LinearMassDensityUnit.cs | 1 + .../Visual_Studio/Tango.BL/Entities/LiquidType.cs | 3 + .../Visual_Studio/Tango.BL/Entities/Machine.cs | 4 + .../Tango.BL/Entities/MachineVersion.cs | 2 + .../Visual_Studio/Tango.BL/Entities/MediaColor.cs | 1 + .../Tango.BL/Entities/MediaCondition.cs | 1 + .../Tango.BL/Entities/MediaMaterial.cs | 1 + .../Visual_Studio/Tango.BL/Entities/MediaPurpos.cs | 1 + .../Visual_Studio/Tango.BL/Entities/MidTankType.cs | 1 + .../Tango.BL/Entities/Organization.cs | 3 + .../Visual_Studio/Tango.BL/Entities/Permission.cs | 1 + .../Entities/ProcessParametersTablesGroup.cs | 1 + Software/Visual_Studio/Tango.BL/Entities/Rml.cs | 6 + Software/Visual_Studio/Tango.BL/Entities/Role.cs | 2 + .../Visual_Studio/Tango.BL/Entities/Segment.cs | 1 + .../Visual_Studio/Tango.BL/Entities/SpoolType.cs | 2 + .../Visual_Studio/Tango.BL/Entities/Sysdiagram.cs | 1 + Software/Visual_Studio/Tango.BL/Entities/User.cs | 5 + .../Tango.BL/Entities/WindingMethod.cs | 1 + .../Tango.BL/EntitiesExtensions/HardwareVersion.cs | 14 +- .../Tango.BL/EntitiesExtensions/MachineEvent.cs | 2 +- .../Visual_Studio/Tango.BL/ObservableEntity.cs | 13 + .../Tango.BL/ObservablesContext.Views.cs | 4557 ++++++++++++++++++++ .../Tango.BL/ObservablesContextAdapter.cs | 188 + .../Tango.BL/ObservablesContextExtension.cs | 81 +- .../Tango.BL/ObservablesEntitiesAdapter.cs | 63 +- .../Tango.BL/ObservablesStaticCollections.cs | 128 + .../ObservablesStaticCollectionsExtension.cs | 2878 ++++++++++++ .../Tango.BL/Properties/AssemblyInfo.cs | 2 +- .../Tango.BrushPicker/Tango.BrushPicker.csproj | 2 +- Software/Visual_Studio/Tango.CSV/Tango.CSV.csproj | 2 +- .../Tango.CircularGauge/Tango.CircularGauge.csproj | 2 +- .../ObservablesStaticCollectionsFile.cs | 12 + .../Properties/AssemblyInfo.cs | 2 +- .../Tango.CodeGeneration.csproj | 4 +- .../Templates/EntityCodeFile.cshtml | 1 + .../ObservablesStaticCollectionsFile.cshtml | 57 + .../Tango.ColorPicker/Tango.ColorPicker.csproj | 2 +- .../ActiveDirectoryAuthenticationProvider.cs | 36 + Software/Visual_Studio/Tango.Core/App.config | 25 + Software/Visual_Studio/Tango.Core/CoreSettings.cs | 12 +- Software/Visual_Studio/Tango.Core/DataSource.cs | 139 + .../Visual_Studio/Tango.Core/DataSourceType.cs | 31 + .../ExtensionMethods/ObjectExtensions.cs | 21 + .../ObservableCollectionExtensions.cs | 12 + .../Tango.Core/ProducerConsumerQueue.cs | 63 + .../Tango.Core/Properties/AssemblyInfo.cs | 2 +- .../Tango.Core/Properties/Resources.Designer.cs | 2 +- .../Visual_Studio/Tango.Core/Tango.Core.csproj | 44 +- Software/Visual_Studio/Tango.Core/packages.config | 6 + .../Tango.DAL.Local/Tango.DAL.Local.csproj | 2 +- .../Tango.DAL.Remote/DB/HARDWARE_BLOWERS.cs | 1 + .../Tango.DAL.Remote/DB/HARDWARE_BREAK_SENSORS.cs | 1 + .../Tango.DAL.Remote/DB/HARDWARE_DANCERS.cs | 1 + .../Tango.DAL.Remote/DB/HARDWARE_MOTORS.cs | 1 + .../Tango.DAL.Remote/DB/HARDWARE_PID_CONTROLS.cs | 1 + .../Tango.DAL.Remote/DB/HARDWARE_SPEED_SENSORS.cs | 1 + .../Tango.DAL.Remote/DB/HARDWARE_WINDERS.cs | 1 + .../Tango.DAL.Remote/DB/RemoteADO.edmx | 21 + .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 142 +- .../Tango.DAL.Remote/Partials/RemoteDB.cs | 29 +- .../Tango.DAL.Remote/Properties/AssemblyInfo.cs | 2 +- .../Tango.DAL.Remote/Tango.DAL.Remote.csproj | 2 +- .../Tango.Documents/Tango.Documents.csproj | 2 +- .../Tango.DragAndDrop/Tango.DragAndDrop.csproj | 2 +- .../Tango.Editors/ElementsEditor.xaml.cs | 26 +- .../Tango.Editors/Tango.Editors.csproj | 2 +- .../Tango.EmbroideryUI/Properties/AssemblyInfo.cs | 2 +- .../Tango.EmbroideryUI/Tango.EmbroideryUI.csproj | 2 +- .../Visual_Studio/Tango.EmbroideryUI/app.config | 8 + .../Tango.Emulations/Properties/AssemblyInfo.cs | 2 +- .../Tango.Emulations/Tango.Emulations.csproj | 2 +- .../Visual_Studio/Tango.Hive/Tango.Hive.csproj | 2 +- .../Diagnostics/DiagnosticsFileEvent.cs | 6 +- .../ExternalBridge/ExternalBridgeTcpClient.cs | 2 +- .../ExternalBridge/ExternalBridgeUsbClient.cs | 2 +- .../Tango.Integration/Operation/MachineOperator.cs | 14 +- .../Tango.Integration/Properties/AssemblyInfo.cs | 2 +- .../Tango.Integration/Tango.Integration.csproj | 2 +- .../Tango.Logging/GlobalExceptionTrapper.cs | 7 +- Software/Visual_Studio/Tango.Logging/LogManager.cs | 46 +- .../Tango.Logging/ProducerConsumerQueue.cs | 63 + .../Tango.Logging/Properties/AssemblyInfo.cs | 2 +- .../Tango.Logging/Tango.Logging.csproj | 5 +- Software/Visual_Studio/Tango.PMR/NativePMR.cs | 53 +- .../Tango.PMR/Properties/AssemblyInfo.cs | 2 +- Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj | 2 +- .../Tango.Protobuf/Tango.Protobuf.csproj | 2 +- .../Tango.SQLExaminer/Tango.SQLExaminer.csproj | 2 +- .../Tango.Scripting/Properties/AssemblyInfo.cs | 2 +- .../Tango.Scripting/Tango.Scripting.csproj | 2 +- Software/Visual_Studio/Tango.Scripting/app.config | 4 + .../Tango.Serialization/Tango.Serialization.csproj | 2 +- .../Tango.Settings/Tango.Settings.csproj | 2 +- .../Tango.SharedUI/Controls/NavigationControl.cs | 25 +- .../Tango.SharedUI/Properties/AssemblyInfo.cs | 2 +- .../Tango.SharedUI/Tango.SharedUI.csproj | 10 +- Software/Visual_Studio/Tango.SharedUI/ViewModel.cs | 60 +- Software/Visual_Studio/Tango.SharedUI/app.config | 14 + .../Visual_Studio/Tango.SharedUI/packages.config | 1 + .../Tango.Stubs/Properties/AssemblyInfo.cs | 2 +- .../Visual_Studio/Tango.Stubs/Tango.Stubs.csproj | 11 +- .../Tango.Stubs/ViewModels/StubsViewVM.cs | 4 + Software/Visual_Studio/Tango.Stubs/app.config | 14 + Software/Visual_Studio/Tango.Stubs/packages.config | 1 + .../Properties/AssemblyInfo.cs | 2 +- .../Remote/RemoteDBSynchronizer.cs | 2 +- .../Tango.Synchronization.csproj | 2 +- .../Tango.TFS/Properties/AssemblyInfo.cs | 2 +- Software/Visual_Studio/Tango.TFS/Tango.TFS.csproj | 2 +- .../Tango.Touch/Properties/AssemblyInfo.cs | 2 +- .../Visual_Studio/Tango.Touch/Tango.Touch.csproj | 2 +- Software/Visual_Studio/Tango.Touch/app.config | 8 + .../Tango.Transport/Properties/AssemblyInfo.cs | 2 +- .../Tango.Transport/Tango.Transport.csproj | 2 +- .../Tango.Transport/TransporterBase.cs | 281 +- .../Visual_Studio/Tango.UnitTesting/App.config | 8 + .../Visual_Studio/Tango.UnitTesting/DAL_TST.cs | 6 +- .../Tango.UnitTesting/Properties/AssemblyInfo.cs | 2 +- .../Tango.UnitTesting/SQLExaminer_TST.cs | 7 +- .../Tango.UnitTesting/Synchronization_TST.cs | 4 +- .../Tango.UnitTesting/Tango.UnitTesting.csproj | 2 +- .../Visual_Studio/Tango.Video/Tango.Video.csproj | 2 +- .../Visual_Studio/Tango.Visuals/Knob/Knob.xaml.cs | 4 +- .../Tango.Visuals/Tango.Visuals.csproj | 2 +- .../Visual_Studio/Tango.WiFi/Tango.WiFi.csproj | 7 +- Software/Visual_Studio/Tango.sln | 16 +- .../Utilities/Tango.BugReporter/App.config | 8 + .../Tango.BugReporter/Properties/AssemblyInfo.cs | 2 +- .../Tango.BugReporter/Tango.BugReporter.csproj | 2 +- .../Tango.CatalogGenerator.csproj | 2 +- .../ObservablesGenerator.cs | 28 +- .../Properties/AssemblyInfo.cs | 2 +- .../Tango.DBObservablesGenerator.CLI.csproj | 2 +- .../Utilities/Tango.EmbroideryViewer/App.config | 8 + .../Properties/AssemblyInfo.cs | 2 +- .../Tango.EmbroideryViewer.csproj | 2 +- .../Tango.EventsTypesGenerator.csproj | 2 +- .../Tango.HashGenerator/Tango.HashGenerator.csproj | 2 +- .../Utilities/Tango.ILMerge.UI/App.config | 8 + .../Tango.ILMerge.UI/Properties/AssemblyInfo.cs | 2 +- .../Tango.ILMerge.UI/Tango.ILMerge.UI.csproj | 2 +- .../Utilities/Tango.MachineEM.UI/App.config | 8 + .../Tango.MachineEM.UI/Properties/AssemblyInfo.cs | 2 +- .../Tango.MachineEM.UI/Tango.MachineEM.UI.csproj | 2 +- .../Tango.PMRGenerator.CLI.csproj | 8 +- .../Properties/AssemblyInfo.cs | 2 +- .../Tango.PortsListGenerator.csproj | 2 +- .../Tango.Protobuf.CLI/Tango.Protobuf.CLI.csproj | 2 +- .../Utilities/Tango.Protobuf.UI/App.config | 8 + .../Tango.Protobuf.UI/Properties/AssemblyInfo.cs | 2 +- .../Tango.Protobuf.UI/Tango.Protobuf.UI.csproj | 2 +- .../Utilities/Tango.RemoteRunner.UI/App.config | 54 + .../Properties/AssemblyInfo.cs | 2 +- .../Tango.RemoteRunner.UI.csproj | 2 +- .../Utilities/Tango.SQLiteGenerator.CLI/App.config | 8 + .../Utilities/Tango.SQLiteGenerator.CLI/Program.cs | 4 +- .../Properties/AssemblyInfo.cs | 2 +- .../Tango.SQLiteGenerator.CLI.csproj | 2 +- .../Tango.ShortcutGenerator.CLI.csproj | 2 +- .../Tango.Stubs.CLI/Properties/AssemblyInfo.cs | 2 +- .../Tango.Stubs.CLI/Tango.Stubs.CLI.csproj | 2 +- .../Utilities/Tango.Stubs.UI/App.config | 10 +- .../Tango.Stubs.UI/Properties/AssemblyInfo.cs | 2 +- .../Utilities/Tango.Stubs.UI/Tango.Stubs.UI.csproj | 2 +- .../Utilities/Tango.TransportRouter.UI/App.config | 8 + .../Properties/AssemblyInfo.cs | 2 +- .../Tango.TransportRouter.UI.csproj | 2 +- .../Utilities/Tango.UITests/App.config | 4 + .../Tango.UITests/Properties/AssemblyInfo.cs | 2 +- .../Utilities/Tango.UITests/Tango.UITests.csproj | 2 +- .../Properties/AssemblyInfo.cs | 2 +- .../Tango.BuildExtensions.csproj | 2 +- .../Tango.MachineService.csproj | 2 +- 404 files changed, 12417 insertions(+), 2309 deletions(-) create mode 100644 Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c create mode 100644 Software/Visual_Studio/Installers/DB_PACK/sqlexaminer.msi create mode 100644 Software/Visual_Studio/Installers/VS Extensions/TargetFrameworkMigrator.vsix create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/LoadingPanel.cs create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationBlocker.cs create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationObjectReceiver.cs create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationResultProvider.cs create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/Generic.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Threading/IDispatcherProvider.cs create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Threading/DefaultDispatcherProvider.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Threading/DefaultDispatcherProvider.cs create mode 100644 Software/Visual_Studio/Tango.BL/ObservablesContext.Views.cs create mode 100644 Software/Visual_Studio/Tango.BL/ObservablesContextAdapter.cs create mode 100644 Software/Visual_Studio/Tango.BL/ObservablesStaticCollections.cs create mode 100644 Software/Visual_Studio/Tango.BL/ObservablesStaticCollectionsExtension.cs create mode 100644 Software/Visual_Studio/Tango.CodeGeneration/ObservablesStaticCollectionsFile.cs create mode 100644 Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesStaticCollectionsFile.cshtml create mode 100644 Software/Visual_Studio/Tango.Core/ActiveDirectoryAuthenticationProvider.cs create mode 100644 Software/Visual_Studio/Tango.Core/App.config create mode 100644 Software/Visual_Studio/Tango.Core/DataSource.cs create mode 100644 Software/Visual_Studio/Tango.Core/DataSourceType.cs create mode 100644 Software/Visual_Studio/Tango.Core/ProducerConsumerQueue.cs create mode 100644 Software/Visual_Studio/Tango.Logging/ProducerConsumerQueue.cs (limited to 'Software') diff --git a/Software/Embedded_SW/Embedded/.cproject b/Software/Embedded_SW/Embedded/.cproject index f81cf0c62..4631ff289 100644 --- a/Software/Embedded_SW/Embedded/.cproject +++ b/Software/Embedded_SW/Embedded/.cproject @@ -163,7 +163,7 @@ - + diff --git a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c index bd89b8f2a..91f1a78aa 100644 --- a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c +++ b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c @@ -31,12 +31,12 @@ struct serialBuffer { size_t size; } typedef SerialBuffer; -char Buffer[4000]; +char CommRxBuffer[COMM_MAX_BUFFER_SIZE]; SerialBuffer inBuffer; uint32_t initArray(size_t initialSize) { SerialBuffer *a = &inBuffer; - if (initialSize >= 4000) return 0; - a->buffer = Buffer; + if (initialSize >= COMM_MAX_BUFFER_SIZE) return 0; + a->buffer = CommRxBuffer; a->used = 0; a->size = initialSize; return initialSize; @@ -160,11 +160,11 @@ void communicationTxTask(UArg arg0, UArg arg1) */ initArray(1); - #ifdef USE_USB + /*#ifdef USE_USB SetCommunicationPath(isUSB); #else SetCommunicationPath(isUART); - #endif + #endif*/ //ui32RxCount = 0; CommunicationTxMsgQ = Mailbox_create(sizeof(CommTxMessageStruc), 20, NULL,NULL); diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_Comm.h b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_Comm.h index dd817765c..1ecedf00c 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_Comm.h +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_Comm.h @@ -119,6 +119,9 @@ #define F1_DRYER_LOADARM_ROTENC_M (*((volatile short *)(FPGA1_BASE | 0x152))) //10bits Value of the Msb of the QEI register, 1bit Direction of movement, 5bits Reserved #define F1_DRYER_LOADARM_ROTENC_I (*((volatile short *)(FPGA1_BASE | 0x154))) //value of index counter +//WATCHDOG +#define F1_Watchdog_reg (*((volatile short *)(FPGA1_BASE | 0x160)))//Watchdog enable bit, watchdog value - F1_gpo_01 BIT2 DYEINGH_SSR10_CTRL HeadHeaterZ5 + //SSI #define F1_RSPARE_ROTENC_DATA_p_RX_lsb (*((volatile short *)(FPGA1_BASE | 0x180))) //The 16 Lsb bits of the shifted in data. #define F1_RSPARE_ROTENC_DATA_p_RX_msb (*((volatile short *)(FPGA1_BASE | 0x182))) //16 bit MSB if nessesary @@ -627,6 +630,9 @@ #define F3_RSPARE_ROTENC_msb (*((volatile short *)(FPGA3_BASE | 0x112))) //10bits Value of the Msb of the QEI register, 1bit Direction of movement, 5bits Reserved #define F3_RSPARE_ROTENC_index (*((volatile short *)(FPGA3_BASE | 0x114))) //value of index counter +//WATCHDOG +#define F3_Watchdog_reg (*((volatile short *)(FPGA3_BASE | 0x140)))//Watchdog enable bit, watchdog value - F3_GPO_01_bus BIT4 DYEINGH_SSR11_CTRL HeadHeaterZ6 + //SPI_MOTO_RLOADING_A1 #define F3_MOTO_SPARE1_1_A1_TX_00 (*((volatile short *)(FPGA3_BASE | 0x200))) //The second register to be shifted out of the spi. The msb bit of this register is shifted out first. #define F3_MOTO_SPARE1_1_A1_TX_01 (*((volatile short *)(FPGA3_BASE | 0x202))) //The first register to be shifted out of the spi. The msb bit of this register is shifted out first. diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c index 4d10b6b7c..ef3933d30 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c @@ -309,8 +309,8 @@ bool FPGA_Read_limit_Switches(FPGA_GPI_ENUM Limit_Switch) LS_Dispenser_7_8.bits.F2_LS_DISPENSER_UP_8 = NO_LIMIT; break; default : - //error - break; + LM_Status = NO_LIMIT; + break; } return LM_Status; } @@ -376,13 +376,20 @@ uint32_t Control_WD(bool IsEnable, unsigned char SetTimer_Steps100mSec) // Contr */ { #ifndef EVALUATION_BOARD + + short WD_Enable = 0x4000 | SetTimer_Steps100mSec; + if (IsEnable == DISABLE) { + F1_Watchdog_reg = 0; F2_Watchdog_reg = 0; + F3_Watchdog_reg = 0; } else { - F2_Watchdog_reg = 0x4000 | SetTimer_Steps100mSec; // Enable the watchdog + F1_Watchdog_reg = WD_Enable; // Enable the watchdog F3_GPO_01_bus BIT4 DYEINGH_SSR11_CTRL HeadHeaterZ6 + F2_Watchdog_reg = WD_Enable; // Enable the watchdog F2_CTRL + reset dispensers motor drivers + F3_Watchdog_reg = WD_Enable; // Enable the watchdog F1_gpo_01 BIT2 DYEINGH_SSR10_CTRL HeadHeaterZ5 } #endif return OK; diff --git a/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.c b/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.c index 944abb737..702ecafcc 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.c +++ b/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.c @@ -3,6 +3,11 @@ //see also https://github.com/yuvadm/tiva-c/blob/master/boards/dk-tm4c129x/drivers/mx66l51235f.c //On board Quad SPI 512Mb Flash + +//Macronixýþ þýMX66L51235FZ2I-10Gýþ +//Sector Size 4KB + + #include #include #include @@ -47,6 +52,12 @@ #define INS_PAGE_PROGRAM 0x02 #define INS_READ_DATA 0x03 +//-------------------- AVI: based on https://github.com/turingo/stm32ss/blob/master/src/stm32ss/bsp/sf.c +#define INS_BLOCK_ERASE (0xd8) +#define INS_CHIP_ERASE (0xc7) +#define INS_WRITE_DISABLE (0x04) +//------------------------- + #if defined(ewarm) #pragma data_alignment=1024 tDMAControlTable g_sDMAControlTable[6]; @@ -610,13 +621,36 @@ int Read_Ext_Flash_Device_ID() return 0; } -int Erase_Sector_before_writting_To_Ext_Flash(uint32_t ui32Address) +int Erase_Sector_before_writting_To_Ext_Flash(uint32_t ui32Address)// 4Kb every 100h is sector (0-0xFFF, 0x1000-0x1fff,..) { SSILibSendEraseCommand(SSI3_BASE,ui32Address,INS_SECTOR_ERASE_4KB); return 0; } +int Erase_Block(uint32_t ui32Address)// 32Kb or 64Kb ? +{ + //writeLine("Starting Erase Block Operations..."); + + + SSILibSendEraseCommand(SSI3_BASE,ui32Address,INS_BLOCK_ERASE ); + + //writeLine("Erase Block Completed..."); + + return 0; +} + +int Erase_Chip()// 32Kb or 64Kb ? +{ + //writeLine("Starting Erase Block Operations..."); + + SSILibSendEraseCommand(SSI3_BASE,0,INS_CHIP_ERASE ); + + //writeLine("Erase Block Completed..."); + + return 0; +} + int Write_Words_To_Ext_Flash(uint32_t ui32Address, uint32_t NumOfWords, uint32_t* TxBuf) { @@ -714,7 +748,8 @@ int Ext_Flash_Operation(uint32_t ui32Address,uint32_t Operation, uint32_t NumOf Display_RX_TX_Ext_Flash_Data(NumOfWords, pui32DataTx, NULL); // Erase the Sector before Program Operation... - Erase_Sector_before_writting_To_Ext_Flash(ui32Address); + Erase_Sector_before_writting_To_Ext_Flash(ui32Address);//Erase all the sector not only from this address + //Erase_Block(ui32Address);//Added by AVI for testing // Write NUM_SSI_DATA words to the External Flash Write_Words_To_Ext_Flash(ui32Address, NumOfWords, pui32DataTx); @@ -750,7 +785,7 @@ Flash_Union Flash_RW; uint32_t WriteBuf[MaxFlashBytes]; uint32_t ReadBuf[MaxFlashBytes]; - +/* uint32_t ExtFlashWriteBuf(uint32_t ui32Address,uint32_t NumOfWords, uint32_t* pui32DataTx) { static uint32_t AddressCounter = 0; @@ -795,9 +830,63 @@ uint32_t ExtFlashWriteBuf(uint32_t ui32Address,uint32_t NumOfWords, uint32_t* p Ext_Flash_Operation(0X00 + (0X100*AddressCounter), TX, No_Bytes , WriteBuf, NULL );////always use address 0 and handle the add by the AddressCounter } - return return_start_address; + return return_start_address;// for reading what we just wrote } +*/ + +uint32_t ExtFlashWriteBuf(/*uint32_t ui32Address,*/uint32_t NumOfWords, uint32_t* pui32DataTx)//ui32Address not in use +{ + uint32_t AddressCounter = 0; + uint32_t i; + uint32_t No_Bytes; + + static uint32_t Current_Start_address = 0x00; + uint32_t Save_Current_Start_address = 0x00; + + assert(NumOfWords <= MaxFlashWords); + + No_Bytes = NumOfWords *4; + + uint32_t Current_End_address = Current_Start_address + No_Bytes; + + memset(&Flash_RW,0,sizeof(Flash_RW)); + + for(i = 0; i < NumOfWords;i++) + { + Flash_RW.DWords[i] = pui32DataTx[i]; + } + + for(i = 0; i < No_Bytes;i++) + { + WriteBuf[i] = Flash_RW.Bytes[i]; + } + + if(No_Bytes >MaxBytesForAddress) + { + uint32_t number = No_Bytes / MaxBytesForAddress; + uint32_t Remainder = No_Bytes % MaxBytesForAddress; + + for(i=0;i +#include "include.h" + +#include "diagnostics.h" +#include +#include + +#include +#include + +#include +#include + +#include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" +#include "Drivers/I2C_Communication/DAC/blower.h" +#include "drivers/Valves/Valve.h" + +typedef enum +{ + GPO_DILUTORPUMP_SSR10_CTRL, + GPO_WASTECH_PUMP2, + Midtank_1_Air, + Midtank_2_Air, + Midtank_3_Air, + Midtank_4_Air, + Midtank_5_Air, + Midtank_6_Air, + Midtank_7_Air, + Midtank_8_Air, + Midtank_1_Cartridge, + Midtank_2_Cartridge, + Midtank_3_Cartridge, + Midtank_4_Cartridge, + Midtank_5_Cartridge, + Midtank_6_Cartridge, + Midtank_7_Cartridge, + Midtank_8_Cartridge, + GPO_BUZZER, + GPO_LED1, + GPO_LED2, + GPO_LED3, + GPO_LED4, + GPO_TFEED_BREAK_1, + GPO_TFEED_BREAK_2, + GPO_SPARE1_1, + GPO_SPARE1_2, + GPO_SPARE2_1, + GPO_SPARE2_2, + GPO_BLOWER_PWM, + GPO_CHILLER_SSR9_CTRL, + GPO_WHS_WTANKPUMP2, + GPO_VALVE_WASTE_TANK, +}DigitalOutputEnum; +/******************************************************************************** + *Blower Diagnostic + ********************************************************************************/ +uint32_t SetComponentValueRequestRequestFunc(MessageContainer* requestContainer) +{ + MessageContainer responseContainer; + uint8_t* container_buffer; + uint32_t status = 0; + uint32_t intvoltage; + SetComponentValueRequest* request = set_component_value_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + + + + SetComponentValueResponse response = SET_COMPONENT_VALUE_RESPONSE__INIT; + + responseContainer = createContainer(MESSAGE_TYPE__SetComponentValueResponse, requestContainer->token, true, &response, &set_component_value_response__pack, &set_component_value_response__get_packed_size); + container_buffer = malloc(message_container__get_packed_size(&responseContainer)); + + + switch (request->component) + { + case VALUE_COMPONENT__BlowerVoltage: + blowervolatgedisplay = true; + voltage = request->value; + if (voltage == 0.0) + Turn_the_Blower_Off(); + else + { + Turn_the_Blower_On(); + intvoltage = voltage; + Control_Voltage_To_Blower(intvoltage); + } + break; + default: + break; + } + + size_t container_size = message_container__pack(&responseContainer, container_buffer); + free(responseContainer.data.data); + SendChars(container_buffer, container_size); + //free(container_buffer); + //free(requestContainer); + set_component_value_request__free_unpacked(request,NULL); + + return OK; +} + +/******************************************************************************** + *Set digital output Diagnostic + ********************************************************************************/ +uint32_t SetDigitalOutRequestRequestFunc(MessageContainer* requestContainer) +{ + MessageContainer responseContainer; + uint8_t* container_buffer; + uint32_t status = 0; + int portId; + SetDigitalOutRequest* request = set_digital_out_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + + + + SetDigitalOutResponse response = SET_DIGITAL_OUT_RESPONSE__INIT; + + responseContainer = createContainer(MESSAGE_TYPE__SetDigitalOutResponse, requestContainer->token, true, &response, &set_digital_out_response__pack, &set_digital_out_response__get_packed_size); + container_buffer = malloc(message_container__get_packed_size(&responseContainer)); + + + if ((request->port >= Midtank_1_Air)&&(request->port >=Midtank_8_Air)) + { + portId = (request->port - Midtank_1_Air) ; //0-7 + Valve_Set((Valves_t) (portId+VALVE_2W_MID_AIR_LF), request->value ); //Atm_MidTank_OFF/ON + } + else if ((request->port >= Midtank_1_Cartridge)&&(request->port >=Midtank_8_Cartridge)) + { + portId = (request->port - Midtank_1_Cartridge) ; //0-7 + Valve_Set((Valves_t) (portId+VALVE_2W_CART_MID_LF), request->value ); //Cartridge_MidTank_OFF/ON + } + else + { + status = ERROR; + responseContainer.has_error = true; + responseContainer.error = ERROR_CODE__INVALID_DIGITAL_PIN_NUMBER; + } + + size_t container_size = message_container__pack(&responseContainer, container_buffer); + free(responseContainer.data.data); + SendChars(container_buffer, container_size); + //free(container_buffer); + //free(requestContainer); + set_digital_out_request__free_unpacked(request,NULL); + + return OK; +} + + + diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.h b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.h index 82d267bd6..3fc0969f8 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.h +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.h @@ -34,6 +34,7 @@ uint32_t MotorAbortJoggingRequestFunc(MessageContainer* requestContainer); uint32_t DispenserAbortJoggingRequestFunc(MessageContainer* requestContainer); uint32_t SetComponentValueRequestRequestFunc(MessageContainer* requestContainer); +uint32_t SetDigitalOutRequestRequestFunc(MessageContainer* requestContainer); diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c index bb8da0b2e..af8932872 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c @@ -59,11 +59,6 @@ FPGA_GPI_ENUM Motor_Id_to_LS_Id[NUM_OF_MOTORS] = { MAX_GPI, //MOTO_RDRIVING = 22, GPI_LS_RLOADRAM_UP, //MOTO_RLOADARM = 23, GPI_LS_RLOADMOTOR_DOWN, //MOTO_RLOADING = 24, - MAX_GPI, //MOTO_SPARE1_1 = 25, - MAX_GPI, //MOTO_SPARE1_2 = 26, - MAX_GPI, //MOTO_SPARE2_1 = 27, - MAX_GPI, //MOTO_SPARE2_2 = 28 - }; typedef enum { MotorHomingDirectionUp, @@ -97,11 +92,6 @@ MotorHomingDirectionEnum Motor_Id_to_LS_Direction[NUM_OF_MOTORS] = { MotorHomingDirectionNoHoming, //MOTO_RDRIVING = 22, MotorHomingDirectionUp, //MOTO_RLOADARM = 23, MotorHomingDirectionDown, //MOTO_RLOADING = 24, - MotorHomingDirectionNoHoming, //MOTO_SPARE1_1 = 25, - MotorHomingDirectionNoHoming, //MOTO_SPARE1_2 = 26, - MotorHomingDirectionNoHoming, //MOTO_SPARE2_1 = 27, - MotorHomingDirectionNoHoming, //MOTO_SPARE2_2 = 28 - }; char HomingToken[NUM_OF_MOTORS][36+1]={0}; @@ -138,7 +128,7 @@ uint32_t MotorHomingRequestFunc(MessageContainer* requestContainer) if (speed == 0) speed = 150; if (MotorId <= NUM_OF_MOTORS) { - if (JobIsActive() == false) + if ((JobIsActive() == false)&&(isMotorConfigured(MotorId) == true)) { if ( Motor_Id_to_LS_Id[MotorId] != MAX_GPI) { @@ -230,7 +220,7 @@ uint32_t DispenserHomingRequestFunc(MessageContainer* requestContainer) //free (container_buffer); if (MotorId <= NUM_OF_MOTORS) { - if (JobIsActive() == false) + if ((JobIsActive() == false)&&(isMotorConfigured(MotorId) == true)) { if ( Motor_Id_to_LS_Id[MotorId] != MAX_GPI) { diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsJogging.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsJogging.c index cf341b9a9..32e76cbde 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsJogging.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsJogging.c @@ -32,13 +32,9 @@ #include #include -#include -#include - #include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" #include "drivers/Motors/Motor.h" #include "drivers/Valves/Valve.h" -#include "Drivers/I2C_Communication/DAC/blower.h" #include "StateMachines/Printing/PrintingSTM.h" @@ -63,7 +59,7 @@ uint32_t MotorJoggingRequestFunc(MessageContainer* requestContainer) if (MotorId <= NUM_OF_MOTORS) { - if (JobIsActive() == false) + if ((JobIsActive() == false)&&(isMotorConfigured(MotorId) == true)) { { switch (request->direction) @@ -149,7 +145,7 @@ uint32_t DispenserJoggingRequestFunc(MessageContainer* requestContainer) if (MotorId <= NUM_OF_MOTORS) { - if (JobIsActive() == false) + if ((JobIsActive() == false)&&(isMotorConfigured(MotorId) == true)) { switch (request->direction) { @@ -212,51 +208,4 @@ uint32_t DispenserAbortJoggingRequestFunc(MessageContainer* requestContainer) return OK; } -/******************************************************************************** - *Blower Diagnostic - ********************************************************************************/ -uint32_t SetComponentValueRequestRequestFunc(MessageContainer* requestContainer) -{ - MessageContainer responseContainer; - uint8_t* container_buffer; - uint32_t status = 0; - uint32_t intvoltage; - SetComponentValueRequest* request = set_component_value_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - - - - SetComponentValueResponse response = SET_COMPONENT_VALUE_RESPONSE__INIT; - - responseContainer = createContainer(MESSAGE_TYPE__SetComponentValueResponse, requestContainer->token, true, &response, &set_component_value_response__pack, &set_component_value_response__get_packed_size); - container_buffer = malloc(message_container__get_packed_size(&responseContainer)); - - - switch (request->component) - { - case VALUE_COMPONENT__BlowerVoltage: - blowervolatgedisplay = true; - voltage = request->value; - if (voltage == 0.0) - Turn_the_Blower_Off(); - else - { - Turn_the_Blower_On(); - intvoltage = voltage; - Control_Voltage_To_Blower(intvoltage); - } - break; - default: - break; - } - - size_t container_size = message_container__pack(&responseContainer, container_buffer); - free(responseContainer.data.data); - SendChars(container_buffer, container_size); - //free(container_buffer); - //free(requestContainer); - set_component_value_request__free_unpacked(request,NULL); - - return OK; -} - diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c index 185d4ac66..b035ff97b 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c @@ -69,6 +69,8 @@ float CalculateDispenserPressure (int DispenserId) //DispenserPressure[DispenserId] *=10000000; //uBar; //DispenserPressure[DispenserId] *=145.0377; //PSI; + DispenserPressure[DispenserId] *= 10; //MPascal -> Bar + return(DispenserPressure[DispenserId]); } diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c index 581a27f1f..68b79edeb 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c @@ -12,7 +12,7 @@ #include "Drivers/USB_Communication/USBCDCD.h" - +//#include "drivers/twine_graphicslib/graphics_adapter.h" #include "Stub_Status.h" @@ -25,6 +25,20 @@ void Stub_CartridgeReadRequest(MessageContainer* requestContainer) //request->cartridgeid + //writeLine("cartridge Request: "); + + //writeFloat(request->cartridgeid); + + /* + int i; + for( i=0;i<8;i++) + { + Read_MidTank_Pressure_Sensor(i); + SysCtlDelay(1); + } + + */ + StubCartridgeReadResponse response = STUB_CARTRIDGE_READ_RESPONSE__INIT; response.cartridgeid = request->cartridgeid; @@ -43,8 +57,20 @@ void Stub_CartridgeReadRequest(MessageContainer* requestContainer) response.has_cartridgeused = false; status_response(status,&response.status, &response.statusword ,&response.has_statusword); - - +/* + writeLine("Sending Response: "); + + writeFloat(response.cartridgeid); + writeString(", "); + writeFloat(response.cartridgecolor); + writeString(", "); + writeFloat(response.cartridgeversion); + writeString(", "); + writeFloat(response.cartridgedata); + writeString(", "); + writeFloat(response.cartridgeused); + writeString(", "); +*/ Write_status_response(status); responseContainer = createContainer(MESSAGE_TYPE__StubCartridgeReadResponse, requestContainer->token, true, &response, &stub_cartridge_read_response__pack, &stub_cartridge_read_response__get_packed_size); @@ -71,8 +97,19 @@ void Stub_CartridgeWriteRequest(MessageContainer* requestContainer) //request->cartridgeversion //request->cartridgedata //request->cartridgeused - - +/* + writeLine("Cartridge Request: "); + + writeFloat(request->cartridgeid); + writeString(", "); + writeFloat(request->cartridgecolor); + writeString(", "); + writeFloat(request->cartridgeversion); + writeString(", "); + writeFloat(request->cartridgedata); + writeString(", "); + writeFloat(request->cartridgeused); +*/ StubCartridgeWriteResponse response = STUB_CARTRIDGE_WRITE_RESPONSE__INIT; response.cartridgeid = request->cartridgeid; @@ -83,7 +120,13 @@ void Stub_CartridgeWriteRequest(MessageContainer* requestContainer) // response.statusword = OK; // response.has_statusword = true; status_response(status,&response.status, &response.statusword ,&response.has_statusword); +/* + writeLine("Sending Response: "); + writeFloat(response.cartridgeid); + writeString(", ");*/ +// writeFloat(response.statusword); +// WRITELINESTATUS; Write_status_response(status); responseContainer = createContainer(MESSAGE_TYPE__StubCartridgeWriteResponse, requestContainer->token, true, &response, &stub_cartridge_write_response__pack, &stub_cartridge_write_response__get_packed_size); diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dispenser.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dispenser.c index 0bcc9f7c9..7c0a4c980 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dispenser.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dispenser.c @@ -9,6 +9,7 @@ #include "Drivers/USB_Communication/USBCDCD.h" #include "drivers/adc_sampling/adc.h" +#include "modules/ids/ids_ex.h" diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c index f478e9428..51c92ed8c 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c @@ -300,10 +300,10 @@ void Stub_ExtFlashWriteWordsRequest(MessageContainer* requestContainer) StubExtFlashWriteWordsResponse response = STUB_EXT_FLASH_WRITE_WORDS_RESPONSE__INIT; - response.address = 0;// alwayes send sddress 0 - response.has_address = true; + uint32_t Current_Start_address = ExtFlashWriteBuf(/*0,*/request->n_wordtwrite, request->wordtwrite);// alwayes send sddress 0 - uint32_t Address = ExtFlashWriteBuf(0,request->n_wordtwrite, request->wordtwrite);// alwayes send sddress 0 + response.address = Current_Start_address; + response.has_address = true; status_response(status,&response.status, &response.statusword ,&response.has_statusword); @@ -331,6 +331,9 @@ void Stub_ExtFlashReadWordsRequest(MessageContainer* requestContainer) response.readbytes = ExtFlashReadBuf(request->address,request->number_of_words); response.n_readbytes = request->number_of_words; + response.address = request->address; + response.has_address = true; + status_response(status,&response.status, &response.statusword ,&response.has_statusword); responseContainer = createContainer(MESSAGE_TYPE__StubExtFlashReadWordsResponse, requestContainer->token, true, &response, &stub_ext_flash_read_words_response__pack, &stub_ext_flash_read_words_response__get_packed_size); diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_SpeedSensor.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_SpeedSensor.c index a433be2ce..eea594817 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_SpeedSensor.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_SpeedSensor.c @@ -34,6 +34,7 @@ #include "drivers/SPI/SPI_Comm.h" #include "drivers/FPGA/FPGA_SSI_Comm.h" #include "Modules/Thread/Thread_ex.h" +#include #include "Modules/thread/thread.h" diff --git a/Software/Stubs Collection/stubs/Ext_Flash_RW_Buf.cs b/Software/Stubs Collection/stubs/Ext_Flash_RW_Buf.cs index e10e2e32b..dc4b1059d 100644 --- a/Software/Stubs Collection/stubs/Ext_Flash_RW_Buf.cs +++ b/Software/Stubs Collection/stubs/Ext_Flash_RW_Buf.cs @@ -10,8 +10,8 @@ using System.Collections.Generic; using Tango.PMR.Stubs; using Tango.Stubs; -const Int32 No_Words = 1024;//1024 -uint Delta = 10000; //4000000000 +const Int32 No_Words = 128;//MaxFlashWords limited in datadef to 128 //1024 +uint Delta = 0; //4000000000 public void OnExecute(StubManager stubManager) { @@ -50,7 +50,7 @@ public void OnExecute(StubManager stubManager) // --------------------- Flash Read multibyte --------------------- StubExtFlashReadWordsRequest stubExtFlashReadWordsRequest = new StubExtFlashReadWordsRequest(); - stubExtFlashReadWordsRequest.Address = 0; + stubExtFlashReadWordsRequest.Address = response.Address; stubExtFlashReadWordsRequest.NumberOfWords = No_Words; // Number of words to read var response1 = stubManager.Run(stubExtFlashReadWordsRequest); diff --git a/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk b/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk index aff43b505..732068ec9 100644 Binary files a/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk and b/Software/Visual_Studio/Build/Shortcuts/Machine Emulator.lnk differ diff --git a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk index cf8bc1d41..3afe81fc5 100644 Binary files a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk and b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk differ diff --git a/Software/Visual_Studio/Build/Shortcuts/Proto Compiler GUI.lnk b/Software/Visual_Studio/Build/Shortcuts/Proto Compiler GUI.lnk index 482e642bf..42a1600c9 100644 Binary files a/Software/Visual_Studio/Build/Shortcuts/Proto Compiler GUI.lnk and b/Software/Visual_Studio/Build/Shortcuts/Proto Compiler GUI.lnk differ diff --git a/Software/Visual_Studio/Installers/DB_PACK/sqlexaminer.msi b/Software/Visual_Studio/Installers/DB_PACK/sqlexaminer.msi new file mode 100644 index 000000000..a2e29a71e Binary files /dev/null and b/Software/Visual_Studio/Installers/DB_PACK/sqlexaminer.msi differ diff --git a/Software/Visual_Studio/Installers/VS Extensions/TargetFrameworkMigrator.vsix b/Software/Visual_Studio/Installers/VS Extensions/TargetFrameworkMigrator.vsix new file mode 100644 index 000000000..24e59b10f Binary files /dev/null and b/Software/Visual_Studio/Installers/VS Extensions/TargetFrameworkMigrator.vsix differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Properties/AssemblyInfo.cs index bda64c925..7af9df838 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Properties/AssemblyInfo.cs @@ -5,7 +5,7 @@ using System.Runtime.InteropServices; using System.Windows; [assembly: AssemblyTitle("Tango - Machine Studio Color Lab Module")] -[assembly: AssemblyVersion("2.0.8.1633")] +[assembly: AssemblyVersion("2.0.9.1119")] [assembly: ComVisible(false)] diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Tango.MachineStudio.ColorLab.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Tango.MachineStudio.ColorLab.csproj index a0d471522..7e8a9e126 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Tango.MachineStudio.ColorLab.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Tango.MachineStudio.ColorLab.csproj @@ -8,7 +8,7 @@ library Tango.MachineStudio.ColorLab Tango.MachineStudio.ColorLab - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs index 5b317e6d2..02f496b1f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs @@ -25,7 +25,7 @@ using Tango.SharedUI.Controls; namespace Tango.MachineStudio.ColorLab.ViewModels { - public class MainViewVM : StudioViewModel + public class MainViewVM : StudioViewModel { private ObservablesContext _dbContext; private INotificationProvider _notification; @@ -239,34 +239,57 @@ namespace Tango.MachineStudio.ColorLab.ViewModels #endregion + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// The notification. public MainViewVM(INotificationProvider notification) : base() { _notification = notification; - _dbContext = ObservablesContext.CreateDefault(); - CCT = new Cct(); SourceColor = new RgbVM(); SourceColor.ColorChanged += SourceColor_ColorChanged; - Machines = _dbContext.Machines.ToObservableCollection(); - ColorSpaces = _dbContext.ColorSpaces.ToObservableCollection(); - Rmls = _dbContext.Rmls.ToObservableCollection(); - ImportForwardDataCommand = new RelayCommand(ImportForwardData, () => SelectedRML != null); - ImportInverseDataCommand = new RelayCommand(ImportInverseData, () => SelectedRML != null); + ImportForwardDataCommand = new RelayCommand(ImportForwardData, () => SelectedRML != null && IsFree); + ImportInverseDataCommand = new RelayCommand(ImportInverseData, () => SelectedRML != null && IsFree); - ExportForwardDataCommand = new RelayCommand(ExportForwardData, () => SelectedRML != null && CCT != null && CCT.ForwardFileName != null); - ExportInverseDataCommand = new RelayCommand(ExportInverseData, () => SelectedRML != null && CCT != null && CCT.InverseFileName != null); + ExportForwardDataCommand = new RelayCommand(ExportForwardData, () => SelectedRML != null && CCT != null && CCT.ForwardFileName != null && IsFree); + ExportInverseDataCommand = new RelayCommand(ExportInverseData, () => SelectedRML != null && CCT != null && CCT.InverseFileName != null && IsFree); - SaveCommand = new RelayCommand(Save, () => SelectedRML != null); + SaveCommand = new RelayCommand(Save, () => SelectedRML != null && IsFree); } + #endregion + + #region Event Handlers + private void SourceColor_ColorChanged(object sender, Color e) { GetHiveSuggestions(); } + #endregion + + #region Application Ready + + public override void OnApplicationReady() + { + Task.Factory.StartNew(() => + { + _dbContext = ObservablesContext.CreateDefault(); + + Machines = _dbContext.Machines.ToObservableCollection(); + ColorSpaces = _dbContext.ColorSpaces.ToObservableCollection(); + Rmls = _dbContext.Rmls.ToObservableCollection(); + }); + } + + #endregion + #region ColorLab private void GetHiveSuggestions() @@ -417,6 +440,10 @@ namespace Tango.MachineStudio.ColorLab.ViewModels { if (SelectedMachine != null) { + IsFree = false; + + _dbContext.Adapter.GetConfiguration(x => x.Guid == SelectedMachine.ConfigurationGuid); + LiquidVolumes = SelectedMachine.Configuration.NoneEmptyIdsPacks.OrderBy(x => x.PackIndex).Select(x => new LiquidVolumeVM() { Color = x.LiquidType.Color, @@ -424,12 +451,17 @@ namespace Tango.MachineStudio.ColorLab.ViewModels IdsPack = x, }).ToObservableCollection(); + + LiquidVolumes.EnableCrossThreadOperations(); + LiquidVolumes.ToList().ForEach(x => x.VolumeChanged += (s, e) => OnLiquidVolumeChanged()); InvalidateLiquidFactorsCalibrationData(); SelectedMachine.Modified -= SelectedMachine_Modified; SelectedMachine.Modified += SelectedMachine_Modified; + + IsFree = true; } } @@ -515,42 +547,61 @@ namespace Tango.MachineStudio.ColorLab.ViewModels #region RML - private void InvalidateLiquidFactorsCalibrationData() + private async void InvalidateLiquidFactorsCalibrationData() { if (SelectedRML != null && SelectedMachine != null) { - LiquidTypesRmls = SelectedMachine.Configuration.NoneEmptyIdsPacks.OrderBy(x => x.PackIndex).Select(x => x.LiquidType).SelectMany(x => x.LiquidTypesRmls).Where(x => x.Rml.Guid == SelectedRML.Guid).ToList(); - //RmlProcessParametersTableGroup = SelectedRML.ProcessParametersTablesGroups.ToList().SingleOrDefault(x => x.Active); + IsFree = false; - LiquidsCalibrationData = new ObservableCollection(); - - foreach (var idsPack in SelectedMachine.Configuration.NoneEmptyIdsPacks.OrderBy(x => x.PackIndex)) + await Task.Factory.StartNew(() => { - CalibrationDataVM vm = new CalibrationDataVM(); - vm.Name = idsPack.LiquidType.Name; - vm.Color = idsPack.LiquidType.Color; - vm.IdsPack = idsPack; + using (_notification.PushTaskItem("Loading RML data...")) + { + _dbContext.Adapter.GetConfiguration(x => x.Guid == SelectedMachine.ConfigurationGuid); + _dbContext.Adapter.GetRmlCCTs(SelectedRML.Guid); + _dbContext.Adapter.GetRmlCATs(SelectedRML.Guid, SelectedMachine.Guid); + _dbContext.Adapter.GetRmlLiquidTypes(SelectedRML.Guid); - var cat = idsPack.LiquidType.Cats.FirstOrDefault(x => x.Machine == SelectedMachine && x.Rml == SelectedRML); + LiquidTypesRmls = SelectedMachine.Configuration.NoneEmptyIdsPacks.OrderBy(x => x.PackIndex).Select(x => x.LiquidType).SelectMany(x => x.LiquidTypesRmls).Where(x => x.Rml.Guid == SelectedRML.Guid).ToList(); + //RmlProcessParametersTableGroup = SelectedRML.ProcessParametersTablesGroups.ToList().SingleOrDefault(x => x.Active); - if (cat != null) - { - var calData = cat.GetCalibrationData(); - vm.CalibrationPoints = calData.CalibrationPoints.Select(x => new CalibrationDataPointVM(x.X, x.Y)).ToObservableCollection(); - } + LiquidsCalibrationData = new ObservableCollection(); + LiquidsCalibrationData.EnableCrossThreadOperations(); - LiquidsCalibrationData.Add(vm); - } + foreach (var idsPack in SelectedMachine.Configuration.NoneEmptyIdsPacks.OrderBy(x => x.PackIndex)) + { + CalibrationDataVM vm = new CalibrationDataVM(); + vm.Name = idsPack.LiquidType.Name; + vm.Color = idsPack.LiquidType.Color; + vm.IdsPack = idsPack; + + var cat = idsPack.LiquidType.Cats.FirstOrDefault(x => x.Machine == SelectedMachine && x.Rml == SelectedRML); + + if (cat != null) + { + var calData = cat.GetCalibrationData(); + vm.CalibrationPoints = calData.CalibrationPoints.Select(x => new CalibrationDataPointVM(x.X, x.Y)).ToObservableCollection(); + } + + InvokeUINow(() => + { + LiquidsCalibrationData.Add(vm); + }); + } - _isNewCCT = false; - CCT = SelectedRML.Ccts.FirstOrDefault(); + _isNewCCT = false; + CCT = SelectedRML.Ccts.FirstOrDefault(); - if (CCT == null) - { - CCT = new Cct(); - CCT.Rml = SelectedRML; - _isNewCCT = true; - } + if (CCT == null) + { + CCT = new Cct(); + CCT.Rml = SelectedRML; + _isNewCCT = true; + } + } + }); + + IsFree = true; } } @@ -564,6 +615,8 @@ namespace Tango.MachineStudio.ColorLab.ViewModels { try { + IsFree = false; + if (_isNewCCT) { _dbContext.Ccts.Add(CCT); @@ -601,6 +654,10 @@ namespace Tango.MachineStudio.ColorLab.ViewModels { _notification.ShowError(LogManager.Log(ex, "An error occurred while trying to save to data base.").Message + Environment.NewLine + ex.Message); } + finally + { + IsFree = true; + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml index d8ef015be..78eaf04e8 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml @@ -35,7 +35,7 @@ - + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/AssemblyInfo.cs index 51246a5d1..24afc84e3 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Properties/AssemblyInfo.cs @@ -5,7 +5,7 @@ using System.Runtime.InteropServices; using System.Windows; [assembly: AssemblyTitle("Tango - Machine Studio Data Capturing Module")] -[assembly: AssemblyVersion("2.0.8.1633")] +[assembly: AssemblyVersion("2.0.9.1119")] [assembly: ComVisible(false)] diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Tango.MachineStudio.DataCapture.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Tango.MachineStudio.DataCapture.csproj index a8cd6b1cd..15df43f6e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Tango.MachineStudio.DataCapture.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Tango.MachineStudio.DataCapture.csproj @@ -8,7 +8,7 @@ library Tango.MachineStudio.DataCapture Tango.MachineStudio.DataCapture - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 @@ -31,6 +31,12 @@ 4 + + ..\..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll + + + ..\..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll + ..\..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll @@ -44,6 +50,7 @@ ..\..\..\packages\MaterialDesignThemes.2.3.1.953\lib\net45\MaterialDesignThemes.Wpf.dll + @@ -188,7 +195,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/app.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/app.config index 5d794b958..0e58ccf54 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/app.config +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/app.config @@ -1,5 +1,9 @@  + + +
+ @@ -46,6 +50,16 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/packages.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/packages.config index 73dae1a0c..d1cf6cd7a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/packages.config +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/packages.config @@ -1,6 +1,7 @@  + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Navigation/DeveloperNavigationManager.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Navigation/DeveloperNavigationManager.cs index ff8b0320d..b1039c2c5 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Navigation/DeveloperNavigationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Navigation/DeveloperNavigationManager.cs @@ -16,7 +16,7 @@ namespace Tango.MachineStudio.Developer.Navigation public void NavigateTo(DeveloperNavigationView view) { LogManager.Log(String.Format("Navigating to view {0}...", view.ToString())); - MainView.Instance.TransitionControl.NavigateTo(view.ToString()); + MainView.Instance.NavigationControl.NavigateTo(view.ToString()); } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Properties/AssemblyInfo.cs index 66e36649b..333ca0b2e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Properties/AssemblyInfo.cs @@ -5,7 +5,7 @@ using System.Runtime.InteropServices; using System.Windows; [assembly: AssemblyTitle("Tango - Machine Studio Developer Module")] -[assembly: AssemblyVersion("2.0.15.1633")] +[assembly: AssemblyVersion("2.0.16.1119")] [assembly: ComVisible(false)] diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj index bd7484de8..cc9831ad9 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj @@ -8,7 +8,7 @@ library Tango.MachineStudio.Developer Tango.MachineStudio.Developer - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 @@ -196,6 +196,10 @@ {b9ae25d6-be35-492f-9079-21a7f3e6f7cc} RealTimeGraphEx + + {BB2ABB74-BA58-4812-83AA-EC8171F42DF4} + Tango.AutoComplete + {f441feee-322a-4943-b566-110e12fd3b72} Tango.BL @@ -264,10 +268,6 @@ {fc337a7f-1214-41d8-9992-78092a3b961e} Tango.MachineStudio.DataCapture - - {94f7acf8-55e1-4a02-b9bc-a818413fdbbf} - Tango.MachineStudio.DB - {1674f726-0e66-414f-b9fd-c6f20d7f07c7} Tango.MachineStudio.Logging @@ -276,10 +276,6 @@ {d0ce8122-077d-42a2-9490-028ae4769b52} Tango.MachineStudio.MachineDesigner - - {5d39c1e1-3ecd-4634-bd1b-2bcf71c54a15} - Tango.MachineStudio.Technician - diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModelLocator.cs index ebf2f2446..5f82984a4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModelLocator.cs @@ -16,8 +16,8 @@ namespace Tango.MachineStudio.Developer /// static ViewModelLocator() { - TangoIOC.Default.Register(); TangoIOC.Default.Register(); + TangoIOC.Default.Register(); } public static MainViewVM MainViewVM diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index dace2ceac..60c2e65f9 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -41,6 +41,9 @@ using Tango.MachineStudio.Common; using Tango.BL.ColorConversion; using Tango.MachineStudio.Logging.ViewModels; using Tango.MachineStudio.Logging.Views; +using Tango.AutoComplete.Editors; +using System.Data.Entity; +using System.Runtime.ExceptionServices; namespace Tango.MachineStudio.Developer.ViewModels { @@ -48,7 +51,8 @@ namespace Tango.MachineStudio.Developer.ViewModels /// Represents the developer module main view, view model. /// /// - public class MainViewVM : StudioViewModel + [TangoCreateWhenRegistered] + public class MainViewVM : StudioViewModel { private static object _syncLock = new object(); private const string EMB_FORMATS_EXPORT = "Baby Lock (PES)|*.pes|Tajima (DST)|*.dst|EXP|*.exp|PCS|*.pcs|HUS|*.hus|KSM|*.ksm"; @@ -71,6 +75,7 @@ namespace Tango.MachineStudio.Developer.ViewModels private bool _hiveOpened; private bool _color_changed_from_hive; private bool _dialog_shown; + private bool _disable_gamut_check; #region Properties @@ -104,16 +109,6 @@ namespace Tango.MachineStudio.Developer.ViewModels set { _runningJobStatus = value; RaisePropertyChangedAuto(); } } - private ObservableCollection _machines; - /// - /// Gets or sets the machines. - /// - public ObservableCollection Machines - { - get { return _machines; } - set { _machines = value; RaisePropertyChangedAuto(); } - } - private ObservableCollection _colorSpaces; /// /// Gets or sets the color spaces. @@ -173,19 +168,32 @@ namespace Tango.MachineStudio.Developer.ViewModels get { return _selectedMachine; } set { - _selectedMachine = value; - OnSelectedMachineChanged(); - RaisePropertyChangedAuto(); - InvalidateRelayCommands(); - - if (_selectedMachine != null) + if (value != null && _selectedMachine != value) { - _selectedMachine.Modified -= SelectedMachine_Modified; - _selectedMachine.Modified += SelectedMachine_Modified; + _selectedMachine = value; + OnSelectedMachineChanged(); + RaisePropertyChangedAuto(); + InvalidateRelayCommands(); + + if (_selectedMachine != null) + { + _selectedMachine.Modified -= SelectedMachine_Modified; + _selectedMachine.Modified += SelectedMachine_Modified; + } } } } + private bool _canWork; + /// + /// Gets or sets a value indicating whether this instance is loading machine. + /// + public bool CanWork + { + get { return _canWork; } + set { _canWork = value; RaisePropertyChangedAuto(); } + } + private List _liquidTypesRmls; /// /// Gets or sets the liquid types RMLS. @@ -248,7 +256,6 @@ namespace Tango.MachineStudio.Developer.ViewModels { _activeJob = value; RaisePropertyChangedAuto(); - OnActiveJobChanged(); } } @@ -322,7 +329,7 @@ namespace Tango.MachineStudio.Developer.ViewModels set { _selectedRML = value; - InvalidateLiquidFactorsAndProcessTables(); + OnSelectedRMLChanged(); RaisePropertyChangedAuto(); InvalidateRelayCommands(); } @@ -504,6 +511,11 @@ namespace Tango.MachineStudio.Developer.ViewModels set { _selectedJobEvent = value; RaisePropertyChangedAuto(); OnSelectedJobEventChanged(); } } + /// + /// Gets or sets the machines providers. + /// + public ISuggestionProvider MachinesProvider { get; set; } + #endregion #region Commands @@ -643,28 +655,7 @@ namespace Tango.MachineStudio.Developer.ViewModels /// The notification provider. public MainViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider, IDiagnosticsFrameProvider diagnosticsFrameProvider, IVideoCaptureProvider videoCaptureProvider, DeveloperNavigationManager navigation, IAuthenticationProvider authentication, IEventLogger eventLogger, ISpeechProvider speech) { - _settings = SettingsManager.Default.GetOrCreate(); - - SelectedJobs = new ObservableCollection(); - - JobEvents = new ObservableCollection(); - - LogManager.Log("Initializing machine Db context..."); - _machineDbContext = ObservablesContext.CreateDefault(); - - Machines = _machineDbContext.Machines.ToObservableCollection(); - - if (_settings.LastSelectedMachineGuid != null) - { - LogManager.Log("Setting last selected machine from settings..."); - SelectedMachine = _machineDbContext.Machines.SingleOrDefault(x => x.Guid == _settings.LastSelectedMachineGuid); - } - - if (_settings.LastSelectedJobGuid != null && SelectedMachine != null) - { - LogManager.Log("Setting last selected job from settings..."); - SelectedMachineJob = SelectedMachine.Jobs.SingleOrDefault(x => x.Guid == _settings.LastSelectedJobGuid); - } + CanWork = true; _authentication = authentication; @@ -684,36 +675,76 @@ namespace Tango.MachineStudio.Developer.ViewModels }); //Initialize Commands... - EditMachineCommand = new RelayCommand(EditMachine, () => SelectedMachine != null); - EditRMLCommand = new RelayCommand(EditRML, () => SelectedRML != null); + EditMachineCommand = new RelayCommand(EditMachine, () => SelectedMachine != null && CanWork); + EditRMLCommand = new RelayCommand(EditRML, () => SelectedRML != null && CanWork); ToggleSideBarCommand = new RelayCommand(() => IsSideBarOpened = !IsSideBarOpened); - SaveLiquidFactorsCommand = new RelayCommand(SaveLiquidFactors, () => SelectedRML != null); - AddSegmentCommand = new RelayCommand(AddSegment, () => ActiveJob != null); - RemoveSegmentCommand = new RelayCommand(RemoveSelectedSegments, () => SelectedSegment != null); - AddJobCommand = new RelayCommand(AddJob, () => SelectedMachine != null); - RemoveJobCommand = new RelayCommand(RemoveSelectedJobs, () => SelectedMachineJob != null); - AddBrushStopCommand = new RelayCommand(AddBrushStop, () => SelectedSegment != null); - RemoveBrushStopCommand = new RelayCommand(RemoveSelectedBrushStops, () => SelectedBrushStop != null); - SaveJobCommand = new RelayCommand(SaveActiveJob, () => SelectedMachine != null); - DiscardJobCommand = new RelayCommand(BackToJobs, () => SelectedMachine != null); - StartJobCommand = new RelayCommand(StartJob, () => ActiveJob != null && !IsJobRunning && MachineOperator != null && !MachineOperator.MachineEventsStateProvider.Events.ToList().Exists(x => x.ActionTypes.Contains(BL.Enumerations.ActionTypes.PreventJobExecution))); + SaveLiquidFactorsCommand = new RelayCommand(SaveLiquidFactors, () => SelectedRML != null && CanWork); + AddSegmentCommand = new RelayCommand(AddSegment, () => ActiveJob != null && CanWork); + RemoveSegmentCommand = new RelayCommand(RemoveSelectedSegments, () => SelectedSegment != null && CanWork); + AddJobCommand = new RelayCommand(AddJob, () => SelectedMachine != null && CanWork); + RemoveJobCommand = new RelayCommand(RemoveSelectedJobs, () => SelectedMachineJob != null && CanWork); + AddBrushStopCommand = new RelayCommand(AddBrushStop, () => SelectedSegment != null && CanWork); + RemoveBrushStopCommand = new RelayCommand(RemoveSelectedBrushStops, () => SelectedBrushStop != null && CanWork); + SaveJobCommand = new RelayCommand(SaveActiveJob, () => SelectedMachine != null && CanWork); + DiscardJobCommand = new RelayCommand(BackToJobs, () => SelectedMachine != null && CanWork); + StartJobCommand = new RelayCommand(StartJob, () => ActiveJob != null && CanWork && !IsJobRunning && MachineOperator != null && !MachineOperator.MachineEventsStateProvider.Events.ToList().Exists(x => x.ActionTypes.Contains(BL.Enumerations.ActionTypes.PreventJobExecution))); StartJobAndRecordCommand = new RelayCommand(StartJobAndRecord, () => _dataCaptureVM != null && !_dataCaptureVM.Recorder.IsRecording && !_dataCaptureVM.Player.IsPlaying && ActiveJob != null && !IsJobRunning && MachineOperator != null && !MachineOperator.MachineEventsStateProvider.Events.ToList().Exists(x => x.ActionTypes.Contains(BL.Enumerations.ActionTypes.PreventJobExecution))); - StopJobCommand = new RelayCommand(StopJob, () => IsJobRunning); + StopJobCommand = new RelayCommand(StopJob, () => IsJobRunning && CanWork); CloseJobCompletionStatusCommand = new RelayCommand(CloseJobCompletionStatusBar); - LoadJobCommand = new RelayCommand(LoadSelectedJob, () => SelectedMachineJob != null); - DuplicateJobCommand = new RelayCommand(DuplicateSelectedJobs, () => SelectedMachineJob != null); - DuplicateSegmentCommand = new RelayCommand(DuplicateSelectedSegments, () => SelectedSegment != null); - DuplicateBrushStopCommand = new RelayCommand(DuplicateSelectedBrushStops, () => SelectedBrushStop != null); - SaveProcessParametersCommand = new RelayCommand(SaveProcessParameters, () => SelectedRML != null && SelectedRML.ProcessParametersTablesGroups.Count > 0); - PushProcessParametersCommand = new RelayCommand(PushProcessParameters, () => SelectedRML != null && SelectedRML.ProcessParametersTablesGroups.Count > 0 && SelectedProcessParametersTable != null && MachineOperator != null); - ImportEmbroideryFileCommand = new RelayCommand(ImportEmbroideryFile, () => SelectedMachine != null); - DisplayJobEmbroideryFileCommand = new RelayCommand(DisplayJobEmbroideryFile); - ReloadMachinesCommand = new RelayCommand(ReloadMachine); + LoadJobCommand = new RelayCommand(LoadSelectedJob, () => SelectedMachineJob != null && CanWork); + DuplicateJobCommand = new RelayCommand(DuplicateSelectedJobs, () => SelectedMachineJob != null && CanWork); + DuplicateSegmentCommand = new RelayCommand(DuplicateSelectedSegments, () => SelectedSegment != null && CanWork); + DuplicateBrushStopCommand = new RelayCommand(DuplicateSelectedBrushStops, () => SelectedBrushStop != null && CanWork); + SaveProcessParametersCommand = new RelayCommand(SaveProcessParameters, () => SelectedRML != null && CanWork && SelectedRML.ProcessParametersTablesGroups.Count > 0); + PushProcessParametersCommand = new RelayCommand(PushProcessParameters, () => SelectedRML != null && CanWork && SelectedRML.ProcessParametersTablesGroups.Count > 0 && SelectedProcessParametersTable != null && MachineOperator != null); + ImportEmbroideryFileCommand = new RelayCommand(ImportEmbroideryFile, () => SelectedMachine != null && CanWork); + DisplayJobEmbroideryFileCommand = new RelayCommand(DisplayJobEmbroideryFile, () => CanWork); + ReloadMachinesCommand = new RelayCommand(() => LoadMachine(), () => CanWork && SelectedMachine != null); ApplicationManager.ConnectedMachineChanged += ApplicationManager_ConnectedMachineChanged; _eventLogger.NewLog += _eventLogger_NewLog; + + MachinesProvider = new SuggestionProvider((filter) => + { + try + { + return _machineDbContext.Machines.Where(x => x.SerialNumber.StartsWith(filter)).ToList(); + } + catch + { + return null; + } + }); + } + + #endregion + + #region Application Ready + + public override void OnApplicationReady() + { + _settings = SettingsManager.Default.GetOrCreate(); + + SelectedJobs = new ObservableCollection(); + JobEvents = new ObservableCollection(); + + LogManager.Log("Initializing machine Db context..."); + _machineDbContext = ObservablesContext.CreateDefault(); + + if (_settings.LastSelectedMachineGuid != null) + { + LogManager.Log("Setting last selected machine from settings..."); + SelectedMachine = _machineDbContext.Machines.SingleOrDefault(x => x.Guid == _settings.LastSelectedMachineGuid); + } + + if (_settings.LastSelectedJobGuid != null && SelectedMachine != null) + { + LogManager.Log("Setting last selected job from settings..."); + SelectedMachineJob = SelectedMachine.Jobs.SingleOrDefault(x => x.Guid == _settings.LastSelectedJobGuid); + } + _colorConversionThread = new Thread(ColorConversionThreadMethod); _colorConversionThread.IsBackground = true; _colorConversionThread.Start(); @@ -723,37 +754,42 @@ namespace Tango.MachineStudio.Developer.ViewModels #region Color Conversion + [HandleProcessCorruptedStateExceptions] private void ColorConversionThreadMethod() { while (true) { - if (IsVisible && ActiveJob != null && ActiveJob.Segments != null) + if (!_disable_gamut_check && IsVisible && ActiveJob != null && ActiveJob.Segments != null) { - var stops = ActiveJob.Segments.SelectMany(x => x.BrushStops).ToList(); - - foreach (var stop in stops) + try { - if (stop.ColorSpace.Code == BL.Enumerations.ColorSpaces.Volume.ToInt32() && !stop.IsLiquidVolumesOutOfRange) + var stops = ActiveJob.Segments.SelectMany(x => x.BrushStops).ToList(); + + foreach (var stop in stops) { - try + if (stop.ColorSpace.Code == BL.Enumerations.ColorSpaces.Volume.ToInt32() && !stop.IsLiquidVolumesOutOfRange) { - var output = TangoColorConverter.GetSuggestions(stop); - - stop.Red = output.SingleCoordinates.Red; - stop.Green = output.SingleCoordinates.Green; - stop.Blue = output.SingleCoordinates.Blue; + try + { + var output = TangoColorConverter.GetSuggestions(stop); + + stop.Red = output.SingleCoordinates.Red; + stop.Green = output.SingleCoordinates.Green; + stop.Blue = output.SingleCoordinates.Blue; + } + catch { } } - catch { } - } - else if (stop.ColorSpace.Code == BL.Enumerations.ColorSpaces.RGB.ToInt32() && !stop.Corrected) - { - try + else if (stop.ColorSpace.Code == BL.Enumerations.ColorSpaces.RGB.ToInt32() && !stop.Corrected) { - stop.IsOutOfGamut = TangoColorConverter.IsOutOfGamut(stop); + try + { + stop.IsOutOfGamut = TangoColorConverter.IsOutOfGamut(stop); + } + catch { } } - catch { } } } + catch { } } Thread.Sleep(500); @@ -950,9 +986,12 @@ namespace Tango.MachineStudio.Developer.ViewModels if (RmlProcessParametersTableGroup != null && RmlProcessParametersTableGroup.ProcessParametersTables.Count > 0) { LogManager.Log("Process parameters group changed..."); - SelectedProcessParametersTable = RmlProcessParametersTableGroup.ProcessParametersTables.OrderBy(x => x.TableIndex).FirstOrDefault(); - UpdateEstimatedDuration(); + InvokeUI(() => + { + SelectedProcessParametersTable = RmlProcessParametersTableGroup.ProcessParametersTables.OrderBy(x => x.TableIndex).FirstOrDefault(); + UpdateEstimatedDuration(); + }); } } @@ -992,9 +1031,7 @@ namespace Tango.MachineStudio.Developer.ViewModels if (SelectedMachine != null) { LogManager.Log(String.Format("Machine {0} changed.", SelectedMachine.SerialNumber)); - ReloadMachine(); - JobsCollectionView = CollectionViewSource.GetDefaultView(SelectedMachine.Jobs); - JobsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Job.LastUpdated), ListSortDirection.Descending)); + LoadMachine(); } } @@ -1018,19 +1055,6 @@ namespace Tango.MachineStudio.Developer.ViewModels }; } - /// - /// Called when the active job has changed. - /// - protected virtual void OnActiveJobChanged() - { - if (ActiveJob != null) - { - LogManager.Log(String.Format("Active job {0} changed.", ActiveJob.Name)); - SegmentsCollectionView = CollectionViewSource.GetDefaultView(ActiveJob.Segments); - SegmentsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Segment.SegmentIndex), ListSortDirection.Ascending)); - } - } - #endregion #region Drag & Drop @@ -1297,12 +1321,21 @@ namespace Tango.MachineStudio.Developer.ViewModels { if (SelectedRML != null) { + CanWork = false; + using (_notification.PushTaskItem("Saving Liquid Factors...")) { LogManager.Log(String.Format("Saving liquid factors for RML {0}...", SelectedRML.Name)); await SelectedRML.SaveAsync(_activeJobDbContext); - InvalidateLiquidFactorsAndProcessTables(); + LiquidTypesRmls = ActiveJob.Machine.Configuration.NoneEmptyIdsPacks.Where(x => !x.IsEmpty).OrderBy(x => x.PackIndex).Select(x => x.LiquidType).SelectMany(x => x.LiquidTypesRmls).Where(x => x.Rml.Guid == SelectedRML.Guid).ToList(); + + if (SelectedSegment != null) + { + SetSegmentBrushStopsLiquidVolumes(SelectedSegment); + } } + + CanWork = true; } } @@ -1312,7 +1345,6 @@ namespace Tango.MachineStudio.Developer.ViewModels private void EditRML() { LogManager.Log(String.Format("Requesting DB module for RML {0} editing...", SelectedRML.Name)); - ApplicationManager.RequestModule("Data Base", SelectedRML); } /// @@ -1323,7 +1355,10 @@ namespace Tango.MachineStudio.Developer.ViewModels if (SelectedRML != null && SelectedMachine != null) { LogManager.Log("Invalidating liquid factors, process parameters and process group history..."); - LiquidTypesRmls = SelectedMachine.Configuration.NoneEmptyIdsPacks.Where(x => !x.IsEmpty).OrderBy(x => x.PackIndex).Select(x => x.LiquidType).SelectMany(x => x.LiquidTypesRmls).Where(x => x.Rml.Guid == SelectedRML.Guid).ToList(); + LiquidTypesRmls = ActiveJob.Machine.Configuration.NoneEmptyIdsPacks.Where(x => !x.IsEmpty).OrderBy(x => x.PackIndex).Select(x => x.LiquidType).SelectMany(x => x.LiquidTypesRmls).Where(x => x.Rml.Guid == SelectedRML.Guid).ToList(); + + _activeJobDbContext.ProcessParametersTablesGroups.Where(x => x.RmlGuid == SelectedRML.Guid).Include(x => x.ProcessParametersTables).ToList(); + RmlProcessParametersTableGroup = SelectedRML.ProcessParametersTablesGroups.ToList().SingleOrDefault(x => x.Active); var selectedHistory = RmlProcessParametersTableGroup; @@ -1334,11 +1369,26 @@ namespace Tango.MachineStudio.Developer.ViewModels RmlProcessParametersTableGroup.ProcessParametersTables = RmlProcessParametersTableGroup.ProcessParametersTables.OrderBy(x => x.TableIndex).ToObservableCollection(); } - GroupsHistory = SelectedRML.ProcessParametersTablesGroups.OrderByDescending(x => x.SaveDate).OrderBy(x => !x.Active).ToObservableCollection(); + GroupsHistory = SelectedRML.ProcessParametersTablesGroups.OrderByDescending(x => x.SaveDate).OrderBy(x => !x.Active).ToObservableCollection(); _selectedGroupHistory = selectedHistory; - RaisePropertyChangedAuto(nameof(SelectedGroupHistory)); + InvokeUI(() => + { + RaisePropertyChanged(nameof(SelectedGroupHistory)); + RaisePropertyChanged(nameof(RmlProcessParametersTableGroup)); + }); + } + } + + private async void OnSelectedRMLChanged() + { + using (_notification.PushTaskItem("Loading RML...")) + { + await Task.Factory.StartNew(() => + { + InvalidateLiquidFactorsAndProcessTables(); + }); } } @@ -1375,6 +1425,8 @@ namespace Tango.MachineStudio.Developer.ViewModels if (response == null) return; + CanWork = false; + using (_notification.PushTaskItem("Saving Parameters Group...")) { LogManager.Log(String.Format("Saving process parameters group under the name {0}...", response)); @@ -1408,6 +1460,8 @@ namespace Tango.MachineStudio.Developer.ViewModels InvalidateLiquidFactorsAndProcessTables(); } + + CanWork = true; } #endregion @@ -1417,84 +1471,138 @@ namespace Tango.MachineStudio.Developer.ViewModels /// /// Loads the selected job. /// - private void LoadSelectedJob() + private async void LoadSelectedJob() { if (SelectedMachineJob != null) { + CanWork = false; + using (_notification.PushTaskItem("Loading job details...")) { - LogManager.Log(String.Format("Loading job {0}...", SelectedMachineJob.Name)); - SelectedSegments = new ObservableCollection(); - SelectedBrushStops = new ObservableCollection(); - SelectedRML = null; - SelectedSegment = null; - SelectedGroupHistory = null; - SelectedBrushStop = null; - SelectedProcessParametersTable = null; - RmlProcessParametersTableGroup = null; + await Task.Factory.StartNew(() => + { + _disable_gamut_check = true; + LogManager.Log(String.Format("Loading job {0}...", SelectedMachineJob.Name)); + SelectedSegments = new ObservableCollection(); + SelectedBrushStops = new ObservableCollection(); + SelectedRML = null; + SelectedSegment = null; + SelectedGroupHistory = null; + SelectedBrushStop = null; + SelectedProcessParametersTable = null; + RmlProcessParametersTableGroup = null; - _blockInvalidateCommands = false; + _blockInvalidateCommands = false; - LogManager.Log("Creating active job DB context..."); - _activeJobDbContext = ObservablesContext.CreateDefault(); - _activeJobDbContext.Configuration.LazyLoadingEnabled = true; + LogManager.Log("Creating active job DB context..."); + _activeJobDbContext = ObservablesContext.CreateDefault(); - LogManager.Log("Initializing available color spaces, RMLs & Winding methods..."); - var processParamsGroups = _activeJobDbContext.ProcessParametersTablesGroups.ToList(); - var processParams = _activeJobDbContext.ProcessParametersTables.ToList(); - ColorSpaces = _activeJobDbContext.ColorSpaces.ToObservableCollection(); - Rmls = _activeJobDbContext.Rmls.ToObservableCollection(); - WindingMethods = _activeJobDbContext.WindingMethods.ToObservableCollection(); - SpoolTypes = _activeJobDbContext.SpoolTypes.ToObservableCollection(); + LogManager.Log("Initializing available color spaces, RMLs & Winding methods..."); + //var processParamsGroups = _activeJobDbContext.ProcessParametersTablesGroups.ToList(); + //var processParams = _activeJobDbContext.ProcessParametersTables.ToList(); - LogManager.Log("Setting active job..."); - _activeJob = _activeJobDbContext.Jobs.SingleOrDefault(x => x.Guid == SelectedMachineJob.Guid); + ColorSpaces = _activeJobDbContext.ColorSpaces.ToObservableCollection(); + Rmls = _activeJobDbContext.Rmls.ToObservableCollection(); + WindingMethods = _activeJobDbContext.WindingMethods.ToObservableCollection(); + SpoolTypes = _activeJobDbContext.SpoolTypes.ToObservableCollection(); - _selectedRML = ActiveJob.Rml; + LogManager.Log("Setting active job..."); + ActiveJob = _activeJobDbContext.Jobs.Include(x => x.Rml).Include(x => x.Segments).Include(x => x.Segments.Select(y => y.BrushStops)).SingleOrDefault(x => x.Guid == SelectedMachineJob.Guid); - LogManager.Log("Setting selected segment..."); - _selectedSegment = ActiveJob.Segments.FirstOrDefault(); + _activeJobDbContext.Ccts.Where(x => x.RmlGuid == ActiveJob.RmlGuid).ToList(); + _activeJobDbContext.Cats.Where(x => x.RmlGuid == ActiveJob.RmlGuid).ToList(); + _activeJobDbContext.Machines.SingleOrDefault(x => x.Guid == ActiveJob.MachineGuid); + _activeJobDbContext.Configurations.SingleOrDefault(x => x.Guid == ActiveJob.Machine.ConfigurationGuid); - ActiveJob.LengthChanged -= ActiveJob_LengthChanged; - ActiveJob.LengthChanged += ActiveJob_LengthChanged; + _activeJobDbContext.LiquidTypesRmls.ToList(); - ActiveJob = _activeJob; + _activeJobDbContext.IdsPackFormulas.ToList(); + _activeJobDbContext.LiquidTypes.ToList(); + _activeJobDbContext.MidTankTypes.ToList(); + _activeJobDbContext.DispenserTypes.ToList(); - SelectedRML = _selectedRML; - SelectedSegment = _selectedSegment; + _activeJobDbContext.IdsPacks.Where(x => x.ConfigurationGuid == ActiveJob.Machine.ConfigurationGuid).ToList(); - UpdateEstimatedDuration(); - _blockInvalidateCommands = false; - InvalidateRelayCommands(); + + LogManager.Log("Setting selected segment..."); + _selectedSegment = ActiveJob.Segments.FirstOrDefault(); + + ActiveJob.LengthChanged -= ActiveJob_LengthChanged; + ActiveJob.LengthChanged += ActiveJob_LengthChanged; + + _selectedRML = ActiveJob.Rml; + InvalidateLiquidFactorsAndProcessTables(); + RaisePropertyChanged(nameof(SelectedRML)); + + UpdateEstimatedDuration(); + + _blockInvalidateCommands = false; + InvalidateRelayCommands(); + + _disable_gamut_check = false; + }); + + SegmentsCollectionView = CollectionViewSource.GetDefaultView(ActiveJob.Segments); + SegmentsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Segment.SegmentIndex), ListSortDirection.Ascending)); + + SelectedSegment = _selectedSegment; UIHelper.DoEvents(); _navigation.NavigateTo(DeveloperNavigationView.JobView); - } + + CanWork = true; } } /// /// Saves the active job. /// - private void SaveActiveJob() + private async void SaveActiveJob() { if (ActiveJob != null) { + CanWork = false; + using (_notification.PushTaskItem("Saving job details...")) { - LogManager.Log(String.Format("Saving the active job {0}...", ActiveJob.Name)); - ActiveJob.LastUpdated = DateTime.UtcNow; - ActiveJob.Rml = SelectedRML; - ActiveJob.EstimatedDurationMili = (int)EstimatedDuration.TotalMilliseconds; - - _activeJobDbContext.SaveChanges(); - ReloadMachine(); - SelectedMachineJob = SelectedMachine.Jobs.SingleOrDefault(x => x.Guid == ActiveJob.Guid); + await Task.Factory.StartNew(() => + { + LogManager.Log(String.Format("Saving the active job {0}...", ActiveJob.Name)); + ActiveJob.LastUpdated = DateTime.UtcNow; + ActiveJob.Rml = SelectedRML; + ActiveJob.EstimatedDurationMili = (int)EstimatedDuration.TotalMilliseconds; + _activeJobDbContext.SaveChanges(); + + _machineDbContext.Entry(SelectedMachineJob).Reload(); + + + _machineDbContext.Entry(SelectedMachineJob).Collection(x => x.Segments).Load(); + + foreach (var segment in SelectedMachineJob.Segments.ToList()) + { + _machineDbContext.Entry(segment).Collection(x => x.BrushStops).Load(); + + foreach (var brushStop in segment.BrushStops.ToList()) + { + _machineDbContext.Entry(brushStop).Reload(); + } + + _machineDbContext.Entry(segment).Reload(); + } + + InvokeUI(() => + { + SelectedMachineJob.Segments = SelectedMachineJob.Segments; + }); + + }); } + + CanWork = true; } } @@ -1527,19 +1635,51 @@ namespace Tango.MachineStudio.Developer.ViewModels #region Private Methods - private void ReloadMachine() + private async void LoadMachine() { - LogManager.Log("Reloading selected machine..."); - _machineDbContext.Dispose(); - _machineDbContext = ObservablesContext.CreateDefault(); - _machineDbContext.Configuration.LazyLoadingEnabled = true; - String machineGuid = _selectedMachine.Guid; - Machines = _machineDbContext.Machines.ToObservableCollection(); - _selectedMachine = Machines.SingleOrDefault(x => x.Guid == machineGuid); - RaisePropertyChanged(nameof(SelectedMachine)); + try + { + LogManager.Log("Loading selected machine..."); + + CanWork = false; + + using (_notification.PushTaskItem("Loading selected machine...")) + { + await _machineDbContext.Jobs.Where(x => x.MachineGuid == SelectedMachine.Guid).Include(x => x.User).Include(x => x.User.Contact).LoadAsync(); + await _machineDbContext.Configurations.SingleOrDefaultAsync(x => x.Guid == SelectedMachine.ConfigurationGuid); + + await _machineDbContext.ColorSpaces.LoadAsync(); + + SelectedMachine.Configuration.IdsPacks.EnableCrossThreadOperations(); + + await _machineDbContext.IdsPacks.OrderBy(x => x.PackIndex).Where(x => x.ConfigurationGuid == SelectedMachine.ConfigurationGuid). + Include(x => x.CartridgeType). + Include(x => x.DispenserType). + Include(x => x.LiquidType). + Include(x => x.IdsPackFormula). + Include(x => x.MidTankType).LoadAsync(); + + RaisePropertyChanged(nameof(SelectedMachine)); + + JobsCollectionView = CollectionViewSource.GetDefaultView(SelectedMachine.Jobs); + JobsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Job.LastUpdated), ListSortDirection.Descending)); + } + + CanWork = true; - JobsCollectionView = CollectionViewSource.GetDefaultView(SelectedMachine.Jobs); - JobsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Job.LastUpdated), ListSortDirection.Descending)); + foreach (var job in SelectedMachine.Jobs.OrderByDescending(x => x.LastUpdated)) + { + if (!CanWork) break; + job.Segments.EnableCrossThreadOperations(); + await _machineDbContext.Segments.Where(x => x.JobGuid == job.Guid).Include(x => x.BrushStops).OrderBy(x => x.SegmentIndex).LoadAsync(); + } + } + catch (Exception ex) + { + LogManager.Log(ex); + _notification.ShowError("An error occurred while trying to load the selected machine."); + CanWork = true; + } } private void UpdateEstimatedDuration() @@ -1557,7 +1697,7 @@ namespace Tango.MachineStudio.Developer.ViewModels LogManager.Log("Setting segment brush stops liquid volumes..."); foreach (var stop in segment.BrushStops) { - stop.SetLiquidVolumes(SelectedMachine.Configuration, SelectedRML, SelectedProcessParametersTable); + stop.SetLiquidVolumes(ActiveJob.Machine.Configuration, SelectedRML, SelectedProcessParametersTable); } } } @@ -1568,7 +1708,6 @@ namespace Tango.MachineStudio.Developer.ViewModels private void EditMachine() { LogManager.Log(String.Format("Requesting machine designer module for machine {0} editing...", SelectedMachine.SerialNumber)); - ApplicationManager.RequestModule("Machine Designer", SelectedMachine); } #endregion @@ -1713,14 +1852,15 @@ namespace Tango.MachineStudio.Developer.ViewModels newJob.Rml = _machineDbContext.Rmls.FirstOrDefault(); newJob.WindingMethod = _machineDbContext.WindingMethods.FirstOrDefault(); newJob.SpoolType = _machineDbContext.SpoolTypes.FirstOrDefault(); + newJob.ColorSpace = _machineDbContext.ColorSpaces.FirstOrDefault(); newJob.Machine = SelectedMachine; SelectedMachine.Jobs.Add(newJob); + newJob.AddSolidSegment(); LogManager.Log("Saving selected machine to database..."); await SelectedMachine.SaveAsync(_machineDbContext); SelectedMachineJob = newJob; LoadSelectedJob(); - AddSegment(); } } } @@ -1769,7 +1909,7 @@ namespace Tango.MachineStudio.Developer.ViewModels stop.OffsetPercent = 100; stop.Segment = SelectedSegment; - stop.ColorSpace = _activeJobDbContext.ColorSpaces.FirstOrDefault(); + stop.ColorSpace = ColorSpaces.FirstOrDefault(); stop.Color = Colors.Black; stop.SetLiquidVolumes(SelectedMachine.Configuration, SelectedRML, SelectedProcessParametersTable); SelectedSegment.BrushStops.Add(stop); @@ -1821,6 +1961,8 @@ namespace Tango.MachineStudio.Developer.ViewModels { using (_notification.PushTaskItem("Cloning selected jobs...")) { + CanWork = false; + LogManager.LogFormat("Duplicating {0} jobs...", SelectedJobs.Count); int index = SelectedMachine.Jobs.Max(x => x.JobIndex); @@ -1834,6 +1976,8 @@ namespace Tango.MachineStudio.Developer.ViewModels LogManager.Log("Saving selected machine to database..."); await SelectedMachine.SaveAsync(_machineDbContext); + + CanWork = true; } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index 1b96b27ce..016718075 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -11,11 +11,9 @@ xmlns:hive="clr-namespace:Tango.Hive;assembly=Tango.Hive" xmlns:automation="clr-namespace:Tango.MachineStudio.Common.Automation;assembly=Tango.MachineStudio.Common" xmlns:sys="clr-namespace:System;assembly=mscorlib" - xmlns:techViews="clr-namespace:Tango.MachineStudio.Technician.Views;assembly=Tango.MachineStudio.Technician" xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker" xmlns:dispensing="clr-namespace:Tango.BL.Dispensing;assembly=Tango.BL" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" - xmlns:db="clr-namespace:Tango.MachineStudio.DB.Views.DBViews;assembly=Tango.MachineStudio.DB" xmlns:commonControls="clr-namespace:Tango.MachineStudio.Common.Controls;assembly=Tango.MachineStudio.Common" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:designer="clr-namespace:Tango.MachineStudio.MachineDesigner.Views;assembly=Tango.MachineStudio.MachineDesigner" @@ -1495,9 +1493,9 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs index bb17a502d..2942d36af 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs @@ -64,7 +64,7 @@ namespace Tango.MachineStudio.Developer.Views if (_vm != null && _vm.ActiveJob != null) { List segments = new List(); - foreach (var s in _vm.ActiveJob.Segments) + foreach (var s in _vm.ActiveJob.Segments.OrderBy(x => x.SegmentIndex)) { segments.Add(s); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml index c151b62bc..279a9daf3 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml @@ -6,6 +6,7 @@ xmlns:global="clr-namespace:Tango.MachineStudio.Developer" xmlns:designer="clr-namespace:Tango.MachineStudio.MachineDesigner.Views;assembly=Tango.MachineStudio.MachineDesigner" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" xmlns:automation="clr-namespace:Tango.MachineStudio.Common.Automation;assembly=Tango.MachineStudio.Common" xmlns:localConverters="clr-namespace:Tango.MachineStudio.Developer.Converters" xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels" @@ -13,6 +14,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:observables="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:commonControls="clr-namespace:Tango.MachineStudio.Common.Controls;assembly=Tango.MachineStudio.Common" xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views" mc:Ignorable="d" x:Name="control" d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> @@ -23,6 +25,7 @@ + @@ -36,20 +39,20 @@ TARGET MACHINE - + - - + + - - + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj index 8490800ad..e187db982 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj @@ -8,7 +8,7 @@ library Tango.MachineStudio.Technician Tango.MachineStudio.Technician - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 @@ -31,6 +31,12 @@ 4 + + ..\..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll + + + ..\..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll + ..\..\..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll @@ -47,6 +53,7 @@ ..\..\..\packages\MaterialDesignThemes.2.3.1.953\lib\net45\MaterialDesignThemes.Wpf.dll + ..\..\..\packages\System.Reactive.Core.3.1.1\lib\net46\System.Reactive.Core.dll @@ -612,7 +619,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/BlowerItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/BlowerItem.cs index 59a96f107..6b532204e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/BlowerItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/BlowerItem.cs @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Media; using System.Xml.Serialization; +using Tango.BL; using Tango.BL.Entities; using Tango.SharedUI.Helpers; @@ -31,7 +32,7 @@ namespace Tango.MachineStudio.Technician.TechItems { BlowerConfigurations = new List(); - foreach (var BlowerType in BL.ObservablesEntitiesAdapter.Instance.HardwareBlowerTypes) + foreach (var BlowerType in ObservablesStaticCollections.Instance.HardwareBlowerTypes) { BlowerConfigurations.Add(new HardwareBlower() { HardwareBlowerType = BlowerType }); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/BreakSensorItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/BreakSensorItem.cs index cf1ed682e..4a0d1c9c9 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/BreakSensorItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/BreakSensorItem.cs @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Media; using System.Xml.Serialization; +using Tango.BL; using Tango.BL.Entities; using Tango.SharedUI.Helpers; @@ -31,7 +32,7 @@ namespace Tango.MachineStudio.Technician.TechItems { BreakSensorConfigurations = new List(); - foreach (var BreakSensorType in BL.ObservablesEntitiesAdapter.Instance.HardwareBreakSensorTypes) + foreach (var BreakSensorType in ObservablesStaticCollections.Instance.HardwareBreakSensorTypes) { BreakSensorConfigurations.Add(new HardwareBreakSensor() { HardwareBreakSensorType = BreakSensorType }); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DancerItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DancerItem.cs index e5651acce..1115c6dbf 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DancerItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DancerItem.cs @@ -33,7 +33,7 @@ namespace Tango.MachineStudio.Technician.TechItems { DancerConfigurations = new List(); - foreach (var winderType in BL.ObservablesEntitiesAdapter.Instance.HardwareDancerTypes) + foreach (var winderType in BL.ObservablesStaticCollections.Instance.HardwareDancerTypes) { DancerConfigurations.Add(new HardwareDancer() { HardwareDancerType = winderType }); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DispenserItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DispenserItem.cs index f058036d0..7945c5b73 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DispenserItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DispenserItem.cs @@ -37,7 +37,7 @@ namespace Tango.MachineStudio.Technician.TechItems { DispenserTypes = new List(); - foreach (var techDispenser in BL.ObservablesEntitiesAdapter.Instance.TechDispensers) + foreach (var techDispenser in BL.ObservablesStaticCollections.Instance.TechDispensers) { DispenserTypes.Add(new DispenserType() { Code = int.Parse(techDispenser.Name.Replace("Dispenser", "")) - 1 }); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/JobRunnerItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/JobRunnerItem.cs index 8d102d6c0..3443c008e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/JobRunnerItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/JobRunnerItem.cs @@ -160,6 +160,7 @@ namespace Tango.MachineStudio.Technician.TechItems { Job.Machine = Machine; Job.Rml = Rml; + BrushStop.SetLiquidVolumes(Machine.Configuration, Rml, ProcessParameters); } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorGroupItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorGroupItem.cs index 5cdb8017e..a5288e6bc 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorGroupItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorGroupItem.cs @@ -59,7 +59,7 @@ namespace Tango.MachineStudio.Technician.TechItems { if (TechMotors != null) { - SelectedMotors = new SelectedObjectCollection(ObservablesEntitiesAdapter.Instance.HardwareMotorTypes.ToObservableCollection(), TechMotors); + SelectedMotors = new SelectedObjectCollection(ObservablesStaticCollections.Instance.HardwareMotorTypes.ToObservableCollection(), TechMotors); } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorItem.cs index 779919039..c097a0b7b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorItem.cs @@ -38,7 +38,7 @@ namespace Tango.MachineStudio.Technician.TechItems { MotorConfigurations = new List(); - foreach (var motorType in BL.ObservablesEntitiesAdapter.Instance.HardwareMotorTypes) + foreach (var motorType in BL.ObservablesStaticCollections.Instance.HardwareMotorTypes) { MotorConfigurations.Add(new HardwareMotor() { HardwareMotorType = motorType }); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/PidItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/PidItem.cs index a56c3b0c1..70ecc1a70 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/PidItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/PidItem.cs @@ -33,7 +33,7 @@ namespace Tango.MachineStudio.Technician.TechItems { PidConfigurations = new List(); - foreach (var pidType in BL.ObservablesEntitiesAdapter.Instance.HardwarePidControlTypes) + foreach (var pidType in BL.ObservablesStaticCollections.Instance.HardwarePidControlTypes) { PidConfigurations.Add(new HardwarePidControl() { HardwarePidControlType = pidType }); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ProcessParametersItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ProcessParametersItem.cs index 79aea7a0c..4aedf8bc7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ProcessParametersItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ProcessParametersItem.cs @@ -6,6 +6,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Media; using System.Xml.Serialization; +using Tango.BL; using Tango.BL.Entities; using Tango.Core.Commands; using Tango.SharedUI.Helpers; @@ -93,7 +94,9 @@ namespace Tango.MachineStudio.Technician.TechItems if (_counter > 1) { + String name = ProcessParameters.Name; ProcessParametersTables.Add(ProcessParameters); + ProcessParameters.Name = name; } } @@ -101,15 +104,18 @@ namespace Tango.MachineStudio.Technician.TechItems { if (SelectedResetRML != null) { - var group = SelectedResetRML.ProcessParametersTablesGroups.FirstOrDefault(x => x.Active); - - if (group != null) + using (ObservablesContext db = ObservablesContext.CreateDefault()) { - var table = group.ProcessParametersTables.OrderBy(x => x.TableIndex).FirstOrDefault(); + var group = db.Adapter.GetRmlActiveProcessParametersTablesGroup(SelectedResetRML.Guid); - if (table != null) + if (group != null) { - ProcessParameters = table.Clone(); + var table = group.ProcessParametersTables.OrderBy(x => x.TableIndex).FirstOrDefault(); + + if (table != null) + { + table.MapPrimitivesTo(ProcessParameters); + } } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SpeedSensorItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SpeedSensorItem.cs index a067ec95f..e43a518c1 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SpeedSensorItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SpeedSensorItem.cs @@ -33,7 +33,7 @@ namespace Tango.MachineStudio.Technician.TechItems { SpeedSensorConfigurations = new List(); - foreach (var SpeedSensorType in BL.ObservablesEntitiesAdapter.Instance.HardwareSpeedSensorTypes) + foreach (var SpeedSensorType in BL.ObservablesStaticCollections.Instance.HardwareSpeedSensorTypes) { SpeedSensorConfigurations.Add(new HardwareSpeedSensor() { HardwareSpeedSensorType = SpeedSensorType }); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs index 11188c69d..b6ebf2857 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs @@ -47,7 +47,7 @@ namespace Tango.MachineStudio.Technician.TechItems { ID = Guid.NewGuid().ToString(); Name = "Untitled"; - Adapter = ObservablesEntitiesAdapter.Instance; + Adapter = ObservablesStaticCollections.Instance; _color = Colors.DodgerBlue; } @@ -77,7 +77,7 @@ namespace Tango.MachineStudio.Technician.TechItems /// Gets or sets the db adapter. /// [XmlIgnore] - public ObservablesEntitiesAdapter Adapter { get; set; } + public ObservablesStaticCollections Adapter { get; set; } private String _id; /// diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/WinderItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/WinderItem.cs index 425baf471..2df2d7ad7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/WinderItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/WinderItem.cs @@ -33,7 +33,7 @@ namespace Tango.MachineStudio.Technician.TechItems { WinderConfigurations = new List(); - foreach (var winderType in BL.ObservablesEntitiesAdapter.Instance.HardwareWinderTypes) + foreach (var winderType in BL.ObservablesStaticCollections.Instance.HardwareWinderTypes) { WinderConfigurations.Add(new HardwareWinder() { HardwareWinderType = winderType }); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs index 333e43187..55235b3c2 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs @@ -41,7 +41,7 @@ namespace Tango.MachineStudio.Technician.ViewModels /// /// /// - public class MachineTechViewVM : StudioViewModel + public class MachineTechViewVM : StudioViewModel { private List _diagnoticsMonitorsDataProperties; private IDiagnosticsFrameProvider _diagnosticsFrameProvider; @@ -94,7 +94,7 @@ namespace Tango.MachineStudio.Technician.ViewModels /// /// Gets or sets the db adapter. /// - public ObservablesEntitiesAdapter Adapter { get; set; } + public ObservablesStaticCollections Adapter { get; set; } /// /// Gets or sets the application manager. @@ -241,7 +241,7 @@ namespace Tango.MachineStudio.Technician.ViewModels ApplicationManager = applicationManager; ApplicationManager.ConnectedMachineChanged += ApplicationManager_ConnectedMachineChanged; - Adapter = ObservablesEntitiesAdapter.Instance; + Adapter = ObservablesStaticCollections.Instance; Elements = new ObservableCollection(); OpenProjectCommand = new RelayCommand(OpenProject); @@ -1473,7 +1473,7 @@ namespace Tango.MachineStudio.Technician.ViewModels { if (item is MotorGroupItem) { - (item as MotorGroupItem).TechMotors = ObservablesEntitiesAdapter.Instance.HardwareMotorTypes.Where(x => (item as MotorGroupItem).ItemsGuids.Contains(x.Guid)).ToObservableCollection(); + (item as MotorGroupItem).TechMotors = ObservablesStaticCollections.Instance.HardwareMotorTypes.Where(x => (item as MotorGroupItem).ItemsGuids.Contains(x.Guid)).ToObservableCollection(); } AddTechItem(item); @@ -1572,6 +1572,11 @@ namespace Tango.MachineStudio.Technician.ViewModels }); } + public override void OnApplicationReady() + { + + } + #endregion #region Hardware Configuration @@ -1666,83 +1671,93 @@ namespace Tango.MachineStudio.Technician.ViewModels { if (MachineOperator != null) { - var hw = ApplicationManager.ConnectedMachine.Machine.Configuration.HardwareVersion.Clone(); - - foreach (var motorConfig in hw.HardwareMotors) + using (_notification.PushTaskItem("Uploading hardware configuration...")) { - var itemConfig = MotorItem.MotorConfigurations.SingleOrDefault(x => x.HardwareMotorType.Code == motorConfig.HardwareMotorType.Code); - - if (itemConfig != null) + try { - itemConfig.MapPrimitivesTo(motorConfig); - } - } + HardwareVersion hw = null; + Configuration config = null; - foreach (var pidConfig in hw.HardwarePidControls) - { - var itemConfig = PidItem.PidConfigurations.SingleOrDefault(x => x.HardwarePidControlType.Code == pidConfig.HardwarePidControlType.Code); + await Task.Factory.StartNew(() => + { + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + config = db.Adapter.GetConfiguration(x => x.Guid == ApplicationManager.ConnectedMachine.Machine.ConfigurationGuid).Clone(); + hw = db.Adapter.GetHardwareVersionByMachine(ApplicationManager.ConnectedMachine.Machine.Guid).Clone(); + } + }); - if (itemConfig != null) - { - itemConfig.MapPrimitivesTo(pidConfig); - } - } + foreach (var motorConfig in hw.HardwareMotors) + { + var itemConfig = MotorItem.MotorConfigurations.SingleOrDefault(x => x.HardwareMotorType.Code == motorConfig.HardwareMotorType.Code); - foreach (var winderConfig in hw.HardwareWinders) - { - var itemConfig = WinderItem.WinderConfigurations.SingleOrDefault(x => x.HardwareWinderType.Code == winderConfig.HardwareWinderType.Code); + if (itemConfig != null) + { + itemConfig.MapPrimitivesTo(motorConfig); + } + } - if (itemConfig != null) - { - itemConfig.MapPrimitivesTo(winderConfig); - } - } + foreach (var pidConfig in hw.HardwarePidControls) + { + var itemConfig = PidItem.PidConfigurations.SingleOrDefault(x => x.HardwarePidControlType.Code == pidConfig.HardwarePidControlType.Code); - foreach (var dancerConfig in hw.HardwareDancers) - { - var itemConfig = DancerItem.DancerConfigurations.SingleOrDefault(x => x.HardwareDancerType.Code == dancerConfig.HardwareDancerType.Code); + if (itemConfig != null) + { + itemConfig.MapPrimitivesTo(pidConfig); + } + } - if (itemConfig != null) - { - itemConfig.MapPrimitivesTo(dancerConfig); - } - } + foreach (var winderConfig in hw.HardwareWinders) + { + var itemConfig = WinderItem.WinderConfigurations.SingleOrDefault(x => x.HardwareWinderType.Code == winderConfig.HardwareWinderType.Code); - foreach (var speedSensorConfig in hw.HardwareSpeedSensors) - { - var itemConfig = SpeedSensorItem.SpeedSensorConfigurations.SingleOrDefault(x => x.HardwareSpeedSensorType.Code == speedSensorConfig.HardwareSpeedSensorType.Code); + if (itemConfig != null) + { + itemConfig.MapPrimitivesTo(winderConfig); + } + } - if (itemConfig != null) - { - itemConfig.MapPrimitivesTo(speedSensorConfig); - } - } + foreach (var dancerConfig in hw.HardwareDancers) + { + var itemConfig = DancerItem.DancerConfigurations.SingleOrDefault(x => x.HardwareDancerType.Code == dancerConfig.HardwareDancerType.Code); - foreach (var blowerConfig in hw.HardwareBlowers) - { - var itemConfig = BlowerItem.BlowerConfigurations.SingleOrDefault(x => x.HardwareBlowerType.Code == blowerConfig.HardwareBlowerType.Code); + if (itemConfig != null) + { + itemConfig.MapPrimitivesTo(dancerConfig); + } + } - if (itemConfig != null) - { - itemConfig.MapPrimitivesTo(blowerConfig); - } - } + foreach (var speedSensorConfig in hw.HardwareSpeedSensors) + { + var itemConfig = SpeedSensorItem.SpeedSensorConfigurations.SingleOrDefault(x => x.HardwareSpeedSensorType.Code == speedSensorConfig.HardwareSpeedSensorType.Code); - foreach (var breakSensorConfig in hw.HardwareBreakSensors) - { - var itemConfig = BreakSensorItem.BreakSensorConfigurations.SingleOrDefault(x => x.HardwareBreakSensorType.Code == breakSensorConfig.HardwareBreakSensorType.Code); + if (itemConfig != null) + { + itemConfig.MapPrimitivesTo(speedSensorConfig); + } + } - if (itemConfig != null) - { - itemConfig.MapPrimitivesTo(breakSensorConfig); - } - } + foreach (var blowerConfig in hw.HardwareBlowers) + { + var itemConfig = BlowerItem.BlowerConfigurations.SingleOrDefault(x => x.HardwareBlowerType.Code == blowerConfig.HardwareBlowerType.Code); - using (_notification.PushTaskItem("Uploading hardware configuration...")) - { - try - { - await MachineOperator.UploadHardwareConfiguration(hw, ApplicationManager.ConnectedMachine.Machine.Configuration); + if (itemConfig != null) + { + itemConfig.MapPrimitivesTo(blowerConfig); + } + } + + foreach (var breakSensorConfig in hw.HardwareBreakSensors) + { + var itemConfig = BreakSensorItem.BreakSensorConfigurations.SingleOrDefault(x => x.HardwareBreakSensorType.Code == breakSensorConfig.HardwareBreakSensorType.Code); + + if (itemConfig != null) + { + itemConfig.MapPrimitivesTo(breakSensorConfig); + } + } + + await MachineOperator.UploadHardwareConfiguration(hw, config); } catch (Exception ex) { @@ -1753,11 +1768,19 @@ namespace Tango.MachineStudio.Technician.ViewModels } } - private void ResetHardwareConfiguration(bool showMessage = true) + private async void ResetHardwareConfiguration(bool showMessage = true) { if (MachineOperator != null) { - var hw = ApplicationManager.ConnectedMachine.Machine.Configuration.HardwareVersion; + ObservablesContext db = ObservablesContext.CreateDefault(); + ObservablesContextAdapter adapter = new ObservablesContextAdapter(db); + + HardwareVersion hw = null; + + await Task.Factory.StartNew(() => + { + hw = adapter.GetHardwareVersionByMachine(ApplicationManager.ConnectedMachine.Machine.Guid); + }); foreach (var motorConfig in hw.HardwareMotors) { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml.cs index b60f4d725..977974f8a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml.cs @@ -59,7 +59,7 @@ namespace Tango.MachineStudio.Technician.Views private void OnActionModeClicked(object sender, MouseButtonEventArgs e) { - editor.DeselectElements(); + //editor.DeselectElements(); } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/app.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/app.config index 5d794b958..77b7003e2 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/app.config +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/app.config @@ -1,5 +1,9 @@  + + +
+ @@ -48,4 +52,10 @@ + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/packages.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/packages.config index 49b90c865..ea48e62ff 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/packages.config +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/packages.config @@ -1,6 +1,7 @@  + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Properties/AssemblyInfo.cs index 45b3ef1ce..995336499 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Properties/AssemblyInfo.cs @@ -5,7 +5,7 @@ using System.Runtime.InteropServices; using System.Windows; [assembly: AssemblyTitle("Tango - Machine Studio Users & Roles Module")] -[assembly: AssemblyVersion("2.0.7.1633")] +[assembly: AssemblyVersion("2.0.8.1119")] [assembly: ComVisible(false)] diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Tango.MachineStudio.UsersAndRoles.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Tango.MachineStudio.UsersAndRoles.csproj index 48fe2b34c..539f10574 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Tango.MachineStudio.UsersAndRoles.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Tango.MachineStudio.UsersAndRoles.csproj @@ -8,7 +8,7 @@ library Tango.MachineStudio.UsersAndRoles Tango.MachineStudio.UsersAndRoles - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/MainViewVM.cs index 7d82cbbbc..db312b78f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/MainViewVM.cs @@ -8,14 +8,16 @@ using System.Threading.Tasks; using Tango.BL; using Tango.BL.Entities; using Tango.Core.Commands; +using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.Notifications; using Tango.MachineStudio.UsersAndRoles.Navigation; using Tango.MachineStudio.UsersAndRoles.Providers; using Tango.SharedUI; +using System.Data.Entity; namespace Tango.MachineStudio.UsersAndRoles.ViewModels { - public class MainViewVM : ViewModel + public class MainViewVM : StudioViewModel { private ObservablesContext _organizationsContext; private ObservablesContext _manageContext; @@ -129,8 +131,6 @@ namespace Tango.MachineStudio.UsersAndRoles.ViewModels _navigation = navigation; _notification = notification; - LoadOrganizations(); - ManageOrganizationCommand = new RelayCommand(LoadSelectedOrganization, () => SelectedOrganization != null); BackToOrganizationsCommand = new RelayCommand(BackToOrganizations); ManageUserCommand = new RelayCommand(LoadSelectedUser, () => SelectedUser != null); @@ -144,6 +144,11 @@ namespace Tango.MachineStudio.UsersAndRoles.ViewModels RemoveUserCommand = new RelayCommand(RemoveSelectedUser, () => SelectedUser != null); } + public override void OnApplicationReady() + { + LoadOrganizations(); + } + private async void AddOrganization() { String name = _notification.ShowTextInput("Enter organization name", "Name"); @@ -187,19 +192,20 @@ namespace Tango.MachineStudio.UsersAndRoles.ViewModels } } - private void LoadSelectedUser() + private async void LoadSelectedUser() { using (_notification.PushTaskItem("Loading user details...")) { - Task.Factory.StartNew(() => + await Task.Factory.StartNew(() => { _userContext = ObservablesContext.CreateDefault(); + Roles = _userContext.Roles.ToObservableCollection(); - ManagedUser = _userContext.Users.SingleOrDefault(x => x.Guid == SelectedUser.Guid); + ManagedUser = _userContext.Adapter.GetUser(SelectedUser.Guid); ManagedUserRoles = ManagedUser.Roles.ToObservableCollection(); - - InvokeUI(() => _navigation.NavigateTo(UsersAndRolesNavigationView.UserManagementView)); }); + + _navigation.NavigateTo(UsersAndRolesNavigationView.UserManagementView); } } @@ -242,31 +248,35 @@ namespace Tango.MachineStudio.UsersAndRoles.ViewModels } } - private void LoadSelectedOrganization() + private async void LoadSelectedOrganization() { using (_notification.PushTaskItem("Loading organization...")) { - Task.Factory.StartNew(() => + await Task.Factory.StartNew(() => { _manageContext = ObservablesContext.CreateDefault(); - ManagedOrganization = _manageContext.Organizations.SingleOrDefault(x => x.Guid == SelectedOrganization.Guid); - InvokeUI(() => _navigation.NavigateTo(UsersAndRolesNavigationView.OrganizationManagementView)); + ManagedOrganization = _manageContext.Adapter.GetOrganizationAndUsers(SelectedOrganization.Guid); }); + + _navigation.NavigateTo(UsersAndRolesNavigationView.OrganizationManagementView); } } private void LoadOrganizations() { - _organizationsContext = ObservablesContext.CreateDefault(); - _organizationsContext.Configuration.LazyLoadingEnabled = false; - - _organizationsContext.Users.ToList(); - _organizationsContext.Contacts.ToList(); - _organizationsContext.Addresses.ToList(); - _organizationsContext.Machines.ToList(); - - Organizations = _organizationsContext.Organizations.ToObservableCollection(); + Task.Factory.StartNew(() => + { + _organizationsContext = ObservablesContext.CreateDefault(); + + Organizations = _organizationsContext.Organizations + .Include(x => x.Machines) + .Include(x => x.Users) + .Include(x => x.Users.Select(y => y.Contact)) + .Include(x => x.Users.Select(y => y.Address)) + .Include(x => x.Address) + .ToObservableCollection(); + }); } public void OnDropRole(Role role) diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/AutoComplete/MachinesProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/AutoComplete/MachinesProvider.cs index e486ec79a..ec23fefee 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/AutoComplete/MachinesProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/AutoComplete/MachinesProvider.cs @@ -23,7 +23,7 @@ namespace Tango.MachineStudio.Common.AutoComplete /// public IEnumerable GetSuggestions(string filter) { - return ObservablesEntitiesAdapter.Instance.Machines.Where(x => x.SerialNumber.StartsWith(filter, StringComparison.CurrentCultureIgnoreCase) || x.Name.ToLower().Contains(filter.ToLower())).ToList(); + return ObservablesStaticCollections.Instance.Machines.Where(x => x.SerialNumber.StartsWith(filter, StringComparison.CurrentCultureIgnoreCase) || x.Name.ToLower().Contains(filter.ToLower())).ToList(); } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/LoadingPanel.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/LoadingPanel.cs new file mode 100644 index 000000000..665d6995b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/LoadingPanel.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.Common.Controls +{ + public class LoadingPanel : ContentControl + { + + + public bool IsLoading + { + get { return (bool)GetValue(IsLoadingProperty); } + set { SetValue(IsLoadingProperty, value); } + } + public static readonly DependencyProperty IsLoadingProperty = + DependencyProperty.Register("IsLoading", typeof(bool), typeof(LoadingPanel), new PropertyMetadata(false)); + + + + static LoadingPanel() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(LoadingPanel), new FrameworkPropertyMetadata(typeof(LoadingPanel))); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs index c5b9c63cb..cb4611cad 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs @@ -81,7 +81,6 @@ namespace Tango.MachineStudio.Common.EventLogging try { _db = ObservablesContext.CreateDefault(); - _db.Configuration.LazyLoadingEnabled = false; _db.ActionTypes.ToList(); _db.EventTypesActions.ToList(); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioViewModel.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioViewModel.cs index 4203a1e8b..be0906fc4 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioViewModel.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioViewModel.cs @@ -3,24 +3,15 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using static Tango.SharedUI.Controls.NavigationControl; namespace Tango.MachineStudio.Common { /// /// Represents a Machine Studio view model. /// - public interface IStudioViewModel + public interface IStudioViewModel : INavigationViewModel { - /// - /// Called when the user has navigated in to the module. - /// - void OnNavigatedTo(); - - /// - /// Called when the user has navigated out of the module. - /// - void OnNavigatedFrom(); - /// /// Called when application is shutting down. /// @@ -34,14 +25,13 @@ namespace Tango.MachineStudio.Common Task OnShutdownRequest(); /// - /// Called when another module has wants to navigate to this module with some arguments. + /// Called when the application has been started /// - /// The arguments. - void OnModuleRequest(params object[] args); + void OnApplicationStarted(); /// - /// Called when the application has been started + /// Called when the application is ready and all modules are loaded. /// - void OnApplicationStarted(); + void OnApplicationReady(); } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Modules/IStudioModuleLoader.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Modules/IStudioModuleLoader.cs index 1fd72c53a..990300143 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Modules/IStudioModuleLoader.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Modules/IStudioModuleLoader.cs @@ -12,6 +12,11 @@ namespace Tango.MachineStudio.Common.Modules ///
public interface IStudioModuleLoader { + /// + /// Occurs when all modules are initialized. + /// + event EventHandler ModulesLoaded; + /// /// Gets all loaded modules. /// diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationBlocker.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationBlocker.cs new file mode 100644 index 000000000..abd6db172 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationBlocker.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.Common.Navigation +{ + /// + /// Represents an object which can abort the navigation from it. + /// + public interface INavigationBlocker + { + /// + /// Called before the navigation system navigates from this object. + /// Return false to abort the navigation. + /// + /// + Task OnNavigateOutRequest(); + + /// + /// Called before the navigation system navigates back from this object. + /// Return false to abort the navigation. + /// + /// + Task OnNavigateBackRequest(); + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationManager.cs index 4d1cbea8c..e20940c8d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationManager.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.Core.Commands; namespace Tango.MachineStudio.Common.Navigation { @@ -12,9 +13,102 @@ namespace Tango.MachineStudio.Common.Navigation public interface INavigationManager { /// - /// Navigates to the specified view. + /// Gets the current module. + /// + IStudioModule CurrentModule { get; } + + /// + /// Gets the current view model. + /// + StudioViewModel CurrentVM { get; } + + /// + /// Gets a value indicating whether the navigation system is able to navigate to the previous view. + /// + bool CanNavigateBack { get; } + + /// + /// Navigates to the previous view if is true. + /// + Task NavigateBack(); + + /// + /// Navigates to the previous view.. + /// + RelayCommand NavigateBackCommand { get; } + + /// + /// Navigates to the specified full path in command parameter. + /// + RelayCommand NavigateToCommand { get; } + + /// + /// Navigates to the specified PPC view. /// /// The view. - void NavigateTo(NavigationView view); + Task NavigateTo(NavigationView view, bool pushToHistory = true); + + /// + /// Navigates to the specified PPC view with the specified receive object. + /// + /// The view. + Task NavigateWithObject(NavigationView view, TPass obj, bool pushToHistory = true); + + /// + /// Navigates to the specified module. + /// + /// + Task NavigateTo(bool pushToHistory = true) where T : IStudioModule; + + /// + /// Navigates to the specified module using the view path (e.g MainView.JobsView). + /// + /// + /// The view path. + Task NavigateTo(String viewPath, bool pushToHistory = true) where T : IStudioModule; + + /// + /// Navigates to the specified module using the view path (e.g MainView,JobsView). + /// This method makes it easy to do stuff like NavigateTo(nameof(MainView),nameof(JobsView)); + /// + /// + /// The view path. + Task NavigateTo(bool pushToHistory = true, params String[] viewPath) where T : IStudioModule; + + /// + /// Navigates to the specified module and view by full path (e.g Jobs.JobsView). + /// + /// The full path. + Task NavigateTo(String fullPath, bool pushToHistory = true); + + /// + /// Navigates to the specified module and view with the specified object and expecting a return parameter. + /// The view must be of type INavigationResultProvider. + /// + /// The full path. + Task NavigateForResult(TPass obj, bool pushToHistory = true) + where TModule : IStudioModule; + + /// + /// Navigates to the specified module and view with the specified object. + /// + /// The type of the module. + /// The type of the view. + /// The type of the pass. + /// The object. + /// if set to true [push to history]. + /// + Task NavigateWithObject(TPass obj, bool pushToHistory = true) + where TModule : IStudioModule; + + /// + /// Clears the navigation back history. + /// + void ClearHistory(); + + /// + /// Clears the navigation back history except the specified view type. + /// + void ClearHistoryExcept(); } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationObjectReceiver.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationObjectReceiver.cs new file mode 100644 index 000000000..5072881d2 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationObjectReceiver.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.Common.Navigation +{ + /// + /// Represents an object which supports receiving an object as part of the navigation to it. + /// + /// + public interface INavigationObjectReceiver + { + /// + /// Called when navigation system is going to navigate to this instance with the specified object. + /// + /// The object. + void OnNavigatedToWithObject(T obj); + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationResultProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationResultProvider.cs new file mode 100644 index 000000000..dee037432 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationResultProvider.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.Common.Navigation +{ + /// + /// Represents a object which provides a result the navigation system navigates away from it. + /// + /// The type of the result. + /// The type of the pass. + public interface INavigationResultProvider + { + /// + /// Called when the navigation system requests a result when it is navigating away from this instance. + /// + /// + TResult GetNavigationResult(); + + /// + /// Called when navigation system is going to navigate to this instance with the specified object. + /// + /// The object. + void OnNavigationObjectReceived(TPass obj); + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Properties/AssemblyInfo.cs index 4b671e2e1..ccb580abf 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Properties/AssemblyInfo.cs @@ -5,7 +5,7 @@ using System.Runtime.InteropServices; using System.Windows; [assembly: AssemblyTitle("Tango - Machine Studio Common Components")] -[assembly: AssemblyVersion("2.0.24.1647")] +[assembly: AssemblyVersion("2.0.25.1119")] [assembly: ComVisible(false)] [assembly:ThemeInfo( diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml index 07818269b..6fcf6dd72 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml @@ -3,6 +3,7 @@ xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf" xmlns:editors="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" + xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:mahApps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:local="clr-namespace:Tango.MachineStudio.Common.Resources"> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs index 07f02df3a..96de3eea0 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs @@ -44,13 +44,6 @@ namespace Tango.MachineStudio.Common.StudioApplication ///
bool IsMachineConnectedViaTCP { get; } - /// - /// Loads the specified module if permitted. - /// - /// Name of the module. - /// The arguments. - void RequestModule(String moduleName, params object[] args); - /// /// Gets the machine studio application version. /// @@ -77,5 +70,10 @@ namespace Tango.MachineStudio.Common.StudioApplication ///
/// The window. void RegisterOpenedWindow(Window window); + + /// + /// Raises the application ready event. + /// + void NotifyApplicationReady(); } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioViewModel.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioViewModel.cs index 96715dc20..63ff2119a 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioViewModel.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioViewModel.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.Core.DI; using Tango.SharedUI; namespace Tango.MachineStudio.Common @@ -10,51 +11,42 @@ namespace Tango.MachineStudio.Common /// /// Represents a Machine Studio view model /// - /// The type of the module. /// /// - public abstract class StudioViewModelInternal : ViewModel, IStudioViewModel + public abstract class StudioViewModel : ViewModel, IStudioViewModel { - public bool IsVisible { get; private set; } - - /// - /// Gets or sets a value indicating whether this view model studio module is currently loaded. - /// - public bool IsModuleLoaded { get; private set; } - + private bool _isVisible; /// - /// Initializes a new instance of the class. + /// Gets or sets a value indicating whether this view model view's is visible. /// - public StudioViewModelInternal() : base() + public bool IsVisible { - + get { return _isVisible; } + set { _isVisible = value; RaisePropertyChangedAuto(); } } /// - /// Called when another module has wants to navigate to this module with some arguments. + /// Initializes a new instance of the class. /// - /// The arguments. - public virtual void OnModuleRequest(params object[] args) + public StudioViewModel() : base() { } /// - /// Called when the user has navigated out of the module. + /// Called when the user has navigated out of this view model. /// public virtual void OnNavigatedFrom() { IsVisible = false; - IsModuleLoaded = false; } /// - /// Called when the user has navigated in to the module. + /// Called when the user has navigated in to this view model. /// public virtual void OnNavigatedTo() { IsVisible = true; - IsModuleLoaded = true; } /// @@ -82,153 +74,42 @@ namespace Tango.MachineStudio.Common { } - } - - /// - /// Represents a Machine Studio view model - /// - /// The type of the module. - /// - /// - public abstract class StudioViewModel : ViewModel, IStudioViewModel where Module : IStudioModule - { - public bool IsVisible { get; private set; } - - /// - /// Gets or sets a value indicating whether this view model studio module is currently loaded. - /// - public bool IsModuleLoaded { get; private set; } - - /// - /// Initializes a new instance of the class. - /// - public StudioViewModel() : base() - { - - } - - /// - /// Called when another module has wants to navigate to this module with some arguments. - /// - /// The arguments. - public virtual void OnModuleRequest(params object[] args) - { - - } /// - /// Called when the user has navigated out of the module. - /// - public virtual void OnNavigatedFrom() - { - IsVisible = false; - IsModuleLoaded = false; - } - - /// - /// Called when the user has navigated in to the module. - /// - public virtual void OnNavigatedTo() - { - IsVisible = true; - IsModuleLoaded = true; - } - - /// - /// Called before the application is shutting down. - /// Return false to cancel the shutdown in case an important process is in progress. - /// - /// - public virtual Task OnShutdownRequest() - { - return Task.FromResult(true); - } - - /// - /// Called when application is shutting down. + /// Called when the application is ready and all modules are loaded. /// - public virtual void OnShuttingDown() - { - - } - - /// - /// Called when the application has been started - /// - public virtual void OnApplicationStarted() - { - - } + public abstract void OnApplicationReady(); } /// - /// Represents a Machine Studio view model. + /// Represents a Machine Studio view model with a support for a view contract. /// - /// The type of the module. - /// + /// /// - /// - public abstract class StudioViewModel : ViewModel, IStudioViewModel where Module : IStudioModule where T : IView + public abstract class StudioViewModel : StudioViewModel where TView : IView { /// - /// Initializes a new instance of the class. + /// Gets the view model's view. /// - /// The view. - public StudioViewModel(T view) : base(view) - { - - } - - /// - /// Called when the application has been started - /// - public virtual void OnApplicationStarted() - { - - } + public TView View { get; private set; } /// - /// Called when another module has wants to navigate to this module with some arguments. + /// Initializes a new instance of the class. /// - /// The arguments. - public virtual void OnModuleRequest(params object[] args) - { - - } - - /// - /// Called when the user has navigated out of the module. - /// - public virtual void OnNavigatedFrom() - { - - } - - /// - /// Called when the user has navigated in to the module. - /// - public virtual void OnNavigatedTo() - { - - } - - /// - /// Called before the application is shutting down. - /// Return false to cancel the shutdown in case an important process is in progress. - /// - /// - public virtual Task OnShutdownRequest() + public StudioViewModel() : base() { - return Task.FromResult(true); + TangoIOC.Default.GetInstanceWhenAvailable((view) => + { + View = view; + OnViewAttached(view); + }); } /// - /// Called when application is shutting down. + /// Called when the view has been attached /// - public virtual void OnShuttingDown() - { - - } + /// The view. + protected abstract void OnViewAttached(TView view); } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj index 6d6803076..09678b515 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj @@ -8,7 +8,7 @@ library Tango.MachineStudio.Common Tango.MachineStudio.Common - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 @@ -85,6 +85,7 @@ HiveComboControl.xaml + RealTimeGraphMultiControl.xaml @@ -105,6 +106,9 @@ + + + @@ -114,6 +118,7 @@ + @@ -163,6 +168,10 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + @@ -287,9 +296,7 @@ True - - - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/Generic.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/Generic.xaml new file mode 100644 index 000000000..9cc398753 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/Generic.xaml @@ -0,0 +1,31 @@ + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Threading/IDispatcherProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Threading/IDispatcherProvider.cs new file mode 100644 index 000000000..1c960ed3a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Threading/IDispatcherProvider.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.Common.Threading +{ + /// + /// Represents a mechanism for invoking actions on the main application thread. + /// + public interface IDispatcherProvider + { + /// + /// Invokes the specified action asynchronously. + /// + /// The action. + void Invoke(Action action); + + /// + /// Invokes the specified action synchronously. + /// + /// The action. + void InvokeSync(Action action); + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/app.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/app.config index 77b7003e2..0e58ccf54 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/app.config +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/app.config @@ -50,6 +50,10 @@ + + + + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/App.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/App.config index 209c9be3f..156c5f7e1 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/App.config +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/App.config @@ -49,6 +49,14 @@ + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/Tango.MachineStudio.Publisher.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/Tango.MachineStudio.Publisher.csproj index e86b3ddf0..f9f337b70 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/Tango.MachineStudio.Publisher.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher/Tango.MachineStudio.Publisher.csproj @@ -8,7 +8,7 @@ WinExe Tango.MachineStudio.Publisher Tango.MachineStudio.Publisher - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config index 004400788..4147a78ec 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config @@ -39,7 +39,7 @@ - + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs index ed2cbdbd7..4e1c36593 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs @@ -37,9 +37,20 @@ namespace Tango.MachineStudio.UI { #if DEBUG - CoreSettings.DefaultDataBaseSource = "localhost\\SQLEXPRESS"; + CoreSettings.DefaultDataSource = new DataSource() + { + Address = "localhost\\SQLEXPRESS", + Catalog = "Tango", + IntegratedSecurity = true, + }; #else - CoreSettings.DefaultDataBaseSource = "twine01\\SQLTWINE"; + + CoreSettings.DefaultDataSource = new DataSource() + { + Address = "twine01\\SQLTWINE", + Catalog = "Tango", + IntegratedSecurity = true, + }; #endif diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs index 4e5425138..c16f76449 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs @@ -9,6 +9,7 @@ using Tango.BL.Entities; using Tango.MachineStudio.Common.Authentication; using Tango.BL; using Tango.BL.Enumerations; +using System.Data.Entity; namespace Tango.MachineStudio.UI.Authentication { @@ -48,32 +49,38 @@ namespace Tango.MachineStudio.UI.Authentication /// Login failed for user " + email public User Login(string email, string password) { - String hash = User.GetPasswordHash(password); + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { - User user = ObservablesEntitiesAdapter.Instance.Users.SingleOrDefault(x => x.Email.ToLower() == email.ToLower() && x.Password == hash); + String hash = User.GetPasswordHash(password); - if (user == null) - { - throw new AuthenticationException("Invalid credentials for " + email); - } + db.Roles.Load(); + db.Permissions.Load(); + db.RolesPermissions.Load(); - if (!user.HasPermission(Permissions.RunMachineStudio)) - { - throw new AuthenticationException("It seems like you do not have sufficient privileges to run Machine Studio. Please contact your administrator."); - } + User user = db.Users + .Include(x => x.UsersRoles) + .Include(x => x.Organization).SingleOrDefault(x => x.Email.ToLower() == email.ToLower() && x.Password == hash); - if (user != null) - { - using (ObservablesContext db = ObservablesContext.CreateDefault()) + if (user == null) + { + throw new AuthenticationException("Invalid credentials for " + email); + } + + if (!user.HasPermission(Permissions.RunMachineStudio)) { - var u = db.Users.Single(x => x.Guid == user.Guid); - u.LastLogin = DateTime.UtcNow; + throw new AuthenticationException("It seems like you do not have sufficient privileges to run Machine Studio. Please contact your administrator."); + } + + if (user != null) + { + user.LastLogin = DateTime.UtcNow; db.SaveChanges(); } - } - CurrentUser = user; - return user; + CurrentUser = user; + return user; + } } /// diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml index b8a6cd1c0..44b2ed401 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml @@ -17,7 +17,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs index 26a789d0f..13c3d6779 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs @@ -12,9 +12,6 @@ using Tango.Logging; using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.Authentication; using Tango.MachineStudio.Common.Modules; -using Tango.MachineStudio.DB; -using Tango.MachineStudio.MachineDesigner; -using Tango.MachineStudio.Stubs; namespace Tango.MachineStudio.UI.Modules { @@ -27,7 +24,6 @@ namespace Tango.MachineStudio.UI.Modules { private IAuthenticationProvider _authenticationProvider; private bool _loaded; - public event EventHandler ModulesLoaded; /// /// Initializes a new instance of the class. @@ -78,15 +74,15 @@ namespace Tango.MachineStudio.UI.Modules { if (!_loaded) { - //Preloaded + ////Preloaded - LogManager.Log(String.Format("Loading module '{0}'...", nameof(StubsModule))); - AllModules.Add(new StubsModule()); - LogManager.Log(String.Format("Loading module '{0}'...", nameof(DBModule))); - AllModules.Add(new DBModule()); - LogManager.Log(String.Format("Loading module '{0}'...", nameof(MachineDesignerModule))); - AllModules.Add(new MachineDesignerModule()); - //Preloaded + //LogManager.Log(String.Format("Loading module '{0}'...", nameof(StubsModule))); + //AllModules.Add(new StubsModule()); + //LogManager.Log(String.Format("Loading module '{0}'...", nameof(DBModule))); + //AllModules.Add(new DBModule()); + //LogManager.Log(String.Format("Loading module '{0}'...", nameof(MachineDesignerModule))); + //AllModules.Add(new MachineDesignerModule()); + ////Preloaded AllModules.Clear(); string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); @@ -146,5 +142,10 @@ namespace Tango.MachineStudio.UI.Modules { return UserModules.OfType().FirstOrDefault(); } + + /// + /// Occurs when all modules are initialized. + /// + public event EventHandler ModulesLoaded; } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Navigation/DefaultNavigationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Navigation/DefaultNavigationManager.cs index 092b958cc..899ba846e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Navigation/DefaultNavigationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Navigation/DefaultNavigationManager.cs @@ -3,8 +3,13 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.Core; +using Tango.Core.Commands; using Tango.MachineStudio.Common; +using Tango.MachineStudio.Common.Modules; using Tango.MachineStudio.Common.Navigation; +using Tango.MachineStudio.Common.Threading; +using Tango.SharedUI.Controls; namespace Tango.MachineStudio.UI.Navigation { @@ -12,18 +17,372 @@ namespace Tango.MachineStudio.UI.Navigation /// Represents the Machine Studio default Navigation Manager. /// /// - public class DefaultNavigationManager : INavigationManager + public class DefaultNavigationManager : ExtendedObject, INavigationManager { + private event Action NavigationCycleCompleted; + + private IDispatcherProvider _dispatcherProvider; + private IStudioModuleLoader _moduleLoader; + private Object _currentVM; + private String _lastFullPath; + private bool _preventHistory; + private bool _navigating_back; + + private Stack _navigationHistory; + + /// + /// Gets the current view model. + /// + public StudioViewModel CurrentVM + { + get { return _currentVM as StudioViewModel; } + } + + private IStudioModule _currentModule; + /// + /// Gets or sets the current module. + /// + public IStudioModule CurrentModule + { + get { return _currentModule; } + private set { _currentModule = value; RaisePropertyChangedAuto(); } + } + + /// + /// Navigates to the previous view. + /// + public RelayCommand NavigateBackCommand { get; private set; } + + /// + /// Navigates to the specified full path in command parameter. + /// + public RelayCommand NavigateToCommand { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + /// The module loader. + public DefaultNavigationManager(IStudioModuleLoader moduleLoader, IDispatcherProvider dispatcherProvider) + { + _navigationHistory = new Stack(); + _moduleLoader = moduleLoader; + + NavigateToCommand = new RelayCommand(async (x) => await NavigateTo(x)); + NavigateBackCommand = new RelayCommand(async () => await NavigateBack()); + + _dispatcherProvider = dispatcherProvider; + } + /// - /// Navigates to the specified view. + /// Navigates to the specified PPC view. /// /// The view. - public void NavigateTo(NavigationView view) + public Task NavigateTo(NavigationView view, bool pushToHistory = true) { - MainWindow.Instance.Dispatcher.Invoke(() => + LogManager.Log($"Navigating to: {view.ToString()}..."); + + _dispatcherProvider.Invoke(() => { - MainWindow.Instance.TransitionControl.NavigateTo(view.ToString()); + MainWindow.Instance.NavigationControl.NavigateTo(view.ToString()); }); + + return Task.FromResult(true); + } + + /// + /// Navigates to the specified PPC view with the specified receive object. + /// + /// The view. + /// + /// + /// + public Task NavigateWithObject(NavigationView view, TPass obj, bool pushToHistory = true) + { + LogManager.Log($"Navigating to: {view.ToString()}, with object {typeof(TPass).Name}..."); + MainWindow.Instance.NavigationControl.NavigateTo(view.ToString()); + INavigationObjectReceiver receiver = MainWindow.Instance.NavigationControl.Elements.FirstOrDefault(x => (x.GetType().Name == view.ToString() || NavigationControl.GetNavigationName(x) == view.ToString()) && x.DataContext is INavigationObjectReceiver).DataContext as INavigationObjectReceiver; + + if (receiver != null) + { + receiver.OnNavigatedToWithObject(obj); + } + + return Task.FromResult(true); + } + + /// + /// Navigates to the specified module. + /// + /// + public Task NavigateTo(bool pushToHistory = true) where T : IStudioModule + { + return NavigateTo(typeof(T)); + } + + /// + /// Navigates to the specified module using the view path (e.g MainView.JobsView). + /// + /// + /// The view path. + public Task NavigateTo(string viewPath, bool pushToHistory = true) where T : IStudioModule + { + return NavigateTo(pushToHistory, viewPath.Split('.')); + } + + /// + /// Navigates to the specified module using the view path (e.g MainView,JobsView). + /// This method makes it easy to do stuff like NavigateTo(nameof(MainView),nameof(JobsView)); + /// + /// + /// The view path. + public Task NavigateTo(bool pushToHistory = true, params String[] viewPath) where T : IStudioModule + { + return NavigateTo(typeof(T), pushToHistory, viewPath); + } + + /// + /// Navigates to the specified module and view by full path (e.g Jobs.JobsView). + /// + /// The full path. + public async Task NavigateTo(String fullPath, bool pushToHistory = true) + { + String[] path = fullPath.Split('.'); + var module = _moduleLoader.UserModules.SingleOrDefault(x => x.GetType().Name == path[0] || x.Name == path[0]); + + if (path.Length == 1 && path[0] == CurrentModule.Name) return true; + + LogManager.Log($"Navigating to: {fullPath}..."); + + var fromVM = _currentVM; + + if (_currentVM != null && _currentVM is INavigationBlocker) + { + if (_navigating_back) + { + if (!await (_currentVM as INavigationBlocker).OnNavigateBackRequest()) + { + return false; + } + } + else + { + if (!await (_currentVM as INavigationBlocker).OnNavigateOutRequest()) + { + return false; + } + } + } + + if (pushToHistory && _lastFullPath != null && !_preventHistory) + { + _navigationHistory.Push(_lastFullPath); + RaisePropertyChanged(nameof(CanNavigateBack)); + } + + _lastFullPath = fullPath; + + MainWindow.Instance.NavigationControl.NavigateTo(NavigationView.MainView.ToString()); + var navigationControl = MachineStudio.UI.Views.MainView.Instance.NavigationControl; + CurrentModule = module; + var moduleView = navigationControl.NavigateTo(module.Name); + + _currentVM = moduleView.DataContext; + + if (path.Length > 1) + { + var moduleNavigation = moduleView.FindChildOffline(); + + moduleNavigation.RegisterForLoadedOrNow(async (x, e) => + { + foreach (var view in path.Skip(1)) + { + await Task.Delay(100); + var v = moduleNavigation.NavigateTo(view); + + if (v != null) + { + _currentVM = v.DataContext; + + if (view != path.Last()) + { + moduleNavigation = v.FindChildOffline(); + } + } + else + { + throw LogManager.Log(new ArgumentNullException("Could not navigate to " + fullPath)); + } + } + + NavigationCycleCompleted?.Invoke(fromVM, _currentVM); + }); + } + + return true; + } + + /// + /// Navigates for result. + /// + /// The type of the module. + /// The type of the view. + /// The type of the result. + /// The type of the object. + /// The object. + /// if set to true [push to history]. + /// + public Task NavigateForResult(TObject obj, bool pushToHistory = true) + where TModule : IStudioModule + { + TaskCompletionSource source = new TaskCompletionSource(); + + var fromVM = _currentVM; + Object toVM = null; + + + Action handler = null; + + handler = (from, to) => + { + if (toVM == null) + { + toVM = to; + if (toVM is INavigationResultProvider) + { + (toVM as INavigationResultProvider).OnNavigationObjectReceived(obj); + } + } + else + { + if (to == fromVM && from == toVM) + { + if (from is INavigationResultProvider) + { + source.SetResult((from as INavigationResultProvider).GetNavigationResult()); + } + } + + NavigationCycleCompleted -= handler; + } + }; + + NavigationCycleCompleted += handler; + + NavigateTo(typeof(TView).Name, pushToHistory); + + return source.Task; + } + + /// + /// Navigates to the specified module and view with the specified object. + /// + /// The type of the module. + /// The type of the view. + /// The type of the pass. + /// The object. + /// if set to true [push to history]. + /// + public Task NavigateWithObject(TPass obj, bool pushToHistory = true) where TModule : IStudioModule + { + TaskCompletionSource source = new TaskCompletionSource(); + + Action handler = null; + + handler = (from, to) => + { + if (to is INavigationObjectReceiver) + { + (to as INavigationObjectReceiver).OnNavigatedToWithObject(obj); + } + + NavigationCycleCompleted -= handler; + }; + + NavigationCycleCompleted += handler; + + NavigateTo(typeof(TView).Name, pushToHistory); + + return source.Task; + } + + private Task NavigateTo(Type moduleType, bool pushToHistory = true, params String[] viewPath) + { + if (viewPath != null && viewPath.Length > 0) + { + return NavigateTo(moduleType.Name + "." + String.Join(".", viewPath), pushToHistory); + } + else + { + return NavigateTo(moduleType.Name, pushToHistory); + } + } + + /// + /// Gets a value indicating whether the navigation system is able to navigate to the previous view. + /// + public bool CanNavigateBack + { + get { return _navigationHistory.Count > 0; } + } + + /// + /// Navigates to the previous view if is true. + /// + public async Task NavigateBack() + { + LogManager.Log("Navigating back..."); + + _navigating_back = true; + + String first = _navigationHistory.Pop(); + _preventHistory = true; + + + if (await NavigateTo(first)) + { + RaisePropertyChanged(nameof(CanNavigateBack)); + _preventHistory = false; + _navigating_back = false; + return true; + } + else + { + _navigationHistory.Push(first); + _preventHistory = false; + _navigating_back = false; + RaisePropertyChanged(nameof(CanNavigateBack)); + return false; + } + } + + /// + /// Clears the navigation back history. + /// + public void ClearHistory() + { + LogManager.Log("Navigation history cleared."); + _navigationHistory.Clear(); + RaisePropertyChanged(nameof(CanNavigateBack)); + } + + /// + /// Clears the navigation back history except the specified view type. + /// + /// + public void ClearHistoryExcept() + { + LogManager.Log($"Navigation history cleared except for {typeof(T).Name}."); + + var history_list = _navigationHistory.ToList(); + history_list = history_list.Where(x => x.Contains(typeof(T).Name)).Distinct().ToList(); + _navigationHistory.Clear(); + + foreach (var item in history_list) + { + _navigationHistory.Push(item); + } + + RaisePropertyChanged(nameof(CanNavigateBack)); } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs index 822e551c1..3e03d33f8 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs @@ -4,5 +4,5 @@ using System.Runtime.InteropServices; [assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)] [assembly: AssemblyTitle("Tango - Machine Studio")] -[assembly: AssemblyVersion("2.8.22.18226")] +[assembly: AssemblyVersion("3.0.25.18235")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs index ee9337eb3..7c7e18276 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs @@ -43,21 +43,10 @@ namespace Tango.MachineStudio.UI.StudioApplication _navigationManager = navigationManager; _openedWindows = new List(); - Task.Factory.StartNew(() => + Application.Current.MainWindow.ContentRendered += (_, __) => { - while (MainWindow.Instance == null) - { - Thread.Sleep(100); - } - - InvokeUI(() => - { - MainWindow.Instance.ContentRendered += (_, __) => - { - TangoIOC.Default.GetAllInstancesByBase().ToList().ForEach(x => x.OnApplicationStarted()); - }; - }); - }); + TangoIOC.Default.GetAllInstancesByBase().ToList().ForEach(x => x.OnApplicationStarted()); + }; } /// @@ -236,31 +225,6 @@ namespace Tango.MachineStudio.UI.StudioApplication } } - /// - /// Loads the specified module if permitted. - /// - /// Name of the module. - /// The arguments. - public void RequestModule(string moduleName, params object[] args) - { - IStudioModule module = _moduleLoader.UserModules.SingleOrDefault(x => x.Name == moduleName); - - if (module != null) - { - TangoIOC.Default.GetInstance().StartModule(module); - - //Notify request listeners. - foreach (var vm in TangoIOC.Default.GetAllInstancesByBase()) - { - vm.OnModuleRequest(module, args); - } - } - else - { - throw new InvalidOperationException("The module was not found or you do not have sufficient privileges."); - } - } - /// /// Notify the application manager about an external opened window. /// When application exists. All registered windows will be closed. @@ -305,5 +269,10 @@ namespace Tango.MachineStudio.UI.StudioApplication return EmbeddedResourceHelper.GetEmbeddedResourceText("Tango.MachineStudio.UI.ChangeLog.txt"); } } + + public void NotifyApplicationReady() + { + TangoIOC.Default.GetAllInstancesByBase().ToList().ForEach(x => x.OnApplicationReady()); + } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj index 724f83680..1bbabb0af 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj @@ -8,7 +8,7 @@ WinExe Tango.MachineStudio.UI Tango.MachineStudio.UI - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 @@ -168,6 +168,7 @@ + @@ -432,10 +433,6 @@ {22c2aa72-9493-4d0d-b421-8ef9789fb192} Tango.MachineStudio.Stubs - - {12d0c43c-391f-4c74-92ab-82e9a9beeb9b} - Tango.MachineStudio.Synchronization - {5d39c1e1-3ecd-4634-bd1b-2bcf71c54a15} Tango.MachineStudio.Technician @@ -577,7 +574,7 @@ copy /Y "$(SolutionDir)Referenced Assemblies\vcruntime140d.dll" "$(TargetDir)" - + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Threading/DefaultDispatcherProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Threading/DefaultDispatcherProvider.cs new file mode 100644 index 000000000..611dca6b9 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Threading/DefaultDispatcherProvider.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Threading; +using Tango.MachineStudio.Common.Threading; + +namespace Tango.MachineStudio.UI.Threading +{ + /// + /// Represents the default PPC which will invoke action on the current application dispatcher. + /// + /// + public class DefaultDispatcherProvider : IDispatcherProvider + { + private Dispatcher _dispatcher; + + /// + /// Initializes a new instance of the class. + /// + /// The dispatcher. + public DefaultDispatcherProvider(Dispatcher dispatcher) + { + _dispatcher = dispatcher; + } + + /// + /// Invokes the specified action asynchronously. + /// + /// The action. + public void Invoke(Action action) + { + _dispatcher.BeginInvoke(action); + } + + /// + /// Invokes the specified action synchronously. + /// + /// The action. + public void InvokeSync(Action action) + { + _dispatcher.Invoke(action); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs index 2c816eb6c..10aa86ad1 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs @@ -1,4 +1,5 @@ using System; +using System.Windows; using Tango.Core.DI; using Tango.Integration.ExternalBridge; using Tango.Logging; @@ -11,6 +12,7 @@ using Tango.MachineStudio.Common.Navigation; using Tango.MachineStudio.Common.Notifications; using Tango.MachineStudio.Common.Speech; using Tango.MachineStudio.Common.StudioApplication; +using Tango.MachineStudio.Common.Threading; using Tango.MachineStudio.Common.Video; using Tango.MachineStudio.UI.Authentication; using Tango.MachineStudio.UI.Console; @@ -21,6 +23,7 @@ using Tango.MachineStudio.UI.Notifications; using Tango.MachineStudio.UI.StudioApplication; using Tango.MachineStudio.UI.SupervisingController; using Tango.MachineStudio.UI.TFS; +using Tango.MachineStudio.UI.Threading; using Tango.MachineStudio.UI.ViewModels; using Tango.MachineStudio.UI.Views; using Tango.Settings; @@ -64,7 +67,10 @@ namespace Tango.MachineStudio.UI TangoIOC.Default.Unregister(); TangoIOC.Default.Unregister(); TangoIOC.Default.Unregister(); + TangoIOC.Default.Unregister(); + + TangoIOC.Default.Register(new DefaultDispatcherProvider(Application.Current.Dispatcher)); TangoIOC.Default.Register(); TangoIOC.Default.Register(); TangoIOC.Default.Register(); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs index a468dc2e7..215f7afb5 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs @@ -28,7 +28,7 @@ namespace Tango.MachineStudio.UI.ViewModels /// Represents the Machine Studio loading view, view model. /// /// - public class LoadingViewVM : StudioViewModelInternal + public class LoadingViewVM : StudioViewModel { private INotificationProvider _notificationProvider; private TeamFoundationServiceExtendedClient _tfs; @@ -141,7 +141,7 @@ namespace Tango.MachineStudio.UI.ViewModels Status = "Loading, please wait..."; - ObservablesEntitiesAdapter.Instance.Initialize(); + ObservablesStaticCollections.Instance.Initialize(); _eventLogger.Log(EventTypes.ApplicationStarted, "Application Started!"); @@ -172,5 +172,10 @@ namespace Tango.MachineStudio.UI.ViewModels } }); } + + public override void OnApplicationReady() + { + + } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs index f2a4f1143..a37879a5e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs @@ -51,6 +51,15 @@ namespace Tango.MachineStudio.UI.ViewModels set { _password = value; RaisePropertyChangedAuto(); } } + private bool _isLogging; + /// + /// Gets or sets a value indicating whether this instance is logging. + /// + public bool IsLogging + { + get { return _isLogging; } + set { _isLogging = value; RaisePropertyChangedAuto(); } + } private bool _rememberMe; /// @@ -81,7 +90,7 @@ namespace Tango.MachineStudio.UI.ViewModels _navigationManager = navigationManager; _authenticationProvider = authenticationProvider; _eventLogger = eventLogger; - LoginCommand = new RelayCommand(Login); + LoginCommand = new RelayCommand(Login,() => !IsLogging); cryptographer = new Rfc2898Cryptographer(); Email = _settings.LastLoginEmail; @@ -100,26 +109,38 @@ namespace Tango.MachineStudio.UI.ViewModels /// /// Logins the requested user. /// - private void Login() + private async void Login() { if (Validate()) { try { - _authenticationProvider.Login(Email, Password); - _navigationManager.NavigateTo(NavigationView.MainView); - _settings.LastLoginEmail = Email; - _settings.RememberMe = RememberMe; + IsLogging = true; + InvalidateRelayCommands(); - _settings.LastLoginPassword = RememberMe ? cryptographer.Encrypt(Password) : null; - _settings.Save(); + await Task.Factory.StartNew(() => + { + _authenticationProvider.Login(Email, Password); + _navigationManager.NavigateTo(NavigationView.MainView); + _settings.LastLoginEmail = Email; + _settings.RememberMe = RememberMe; - _eventLogger.Log("User logged in"); + _settings.LastLoginPassword = RememberMe ? cryptographer.Encrypt(Password) : null; + _settings.Save(); + + _eventLogger.Log("User logged in"); + }); } - catch + catch (Exception) { + _notificationProvider.ShowError("Invalid credentials. Please try again."); } + finally + { + IsLogging = false; + InvalidateRelayCommands(); + } } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineSerialViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineSerialViewVM.cs index 44cfc6788..db32fe623 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineSerialViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineSerialViewVM.cs @@ -29,7 +29,7 @@ namespace Tango.MachineStudio.UI.ViewModels var settings = SettingsManager.Default.GetOrCreate(); - SelectedMachine = ObservablesEntitiesAdapter.Instance.Machines.SingleOrDefault(x => x.SerialNumber == settings.LastVirtualMachineSerialNumber); + SelectedMachine = ObservablesStaticCollections.Instance.Machines.SingleOrDefault(x => x.SerialNumber == settings.LastVirtualMachineSerialNumber); } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs index f8320e1f2..f164d7f14 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Media; +using Tango.BL; using Tango.BL.Entities; using Tango.Core.Commands; using Tango.Core.DI; @@ -547,8 +548,13 @@ namespace Tango.MachineStudio.UI.ViewModels { try { - var configuration = ApplicationManager.ConnectedMachine.Machine.Configuration; - await ApplicationManager.ConnectedMachine.UploadHardwareConfiguration(configuration.HardwareVersion, configuration); + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + var config = db.Adapter.GetConfiguration(s => s.Guid == ApplicationManager.ConnectedMachine.Machine.ConfigurationGuid); + var hw = db.Adapter.GetHardwareVersionByMachine(ApplicationManager.ConnectedMachine.Machine.Guid); + + await ApplicationManager.ConnectedMachine.UploadHardwareConfiguration(hw, config); + } NotificationProvider.ShowInfo("Hardware configuration uploaded successfully."); } catch (Exception ex) @@ -623,20 +629,19 @@ namespace Tango.MachineStudio.UI.ViewModels { LogManager.Log(String.Format("Starting module '{0}'...", module.Name)); - if (!(MainView.Self as MainView).TransitionControl.Elements.ToList().Exists(x => x.GetType() == module.MainViewType)) + if (!(MainView.Self as MainView).NavigationControl.Elements.ToList().Exists(x => x.GetType() == module.MainViewType)) { LogManager.Log("Module was not initialized. Initializing..."); FrameworkElement view = Activator.CreateInstance(module.MainViewType) as FrameworkElement; NavigationControl.SetNavigationName(view, module.Name); - (MainView.Self as MainView).TransitionControl.Elements.Add(view); + (MainView.Self as MainView).NavigationControl.Elements.Add(view); } } foreach (var m in StudioModuleLoader.AllModules.Where(x => x != module && !x.InNewWindow)) { m.IsLoaded = false; - TangoIOC.Default.GetModuleViewModels(m).ToList().ForEach(x => x.OnNavigatedFrom()); } if (module != null) @@ -646,15 +651,13 @@ namespace Tango.MachineStudio.UI.ViewModels IsModuleLoaded = true; LogManager.Log(String.Format("Navigating to module '{0}'...", module.Name)); - (MainView.Self as MainView).TransitionControl.NavigateTo(module.Name); - - TangoIOC.Default.GetModuleViewModels(module).ToList().ForEach(x => x.OnNavigatedTo()); + (MainView.Self as MainView).NavigationControl.NavigateTo(module.Name); } else { IsModuleLoaded = false; LogManager.Log(String.Format("Navigating to Home...")); - (MainView.Self as MainView).TransitionControl.NavigateTo("Home"); + (MainView.Self as MainView).NavigationControl.NavigateTo("Home"); } } @@ -674,16 +677,16 @@ namespace Tango.MachineStudio.UI.ViewModels LogManager.Log(String.Format("Starting module '{0}' in new window...", module.Name)); - if (!(MainView.Self as MainView).TransitionControl.Elements.ToList().Exists(x => x.GetType() == module.MainViewType)) + if (!(MainView.Self as MainView).NavigationControl.Elements.ToList().Exists(x => x.GetType() == module.MainViewType)) { LogManager.Log("Module was not initialized. Initializing..."); FrameworkElement v = Activator.CreateInstance(module.MainViewType) as FrameworkElement; NavigationControl.SetNavigationName(v, module.Name); - (MainView.Self as MainView).TransitionControl.Elements.Add(v); + (MainView.Self as MainView).NavigationControl.Elements.Add(v); } LogManager.Log("Detaching module view..."); - var view = (MainView.Self as MainView).TransitionControl.GetAndDetach(module.Name); + var view = (MainView.Self as MainView).NavigationControl.GetAndDetach(module.Name); ModuleWindowVM vm = new ModuleWindowVM(module); ModuleWindow window = new ModuleWindow(this, vm, view); @@ -694,7 +697,6 @@ namespace Tango.MachineStudio.UI.ViewModels window.grid.Children.Remove(view); module.InNewWindow = false; - TangoIOC.Default.GetModuleViewModels(module).ToList().ForEach(v => v.OnNavigatedFrom()); }; window.Owner = MainWindow.Instance; @@ -702,8 +704,6 @@ namespace Tango.MachineStudio.UI.ViewModels LogManager.Log("Opening new window..."); window.Show(); - TangoIOC.Default.GetModuleViewModels(module).ToList().ForEach(x => x.OnNavigatedTo()); - (_applicationManager as DefaultStudioApplicationManager).RegisterOpenedWindow(window); } catch (Exception ex) diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs index f2550c598..6dbc99591 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs @@ -294,6 +294,9 @@ namespace Tango.MachineStudio.UI.ViewModels } } + //Copy new updater utility to app path. + File.Copy(Path.Combine(_newPackageTempFolder, "Tango.MachineStudio.Updater.exe"), Path.Combine(_appPath, "Tango.MachineStudio.Updater.exe"), true); + TangoIOC.Default.GetInstance().DisableCheckForUpdates = true; Status = UpdateStatus.UpdateCompleted; } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml index 08e1006c1..68334ad24 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml @@ -5,7 +5,9 @@ xmlns:rules="clr-namespace:Tango.MachineStudio.Common.ValidationRules;assembly=Tango.MachineStudio.Common" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:automation="clr-namespace:Tango.MachineStudio.Common.Automation;assembly=Tango.MachineStudio.Common" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:helpers="clr-namespace:Tango.SharedUI.Helpers;assembly=Tango.SharedUI" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" @@ -13,6 +15,8 @@ + + @@ -24,21 +28,30 @@ Machine Studio - - Login to your account - - - - - - - - - - Remember me - - + + + + + Login to your account + + + + + + + + + + Remember me + + + + + Logging you in... + + + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml index 7044ad32e..9a494f862 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml @@ -12,7 +12,6 @@ xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" - xmlns:db="clr-namespace:Tango.MachineStudio.DB.Views;assembly=Tango.MachineStudio.DB" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" xmlns:commonConverters="clr-namespace:Tango.MachineStudio.Common.Converters;assembly=Tango.MachineStudio.Common" mc:Ignorable="d" @@ -398,7 +397,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs index 1e894f3f2..ca8d7066c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs @@ -27,6 +27,7 @@ using Tango.SharedUI.Helpers; using Tango.Logging; using static Tango.SharedUI.Controls.NavigationControl; using Tango.Core.DI; +using Tango.MachineStudio.Common.StudioApplication; namespace Tango.MachineStudio.UI.Views { @@ -37,10 +38,14 @@ namespace Tango.MachineStudio.UI.Views { private DefaultStudioModuleLoader _loader; + public static MainView Instance { get; set; } + public MainView() : base() { InitializeComponent(); + Instance = this; + _loader = TangoIOC.Default.GetInstance() as DefaultStudioModuleLoader; _loader.ModulesLoaded += Loader_ModulesLoaded; } @@ -68,11 +73,11 @@ namespace Tango.MachineStudio.UI.Views ThreadsHelper.InvokeUI(() => { - if (!TransitionControl.Elements.ToList().Exists(x => x.GetType() == module.MainViewType)) + if (!NavigationControl.Elements.ToList().Exists(x => x.GetType() == module.MainViewType)) { FrameworkElement view = Activator.CreateInstance(module.MainViewType) as FrameworkElement; NavigationControl.SetNavigationName(view, module.Name); - TransitionControl.Elements.Add(view); + NavigationControl.Elements.Add(view); } _loader.UserModules.Add(module); @@ -84,6 +89,11 @@ namespace Tango.MachineStudio.UI.Views } item.Pop(); + + ThreadsHelper.InvokeUI(() => + { + TangoIOC.Default.GetInstance().NotifyApplicationReady(); + }); }); } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Tango.MachineStudio.UpdateService.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Tango.MachineStudio.UpdateService.csproj index 8e9d60541..b2200895c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Tango.MachineStudio.UpdateService.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Tango.MachineStudio.UpdateService.csproj @@ -12,7 +12,7 @@ Properties Tango.MachineStudio.UpdateService Tango.MachineStudio.UpdateService - v4.6 + v4.7.2 True true true diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Web.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Web.config index 6fd5e637f..32a2460df 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Web.config +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Web.config @@ -1,4 +1,4 @@ - + @@ -27,8 +27,7 @@ - + @@ -106,6 +105,10 @@ + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/MainWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/MainWindow.xaml.cs index a0c6928d2..4e6a8ad63 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/MainWindow.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/MainWindow.xaml.cs @@ -47,6 +47,7 @@ namespace Tango.MachineStudio.Updater private void Update() { EnsureMachineStudioIsDown(); + RemoveOldDLLFiles(); ReplaceFiles(); StartMachineStudio(); Environment.Exit(0); @@ -65,6 +66,18 @@ namespace Tango.MachineStudio.Updater p.Start(); } + private void RemoveOldDLLFiles() + { + foreach (string dll in Directory.GetFiles(_appPath, "*.dll")) + { + try + { + File.Delete(dll); + } + catch { } + } + } + private void ReplaceFiles() { int maxProgress = Directory.GetFiles(_sourceFolder, "*.*", SearchOption.AllDirectories).Length; @@ -133,9 +146,6 @@ namespace Tango.MachineStudio.Updater } while (appProcess != null); } - /// - /// Forces UI rendering. - /// private void DoEvents() { Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate { })); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/Tango.MachineStudio.Updater.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/Tango.MachineStudio.Updater.csproj index db6fcb52f..241085122 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/Tango.MachineStudio.Updater.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/Tango.MachineStudio.Updater.csproj @@ -8,7 +8,7 @@ WinExe Tango.MachineStudio.Updater Tango.MachineStudio.Updater - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj b/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj index d16f5212b..9aa600c36 100644 --- a/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj +++ b/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj @@ -9,7 +9,7 @@ Properties Tango.Notes Tango.Notes - v4.6 + v4.7.2 512 diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/AssemblyInfo.cs index be2f6cb93..657d58fa3 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/AssemblyInfo.cs @@ -8,7 +8,7 @@ using System.Windows; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Tango Panel PC Jobs Module")] -[assembly: AssemblyVersion("2.0.6.1657")] +[assembly: AssemblyVersion("2.0.7.1119")] [assembly:ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj index 4ab67fa31..a620ecb8c 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj @@ -8,7 +8,7 @@ library Tango.PPC.Jobs Tango.PPC.Jobs - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/app.config index 77b7003e2..0e58ccf54 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/app.config +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/app.config @@ -50,6 +50,10 @@ + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Properties/AssemblyInfo.cs index 0c386b603..8e6777b64 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Properties/AssemblyInfo.cs @@ -8,7 +8,7 @@ using System.Windows; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Tango Module")] -[assembly: AssemblyVersion("2.0.3.1657")] +[assembly: AssemblyVersion("2.0.4.1119")] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Tango.PPC.MachineSettings.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Tango.PPC.MachineSettings.csproj index 8a81a8add..19b79fe52 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Tango.PPC.MachineSettings.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Tango.PPC.MachineSettings.csproj @@ -8,7 +8,7 @@ library Tango.PPC.MachineSettings Tango.PPC.MachineSettings - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/app.config index 77b7003e2..0e58ccf54 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/app.config +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/app.config @@ -50,6 +50,10 @@ + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/AssemblyInfo.cs index 52774bee8..0f2c9f8c4 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/AssemblyInfo.cs @@ -8,7 +8,7 @@ using System.Windows; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Tango Module")] -[assembly: AssemblyVersion("2.0.1.1407")] +[assembly: AssemblyVersion("2.0.2.1119")] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Tango.PPC.Synchronization.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Tango.PPC.Synchronization.csproj index a5e3d9da0..6f5fff695 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Tango.PPC.Synchronization.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Tango.PPC.Synchronization.csproj @@ -8,7 +8,7 @@ library Tango.PPC.Synchronization Tango.PPC.Synchronization - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/app.config index 77b7003e2..0e58ccf54 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/app.config +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/app.config @@ -50,6 +50,10 @@ + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs index cd63bfa4a..e6050f761 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs @@ -95,7 +95,7 @@ namespace Tango.PPC.Common.Connection _isInitialized = true; LogManager.Log("Retrieving first machine database entry..."); - Machine = ObservablesEntitiesAdapter.Instance.Machines.FirstOrDefault(); + Machine = ObservablesStaticCollections.Instance.Machines.FirstOrDefault(); if (Machine != null) { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs index d981723be..adf99e3a3 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/EventLogging/DefaultEventLogger.cs @@ -80,7 +80,6 @@ namespace Tango.PPC.Common.EventLogging try { _db = ObservablesContext.CreateDefault(); - _db.Configuration.LazyLoadingEnabled = false; _db.ActionTypes.ToList(); _db.EventTypesActions.ToList(); 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 8d1c0e147..8d4d5fa0a 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs @@ -173,7 +173,7 @@ namespace Tango.PPC.Common.MachineSetup CurrentStep = MachineSetupSteps.SynchronizingSchema; String db_name = "Tango"; - String localAddress = SettingsManager.Default.GetOrCreate().DataBaseSource; + String localAddress = SettingsManager.Default.GetOrCreate().DataSource.Address; String remote_address = setup_response.DbAddress; LogManager.Log($"Synchronizing database '{remote_address}\\{db_name}' => '{localAddress}\\{db_name}'..."); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs index 23213f194..b2ea6ac30 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs @@ -28,9 +28,9 @@ namespace Tango.PPC.Common /// /// Gets the static observable entities adapter. /// - public ObservablesEntitiesAdapter Adapter + public ObservablesStaticCollections Adapter { - get { return ObservablesEntitiesAdapter.Instance; } + get { return ObservablesStaticCollections.Instance; } } /// diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/AssemblyInfo.cs index 20ad516c0..02006054f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/AssemblyInfo.cs @@ -8,7 +8,7 @@ using System.Windows; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Tango Panel PC Common Library")] -[assembly: AssemblyVersion("2.0.9.1657")] +[assembly: AssemblyVersion("2.0.11.1119")] [assembly:ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 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 5de2fbf81..0fbfb635e 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 @@ -8,7 +8,7 @@ library Tango.PPC.Common Tango.PPC.Common - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/app.config b/Software/Visual_Studio/PPC/Tango.PPC.Common/app.config index d7c68e008..adc229d39 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/app.config +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/app.config @@ -50,6 +50,10 @@ + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Publisher/App.config b/Software/Visual_Studio/PPC/Tango.PPC.Publisher/App.config index a0a64c824..b9930d796 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Publisher/App.config +++ b/Software/Visual_Studio/PPC/Tango.PPC.Publisher/App.config @@ -59,6 +59,10 @@ + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Publisher/Tango.PPC.Publisher.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Publisher/Tango.PPC.Publisher.csproj index be73513b4..7fc30a77b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Publisher/Tango.PPC.Publisher.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Publisher/Tango.PPC.Publisher.csproj @@ -8,7 +8,7 @@ WinExe Tango.PPC.Publisher Tango.PPC.Publisher - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config index 10e543617..545de6e92 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config @@ -57,6 +57,18 @@ + + + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs index 2efd0ad18..4cffce960 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs @@ -47,7 +47,12 @@ namespace Tango.PPC.UI LogManager.Categories.Clear(); - CoreSettings.DefaultDataBaseSource = "localhost\\SQLEXPRESS"; + CoreSettings.DefaultDataSource = new DataSource() + { + Address = "localhost\\SQLEXPRESS", + Catalog = "Tango", + IntegratedSecurity = true, + }; var settings = SettingsManager.Default.GetOrCreate(); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs index 4096abc24..3dae9d05a 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Authentication/DefaultAuthenticationProvider.cs @@ -55,7 +55,7 @@ namespace Tango.PPC.UI.Authentication String hash = User.GetPasswordHash(password); LogManager.Log($"Logging in user {email}..."); - CurrentUser = ObservablesEntitiesAdapter.Instance.Users.SingleOrDefault(x => x.Email.ToLower() == email && x.Password == hash); + CurrentUser = ObservablesStaticCollections.Instance.Users.SingleOrDefault(x => x.Email.ToLower() == email && x.Password == hash); if (CurrentUser != null) { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs index 1dbe7785d..648ddbb59 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs @@ -8,4 +8,4 @@ using System.Windows; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Tango Panel PC Application")] -[assembly: AssemblyVersion("2.0.6.1657")] +[assembly: AssemblyVersion("2.0.7.1119")] diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index d91bee884..2b2752a24 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj @@ -8,7 +8,7 @@ WinExe Tango.PPC.UI Tango.PPC.UI - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 @@ -126,7 +126,7 @@ - + @@ -421,7 +421,7 @@ copy /Y "$(SolutionDir)Referenced Assemblies\vcruntime140d.dll" "$(TargetDir)" - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Threading/DefaultDispatcherProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Threading/DefaultDispatcherProvider.cs new file mode 100644 index 000000000..940c13052 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Threading/DefaultDispatcherProvider.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Threading; +using Tango.PPC.Common.Threading; + +namespace Tango.PPC.UI.Threading +{ + /// + /// Represents the default PPC which will invoke action on the current application dispatcher. + /// + /// + public class DefaultDispatcherProvider : IDispatcherProvider + { + private Dispatcher _dispatcher; + + /// + /// Initializes a new instance of the class. + /// + /// The dispatcher. + public DefaultDispatcherProvider(Dispatcher dispatcher) + { + _dispatcher = dispatcher; + } + + /// + /// Invokes the specified action asynchronously. + /// + /// The action. + public void Invoke(Action action) + { + _dispatcher.BeginInvoke(action); + } + + /// + /// Invokes the specified action synchronously. + /// + /// The action. + public void InvokeSync(Action action) + { + _dispatcher.Invoke(action); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs index 5c416a289..bec1d2b48 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs @@ -58,7 +58,7 @@ namespace Tango.PPC.UI TangoIOC.Default.Unregister(); TangoIOC.Default.Unregister(); - TangoIOC.Default.Register(new DefaultDispetcherProvider(Application.Current.Dispatcher)); + TangoIOC.Default.Register(new DefaultDispatcherProvider(Application.Current.Dispatcher)); TangoIOC.Default.Register(); TangoIOC.Default.Register(); TangoIOC.Default.Register(); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UpdateService/Tango.PPC.UpdateService.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UpdateService/Tango.PPC.UpdateService.csproj index 8f3f6bc0a..7d48e06d1 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UpdateService/Tango.PPC.UpdateService.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.UpdateService/Tango.PPC.UpdateService.csproj @@ -12,7 +12,7 @@ Properties Tango.PPC.UpdateService Tango.PPC.UpdateService - v4.6 + v4.7.2 True true true diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UpdateService/Web.config b/Software/Visual_Studio/PPC/Tango.PPC.UpdateService/Web.config index eca7f404e..d73fd1425 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UpdateService/Web.config +++ b/Software/Visual_Studio/PPC/Tango.PPC.UpdateService/Web.config @@ -27,8 +27,7 @@ - + @@ -106,6 +105,10 @@ + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Updater/Tango.PPC.Updater.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Updater/Tango.PPC.Updater.csproj index 8ae94ebf8..4b05b79c6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Updater/Tango.PPC.Updater.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Updater/Tango.PPC.Updater.csproj @@ -8,7 +8,7 @@ WinExe Tango.PPC.Updater Tango.PPC.Updater - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/Resources/PortsList.xlsx b/Software/Visual_Studio/Resources/PortsList.xlsx index 1c8c7b1cc..52bbd0942 100644 Binary files a/Software/Visual_Studio/Resources/PortsList.xlsx and b/Software/Visual_Studio/Resources/PortsList.xlsx differ diff --git a/Software/Visual_Studio/SideChains/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj b/Software/Visual_Studio/SideChains/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj index 587f1e74d..1fa07caa6 100644 --- a/Software/Visual_Studio/SideChains/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj +++ b/Software/Visual_Studio/SideChains/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj @@ -7,7 +7,7 @@ Library ICSharpCode.AvalonEdit ICSharpCode.AvalonEdit - v4.6 + v4.7.2 Properties "C:\Program Files\SharpDevelop\3.0\bin\..\AddIns\AddIns\Misc\SourceAnalysis\Settings.SourceAnalysis" False diff --git a/Software/Visual_Studio/SideChains/MaterialDesignInXamlToolkit-master/MaterialDesignColors.Wpf/MaterialDesignColors.Wpf.csproj b/Software/Visual_Studio/SideChains/MaterialDesignInXamlToolkit-master/MaterialDesignColors.Wpf/MaterialDesignColors.Wpf.csproj index 4fe17cdc8..017cd7548 100644 --- a/Software/Visual_Studio/SideChains/MaterialDesignInXamlToolkit-master/MaterialDesignColors.Wpf/MaterialDesignColors.Wpf.csproj +++ b/Software/Visual_Studio/SideChains/MaterialDesignInXamlToolkit-master/MaterialDesignColors.Wpf/MaterialDesignColors.Wpf.csproj @@ -9,7 +9,7 @@ Properties MaterialDesignColors MaterialDesignColors - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/SideChains/MaterialDesignInXamlToolkit-master/MaterialDesignThemes.Wpf/MaterialDesignThemes.Wpf.csproj b/Software/Visual_Studio/SideChains/MaterialDesignInXamlToolkit-master/MaterialDesignThemes.Wpf/MaterialDesignThemes.Wpf.csproj index 4c86442a0..ad6c0efe0 100644 --- a/Software/Visual_Studio/SideChains/MaterialDesignInXamlToolkit-master/MaterialDesignThemes.Wpf/MaterialDesignThemes.Wpf.csproj +++ b/Software/Visual_Studio/SideChains/MaterialDesignInXamlToolkit-master/MaterialDesignThemes.Wpf/MaterialDesignThemes.Wpf.csproj @@ -9,7 +9,7 @@ Properties MaterialDesignThemes.Wpf MaterialDesignThemes.Wpf - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphEx/Properties/AssemblyInfo.cs b/Software/Visual_Studio/SideChains/RealTimeGraphEx/Properties/AssemblyInfo.cs index bde9c6f09..7c5ff58ed 100644 --- a/Software/Visual_Studio/SideChains/RealTimeGraphEx/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/SideChains/RealTimeGraphEx/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ using System.Windows; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.18.1647")] +[assembly: AssemblyVersion("1.0.19.1119")] [assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphEx/RealTimeGraphExBase.cs b/Software/Visual_Studio/SideChains/RealTimeGraphEx/RealTimeGraphExBase.cs index 141daf731..743ffaeab 100644 --- a/Software/Visual_Studio/SideChains/RealTimeGraphEx/RealTimeGraphExBase.cs +++ b/Software/Visual_Studio/SideChains/RealTimeGraphEx/RealTimeGraphExBase.cs @@ -6,6 +6,7 @@ using System.Collections.ObjectModel; using System.Diagnostics; using System.Globalization; using System.Linq; +using System.Runtime.ExceptionServices; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -1032,6 +1033,7 @@ namespace RealTimeGraphEx /// /// The push thread method. /// + [HandleProcessCorruptedStateExceptions] private void PushDataThreadMethod() { while (!_requestTermination.WaitOne(0)) diff --git a/Software/Visual_Studio/SideChains/Tango.AutoComplete/Properties/AssemblyInfo.cs b/Software/Visual_Studio/SideChains/Tango.AutoComplete/Properties/AssemblyInfo.cs index 6bc66ca75..fe55fc94f 100644 --- a/Software/Visual_Studio/SideChains/Tango.AutoComplete/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/SideChains/Tango.AutoComplete/Properties/AssemblyInfo.cs @@ -49,5 +49,5 @@ using System.Windows.Markup; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.18.1647")] +[assembly: AssemblyVersion("1.0.19.1119")] [assembly: AssemblyFileVersion("1.0.0.8")] diff --git a/Software/Visual_Studio/SideChains/Tango.AutoComplete/Tango.AutoComplete.csproj b/Software/Visual_Studio/SideChains/Tango.AutoComplete/Tango.AutoComplete.csproj index 44aba5b8e..d4139426b 100644 --- a/Software/Visual_Studio/SideChains/Tango.AutoComplete/Tango.AutoComplete.csproj +++ b/Software/Visual_Studio/SideChains/Tango.AutoComplete/Tango.AutoComplete.csproj @@ -9,7 +9,7 @@ Properties Tango.AutoComplete Tango.AutoComplete - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/Tango.AnimatedGif/Tango.AnimatedGif.csproj b/Software/Visual_Studio/Tango.AnimatedGif/Tango.AnimatedGif.csproj index 7ef6a0182..60da741dc 100644 --- a/Software/Visual_Studio/Tango.AnimatedGif/Tango.AnimatedGif.csproj +++ b/Software/Visual_Studio/Tango.AnimatedGif/Tango.AnimatedGif.csproj @@ -10,7 +10,7 @@ Properties Tango.AnimatedGif Tango.AnimatedGif - v4.6 + v4.7.2 512 diff --git a/Software/Visual_Studio/Tango.BL/Entities/ActionType.cs b/Software/Visual_Studio/Tango.BL/Entities/ActionType.cs index d1898e1f8..0ff5d8621 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ActionType.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ActionType.cs @@ -117,6 +117,7 @@ namespace Tango.BL.Entities { EventTypesActions = new ObservableCollection(); + EventTypesActions.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Address.cs b/Software/Visual_Studio/Tango.BL/Entities/Address.cs index 7f546fcc7..242ba6131 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Address.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Address.cs @@ -247,8 +247,10 @@ namespace Tango.BL.Entities { Organizations = new ObservableCollection(); + Organizations.EnableCrossThreadOperations(); Users = new ObservableCollection(); + Users.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/ApplicationDisplayPanelVersion.cs b/Software/Visual_Studio/Tango.BL/Entities/ApplicationDisplayPanelVersion.cs index 1833219a8..c16873e96 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ApplicationDisplayPanelVersion.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ApplicationDisplayPanelVersion.cs @@ -95,6 +95,7 @@ namespace Tango.BL.Entities { Configurations = new ObservableCollection(); + Configurations.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/ApplicationFirmwareVersion.cs b/Software/Visual_Studio/Tango.BL/Entities/ApplicationFirmwareVersion.cs index 7132f6d28..b8dbd3217 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ApplicationFirmwareVersion.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ApplicationFirmwareVersion.cs @@ -95,6 +95,7 @@ namespace Tango.BL.Entities { Configurations = new ObservableCollection(); + Configurations.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/ApplicationOsVersion.cs b/Software/Visual_Studio/Tango.BL/Entities/ApplicationOsVersion.cs index ce6e5fa26..dd0d6372f 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ApplicationOsVersion.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ApplicationOsVersion.cs @@ -95,6 +95,7 @@ namespace Tango.BL.Entities { Configurations = new ObservableCollection(); + Configurations.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/CartridgeType.cs b/Software/Visual_Studio/Tango.BL/Entities/CartridgeType.cs index aceabf132..df75748a5 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/CartridgeType.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/CartridgeType.cs @@ -95,6 +95,7 @@ namespace Tango.BL.Entities { IdsPacks = new ObservableCollection(); + IdsPacks.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalog.cs b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalog.cs index f9903a7a7..087a93d27 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ColorCatalog.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ColorCatalog.cs @@ -558,6 +558,7 @@ namespace Tango.BL.Entities { BrushStops = new ObservableCollection(); + BrushStops.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/ColorSpace.cs b/Software/Visual_Studio/Tango.BL/Entities/ColorSpace.cs index b38a18d7c..7aa2e448b 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ColorSpace.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ColorSpace.cs @@ -177,12 +177,16 @@ namespace Tango.BL.Entities { BrushStops = new ObservableCollection(); + BrushStops.EnableCrossThreadOperations(); ColorCatalogs = new ObservableCollection(); + ColorCatalogs.EnableCrossThreadOperations(); Jobs = new ObservableCollection(); + Jobs.EnableCrossThreadOperations(); Machines = new ObservableCollection(); + Machines.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Configuration.cs b/Software/Visual_Studio/Tango.BL/Entities/Configuration.cs index 634cb1c83..df7e69e3c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Configuration.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Configuration.cs @@ -380,12 +380,16 @@ namespace Tango.BL.Entities { IdsPacks = new ObservableCollection(); + IdsPacks.EnableCrossThreadOperations(); MachineVersions = new ObservableCollection(); + MachineVersions.EnableCrossThreadOperations(); Machines = new ObservableCollection(); + Machines.EnableCrossThreadOperations(); MachinesConfigurations = new ObservableCollection(); + MachinesConfigurations.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Contact.cs b/Software/Visual_Studio/Tango.BL/Entities/Contact.cs index b134748ce..a6c7bd319 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Contact.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Contact.cs @@ -225,8 +225,10 @@ namespace Tango.BL.Entities { Organizations = new ObservableCollection(); + Organizations.EnableCrossThreadOperations(); Users = new ObservableCollection(); + Users.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Customer.cs b/Software/Visual_Studio/Tango.BL/Entities/Customer.cs index daa842ad0..57a76a6bd 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Customer.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Customer.cs @@ -118,6 +118,7 @@ namespace Tango.BL.Entities { Jobs = new ObservableCollection(); + Jobs.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/DispenserType.cs b/Software/Visual_Studio/Tango.BL/Entities/DispenserType.cs index 965244ab3..4b47e35ce 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/DispenserType.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/DispenserType.cs @@ -139,6 +139,7 @@ namespace Tango.BL.Entities { IdsPacks = new ObservableCollection(); + IdsPacks.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/EmbeddedFirmwareVersion.cs b/Software/Visual_Studio/Tango.BL/Entities/EmbeddedFirmwareVersion.cs index c7d75cac6..8d5995a7b 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/EmbeddedFirmwareVersion.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/EmbeddedFirmwareVersion.cs @@ -95,6 +95,7 @@ namespace Tango.BL.Entities { Configurations = new ObservableCollection(); + Configurations.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/EventType.cs b/Software/Visual_Studio/Tango.BL/Entities/EventType.cs index c6ffa4667..766e0a4f1 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/EventType.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/EventType.cs @@ -316,8 +316,10 @@ namespace Tango.BL.Entities { EventTypesActions = new ObservableCollection(); + EventTypesActions.EnableCrossThreadOperations(); MachinesEvents = new ObservableCollection(); + MachinesEvents.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/EventTypesCategory.cs b/Software/Visual_Studio/Tango.BL/Entities/EventTypesCategory.cs index 8280a4821..00faaee7d 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/EventTypesCategory.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/EventTypesCategory.cs @@ -117,6 +117,7 @@ namespace Tango.BL.Entities { EventTypes = new ObservableCollection(); + EventTypes.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/EventTypesGroup.cs b/Software/Visual_Studio/Tango.BL/Entities/EventTypesGroup.cs index c3d286a93..d2bc9bd40 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/EventTypesGroup.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/EventTypesGroup.cs @@ -117,6 +117,7 @@ namespace Tango.BL.Entities { EventTypes = new ObservableCollection(); + EventTypes.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/FiberShape.cs b/Software/Visual_Studio/Tango.BL/Entities/FiberShape.cs index bfca3dd2b..4bf2f4bf9 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/FiberShape.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/FiberShape.cs @@ -95,6 +95,7 @@ namespace Tango.BL.Entities { Rmls = new ObservableCollection(); + Rmls.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/FiberSynth.cs b/Software/Visual_Studio/Tango.BL/Entities/FiberSynth.cs index 00352247d..d3555f5fb 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/FiberSynth.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/FiberSynth.cs @@ -95,6 +95,7 @@ namespace Tango.BL.Entities { Rmls = new ObservableCollection(); + Rmls.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareBlower.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareBlower.cs index afef2c3d7..b49c913a1 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareBlower.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareBlower.cs @@ -114,6 +114,28 @@ namespace Tango.BL.Entities } + protected Boolean _active; + + /// + /// Gets or sets the hardwareblower active. + /// + + [Column("ACTIVE")] + + public Boolean Active + { + get + { + return _active; + } + + set + { + _active = value; RaisePropertyChanged(nameof(Active)); + } + + } + protected HardwareBlowerType _hardwareblowertype; /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerType.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerType.cs index 5bfdf6515..b8915b389 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerType.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareBlowerType.cs @@ -117,6 +117,7 @@ namespace Tango.BL.Entities { HardwareBlowers = new ObservableCollection(); + HardwareBlowers.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensor.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensor.cs index f2bdf4f89..34bd84036 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensor.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensor.cs @@ -114,6 +114,28 @@ namespace Tango.BL.Entities } + protected Boolean _active; + + /// + /// Gets or sets the hardwarebreaksensor active. + /// + + [Column("ACTIVE")] + + public Boolean Active + { + get + { + return _active; + } + + set + { + _active = value; RaisePropertyChanged(nameof(Active)); + } + + } + protected HardwareBreakSensorType _hardwarebreaksensortype; /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorType.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorType.cs index c1d306e5b..c452377c5 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorType.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareBreakSensorType.cs @@ -117,6 +117,7 @@ namespace Tango.BL.Entities { HardwareBreakSensors = new ObservableCollection(); + HardwareBreakSensors.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareDancer.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareDancer.cs index 288153cf3..7fed45b85 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareDancer.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareDancer.cs @@ -290,6 +290,28 @@ namespace Tango.BL.Entities } + protected Boolean _active; + + /// + /// Gets or sets the hardwaredancer active. + /// + + [Column("ACTIVE")] + + public Boolean Active + { + get + { + return _active; + } + + set + { + _active = value; RaisePropertyChanged(nameof(Active)); + } + + } + protected HardwareDancerType _hardwaredancertype; /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerType.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerType.cs index 21f3d4157..1480441b8 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerType.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareDancerType.cs @@ -117,6 +117,7 @@ namespace Tango.BL.Entities { HardwareDancers = new ObservableCollection(); + HardwareDancers.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareMotor.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareMotor.cs index cb7abbd64..260e79f78 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareMotor.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareMotor.cs @@ -603,6 +603,28 @@ namespace Tango.BL.Entities } + protected Boolean _active; + + /// + /// Gets or sets the hardwaremotor active. + /// + + [Column("ACTIVE")] + + public Boolean Active + { + get + { + return _active; + } + + set + { + _active = value; RaisePropertyChanged(nameof(Active)); + } + + } + protected HardwareMotorType _hardwaremotortype; /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorType.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorType.cs index 53e36b47b..60afa6c25 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorType.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareMotorType.cs @@ -139,6 +139,7 @@ namespace Tango.BL.Entities { HardwareMotors = new ObservableCollection(); + HardwareMotors.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControl.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControl.cs index a2488534e..3a1af1bfd 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControl.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControl.cs @@ -444,6 +444,28 @@ namespace Tango.BL.Entities } + protected Boolean _active; + + /// + /// Gets or sets the hardwarepidcontrol active. + /// + + [Column("ACTIVE")] + + public Boolean Active + { + get + { + return _active; + } + + set + { + _active = value; RaisePropertyChanged(nameof(Active)); + } + + } + protected HardwarePidControlType _hardwarepidcontroltype; /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlType.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlType.cs index 78a5ad8fb..a5983d4c2 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlType.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwarePidControlType.cs @@ -117,6 +117,7 @@ namespace Tango.BL.Entities { HardwarePidControls = new ObservableCollection(); + HardwarePidControls.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensor.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensor.cs index fbadca1f3..85de0170f 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensor.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensor.cs @@ -114,6 +114,28 @@ namespace Tango.BL.Entities } + protected Boolean _active; + + /// + /// Gets or sets the hardwarespeedsensor active. + /// + + [Column("ACTIVE")] + + public Boolean Active + { + get + { + return _active; + } + + set + { + _active = value; RaisePropertyChanged(nameof(Active)); + } + + } + protected HardwareSpeedSensorType _hardwarespeedsensortype; /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorType.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorType.cs index 816618ac0..774a3a241 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorType.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareSpeedSensorType.cs @@ -117,6 +117,7 @@ namespace Tango.BL.Entities { HardwareSpeedSensors = new ObservableCollection(); + HardwareSpeedSensors.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareWinder.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareWinder.cs index f4cf655ab..d8c15494f 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareWinder.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareWinder.cs @@ -92,6 +92,28 @@ namespace Tango.BL.Entities } + protected Boolean _active; + + /// + /// Gets or sets the hardwarewinder active. + /// + + [Column("ACTIVE")] + + public Boolean Active + { + get + { + return _active; + } + + set + { + _active = value; RaisePropertyChanged(nameof(Active)); + } + + } + protected HardwareVersion _hardwareversion; /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderType.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderType.cs index 347325c2b..d5e2f2ead 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderType.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareWinderType.cs @@ -117,6 +117,7 @@ namespace Tango.BL.Entities { HardwareWinders = new ObservableCollection(); + HardwareWinders.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/HtmlPage.cs b/Software/Visual_Studio/Tango.BL/Entities/HtmlPage.cs index 9b9babf96..e1cf0844b 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HtmlPage.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HtmlPage.cs @@ -139,6 +139,7 @@ namespace Tango.BL.Entities { EventTypes = new ObservableCollection(); + EventTypes.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/IdsPackFormula.cs b/Software/Visual_Studio/Tango.BL/Entities/IdsPackFormula.cs index 5bc38ba0d..9236ef00a 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/IdsPackFormula.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/IdsPackFormula.cs @@ -139,6 +139,7 @@ namespace Tango.BL.Entities { IdsPacks = new ObservableCollection(); + IdsPacks.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs index 1482003a1..fcac42b74 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs @@ -951,8 +951,10 @@ namespace Tango.BL.Entities { JobRuns = new ObservableCollection(); + JobRuns.EnableCrossThreadOperations(); Segments = new ObservableCollection(); + Segments.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/LinearMassDensityUnit.cs b/Software/Visual_Studio/Tango.BL/Entities/LinearMassDensityUnit.cs index 773c2a429..418d1b9be 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/LinearMassDensityUnit.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/LinearMassDensityUnit.cs @@ -95,6 +95,7 @@ namespace Tango.BL.Entities { Rmls = new ObservableCollection(); + Rmls.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs b/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs index bef97ca4f..2a305d4f5 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/LiquidType.cs @@ -179,10 +179,13 @@ namespace Tango.BL.Entities { Cats = new ObservableCollection(); + Cats.EnableCrossThreadOperations(); IdsPacks = new ObservableCollection(); + IdsPacks.EnableCrossThreadOperations(); LiquidTypesRmls = new ObservableCollection(); + LiquidTypesRmls.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Machine.cs b/Software/Visual_Studio/Tango.BL/Entities/Machine.cs index 3c9271fff..8fbf80cd9 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Machine.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Machine.cs @@ -557,12 +557,16 @@ namespace Tango.BL.Entities { Cats = new ObservableCollection(); + Cats.EnableCrossThreadOperations(); Jobs = new ObservableCollection(); + Jobs.EnableCrossThreadOperations(); MachinesConfigurations = new ObservableCollection(); + MachinesConfigurations.EnableCrossThreadOperations(); MachinesEvents = new ObservableCollection(); + MachinesEvents.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs b/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs index b2a716894..a19a2066a 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs @@ -160,8 +160,10 @@ namespace Tango.BL.Entities { Machines = new ObservableCollection(); + Machines.EnableCrossThreadOperations(); TangoVersions = new ObservableCollection(); + TangoVersions.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/MediaColor.cs b/Software/Visual_Studio/Tango.BL/Entities/MediaColor.cs index 311eb3335..2c0141136 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MediaColor.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MediaColor.cs @@ -139,6 +139,7 @@ namespace Tango.BL.Entities { Rmls = new ObservableCollection(); + Rmls.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/MediaCondition.cs b/Software/Visual_Studio/Tango.BL/Entities/MediaCondition.cs index ae85507d6..ef55b87a3 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MediaCondition.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MediaCondition.cs @@ -95,6 +95,7 @@ namespace Tango.BL.Entities { Rmls = new ObservableCollection(); + Rmls.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/MediaMaterial.cs b/Software/Visual_Studio/Tango.BL/Entities/MediaMaterial.cs index 80b46715c..4817db217 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MediaMaterial.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MediaMaterial.cs @@ -95,6 +95,7 @@ namespace Tango.BL.Entities { Rmls = new ObservableCollection(); + Rmls.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/MediaPurpos.cs b/Software/Visual_Studio/Tango.BL/Entities/MediaPurpos.cs index f51ba6f39..2acd79c75 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MediaPurpos.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MediaPurpos.cs @@ -95,6 +95,7 @@ namespace Tango.BL.Entities { Rmls = new ObservableCollection(); + Rmls.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/MidTankType.cs b/Software/Visual_Studio/Tango.BL/Entities/MidTankType.cs index 559ffd4dc..65866bd8c 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MidTankType.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MidTankType.cs @@ -117,6 +117,7 @@ namespace Tango.BL.Entities { IdsPacks = new ObservableCollection(); + IdsPacks.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Organization.cs b/Software/Visual_Studio/Tango.BL/Entities/Organization.cs index ed20dd7f5..3c4b263b9 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Organization.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Organization.cs @@ -203,10 +203,13 @@ namespace Tango.BL.Entities { Customers = new ObservableCollection(); + Customers.EnableCrossThreadOperations(); Machines = new ObservableCollection(); + Machines.EnableCrossThreadOperations(); Users = new ObservableCollection(); + Users.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Permission.cs b/Software/Visual_Studio/Tango.BL/Entities/Permission.cs index 42a3d466c..dc49de94d 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Permission.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Permission.cs @@ -117,6 +117,7 @@ namespace Tango.BL.Entities { RolesPermissions = new ObservableCollection(); + RolesPermissions.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTablesGroup.cs b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTablesGroup.cs index cbd85d41e..ed04cc846 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTablesGroup.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTablesGroup.cs @@ -162,6 +162,7 @@ namespace Tango.BL.Entities { ProcessParametersTables = new ObservableCollection(); + ProcessParametersTables.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Rml.cs b/Software/Visual_Studio/Tango.BL/Entities/Rml.cs index 306ca5e3f..190082311 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Rml.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Rml.cs @@ -752,16 +752,22 @@ namespace Tango.BL.Entities { Cats = new ObservableCollection(); + Cats.EnableCrossThreadOperations(); Ccts = new ObservableCollection(); + Ccts.EnableCrossThreadOperations(); Jobs = new ObservableCollection(); + Jobs.EnableCrossThreadOperations(); LiquidTypesRmls = new ObservableCollection(); + LiquidTypesRmls.EnableCrossThreadOperations(); Machines = new ObservableCollection(); + Machines.EnableCrossThreadOperations(); ProcessParametersTablesGroups = new ObservableCollection(); + ProcessParametersTablesGroups.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Role.cs b/Software/Visual_Studio/Tango.BL/Entities/Role.cs index 231bfdccb..a11624616 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Role.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Role.cs @@ -137,8 +137,10 @@ namespace Tango.BL.Entities { RolesPermissions = new ObservableCollection(); + RolesPermissions.EnableCrossThreadOperations(); UsersRoles = new ObservableCollection(); + UsersRoles.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Segment.cs b/Software/Visual_Studio/Tango.BL/Entities/Segment.cs index 38a067ea8..7d1d94530 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Segment.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Segment.cs @@ -162,6 +162,7 @@ namespace Tango.BL.Entities { BrushStops = new ObservableCollection(); + BrushStops.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/SpoolType.cs b/Software/Visual_Studio/Tango.BL/Entities/SpoolType.cs index 3dfed854c..e15aa88d2 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/SpoolType.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/SpoolType.cs @@ -291,8 +291,10 @@ namespace Tango.BL.Entities { Jobs = new ObservableCollection(); + Jobs.EnableCrossThreadOperations(); Machines = new ObservableCollection(); + Machines.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Sysdiagram.cs b/Software/Visual_Studio/Tango.BL/Entities/Sysdiagram.cs index c79764b8c..d79aa5557 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Sysdiagram.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Sysdiagram.cs @@ -73,6 +73,7 @@ namespace Tango.BL.Entities { Version = new ObservableCollection(); + Version.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/User.cs b/Software/Visual_Studio/Tango.BL/Entities/User.cs index 93905e07d..c5c4bb5f9 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/User.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/User.cs @@ -354,14 +354,19 @@ namespace Tango.BL.Entities { Jobs = new ObservableCollection(); + Jobs.EnableCrossThreadOperations(); MachineStudioVersions = new ObservableCollection(); + MachineStudioVersions.EnableCrossThreadOperations(); MachinesEvents = new ObservableCollection(); + MachinesEvents.EnableCrossThreadOperations(); TangoVersions = new ObservableCollection(); + TangoVersions.EnableCrossThreadOperations(); UsersRoles = new ObservableCollection(); + UsersRoles.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/WindingMethod.cs b/Software/Visual_Studio/Tango.BL/Entities/WindingMethod.cs index e00670087..28f3bed9a 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/WindingMethod.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/WindingMethod.cs @@ -117,6 +117,7 @@ namespace Tango.BL.Entities { Jobs = new ObservableCollection(); + Jobs.EnableCrossThreadOperations(); } } diff --git a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/HardwareVersion.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/HardwareVersion.cs index 677055414..5ce0938b3 100644 --- a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/HardwareVersion.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/HardwareVersion.cs @@ -11,13 +11,13 @@ namespace Tango.BL.Entities public override HardwareVersion Clone() { var cloned = base.Clone(); - cloned.HardwareMotors = HardwareMotors.Select(x => x.Clone()).ToObservableCollection(); - cloned.HardwareDancers = HardwareDancers.Select(x => x.Clone()).ToObservableCollection(); - cloned.HardwarePidControls = HardwarePidControls.Select(x => x.Clone()).ToObservableCollection(); - cloned.HardwareWinders = HardwareWinders.Select(x => x.Clone()).ToObservableCollection(); - cloned.HardwareSpeedSensors = HardwareSpeedSensors.Select(x => x.Clone()).ToObservableCollection(); - cloned.HardwareBlowers = HardwareBlowers.Select(x => x.Clone()).ToObservableCollection(); - cloned.HardwareBreakSensors = HardwareBreakSensors.Select(x => x.Clone()).ToObservableCollection(); + cloned.HardwareMotors = HardwareMotors.Select(x => x.Clone(y => y.HardwareVersion = cloned)).ToObservableCollection(); + cloned.HardwareDancers = HardwareDancers.Select(x => x.Clone(y => y.HardwareVersion = cloned)).ToObservableCollection(); + cloned.HardwarePidControls = HardwarePidControls.Select(x => x.Clone(y => y.HardwareVersion = cloned)).ToObservableCollection(); + cloned.HardwareWinders = HardwareWinders.Select(x => x.Clone(y => y.HardwareVersion = cloned)).ToObservableCollection(); + cloned.HardwareSpeedSensors = HardwareSpeedSensors.Select(x => x.Clone(y => y.HardwareVersion = cloned)).ToObservableCollection(); + cloned.HardwareBlowers = HardwareBlowers.Select(x => x.Clone(y => y.HardwareVersion = cloned)).ToObservableCollection(); + cloned.HardwareBreakSensors = HardwareBreakSensors.Select(x => x.Clone(y => y.HardwareVersion = cloned)).ToObservableCollection(); return cloned; } diff --git a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/MachineEvent.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/MachineEvent.cs index 33dd34d2c..e100bea82 100644 --- a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/MachineEvent.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/MachineEvent.cs @@ -23,7 +23,7 @@ namespace Tango.BL.Entities _eventTypesGuids = new Dictionary(); - foreach (var type in ObservablesEntitiesAdapter.Instance.EventTypes) + foreach (var type in ObservablesStaticCollections.Instance.EventTypes) { _eventTypesGuids.Add((EventTypes)type.Code, type); } diff --git a/Software/Visual_Studio/Tango.BL/ObservableEntity.cs b/Software/Visual_Studio/Tango.BL/ObservableEntity.cs index fc037f16a..1b69a8bdb 100644 --- a/Software/Visual_Studio/Tango.BL/ObservableEntity.cs +++ b/Software/Visual_Studio/Tango.BL/ObservableEntity.cs @@ -311,6 +311,11 @@ Maybe you have deleted an entity that was no yet inserted into database?", LogCa /// /// public virtual T Clone() + { + return Clone(null); + } + + public T Clone(Action action) { var cloned = Activator.CreateInstance(); @@ -325,6 +330,9 @@ Maybe you have deleted an entity that was no yet inserted into database?", LogCa cloned.ID = 0; cloned.Guid = System.Guid.NewGuid().ToString(); cloned.LastUpdated = DateTime.UtcNow; + + action?.Invoke(cloned); + return cloned; } @@ -361,6 +369,11 @@ Maybe you have deleted an entity that was no yet inserted into database?", LogCa Modified?.Invoke(this, new ObservableModifiedEventArgs(context, source, target)); } + public ObjectContext GetObjectContext() + { + return GetObjectContextFromEntity(this); + } + #endregion #region Private Methods diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContext.Views.cs b/Software/Visual_Studio/Tango.BL/ObservablesContext.Views.cs new file mode 100644 index 000000000..77d5eaf91 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/ObservablesContext.Views.cs @@ -0,0 +1,4557 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Data.Entity.Infrastructure.MappingViews; + +[assembly: DbMappingViewCacheTypeAttribute( + typeof(Tango.BL.ObservablesContext), + typeof(Edm_EntityMappingGeneratedViews.ViewsForBaseEntitySetsc3679a786ef37ebd0dbe7c77338124e318d974c8a9bdfd0840c18c98328c0e50))] + +namespace Edm_EntityMappingGeneratedViews +{ + using System; + using System.CodeDom.Compiler; + using System.Data.Entity.Core.Metadata.Edm; + + /// + /// Implements a mapping view cache. + /// + [GeneratedCode("Entity Framework Power Tools", "0.9.0.0")] + internal sealed class ViewsForBaseEntitySetsc3679a786ef37ebd0dbe7c77338124e318d974c8a9bdfd0840c18c98328c0e50 : DbMappingViewCache + { + /// + /// Gets a hash value computed over the mapping closure. + /// + public override string MappingHashValue + { + get { return "c3679a786ef37ebd0dbe7c77338124e318d974c8a9bdfd0840c18c98328c0e50"; } + } + + /// + /// Gets a view corresponding to the specified extent. + /// + /// The extent. + /// The mapping view, or null if the extent is not associated with a mapping view. + public override DbMappingView GetView(EntitySetBase extent) + { + if (extent == null) + { + throw new ArgumentNullException("extent"); + } + + var extentName = extent.EntityContainer.Name + "." + extent.Name; + + if (extentName == "CodeFirstDatabase.ActionType") + { + return GetView0(); + } + + if (extentName == "CodeFirstDatabase.EventTypesAction") + { + return GetView1(); + } + + if (extentName == "CodeFirstDatabase.EventType") + { + return GetView2(); + } + + if (extentName == "CodeFirstDatabase.EventTypesCategory") + { + return GetView3(); + } + + if (extentName == "CodeFirstDatabase.EventTypesGroup") + { + return GetView4(); + } + + if (extentName == "CodeFirstDatabase.HtmlPage") + { + return GetView5(); + } + + if (extentName == "CodeFirstDatabase.MachinesEvent") + { + return GetView6(); + } + + if (extentName == "CodeFirstDatabase.Machine") + { + return GetView7(); + } + + if (extentName == "CodeFirstDatabase.Cat") + { + return GetView8(); + } + + if (extentName == "CodeFirstDatabase.LiquidType") + { + return GetView9(); + } + + if (extentName == "CodeFirstDatabase.IdsPack") + { + return GetView10(); + } + + if (extentName == "CodeFirstDatabase.CartridgeType") + { + return GetView11(); + } + + if (extentName == "CodeFirstDatabase.Configuration") + { + return GetView12(); + } + + if (extentName == "CodeFirstDatabase.ApplicationDisplayPanelVersion") + { + return GetView13(); + } + + if (extentName == "CodeFirstDatabase.ApplicationFirmwareVersion") + { + return GetView14(); + } + + if (extentName == "CodeFirstDatabase.ApplicationOsVersion") + { + return GetView15(); + } + + if (extentName == "CodeFirstDatabase.EmbeddedFirmwareVersion") + { + return GetView16(); + } + + if (extentName == "CodeFirstDatabase.HardwareVersion") + { + return GetView17(); + } + + if (extentName == "CodeFirstDatabase.HardwareBlower") + { + return GetView18(); + } + + if (extentName == "CodeFirstDatabase.HardwareBlowerType") + { + return GetView19(); + } + + if (extentName == "CodeFirstDatabase.HardwareBreakSensor") + { + return GetView20(); + } + + if (extentName == "CodeFirstDatabase.HardwareBreakSensorType") + { + return GetView21(); + } + + if (extentName == "CodeFirstDatabase.HardwareDancer") + { + return GetView22(); + } + + if (extentName == "CodeFirstDatabase.HardwareDancerType") + { + return GetView23(); + } + + if (extentName == "CodeFirstDatabase.HardwareMotor") + { + return GetView24(); + } + + if (extentName == "CodeFirstDatabase.HardwareMotorType") + { + return GetView25(); + } + + if (extentName == "CodeFirstDatabase.HardwarePidControl") + { + return GetView26(); + } + + if (extentName == "CodeFirstDatabase.HardwarePidControlType") + { + return GetView27(); + } + + if (extentName == "CodeFirstDatabase.HardwareSpeedSensor") + { + return GetView28(); + } + + if (extentName == "CodeFirstDatabase.HardwareSpeedSensorType") + { + return GetView29(); + } + + if (extentName == "CodeFirstDatabase.HardwareWinder") + { + return GetView30(); + } + + if (extentName == "CodeFirstDatabase.HardwareWinderType") + { + return GetView31(); + } + + if (extentName == "CodeFirstDatabase.MachinesConfiguration") + { + return GetView32(); + } + + if (extentName == "CodeFirstDatabase.MachineVersion") + { + return GetView33(); + } + + if (extentName == "CodeFirstDatabase.TangoVersion") + { + return GetView34(); + } + + if (extentName == "CodeFirstDatabase.User") + { + return GetView35(); + } + + if (extentName == "CodeFirstDatabase.Address") + { + return GetView36(); + } + + if (extentName == "CodeFirstDatabase.Organization") + { + return GetView37(); + } + + if (extentName == "CodeFirstDatabase.Contact") + { + return GetView38(); + } + + if (extentName == "CodeFirstDatabase.Customer") + { + return GetView39(); + } + + if (extentName == "CodeFirstDatabase.Job") + { + return GetView40(); + } + + if (extentName == "CodeFirstDatabase.ColorSpace") + { + return GetView41(); + } + + if (extentName == "CodeFirstDatabase.BrushStop") + { + return GetView42(); + } + + if (extentName == "CodeFirstDatabase.ColorCatalog") + { + return GetView43(); + } + + if (extentName == "CodeFirstDatabase.Segment") + { + return GetView44(); + } + + if (extentName == "CodeFirstDatabase.JobRun") + { + return GetView45(); + } + + if (extentName == "CodeFirstDatabase.Rml") + { + return GetView46(); + } + + if (extentName == "CodeFirstDatabase.Cct") + { + return GetView47(); + } + + if (extentName == "CodeFirstDatabase.FiberShape") + { + return GetView48(); + } + + if (extentName == "CodeFirstDatabase.FiberSynth") + { + return GetView49(); + } + + if (extentName == "CodeFirstDatabase.LinearMassDensityUnit") + { + return GetView50(); + } + + if (extentName == "CodeFirstDatabase.LiquidTypesRml") + { + return GetView51(); + } + + if (extentName == "CodeFirstDatabase.MediaColor") + { + return GetView52(); + } + + if (extentName == "CodeFirstDatabase.MediaCondition") + { + return GetView53(); + } + + if (extentName == "CodeFirstDatabase.MediaMaterial") + { + return GetView54(); + } + + if (extentName == "CodeFirstDatabase.MediaPurpos") + { + return GetView55(); + } + + if (extentName == "CodeFirstDatabase.ProcessParametersTablesGroup") + { + return GetView56(); + } + + if (extentName == "CodeFirstDatabase.ProcessParametersTable") + { + return GetView57(); + } + + if (extentName == "CodeFirstDatabase.SpoolType") + { + return GetView58(); + } + + if (extentName == "CodeFirstDatabase.WindingMethod") + { + return GetView59(); + } + + if (extentName == "CodeFirstDatabase.MachineStudioVersion") + { + return GetView60(); + } + + if (extentName == "CodeFirstDatabase.UsersRole") + { + return GetView61(); + } + + if (extentName == "CodeFirstDatabase.Role") + { + return GetView62(); + } + + if (extentName == "CodeFirstDatabase.RolesPermission") + { + return GetView63(); + } + + if (extentName == "CodeFirstDatabase.Permission") + { + return GetView64(); + } + + if (extentName == "CodeFirstDatabase.DispenserType") + { + return GetView65(); + } + + if (extentName == "CodeFirstDatabase.IdsPackFormula") + { + return GetView66(); + } + + if (extentName == "CodeFirstDatabase.MidTankType") + { + return GetView67(); + } + + if (extentName == "ObservablesContext.ActionTypes") + { + return GetView68(); + } + + if (extentName == "ObservablesContext.EventTypesActions") + { + return GetView69(); + } + + if (extentName == "ObservablesContext.EventTypes") + { + return GetView70(); + } + + if (extentName == "ObservablesContext.EventTypesCategories") + { + return GetView71(); + } + + if (extentName == "ObservablesContext.EventTypesGroups") + { + return GetView72(); + } + + if (extentName == "ObservablesContext.HtmlPages") + { + return GetView73(); + } + + if (extentName == "ObservablesContext.MachinesEvents") + { + return GetView74(); + } + + if (extentName == "ObservablesContext.Machines") + { + return GetView75(); + } + + if (extentName == "ObservablesContext.Cats") + { + return GetView76(); + } + + if (extentName == "ObservablesContext.LiquidTypes") + { + return GetView77(); + } + + if (extentName == "ObservablesContext.IdsPacks") + { + return GetView78(); + } + + if (extentName == "ObservablesContext.CartridgeTypes") + { + return GetView79(); + } + + if (extentName == "ObservablesContext.Configurations") + { + return GetView80(); + } + + if (extentName == "ObservablesContext.ApplicationDisplayPanelVersions") + { + return GetView81(); + } + + if (extentName == "ObservablesContext.ApplicationFirmwareVersions") + { + return GetView82(); + } + + if (extentName == "ObservablesContext.ApplicationOsVersions") + { + return GetView83(); + } + + if (extentName == "ObservablesContext.EmbeddedFirmwareVersions") + { + return GetView84(); + } + + if (extentName == "ObservablesContext.HardwareVersions") + { + return GetView85(); + } + + if (extentName == "ObservablesContext.HardwareBlowers") + { + return GetView86(); + } + + if (extentName == "ObservablesContext.HardwareBlowerTypes") + { + return GetView87(); + } + + if (extentName == "ObservablesContext.HardwareBreakSensors") + { + return GetView88(); + } + + if (extentName == "ObservablesContext.HardwareBreakSensorTypes") + { + return GetView89(); + } + + if (extentName == "ObservablesContext.HardwareDancers") + { + return GetView90(); + } + + if (extentName == "ObservablesContext.HardwareDancerTypes") + { + return GetView91(); + } + + if (extentName == "ObservablesContext.HardwareMotors") + { + return GetView92(); + } + + if (extentName == "ObservablesContext.HardwareMotorTypes") + { + return GetView93(); + } + + if (extentName == "ObservablesContext.HardwarePidControls") + { + return GetView94(); + } + + if (extentName == "ObservablesContext.HardwarePidControlTypes") + { + return GetView95(); + } + + if (extentName == "ObservablesContext.HardwareSpeedSensors") + { + return GetView96(); + } + + if (extentName == "ObservablesContext.HardwareSpeedSensorTypes") + { + return GetView97(); + } + + if (extentName == "ObservablesContext.HardwareWinders") + { + return GetView98(); + } + + if (extentName == "ObservablesContext.HardwareWinderTypes") + { + return GetView99(); + } + + if (extentName == "ObservablesContext.MachinesConfigurations") + { + return GetView100(); + } + + if (extentName == "ObservablesContext.MachineVersions") + { + return GetView101(); + } + + if (extentName == "ObservablesContext.TangoVersions") + { + return GetView102(); + } + + if (extentName == "ObservablesContext.Users") + { + return GetView103(); + } + + if (extentName == "ObservablesContext.Addresses") + { + return GetView104(); + } + + if (extentName == "ObservablesContext.Organizations") + { + return GetView105(); + } + + if (extentName == "ObservablesContext.Contacts") + { + return GetView106(); + } + + if (extentName == "ObservablesContext.Customers") + { + return GetView107(); + } + + if (extentName == "ObservablesContext.Jobs") + { + return GetView108(); + } + + if (extentName == "ObservablesContext.ColorSpaces") + { + return GetView109(); + } + + if (extentName == "ObservablesContext.BrushStops") + { + return GetView110(); + } + + if (extentName == "ObservablesContext.ColorCatalogs") + { + return GetView111(); + } + + if (extentName == "ObservablesContext.Segments") + { + return GetView112(); + } + + if (extentName == "ObservablesContext.JobRuns") + { + return GetView113(); + } + + if (extentName == "ObservablesContext.Rmls") + { + return GetView114(); + } + + if (extentName == "ObservablesContext.Ccts") + { + return GetView115(); + } + + if (extentName == "ObservablesContext.FiberShapes") + { + return GetView116(); + } + + if (extentName == "ObservablesContext.FiberSynths") + { + return GetView117(); + } + + if (extentName == "ObservablesContext.LinearMassDensityUnits") + { + return GetView118(); + } + + if (extentName == "ObservablesContext.LiquidTypesRmls") + { + return GetView119(); + } + + if (extentName == "ObservablesContext.MediaColors") + { + return GetView120(); + } + + if (extentName == "ObservablesContext.MediaConditions") + { + return GetView121(); + } + + if (extentName == "ObservablesContext.MediaMaterials") + { + return GetView122(); + } + + if (extentName == "ObservablesContext.MediaPurposes") + { + return GetView123(); + } + + if (extentName == "ObservablesContext.ProcessParametersTablesGroups") + { + return GetView124(); + } + + if (extentName == "ObservablesContext.ProcessParametersTables") + { + return GetView125(); + } + + if (extentName == "ObservablesContext.SpoolTypes") + { + return GetView126(); + } + + if (extentName == "ObservablesContext.WindingMethods") + { + return GetView127(); + } + + if (extentName == "ObservablesContext.MachineStudioVersions") + { + return GetView128(); + } + + if (extentName == "ObservablesContext.UsersRoles") + { + return GetView129(); + } + + if (extentName == "ObservablesContext.Roles") + { + return GetView130(); + } + + if (extentName == "ObservablesContext.RolesPermissions") + { + return GetView131(); + } + + if (extentName == "ObservablesContext.Permissions") + { + return GetView132(); + } + + if (extentName == "ObservablesContext.DispenserTypes") + { + return GetView133(); + } + + if (extentName == "ObservablesContext.IdsPackFormulas") + { + return GetView134(); + } + + if (extentName == "ObservablesContext.MidTankTypes") + { + return GetView135(); + } + + if (extentName == "CodeFirstDatabase.SyncConfiguration") + { + return GetView136(); + } + + if (extentName == "ObservablesContext.SyncConfigurations") + { + return GetView137(); + } + + if (extentName == "CodeFirstDatabase.Sysdiagram") + { + return GetView138(); + } + + if (extentName == "ObservablesContext.Sysdiagrams") + { + return GetView139(); + } + + if (extentName == "CodeFirstDatabase.TechController") + { + return GetView140(); + } + + if (extentName == "ObservablesContext.TechControllers") + { + return GetView141(); + } + + if (extentName == "CodeFirstDatabase.TechDispenser") + { + return GetView142(); + } + + if (extentName == "ObservablesContext.TechDispensers") + { + return GetView143(); + } + + if (extentName == "CodeFirstDatabase.TechIo") + { + return GetView144(); + } + + if (extentName == "ObservablesContext.TechIos") + { + return GetView145(); + } + + if (extentName == "CodeFirstDatabase.TechMonitor") + { + return GetView146(); + } + + if (extentName == "ObservablesContext.TechMonitors") + { + return GetView147(); + } + + if (extentName == "CodeFirstDatabase.TechValf") + { + return GetView148(); + } + + if (extentName == "ObservablesContext.TechValves") + { + return GetView149(); + } + + return null; + } + + /// + /// Gets the view for CodeFirstDatabase.ActionType. + /// + /// The mapping view. + private static DbMappingView GetView0() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing ActionType + [CodeFirstDatabaseSchema.ActionType](T1.ActionType_GUID, T1.ActionType_CODE, T1.ActionType_NAME, T1.ActionType_DESCRIPTION, T1.ActionType_ID, T1.[ActionType.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS ActionType_GUID, + T.Code AS ActionType_CODE, + T.Name AS ActionType_NAME, + T.Description AS ActionType_DESCRIPTION, + T.ID AS ActionType_ID, + T.LastUpdated AS [ActionType.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.ActionTypes AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.EventTypesAction. + /// + /// The mapping view. + private static DbMappingView GetView1() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing EventTypesAction + [CodeFirstDatabaseSchema.EventTypesAction](T1.EventTypesAction_GUID, T1.[EventTypesAction.EVENT_TYPE_GUID], T1.[EventTypesAction.ACTION_TYPE_GUID], T1.EventTypesAction_ID, T1.[EventTypesAction.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS EventTypesAction_GUID, + T.EventTypeGuid AS [EventTypesAction.EVENT_TYPE_GUID], + T.ActionTypeGuid AS [EventTypesAction.ACTION_TYPE_GUID], + T.ID AS EventTypesAction_ID, + T.LastUpdated AS [EventTypesAction.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.EventTypesActions AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.EventType. + /// + /// The mapping view. + private static DbMappingView GetView2() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing EventType + [CodeFirstDatabaseSchema.EventType](T1.EventType_GUID, T1.EventType_CODE, T1.EventType_NAME, T1.EventType_DESCRIPTION, T1.[EventType.EVENT_TYPES_CATEGORY_GUID], T1.[EventType.EVENT_TYPES_GROUP_GUID], T1.[EventType.REQUIRES_USER_INTERVENTION], T1.[EventType.HTML_PAGE_GUID], T1.EventType_RESOLVABLE, T1.EventType_ID, T1.[EventType.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS EventType_GUID, + T.Code AS EventType_CODE, + T.Name AS EventType_NAME, + T.Description AS EventType_DESCRIPTION, + T.EventTypesCategoryGuid AS [EventType.EVENT_TYPES_CATEGORY_GUID], + T.EventTypesGroupGuid AS [EventType.EVENT_TYPES_GROUP_GUID], + T.RequiresUserIntervention AS [EventType.REQUIRES_USER_INTERVENTION], + T.HtmlPageGuid AS [EventType.HTML_PAGE_GUID], + T.Resolvable AS EventType_RESOLVABLE, + T.ID AS EventType_ID, + T.LastUpdated AS [EventType.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.EventTypes AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.EventTypesCategory. + /// + /// The mapping view. + private static DbMappingView GetView3() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing EventTypesCategory + [CodeFirstDatabaseSchema.EventTypesCategory](T1.EventTypesCategory_GUID, T1.EventTypesCategory_CODE, T1.EventTypesCategory_NAME, T1.EventTypesCategory_DESCRIPTION, T1.EventTypesCategory_ID, T1.[EventTypesCategory.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS EventTypesCategory_GUID, + T.Code AS EventTypesCategory_CODE, + T.Name AS EventTypesCategory_NAME, + T.Description AS EventTypesCategory_DESCRIPTION, + T.ID AS EventTypesCategory_ID, + T.LastUpdated AS [EventTypesCategory.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.EventTypesCategories AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.EventTypesGroup. + /// + /// The mapping view. + private static DbMappingView GetView4() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing EventTypesGroup + [CodeFirstDatabaseSchema.EventTypesGroup](T1.EventTypesGroup_GUID, T1.EventTypesGroup_CODE, T1.EventTypesGroup_NAME, T1.EventTypesGroup_DESCRIPTION, T1.EventTypesGroup_ID, T1.[EventTypesGroup.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS EventTypesGroup_GUID, + T.Code AS EventTypesGroup_CODE, + T.Name AS EventTypesGroup_NAME, + T.Description AS EventTypesGroup_DESCRIPTION, + T.ID AS EventTypesGroup_ID, + T.LastUpdated AS [EventTypesGroup.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.EventTypesGroups AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.HtmlPage. + /// + /// The mapping view. + private static DbMappingView GetView5() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HtmlPage + [CodeFirstDatabaseSchema.HtmlPage](T1.HtmlPage_GUID, T1.HtmlPage_CODE, T1.HtmlPage_NAME, T1.HtmlPage_DESCRIPTION, T1.HtmlPage_HTML, T1.HtmlPage_ID, T1.[HtmlPage.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS HtmlPage_GUID, + T.Code AS HtmlPage_CODE, + T.Name AS HtmlPage_NAME, + T.Description AS HtmlPage_DESCRIPTION, + T.Html AS HtmlPage_HTML, + T.ID AS HtmlPage_ID, + T.LastUpdated AS [HtmlPage.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.HtmlPages AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.MachinesEvent. + /// + /// The mapping view. + private static DbMappingView GetView6() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing MachinesEvent + [CodeFirstDatabaseSchema.MachinesEvent](T1.MachinesEvent_GUID, T1.[MachinesEvent.HOST_NAME], T1.[MachinesEvent.MACHINE_GUID], T1.[MachinesEvent.EVENT_TYPE_GUID], T1.[MachinesEvent.USER_GUID], T1.[MachinesEvent.DATE_TIME], T1.MachinesEvent_DESCRIPTION, T1.MachinesEvent_ID, T1.[MachinesEvent.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS MachinesEvent_GUID, + T.HostName AS [MachinesEvent.HOST_NAME], + T.MachineGuid AS [MachinesEvent.MACHINE_GUID], + T.EventTypeGuid AS [MachinesEvent.EVENT_TYPE_GUID], + T.UserGuid AS [MachinesEvent.USER_GUID], + T.DateTime AS [MachinesEvent.DATE_TIME], + T.Description AS MachinesEvent_DESCRIPTION, + T.ID AS MachinesEvent_ID, + T.LastUpdated AS [MachinesEvent.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.MachinesEvents AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.Machine. + /// + /// The mapping view. + private static DbMappingView GetView7() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Machine + [CodeFirstDatabaseSchema.Machine](T1.Machine_GUID, T1.[Machine.SERIAL_NUMBER], T1.Machine_NAME, T1.[Machine.PRODUCTION_DATE], T1.[Machine.ORGANIZATION_GUID], T1.[Machine.MACHINE_VERSION_GUID], T1.[Machine.CONFIGURATION_GUID], T1.[Machine.ENABLE_EXTERNAL_BRIDGE], T1.[Machine.EXTERNAL_BRIDGE_PASSWORD], T1.[Machine.DEFAULT_RML_GUID], T1.[Machine.TARGET_JOB_TYPES], T1.[Machine.DEFAULT_COLOR_SPACE_GUID], T1.[Machine.DEFAULT_SEGMENT_LENGTH], T1.[Machine.DEFAULT_SPOOL_TYPE_GUID], T1.Machine_SYNCHED, T1.Machine_ID, T1.[Machine.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS Machine_GUID, + T.SerialNumber AS [Machine.SERIAL_NUMBER], + T.Name AS Machine_NAME, + T.ProductionDate AS [Machine.PRODUCTION_DATE], + T.OrganizationGuid AS [Machine.ORGANIZATION_GUID], + T.MachineVersionGuid AS [Machine.MACHINE_VERSION_GUID], + T.ConfigurationGuid AS [Machine.CONFIGURATION_GUID], + T.EnableExternalBridge AS [Machine.ENABLE_EXTERNAL_BRIDGE], + T.ExternalBridgePassword AS [Machine.EXTERNAL_BRIDGE_PASSWORD], + T.DefaultRmlGuid AS [Machine.DEFAULT_RML_GUID], + T.TargetJobTypes AS [Machine.TARGET_JOB_TYPES], + T.DefaultColorSpaceGuid AS [Machine.DEFAULT_COLOR_SPACE_GUID], + T.DefaultSegmentLength AS [Machine.DEFAULT_SEGMENT_LENGTH], + T.DefaultSpoolTypeGuid AS [Machine.DEFAULT_SPOOL_TYPE_GUID], + T.Synched AS Machine_SYNCHED, + T.ID AS Machine_ID, + T.LastUpdated AS [Machine.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.Machines AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.Cat. + /// + /// The mapping view. + private static DbMappingView GetView8() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Cat + [CodeFirstDatabaseSchema.Cat](T1.Cat_GUID, T1.Cat_NAME, T1.[Cat.MACHINE_GUID], T1.[Cat.RML_GUID], T1.[Cat.LIQUID_TYPE_GUID], T1.Cat_DATA, T1.Cat_ID, T1.[Cat.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS Cat_GUID, + T.Name AS Cat_NAME, + T.MachineGuid AS [Cat.MACHINE_GUID], + T.RmlGuid AS [Cat.RML_GUID], + T.LiquidTypeGuid AS [Cat.LIQUID_TYPE_GUID], + T.Data AS Cat_DATA, + T.ID AS Cat_ID, + T.LastUpdated AS [Cat.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.Cats AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.LiquidType. + /// + /// The mapping view. + private static DbMappingView GetView9() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing LiquidType + [CodeFirstDatabaseSchema.LiquidType](T1.LiquidType_GUID, T1.LiquidType_CODE, T1.LiquidType_NAME, T1.LiquidType_VERSION, T1.LiquidType_COLOR, T1.LiquidType_ID, T1.[LiquidType.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS LiquidType_GUID, + T.Code AS LiquidType_CODE, + T.Name AS LiquidType_NAME, + T.Version AS LiquidType_VERSION, + T.Color AS LiquidType_COLOR, + T.ID AS LiquidType_ID, + T.LastUpdated AS [LiquidType.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.LiquidTypes AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.IdsPack. + /// + /// The mapping view. + private static DbMappingView GetView10() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing IdsPack + [CodeFirstDatabaseSchema.IdsPack](T1.IdsPack_GUID, T1.[IdsPack.CONFIGURATION_GUID], T1.[IdsPack.DISPENSER_TYPE_GUID], T1.[IdsPack.LIQUID_TYPE_GUID], T1.[IdsPack.CARTRIDGE_TYPE_GUID], T1.[IdsPack.MID_TANK_TYPE_GUID], T1.[IdsPack.IDS_PACK_FORMULA_GUID], T1.IdsPack_NAME, T1.[IdsPack.PACK_INDEX], T1.[IdsPack.IS_EMPTY], T1.IdsPack_ID, T1.[IdsPack.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS IdsPack_GUID, + T.ConfigurationGuid AS [IdsPack.CONFIGURATION_GUID], + T.DispenserTypeGuid AS [IdsPack.DISPENSER_TYPE_GUID], + T.LiquidTypeGuid AS [IdsPack.LIQUID_TYPE_GUID], + T.CartridgeTypeGuid AS [IdsPack.CARTRIDGE_TYPE_GUID], + T.MidTankTypeGuid AS [IdsPack.MID_TANK_TYPE_GUID], + T.IdsPackFormulaGuid AS [IdsPack.IDS_PACK_FORMULA_GUID], + T.Name AS IdsPack_NAME, + T.PackIndex AS [IdsPack.PACK_INDEX], + T.IsEmpty AS [IdsPack.IS_EMPTY], + T.ID AS IdsPack_ID, + T.LastUpdated AS [IdsPack.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.IdsPacks AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.CartridgeType. + /// + /// The mapping view. + private static DbMappingView GetView11() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing CartridgeType + [CodeFirstDatabaseSchema.CartridgeType](T1.CartridgeType_GUID, T1.CartridgeType_CODE, T1.CartridgeType_NAME, T1.CartridgeType_ID, T1.[CartridgeType.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS CartridgeType_GUID, + T.Code AS CartridgeType_CODE, + T.Name AS CartridgeType_NAME, + T.ID AS CartridgeType_ID, + T.LastUpdated AS [CartridgeType.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.CartridgeTypes AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.Configuration. + /// + /// The mapping view. + private static DbMappingView GetView12() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Configuration + [CodeFirstDatabaseSchema.Configuration](T1.Configuration_GUID, T1.Configuration_NAME, T1.[Configuration.CREATION_DATE], T1.[Configuration.APPLICATION_OS_VERSION_GUID], T1.[Configuration.APPLICATION_FIRMWARE_VERSION_GUID], T1.[Configuration.APPLICATION_DISPLAY_PANEL_VERSION_GUID], T1.[Configuration.EMBEDDED_FIRMWARE_VERSION_GUID], T1.[Configuration.HARDWARE_VERSION_GUID], T1.Configuration_ID, T1.[Configuration.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS Configuration_GUID, + T.Name AS Configuration_NAME, + T.CreationDate AS [Configuration.CREATION_DATE], + T.ApplicationOsVersionGuid AS [Configuration.APPLICATION_OS_VERSION_GUID], + T.ApplicationFirmwareVersionGuid AS [Configuration.APPLICATION_FIRMWARE_VERSION_GUID], + T.ApplicationDisplayPanelVersionGuid AS [Configuration.APPLICATION_DISPLAY_PANEL_VERSION_GUID], + T.EmbeddedFirmwareVersionGuid AS [Configuration.EMBEDDED_FIRMWARE_VERSION_GUID], + T.HardwareVersionGuid AS [Configuration.HARDWARE_VERSION_GUID], + T.ID AS Configuration_ID, + T.LastUpdated AS [Configuration.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.Configurations AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.ApplicationDisplayPanelVersion. + /// + /// The mapping view. + private static DbMappingView GetView13() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing ApplicationDisplayPanelVersion + [CodeFirstDatabaseSchema.ApplicationDisplayPanelVersion](T1.ApplicationDisplayPanelVersion_GUID, T1.ApplicationDisplayPanelVersion_VERSION, T1.ApplicationDisplayPanelVersion_NAME, T1.ApplicationDisplayPanelVersion_ID, T1.[ApplicationDisplayPanelVersion.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS ApplicationDisplayPanelVersion_GUID, + T.Version AS ApplicationDisplayPanelVersion_VERSION, + T.Name AS ApplicationDisplayPanelVersion_NAME, + T.ID AS ApplicationDisplayPanelVersion_ID, + T.LastUpdated AS [ApplicationDisplayPanelVersion.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.ApplicationDisplayPanelVersions AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.ApplicationFirmwareVersion. + /// + /// The mapping view. + private static DbMappingView GetView14() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing ApplicationFirmwareVersion + [CodeFirstDatabaseSchema.ApplicationFirmwareVersion](T1.ApplicationFirmwareVersion_GUID, T1.ApplicationFirmwareVersion_VERSION, T1.ApplicationFirmwareVersion_NAME, T1.ApplicationFirmwareVersion_ID, T1.[ApplicationFirmwareVersion.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS ApplicationFirmwareVersion_GUID, + T.Version AS ApplicationFirmwareVersion_VERSION, + T.Name AS ApplicationFirmwareVersion_NAME, + T.ID AS ApplicationFirmwareVersion_ID, + T.LastUpdated AS [ApplicationFirmwareVersion.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.ApplicationFirmwareVersions AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.ApplicationOsVersion. + /// + /// The mapping view. + private static DbMappingView GetView15() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing ApplicationOsVersion + [CodeFirstDatabaseSchema.ApplicationOsVersion](T1.ApplicationOsVersion_GUID, T1.ApplicationOsVersion_VERSION, T1.ApplicationOsVersion_NAME, T1.ApplicationOsVersion_ID, T1.[ApplicationOsVersion.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS ApplicationOsVersion_GUID, + T.Version AS ApplicationOsVersion_VERSION, + T.Name AS ApplicationOsVersion_NAME, + T.ID AS ApplicationOsVersion_ID, + T.LastUpdated AS [ApplicationOsVersion.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.ApplicationOsVersions AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.EmbeddedFirmwareVersion. + /// + /// The mapping view. + private static DbMappingView GetView16() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing EmbeddedFirmwareVersion + [CodeFirstDatabaseSchema.EmbeddedFirmwareVersion](T1.EmbeddedFirmwareVersion_GUID, T1.EmbeddedFirmwareVersion_VERSION, T1.EmbeddedFirmwareVersion_NAME, T1.EmbeddedFirmwareVersion_ID, T1.[EmbeddedFirmwareVersion.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS EmbeddedFirmwareVersion_GUID, + T.Version AS EmbeddedFirmwareVersion_VERSION, + T.Name AS EmbeddedFirmwareVersion_NAME, + T.ID AS EmbeddedFirmwareVersion_ID, + T.LastUpdated AS [EmbeddedFirmwareVersion.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.EmbeddedFirmwareVersions AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.HardwareVersion. + /// + /// The mapping view. + private static DbMappingView GetView17() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareVersion + [CodeFirstDatabaseSchema.HardwareVersion](T1.HardwareVersion_GUID, T1.HardwareVersion_VERSION, T1.HardwareVersion_NAME, T1.HardwareVersion_ID, T1.[HardwareVersion.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS HardwareVersion_GUID, + T.Version AS HardwareVersion_VERSION, + T.Name AS HardwareVersion_NAME, + T.ID AS HardwareVersion_ID, + T.LastUpdated AS [HardwareVersion.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.HardwareVersions AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.HardwareBlower. + /// + /// The mapping view. + private static DbMappingView GetView18() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareBlower + [CodeFirstDatabaseSchema.HardwareBlower](T1.HardwareBlower_GUID, T1.[HardwareBlower.HARDWARE_BLOWER_TYPE_GUID], T1.[HardwareBlower.HARDWARE_VERSION_GUID], T1.HardwareBlower_ENABLED, T1.HardwareBlower_VOLTAGE, T1.HardwareBlower_ACTIVE, T1.HardwareBlower_ID, T1.[HardwareBlower.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS HardwareBlower_GUID, + T.HardwareBlowerTypeGuid AS [HardwareBlower.HARDWARE_BLOWER_TYPE_GUID], + T.HardwareVersionGuid AS [HardwareBlower.HARDWARE_VERSION_GUID], + T.Enabled AS HardwareBlower_ENABLED, + T.Voltage AS HardwareBlower_VOLTAGE, + T.Active AS HardwareBlower_ACTIVE, + T.ID AS HardwareBlower_ID, + T.LastUpdated AS [HardwareBlower.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.HardwareBlowers AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.HardwareBlowerType. + /// + /// The mapping view. + private static DbMappingView GetView19() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareBlowerType + [CodeFirstDatabaseSchema.HardwareBlowerType](T1.HardwareBlowerType_GUID, T1.HardwareBlowerType_CODE, T1.HardwareBlowerType_NAME, T1.HardwareBlowerType_DESCRIPTION, T1.HardwareBlowerType_ID, T1.[HardwareBlowerType.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS HardwareBlowerType_GUID, + T.Code AS HardwareBlowerType_CODE, + T.Name AS HardwareBlowerType_NAME, + T.Description AS HardwareBlowerType_DESCRIPTION, + T.ID AS HardwareBlowerType_ID, + T.LastUpdated AS [HardwareBlowerType.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.HardwareBlowerTypes AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.HardwareBreakSensor. + /// + /// The mapping view. + private static DbMappingView GetView20() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareBreakSensor + [CodeFirstDatabaseSchema.HardwareBreakSensor](T1.HardwareBreakSensor_GUID, T1.[HardwareBreakSensor.HARDWARE_BREAK_SENSOR_TYPE_GUID], T1.[HardwareBreakSensor.HARDWARE_VERSION_GUID], T1.HardwareBreakSensor_ENABLED, T1.[HardwareBreakSensor.DE_BOUNCE_TIME_MILLI], T1.HardwareBreakSensor_ACTIVE, T1.HardwareBreakSensor_ID, T1.[HardwareBreakSensor.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS HardwareBreakSensor_GUID, + T.HardwareBreakSensorTypeGuid AS [HardwareBreakSensor.HARDWARE_BREAK_SENSOR_TYPE_GUID], + T.HardwareVersionGuid AS [HardwareBreakSensor.HARDWARE_VERSION_GUID], + T.Enabled AS HardwareBreakSensor_ENABLED, + T.DeBounceTimeMilli AS [HardwareBreakSensor.DE_BOUNCE_TIME_MILLI], + T.Active AS HardwareBreakSensor_ACTIVE, + T.ID AS HardwareBreakSensor_ID, + T.LastUpdated AS [HardwareBreakSensor.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.HardwareBreakSensors AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.HardwareBreakSensorType. + /// + /// The mapping view. + private static DbMappingView GetView21() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareBreakSensorType + [CodeFirstDatabaseSchema.HardwareBreakSensorType](T1.HardwareBreakSensorType_GUID, T1.HardwareBreakSensorType_CODE, T1.HardwareBreakSensorType_NAME, T1.HardwareBreakSensorType_DESCRIPTION, T1.HardwareBreakSensorType_ID, T1.[HardwareBreakSensorType.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS HardwareBreakSensorType_GUID, + T.Code AS HardwareBreakSensorType_CODE, + T.Name AS HardwareBreakSensorType_NAME, + T.Description AS HardwareBreakSensorType_DESCRIPTION, + T.ID AS HardwareBreakSensorType_ID, + T.LastUpdated AS [HardwareBreakSensorType.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.HardwareBreakSensorTypes AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.HardwareDancer. + /// + /// The mapping view. + private static DbMappingView GetView22() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareDancer + [CodeFirstDatabaseSchema.HardwareDancer](T1.HardwareDancer_GUID, T1.[HardwareDancer.HARDWARE_DANCER_TYPE_GUID], T1.[HardwareDancer.HARDWARE_VERSION_GUID], T1.HardwareDancer_GRADUAL, T1.HardwareDancer_K, T1.HardwareDancer_X, T1.[HardwareDancer.PULSE_PER_MM_SPRING], T1.[HardwareDancer.MAXIMAL_MOVEMENT_MM], T1.[HardwareDancer.ZERO_POINT], T1.[HardwareDancer.RESOLUTION_BITS], T1.[HardwareDancer.ARM_LENGTH], T1.[HardwareDancer.ASSEMBLY_DIRECTION_RIGHT], T1.[HardwareDancer.ACCELERATE_ON_TENSION_RAISE], T1.HardwareDancer_ACTIVE, T1.HardwareDancer_ID, T1.[HardwareDancer.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS HardwareDancer_GUID, + T.HardwareDancerTypeGuid AS [HardwareDancer.HARDWARE_DANCER_TYPE_GUID], + T.HardwareVersionGuid AS [HardwareDancer.HARDWARE_VERSION_GUID], + T.Gradual AS HardwareDancer_GRADUAL, + T.K AS HardwareDancer_K, + T.X AS HardwareDancer_X, + T.PulsePerMmSpring AS [HardwareDancer.PULSE_PER_MM_SPRING], + T.MaximalMovementMm AS [HardwareDancer.MAXIMAL_MOVEMENT_MM], + T.ZeroPoint AS [HardwareDancer.ZERO_POINT], + T.ResolutionBits AS [HardwareDancer.RESOLUTION_BITS], + T.ArmLength AS [HardwareDancer.ARM_LENGTH], + T.AssemblyDirectionRight AS [HardwareDancer.ASSEMBLY_DIRECTION_RIGHT], + T.AccelerateOnTensionRaise AS [HardwareDancer.ACCELERATE_ON_TENSION_RAISE], + T.Active AS HardwareDancer_ACTIVE, + T.ID AS HardwareDancer_ID, + T.LastUpdated AS [HardwareDancer.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.HardwareDancers AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.HardwareDancerType. + /// + /// The mapping view. + private static DbMappingView GetView23() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareDancerType + [CodeFirstDatabaseSchema.HardwareDancerType](T1.HardwareDancerType_GUID, T1.HardwareDancerType_CODE, T1.HardwareDancerType_NAME, T1.HardwareDancerType_DESCRIPTION, T1.HardwareDancerType_ID, T1.[HardwareDancerType.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS HardwareDancerType_GUID, + T.Code AS HardwareDancerType_CODE, + T.Name AS HardwareDancerType_NAME, + T.Description AS HardwareDancerType_DESCRIPTION, + T.ID AS HardwareDancerType_ID, + T.LastUpdated AS [HardwareDancerType.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.HardwareDancerTypes AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.HardwareMotor. + /// + /// The mapping view. + private static DbMappingView GetView24() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareMotor + [CodeFirstDatabaseSchema.HardwareMotor](T1.HardwareMotor_GUID, T1.[HardwareMotor.HARDWARE_MOTOR_TYPE_GUID], T1.[HardwareMotor.HARDWARE_VERSION_GUID], T1.[HardwareMotor.MIN_FREQUENCY], T1.[HardwareMotor.MAX_FREQUENCY], T1.[HardwareMotor.SET_MICRO_STEP], T1.[HardwareMotor.MICRO_STEP], T1.[HardwareMotor.MAX_CHANGE_SLOPE], T1.[HardwareMotor.HIGH_LENGTH_MICRO_SECOND], T1.[HardwareMotor.SPEED_MASTER], T1.[HardwareMotor.PULSE_PER_ROUND], T1.[HardwareMotor.PULLEY_RADIUS], T1.[HardwareMotor.CONFIG_WORD], T1.[HardwareMotor.DIRECTION_THREAD_WIZE], T1.[HardwareMotor.KVAL_HOLD], T1.[HardwareMotor.KVAL_RUN], T1.[HardwareMotor.KVAL_ACC], T1.[HardwareMotor.KVAL_DEC], T1.[HardwareMotor.OVER_CURRENT_THRESHOLD], T1.[HardwareMotor.STALL_THRESHOLD], T1.[HardwareMotor.THERMAL_COMPENSATION_FACTOR], T1.[HardwareMotor.LOW_SPEED_OPTIMIZATION], T1.[HardwareMotor.ST_SLP], T1.[HardwareMotor.INT_SPD], T1.[HardwareMotor.FN_SLP_ACC], T1.[HardwareMotor.FN_SLP_DEC], T1.[HardwareMotor.FS_SPD], T1.HardwareMotor_ACTIVE, T1.HardwareMotor_ID, T1.[HardwareMotor.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS HardwareMotor_GUID, + T.HardwareMotorTypeGuid AS [HardwareMotor.HARDWARE_MOTOR_TYPE_GUID], + T.HardwareVersionGuid AS [HardwareMotor.HARDWARE_VERSION_GUID], + T.MinFrequency AS [HardwareMotor.MIN_FREQUENCY], + T.MaxFrequency AS [HardwareMotor.MAX_FREQUENCY], + T.SetMicroStep AS [HardwareMotor.SET_MICRO_STEP], + T.MicroStep AS [HardwareMotor.MICRO_STEP], + T.MaxChangeSlope AS [HardwareMotor.MAX_CHANGE_SLOPE], + T.HighLengthMicroSecond AS [HardwareMotor.HIGH_LENGTH_MICRO_SECOND], + T.SpeedMaster AS [HardwareMotor.SPEED_MASTER], + T.PulsePerRound AS [HardwareMotor.PULSE_PER_ROUND], + T.PulleyRadius AS [HardwareMotor.PULLEY_RADIUS], + T.ConfigWord AS [HardwareMotor.CONFIG_WORD], + T.DirectionThreadWize AS [HardwareMotor.DIRECTION_THREAD_WIZE], + T.KvalHold AS [HardwareMotor.KVAL_HOLD], + T.KvalRun AS [HardwareMotor.KVAL_RUN], + T.KvalAcc AS [HardwareMotor.KVAL_ACC], + T.KvalDec AS [HardwareMotor.KVAL_DEC], + T.OverCurrentThreshold AS [HardwareMotor.OVER_CURRENT_THRESHOLD], + T.StallThreshold AS [HardwareMotor.STALL_THRESHOLD], + T.ThermalCompensationFactor AS [HardwareMotor.THERMAL_COMPENSATION_FACTOR], + T.LowSpeedOptimization AS [HardwareMotor.LOW_SPEED_OPTIMIZATION], + T.StSlp AS [HardwareMotor.ST_SLP], + T.IntSpd AS [HardwareMotor.INT_SPD], + T.FnSlpAcc AS [HardwareMotor.FN_SLP_ACC], + T.FnSlpDec AS [HardwareMotor.FN_SLP_DEC], + T.FsSpd AS [HardwareMotor.FS_SPD], + T.Active AS HardwareMotor_ACTIVE, + T.ID AS HardwareMotor_ID, + T.LastUpdated AS [HardwareMotor.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.HardwareMotors AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.HardwareMotorType. + /// + /// The mapping view. + private static DbMappingView GetView25() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareMotorType + [CodeFirstDatabaseSchema.HardwareMotorType](T1.HardwareMotorType_GUID, T1.HardwareMotorType_CODE, T1.HardwareMotorType_NAME, T1.HardwareMotorType_DESCRIPTION, T1.[HardwareMotorType.SUPPORTS_HOMING], T1.HardwareMotorType_ID, T1.[HardwareMotorType.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS HardwareMotorType_GUID, + T.Code AS HardwareMotorType_CODE, + T.Name AS HardwareMotorType_NAME, + T.Description AS HardwareMotorType_DESCRIPTION, + T.SupportsHoming AS [HardwareMotorType.SUPPORTS_HOMING], + T.ID AS HardwareMotorType_ID, + T.LastUpdated AS [HardwareMotorType.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.HardwareMotorTypes AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.HardwarePidControl. + /// + /// The mapping view. + private static DbMappingView GetView26() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwarePidControl + [CodeFirstDatabaseSchema.HardwarePidControl](T1.HardwarePidControl_GUID, T1.[HardwarePidControl.HARDWARE_PID_CONTROL_TYPE_GUID], T1.[HardwarePidControl.HARDWARE_VERSION_GUID], T1.[HardwarePidControl.OUTPUT_PROPORTIONAL_POWER_LIMIT], T1.[HardwarePidControl.OUTPUT_PROPORTIONAL_BAND], T1.[HardwarePidControl.INTEGRAL_TIME], T1.[HardwarePidControl.DERIVATIVE_TIME], T1.[HardwarePidControl.SENSOR_CORRECTION_ADJUSTMENT], T1.[HardwarePidControl.SENSOR_MIN_VALUE], T1.[HardwarePidControl.SENSOR_MAX_VALUE], T1.[HardwarePidControl.SET_POINT_RAMP_RATEOR_SOFT_START_RAMP], T1.[HardwarePidControl.SET_POINT_CONTROL_OUTPUT_RATE], T1.[HardwarePidControl.CONTROL_OUTPUT_TYPE], T1.[HardwarePidControl.SSR_CONTROL_OUTPUT_TYPE], T1.[HardwarePidControl.OUTPUT_ON_OFF_HYSTERESIS_VALUE], T1.[HardwarePidControl.PROCESS_VARIABLE_SAMPLING_RATE], T1.[HardwarePidControl.PV_INPUT_FILTER_FACTOR_MODE], T1.[HardwarePidControl.OUTPUT_PROPORTIONAL_CYCLE_TIME], T1.[HardwarePidControl.AC_HEATERS__HALF_CYCLE_TIME], T1.[HardwarePidControl.PROPORTIONAL_GAIN], T1.HardwarePidControl_ACTIVE, T1.HardwarePidControl_ID, T1.[HardwarePidControl.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS HardwarePidControl_GUID, + T.HardwarePidControlTypeGuid AS [HardwarePidControl.HARDWARE_PID_CONTROL_TYPE_GUID], + T.HardwareVersionGuid AS [HardwarePidControl.HARDWARE_VERSION_GUID], + T.OutputProportionalPowerLimit AS [HardwarePidControl.OUTPUT_PROPORTIONAL_POWER_LIMIT], + T.OutputProportionalBand AS [HardwarePidControl.OUTPUT_PROPORTIONAL_BAND], + T.IntegralTime AS [HardwarePidControl.INTEGRAL_TIME], + T.DerivativeTime AS [HardwarePidControl.DERIVATIVE_TIME], + T.SensorCorrectionAdjustment AS [HardwarePidControl.SENSOR_CORRECTION_ADJUSTMENT], + T.SensorMinValue AS [HardwarePidControl.SENSOR_MIN_VALUE], + T.SensorMaxValue AS [HardwarePidControl.SENSOR_MAX_VALUE], + T.SetPointRampRateorSoftStartRamp AS [HardwarePidControl.SET_POINT_RAMP_RATEOR_SOFT_START_RAMP], + T.SetPointControlOutputRate AS [HardwarePidControl.SET_POINT_CONTROL_OUTPUT_RATE], + T.ControlOutputType AS [HardwarePidControl.CONTROL_OUTPUT_TYPE], + T.SsrControlOutputType AS [HardwarePidControl.SSR_CONTROL_OUTPUT_TYPE], + T.OutputOnOffHysteresisValue AS [HardwarePidControl.OUTPUT_ON_OFF_HYSTERESIS_VALUE], + T.ProcessVariableSamplingRate AS [HardwarePidControl.PROCESS_VARIABLE_SAMPLING_RATE], + T.PvInputFilterFactorMode AS [HardwarePidControl.PV_INPUT_FILTER_FACTOR_MODE], + T.OutputProportionalCycleTime AS [HardwarePidControl.OUTPUT_PROPORTIONAL_CYCLE_TIME], + T.AcHeatersHalfCycleTime AS [HardwarePidControl.AC_HEATERS__HALF_CYCLE_TIME], + T.ProportionalGain AS [HardwarePidControl.PROPORTIONAL_GAIN], + T.Active AS HardwarePidControl_ACTIVE, + T.ID AS HardwarePidControl_ID, + T.LastUpdated AS [HardwarePidControl.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.HardwarePidControls AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.HardwarePidControlType. + /// + /// The mapping view. + private static DbMappingView GetView27() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwarePidControlType + [CodeFirstDatabaseSchema.HardwarePidControlType](T1.HardwarePidControlType_GUID, T1.HardwarePidControlType_CODE, T1.HardwarePidControlType_NAME, T1.HardwarePidControlType_DESCRIPTION, T1.HardwarePidControlType_ID, T1.[HardwarePidControlType.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS HardwarePidControlType_GUID, + T.Code AS HardwarePidControlType_CODE, + T.Name AS HardwarePidControlType_NAME, + T.Description AS HardwarePidControlType_DESCRIPTION, + T.ID AS HardwarePidControlType_ID, + T.LastUpdated AS [HardwarePidControlType.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.HardwarePidControlTypes AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.HardwareSpeedSensor. + /// + /// The mapping view. + private static DbMappingView GetView28() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareSpeedSensor + [CodeFirstDatabaseSchema.HardwareSpeedSensor](T1.HardwareSpeedSensor_GUID, T1.[HardwareSpeedSensor.HARDWARE_SPEED_SENSOR_TYPE_GUID], T1.[HardwareSpeedSensor.HARDWARE_VERSION_GUID], T1.[HardwareSpeedSensor.RESOLUTION_BITS], T1.HardwareSpeedSensor_PERIMETER, T1.HardwareSpeedSensor_ACTIVE, T1.HardwareSpeedSensor_ID, T1.[HardwareSpeedSensor.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS HardwareSpeedSensor_GUID, + T.HardwareSpeedSensorTypeGuid AS [HardwareSpeedSensor.HARDWARE_SPEED_SENSOR_TYPE_GUID], + T.HardwareVersionGuid AS [HardwareSpeedSensor.HARDWARE_VERSION_GUID], + T.ResolutionBits AS [HardwareSpeedSensor.RESOLUTION_BITS], + T.Perimeter AS HardwareSpeedSensor_PERIMETER, + T.Active AS HardwareSpeedSensor_ACTIVE, + T.ID AS HardwareSpeedSensor_ID, + T.LastUpdated AS [HardwareSpeedSensor.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.HardwareSpeedSensors AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.HardwareSpeedSensorType. + /// + /// The mapping view. + private static DbMappingView GetView29() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareSpeedSensorType + [CodeFirstDatabaseSchema.HardwareSpeedSensorType](T1.HardwareSpeedSensorType_GUID, T1.HardwareSpeedSensorType_CODE, T1.HardwareSpeedSensorType_NAME, T1.HardwareSpeedSensorType_DESCRIPTION, T1.HardwareSpeedSensorType_ID, T1.[HardwareSpeedSensorType.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS HardwareSpeedSensorType_GUID, + T.Code AS HardwareSpeedSensorType_CODE, + T.Name AS HardwareSpeedSensorType_NAME, + T.Description AS HardwareSpeedSensorType_DESCRIPTION, + T.ID AS HardwareSpeedSensorType_ID, + T.LastUpdated AS [HardwareSpeedSensorType.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.HardwareSpeedSensorTypes AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.HardwareWinder. + /// + /// The mapping view. + private static DbMappingView GetView30() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareWinder + [CodeFirstDatabaseSchema.HardwareWinder](T1.HardwareWinder_GUID, T1.[HardwareWinder.HARDWARE_WINDER_TYPE_GUID], T1.[HardwareWinder.HARDWARE_VERSION_GUID], T1.[HardwareWinder.MILLIMETER_PER_ROTATION], T1.HardwareWinder_ACTIVE, T1.HardwareWinder_ID, T1.[HardwareWinder.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS HardwareWinder_GUID, + T.HardwareWinderTypeGuid AS [HardwareWinder.HARDWARE_WINDER_TYPE_GUID], + T.HardwareVersionGuid AS [HardwareWinder.HARDWARE_VERSION_GUID], + T.MillimeterPerRotation AS [HardwareWinder.MILLIMETER_PER_ROTATION], + T.Active AS HardwareWinder_ACTIVE, + T.ID AS HardwareWinder_ID, + T.LastUpdated AS [HardwareWinder.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.HardwareWinders AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.HardwareWinderType. + /// + /// The mapping view. + private static DbMappingView GetView31() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareWinderType + [CodeFirstDatabaseSchema.HardwareWinderType](T1.HardwareWinderType_GUID, T1.HardwareWinderType_CODE, T1.HardwareWinderType_NAME, T1.HardwareWinderType_DESCRIPTION, T1.HardwareWinderType_ID, T1.[HardwareWinderType.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS HardwareWinderType_GUID, + T.Code AS HardwareWinderType_CODE, + T.Name AS HardwareWinderType_NAME, + T.Description AS HardwareWinderType_DESCRIPTION, + T.ID AS HardwareWinderType_ID, + T.LastUpdated AS [HardwareWinderType.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.HardwareWinderTypes AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.MachinesConfiguration. + /// + /// The mapping view. + private static DbMappingView GetView32() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing MachinesConfiguration + [CodeFirstDatabaseSchema.MachinesConfiguration](T1.MachinesConfiguration_GUID, T1.[MachinesConfiguration.MACHINE_GUID], T1.[MachinesConfiguration.CONFIGURATION_GUID], T1.MachinesConfiguration_ID, T1.[MachinesConfiguration.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS MachinesConfiguration_GUID, + T.MachineGuid AS [MachinesConfiguration.MACHINE_GUID], + T.ConfigurationGuid AS [MachinesConfiguration.CONFIGURATION_GUID], + T.ID AS MachinesConfiguration_ID, + T.LastUpdated AS [MachinesConfiguration.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.MachinesConfigurations AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.MachineVersion. + /// + /// The mapping view. + private static DbMappingView GetView33() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing MachineVersion + [CodeFirstDatabaseSchema.MachineVersion](T1.MachineVersion_GUID, T1.MachineVersion_VERSION, T1.MachineVersion_NAME, T1.[MachineVersion.DEFAULT_CONFIGURATION_GUID], T1.MachineVersion_ID, T1.[MachineVersion.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS MachineVersion_GUID, + T.Version AS MachineVersion_VERSION, + T.Name AS MachineVersion_NAME, + T.DefaultConfigurationGuid AS [MachineVersion.DEFAULT_CONFIGURATION_GUID], + T.ID AS MachineVersion_ID, + T.LastUpdated AS [MachineVersion.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.MachineVersions AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.TangoVersion. + /// + /// The mapping view. + private static DbMappingView GetView34() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing TangoVersion + [CodeFirstDatabaseSchema.TangoVersion](T1.TangoVersion_GUID, T1.TangoVersion_VERSION, T1.[TangoVersion.FTP_FILE_PATH], T1.TangoVersion_COMMENTS, T1.[TangoVersion.USER_GUID], T1.[TangoVersion.MACHINE_VERSION_GUID], T1.TangoVersion_ID, T1.[TangoVersion.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS TangoVersion_GUID, + T.Version AS TangoVersion_VERSION, + T.FtpFilePath AS [TangoVersion.FTP_FILE_PATH], + T.Comments AS TangoVersion_COMMENTS, + T.UserGuid AS [TangoVersion.USER_GUID], + T.MachineVersionGuid AS [TangoVersion.MACHINE_VERSION_GUID], + T.ID AS TangoVersion_ID, + T.LastUpdated AS [TangoVersion.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.TangoVersions AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.User. + /// + /// The mapping view. + private static DbMappingView GetView35() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing User + [CodeFirstDatabaseSchema.User](T1.User_GUID, T1.User_DELETED, T1.User_EMAIL, T1.User_PASSWORD, T1.[User.ORGANIZATION_GUID], T1.[User.CONTACT_GUID], T1.[User.ADDRESS_GUID], T1.[User.LAST_LOGIN], T1.User_ID, T1.[User.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS User_GUID, + T.Deleted AS User_DELETED, + T.Email AS User_EMAIL, + T.Password AS User_PASSWORD, + T.OrganizationGuid AS [User.ORGANIZATION_GUID], + T.ContactGuid AS [User.CONTACT_GUID], + T.AddressGuid AS [User.ADDRESS_GUID], + T.LastLogin AS [User.LAST_LOGIN], + T.ID AS User_ID, + T.LastUpdated AS [User.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.Users AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.Address. + /// + /// The mapping view. + private static DbMappingView GetView36() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Address + [CodeFirstDatabaseSchema.Address](T1.Address_GUID, T1.Address_DELETED, T1.[Address.ADDRESS_STRING], T1.Address_LOCALITY, T1.Address_COUNTRY, T1.Address_CITY, T1.Address_STATE, T1.[Address.COUNTRY_CODE], T1.[Address.POSTAL_CODE], T1.Address_ID, T1.[Address.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS Address_GUID, + T.Deleted AS Address_DELETED, + T.AddressString AS [Address.ADDRESS_STRING], + T.Locality AS Address_LOCALITY, + T.Country AS Address_COUNTRY, + T.City AS Address_CITY, + T.State AS Address_STATE, + T.CountryCode AS [Address.COUNTRY_CODE], + T.PostalCode AS [Address.POSTAL_CODE], + T.ID AS Address_ID, + T.LastUpdated AS [Address.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.Addresses AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.Organization. + /// + /// The mapping view. + private static DbMappingView GetView37() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Organization + [CodeFirstDatabaseSchema.Organization](T1.Organization_GUID, T1.Organization_NAME, T1.[Organization.CONTACT_GUID], T1.[Organization.ADDRESS_GUID], T1.Organization_ID, T1.[Organization.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS Organization_GUID, + T.Name AS Organization_NAME, + T.ContactGuid AS [Organization.CONTACT_GUID], + T.AddressGuid AS [Organization.ADDRESS_GUID], + T.ID AS Organization_ID, + T.LastUpdated AS [Organization.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.Organizations AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.Contact. + /// + /// The mapping view. + private static DbMappingView GetView38() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Contact + [CodeFirstDatabaseSchema.Contact](T1.Contact_GUID, T1.Contact_DELETED, T1.[Contact.FIRST_NAME], T1.[Contact.LAST_NAME], T1.[Contact.FULL_NAME], T1.Contact_EMAIL, T1.[Contact.PHONE_NUMBER], T1.Contact_FAX, T1.Contact_ID, T1.[Contact.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS Contact_GUID, + T.Deleted AS Contact_DELETED, + T.FirstName AS [Contact.FIRST_NAME], + T.LastName AS [Contact.LAST_NAME], + T.FullName AS [Contact.FULL_NAME], + T.Email AS Contact_EMAIL, + T.PhoneNumber AS [Contact.PHONE_NUMBER], + T.Fax AS Contact_FAX, + T.ID AS Contact_ID, + T.LastUpdated AS [Contact.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.Contacts AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.Customer. + /// + /// The mapping view. + private static DbMappingView GetView39() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Customer + [CodeFirstDatabaseSchema.Customer](T1.Customer_GUID, T1.[Customer.ORGANIZATION_GUID], T1.Customer_NAME, T1.Customer_ID, T1.[Customer.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS Customer_GUID, + T.OrganizationGuid AS [Customer.ORGANIZATION_GUID], + T.Name AS Customer_NAME, + T.ID AS Customer_ID, + T.LastUpdated AS [Customer.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.Customers AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.Job. + /// + /// The mapping view. + private static DbMappingView GetView40() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Job + [CodeFirstDatabaseSchema.Job](T1.Job_GUID, T1.[Job.CREATION_DATE], T1.[Job.LAST_RUN], T1.[Job.MACHINE_GUID], T1.[Job.USER_GUID], T1.[Job.RML_GUID], T1.[Job.WINDING_METHOD_GUID], T1.[Job.SPOOL_TYPE_GUID], T1.Job_NAME, T1.Job_DESCRIPTION, T1.[Job.INTER_SEGMENT_LENGTH], T1.[Job.ENABLE_INTER_SEGMENT], T1.[Job.ENABLE_LUBRICATION], T1.[Job.JOB_INDEX], T1.[Job.ESTIMATED_DURATION_MILI], T1.[Job.HAS_EMBROIDERY_FILE], T1.[Job.EMBROIDERY_FILE_DATA], T1.[Job.EMBROIDERY_FILE_NAME], T1.[Job.EMBROIDERY_JPEG], T1.Job_STATUS, T1.[Job.COLOR_SPACE_GUID], T1.[Job.NUMBER_OF_UNITS], T1.Job_TYPE, T1.[Job.CUSTOMER_GUID], T1.[Job.SPOOLS_DISTRIBUTION], T1.[Job.NUMBER_OF_HEADS], T1.[Job.SAMPLE_UNITS_OR_METERS], T1.[Job.FINE_TUNING_STATUS], T1.[Job.FINE_TUNING_APPROVE_DATE], T1.[Job.SAMPLE_DYE_STATUS], T1.[Job.SAMPLE_DYE_APPROVE_DATE], T1.[Job.EDITING_STATE], T1.[Job.LENGTH_PERCENTAGE_FACTOR], T1.Job_ID, T1.[Job.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS Job_GUID, + T.CreationDate AS [Job.CREATION_DATE], + T.LastRun AS [Job.LAST_RUN], + T.MachineGuid AS [Job.MACHINE_GUID], + T.UserGuid AS [Job.USER_GUID], + T.RmlGuid AS [Job.RML_GUID], + T.WindingMethodGuid AS [Job.WINDING_METHOD_GUID], + T.SpoolTypeGuid AS [Job.SPOOL_TYPE_GUID], + T.Name AS Job_NAME, + T.Description AS Job_DESCRIPTION, + T.InterSegmentLength AS [Job.INTER_SEGMENT_LENGTH], + T.EnableInterSegment AS [Job.ENABLE_INTER_SEGMENT], + T.EnableLubrication AS [Job.ENABLE_LUBRICATION], + T.JobIndex AS [Job.JOB_INDEX], + T.EstimatedDurationMili AS [Job.ESTIMATED_DURATION_MILI], + T.HasEmbroideryFile AS [Job.HAS_EMBROIDERY_FILE], + T.EmbroideryFileData AS [Job.EMBROIDERY_FILE_DATA], + T.EmbroideryFileName AS [Job.EMBROIDERY_FILE_NAME], + T.EmbroideryJpeg AS [Job.EMBROIDERY_JPEG], + T.Status AS Job_STATUS, + T.ColorSpaceGuid AS [Job.COLOR_SPACE_GUID], + T.NumberOfUnits AS [Job.NUMBER_OF_UNITS], + T.Type AS Job_TYPE, + T.CustomerGuid AS [Job.CUSTOMER_GUID], + T.SpoolsDistribution AS [Job.SPOOLS_DISTRIBUTION], + T.NumberOfHeads AS [Job.NUMBER_OF_HEADS], + T.SampleUnitsOrMeters AS [Job.SAMPLE_UNITS_OR_METERS], + T.FineTuningStatus AS [Job.FINE_TUNING_STATUS], + T.FineTuningApproveDate AS [Job.FINE_TUNING_APPROVE_DATE], + T.SampleDyeStatus AS [Job.SAMPLE_DYE_STATUS], + T.SampleDyeApproveDate AS [Job.SAMPLE_DYE_APPROVE_DATE], + T.EditingState AS [Job.EDITING_STATE], + T.LengthPercentageFactor AS [Job.LENGTH_PERCENTAGE_FACTOR], + T.ID AS Job_ID, + T.LastUpdated AS [Job.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.Jobs AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.ColorSpace. + /// + /// The mapping view. + private static DbMappingView GetView41() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing ColorSpace + [CodeFirstDatabaseSchema.ColorSpace](T1.ColorSpace_GUID, T1.ColorSpace_CODE, T1.ColorSpace_NAME, T1.ColorSpace_DESCRIPTION, T1.ColorSpace_ID, T1.[ColorSpace.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS ColorSpace_GUID, + T.Code AS ColorSpace_CODE, + T.Name AS ColorSpace_NAME, + T.Description AS ColorSpace_DESCRIPTION, + T.ID AS ColorSpace_ID, + T.LastUpdated AS [ColorSpace.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.ColorSpaces AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.BrushStop. + /// + /// The mapping view. + private static DbMappingView GetView42() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing BrushStop + [CodeFirstDatabaseSchema.BrushStop](T1.BrushStop_GUID, T1.[BrushStop.SEGMENT_GUID], T1.[BrushStop.COLOR_SPACE_GUID], T1.[BrushStop.OFFSET_PERCENT], T1.[BrushStop.STOP_INDEX], T1.BrushStop_CYAN, T1.BrushStop_MAGENTA, T1.BrushStop_YELLOW, T1.BrushStop_BLACK, T1.BrushStop_RED, T1.BrushStop_GREEN, T1.BrushStop_BLUE, T1.BrushStop_L, T1.BrushStop_A, T1.BrushStop_B, T1.BrushStop_V0, T1.BrushStop_V1, T1.BrushStop_V2, T1.BrushStop_V3, T1.BrushStop_V4, T1.BrushStop_V5, T1.BrushStop_V6, T1.BrushStop_V7, T1.BrushStop_CORRECTED, T1.[BrushStop.COLOR_CATALOG_GUID], T1.[BrushStop.COLOR_CATALOG_CODE], T1.BrushStop_ID, T1.[BrushStop.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS BrushStop_GUID, + T.SegmentGuid AS [BrushStop.SEGMENT_GUID], + T.ColorSpaceGuid AS [BrushStop.COLOR_SPACE_GUID], + T.OffsetPercent AS [BrushStop.OFFSET_PERCENT], + T.StopIndex AS [BrushStop.STOP_INDEX], + T.Cyan AS BrushStop_CYAN, + T.Magenta AS BrushStop_MAGENTA, + T.Yellow AS BrushStop_YELLOW, + T.Black AS BrushStop_BLACK, + T.Red AS BrushStop_RED, + T.Green AS BrushStop_GREEN, + T.Blue AS BrushStop_BLUE, + T.L AS BrushStop_L, + T.A AS BrushStop_A, + T.B AS BrushStop_B, + T.V0 AS BrushStop_V0, + T.V1 AS BrushStop_V1, + T.V2 AS BrushStop_V2, + T.V3 AS BrushStop_V3, + T.V4 AS BrushStop_V4, + T.V5 AS BrushStop_V5, + T.V6 AS BrushStop_V6, + T.V7 AS BrushStop_V7, + T.Corrected AS BrushStop_CORRECTED, + T.ColorCatalogGuid AS [BrushStop.COLOR_CATALOG_GUID], + T.ColorCatalogCode AS [BrushStop.COLOR_CATALOG_CODE], + T.ID AS BrushStop_ID, + T.LastUpdated AS [BrushStop.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.BrushStops AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.ColorCatalog. + /// + /// The mapping view. + private static DbMappingView GetView43() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing ColorCatalog + [CodeFirstDatabaseSchema.ColorCatalog](T1.ColorCatalog_GUID, T1.[ColorCatalog.COLOR_SPACE_GUID], T1.[ColorCatalog.COLOR_CODE], T1.ColorCatalog_NAME, T1.[ColorCatalog.COLOR_GROUP], T1.ColorCatalog_CYAN, T1.ColorCatalog_MAGENTA, T1.ColorCatalog_YELLOW, T1.ColorCatalog_BLACK, T1.ColorCatalog_RED, T1.ColorCatalog_GREEN, T1.ColorCatalog_BLUE, T1.ColorCatalog_L, T1.ColorCatalog_A, T1.ColorCatalog_B, T1.ColorCatalog_V0, T1.ColorCatalog_V1, T1.ColorCatalog_V2, T1.ColorCatalog_V3, T1.ColorCatalog_V4, T1.ColorCatalog_V5, T1.ColorCatalog_V6, T1.ColorCatalog_V7, T1.ColorCatalog_ID, T1.[ColorCatalog.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS ColorCatalog_GUID, + T.ColorSpaceGuid AS [ColorCatalog.COLOR_SPACE_GUID], + T.ColorCode AS [ColorCatalog.COLOR_CODE], + T.Name AS ColorCatalog_NAME, + T.ColorGroup AS [ColorCatalog.COLOR_GROUP], + T.Cyan AS ColorCatalog_CYAN, + T.Magenta AS ColorCatalog_MAGENTA, + T.Yellow AS ColorCatalog_YELLOW, + T.Black AS ColorCatalog_BLACK, + T.Red AS ColorCatalog_RED, + T.Green AS ColorCatalog_GREEN, + T.Blue AS ColorCatalog_BLUE, + T.L AS ColorCatalog_L, + T.A AS ColorCatalog_A, + T.B AS ColorCatalog_B, + T.V0 AS ColorCatalog_V0, + T.V1 AS ColorCatalog_V1, + T.V2 AS ColorCatalog_V2, + T.V3 AS ColorCatalog_V3, + T.V4 AS ColorCatalog_V4, + T.V5 AS ColorCatalog_V5, + T.V6 AS ColorCatalog_V6, + T.V7 AS ColorCatalog_V7, + T.ID AS ColorCatalog_ID, + T.LastUpdated AS [ColorCatalog.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.ColorCatalogs AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.Segment. + /// + /// The mapping view. + private static DbMappingView GetView44() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Segment + [CodeFirstDatabaseSchema.Segment](T1.Segment_GUID, T1.Segment_NAME, T1.[Segment.JOB_GUID], T1.Segment_LENGTH, T1.[Segment.SEGMENT_INDEX], T1.Segment_ID, T1.[Segment.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS Segment_GUID, + T.Name AS Segment_NAME, + T.JobGuid AS [Segment.JOB_GUID], + T.Length AS Segment_LENGTH, + T.SegmentIndex AS [Segment.SEGMENT_INDEX], + T.ID AS Segment_ID, + T.LastUpdated AS [Segment.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.Segments AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.JobRun. + /// + /// The mapping view. + private static DbMappingView GetView45() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing JobRun + [CodeFirstDatabaseSchema.JobRun](T1.JobRun_GUID, T1.[JobRun.JOB_GUID], T1.[JobRun.START_DATE], T1.[JobRun.END_DATE], T1.JobRun_SUCCESSFUL, T1.JobRun_ID, T1.[JobRun.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS JobRun_GUID, + T.JobGuid AS [JobRun.JOB_GUID], + T.StartDate AS [JobRun.START_DATE], + T.EndDate AS [JobRun.END_DATE], + T.Successful AS JobRun_SUCCESSFUL, + T.ID AS JobRun_ID, + T.LastUpdated AS [JobRun.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.JobRuns AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.Rml. + /// + /// The mapping view. + private static DbMappingView GetView46() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Rml + [CodeFirstDatabaseSchema.Rml](T1.Rml_GUID, T1.Rml_NAME, T1.Rml_MANUFACTURER, T1.Rml_CODE, T1.[Rml.MEDIA_MATERIAL_GUID], T1.[Rml.MEDIA_COLOR_GUID], T1.[Rml.MEDIA_PURPOSE_GUID], T1.[Rml.MEDIA_CONDITION_GUID], T1.[Rml.LINEAR_MASS_DENSITY_UNIT_GUID], T1.[Rml.FIBER_SHAPE_GUID], T1.[Rml.FIBER_SYNTH_GUID], T1.[Rml.FIBER_SIZE], T1.[Rml.NUMBER_OF_FIBERS], T1.[Rml.PLIES_PER_FIBER], T1.[Rml.PLIES_PER_THREAD], T1.Rml_TWISTED, T1.[Rml.AIR_ENTANGLEMENT], T1.Rml_LUBRICANT, T1.[Rml.TENSILE_STRENGTH], T1.[Rml.ELONGATION_AT_BREAK_PERCENTAGE], T1.[Rml.ESTIMATED_THREAD_DIAMETER], T1.Rml_ID, T1.[Rml.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS Rml_GUID, + T.Name AS Rml_NAME, + T.Manufacturer AS Rml_MANUFACTURER, + T.Code AS Rml_CODE, + T.MediaMaterialGuid AS [Rml.MEDIA_MATERIAL_GUID], + T.MediaColorGuid AS [Rml.MEDIA_COLOR_GUID], + T.MediaPurposeGuid AS [Rml.MEDIA_PURPOSE_GUID], + T.MediaConditionGuid AS [Rml.MEDIA_CONDITION_GUID], + T.LinearMassDensityUnitGuid AS [Rml.LINEAR_MASS_DENSITY_UNIT_GUID], + T.FiberShapeGuid AS [Rml.FIBER_SHAPE_GUID], + T.FiberSynthGuid AS [Rml.FIBER_SYNTH_GUID], + T.FiberSize AS [Rml.FIBER_SIZE], + T.NumberOfFibers AS [Rml.NUMBER_OF_FIBERS], + T.PliesPerFiber AS [Rml.PLIES_PER_FIBER], + T.PliesPerThread AS [Rml.PLIES_PER_THREAD], + T.Twisted AS Rml_TWISTED, + T.AirEntanglement AS [Rml.AIR_ENTANGLEMENT], + T.Lubricant AS Rml_LUBRICANT, + T.TensileStrength AS [Rml.TENSILE_STRENGTH], + T.ElongationAtBreakPercentage AS [Rml.ELONGATION_AT_BREAK_PERCENTAGE], + T.EstimatedThreadDiameter AS [Rml.ESTIMATED_THREAD_DIAMETER], + T.ID AS Rml_ID, + T.LastUpdated AS [Rml.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.Rmls AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.Cct. + /// + /// The mapping view. + private static DbMappingView GetView47() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Cct + [CodeFirstDatabaseSchema.Cct](T1.Cct_GUID, T1.Cct_NAME, T1.Cct_DESCRIPTION, T1.[Cct.FORWARD_FILE_NAME], T1.[Cct.INVERSE_FILE_NAME], T1.[Cct.FORWARD_DATA], T1.[Cct.INVERSE_DATA], T1.Cct_VERSION, T1.[Cct.RML_GUID], T1.Cct_ID, T1.[Cct.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS Cct_GUID, + T.Name AS Cct_NAME, + T.Description AS Cct_DESCRIPTION, + T.ForwardFileName AS [Cct.FORWARD_FILE_NAME], + T.InverseFileName AS [Cct.INVERSE_FILE_NAME], + T.ForwardData AS [Cct.FORWARD_DATA], + T.InverseData AS [Cct.INVERSE_DATA], + T.Version AS Cct_VERSION, + T.RmlGuid AS [Cct.RML_GUID], + T.ID AS Cct_ID, + T.LastUpdated AS [Cct.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.Ccts AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.FiberShape. + /// + /// The mapping view. + private static DbMappingView GetView48() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing FiberShape + [CodeFirstDatabaseSchema.FiberShape](T1.FiberShape_GUID, T1.FiberShape_NAME, T1.FiberShape_CODE, T1.FiberShape_ID, T1.[FiberShape.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS FiberShape_GUID, + T.Name AS FiberShape_NAME, + T.Code AS FiberShape_CODE, + T.ID AS FiberShape_ID, + T.LastUpdated AS [FiberShape.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.FiberShapes AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.FiberSynth. + /// + /// The mapping view. + private static DbMappingView GetView49() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing FiberSynth + [CodeFirstDatabaseSchema.FiberSynth](T1.FiberSynth_GUID, T1.FiberSynth_NAME, T1.FiberSynth_CODE, T1.FiberSynth_ID, T1.[FiberSynth.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS FiberSynth_GUID, + T.Name AS FiberSynth_NAME, + T.Code AS FiberSynth_CODE, + T.ID AS FiberSynth_ID, + T.LastUpdated AS [FiberSynth.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.FiberSynths AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.LinearMassDensityUnit. + /// + /// The mapping view. + private static DbMappingView GetView50() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing LinearMassDensityUnit + [CodeFirstDatabaseSchema.LinearMassDensityUnit](T1.LinearMassDensityUnit_GUID, T1.LinearMassDensityUnit_NAME, T1.LinearMassDensityUnit_CODE, T1.LinearMassDensityUnit_ID, T1.[LinearMassDensityUnit.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS LinearMassDensityUnit_GUID, + T.Name AS LinearMassDensityUnit_NAME, + T.Code AS LinearMassDensityUnit_CODE, + T.ID AS LinearMassDensityUnit_ID, + T.LastUpdated AS [LinearMassDensityUnit.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.LinearMassDensityUnits AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.LiquidTypesRml. + /// + /// The mapping view. + private static DbMappingView GetView51() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing LiquidTypesRml + [CodeFirstDatabaseSchema.LiquidTypesRml](T1.LiquidTypesRml_GUID, T1.[LiquidTypesRml.LIQUID_TYPE_GUID], T1.[LiquidTypesRml.RML_GUID], T1.[LiquidTypesRml.MAX_NL_PER_CM], T1.LiquidTypesRml_ID, T1.[LiquidTypesRml.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS LiquidTypesRml_GUID, + T.LiquidTypeGuid AS [LiquidTypesRml.LIQUID_TYPE_GUID], + T.RmlGuid AS [LiquidTypesRml.RML_GUID], + T.MaxNlPerCm AS [LiquidTypesRml.MAX_NL_PER_CM], + T.ID AS LiquidTypesRml_ID, + T.LastUpdated AS [LiquidTypesRml.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.LiquidTypesRmls AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.MediaColor. + /// + /// The mapping view. + private static DbMappingView GetView52() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing MediaColor + [CodeFirstDatabaseSchema.MediaColor](T1.MediaColor_GUID, T1.MediaColor_NAME, T1.MediaColor_L, T1.MediaColor_A, T1.MediaColor_B, T1.MediaColor_ID, T1.[MediaColor.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS MediaColor_GUID, + T.Name AS MediaColor_NAME, + T.L AS MediaColor_L, + T.A AS MediaColor_A, + T.B AS MediaColor_B, + T.ID AS MediaColor_ID, + T.LastUpdated AS [MediaColor.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.MediaColors AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.MediaCondition. + /// + /// The mapping view. + private static DbMappingView GetView53() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing MediaCondition + [CodeFirstDatabaseSchema.MediaCondition](T1.MediaCondition_GUID, T1.MediaCondition_NAME, T1.MediaCondition_CODE, T1.MediaCondition_ID, T1.[MediaCondition.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS MediaCondition_GUID, + T.Name AS MediaCondition_NAME, + T.Code AS MediaCondition_CODE, + T.ID AS MediaCondition_ID, + T.LastUpdated AS [MediaCondition.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.MediaConditions AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.MediaMaterial. + /// + /// The mapping view. + private static DbMappingView GetView54() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing MediaMaterial + [CodeFirstDatabaseSchema.MediaMaterial](T1.MediaMaterial_GUID, T1.MediaMaterial_NAME, T1.MediaMaterial_CODE, T1.MediaMaterial_ID, T1.[MediaMaterial.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS MediaMaterial_GUID, + T.Name AS MediaMaterial_NAME, + T.Code AS MediaMaterial_CODE, + T.ID AS MediaMaterial_ID, + T.LastUpdated AS [MediaMaterial.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.MediaMaterials AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.MediaPurpos. + /// + /// The mapping view. + private static DbMappingView GetView55() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing MediaPurpos + [CodeFirstDatabaseSchema.MediaPurpos](T1.MediaPurpos_GUID, T1.MediaPurpos_NAME, T1.MediaPurpos_CODE, T1.MediaPurpos_ID, T1.[MediaPurpos.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS MediaPurpos_GUID, + T.Name AS MediaPurpos_NAME, + T.Code AS MediaPurpos_CODE, + T.ID AS MediaPurpos_ID, + T.LastUpdated AS [MediaPurpos.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.MediaPurposes AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.ProcessParametersTablesGroup. + /// + /// The mapping view. + private static DbMappingView GetView56() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing ProcessParametersTablesGroup + [CodeFirstDatabaseSchema.ProcessParametersTablesGroup](T1.ProcessParametersTablesGroup_GUID, T1.[ProcessParametersTablesGroup.RML_GUID], T1.ProcessParametersTablesGroup_NAME, T1.ProcessParametersTablesGroup_ACTIVE, T1.[ProcessParametersTablesGroup.SAVE_DATE], T1.ProcessParametersTablesGroup_ID, T1.[ProcessParametersTablesGroup.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS ProcessParametersTablesGroup_GUID, + T.RmlGuid AS [ProcessParametersTablesGroup.RML_GUID], + T.Name AS ProcessParametersTablesGroup_NAME, + T.Active AS ProcessParametersTablesGroup_ACTIVE, + T.SaveDate AS [ProcessParametersTablesGroup.SAVE_DATE], + T.ID AS ProcessParametersTablesGroup_ID, + T.LastUpdated AS [ProcessParametersTablesGroup.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.ProcessParametersTablesGroups AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.ProcessParametersTable. + /// + /// The mapping view. + private static DbMappingView GetView57() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing ProcessParametersTable + [CodeFirstDatabaseSchema.ProcessParametersTable](T1.ProcessParametersTable_GUID, T1.ProcessParametersTable_NAME, T1.[ProcessParametersTable.DYEING_SPEED], T1.[ProcessParametersTable.MIN_INK_UPTAKE], T1.[ProcessParametersTable.FEEDER_TENSION], T1.[ProcessParametersTable.PULLER_TENSION], T1.[ProcessParametersTable.WINDER_TENSION], T1.[ProcessParametersTable.MIXER_TEMP], T1.[ProcessParametersTable.HEAD_ZONE1_TEMP], T1.[ProcessParametersTable.HEAD_ZONE2_TEMP], T1.[ProcessParametersTable.HEAD_ZONE3_TEMP], T1.[ProcessParametersTable.HEAD_ZONE4_TEMP], T1.[ProcessParametersTable.HEAD_ZONE5_TEMP], T1.[ProcessParametersTable.HEAD_ZONE6_TEMP], T1.[ProcessParametersTable.DRYER_AIR_FLOW], T1.[ProcessParametersTable.DRYER_ZONE1_TEMP], T1.[ProcessParametersTable.DRYER_ZONE2_TEMP], T1.[ProcessParametersTable.DRYER_ZONE3_TEMP], T1.[ProcessParametersTable.DRYER_BUFFER_LENGTH], T1.[ProcessParametersTable.HEAD_AIR_FLOW], T1.[ProcessParametersTable.PROCESS_PARAMETERS_TABLES_GROUP_GUID], T1.[ProcessParametersTable.TABLE_INDEX], T1.ProcessParametersTable_ID, T1.[ProcessParametersTable.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS ProcessParametersTable_GUID, + T.Name AS ProcessParametersTable_NAME, + T.DyeingSpeed AS [ProcessParametersTable.DYEING_SPEED], + T.MinInkUptake AS [ProcessParametersTable.MIN_INK_UPTAKE], + T.FeederTension AS [ProcessParametersTable.FEEDER_TENSION], + T.PullerTension AS [ProcessParametersTable.PULLER_TENSION], + T.WinderTension AS [ProcessParametersTable.WINDER_TENSION], + T.MixerTemp AS [ProcessParametersTable.MIXER_TEMP], + T.HeadZone1Temp AS [ProcessParametersTable.HEAD_ZONE1_TEMP], + T.HeadZone2Temp AS [ProcessParametersTable.HEAD_ZONE2_TEMP], + T.HeadZone3Temp AS [ProcessParametersTable.HEAD_ZONE3_TEMP], + T.HeadZone4Temp AS [ProcessParametersTable.HEAD_ZONE4_TEMP], + T.HeadZone5Temp AS [ProcessParametersTable.HEAD_ZONE5_TEMP], + T.HeadZone6Temp AS [ProcessParametersTable.HEAD_ZONE6_TEMP], + T.DryerAirFlow AS [ProcessParametersTable.DRYER_AIR_FLOW], + T.DryerZone1Temp AS [ProcessParametersTable.DRYER_ZONE1_TEMP], + T.DryerZone2Temp AS [ProcessParametersTable.DRYER_ZONE2_TEMP], + T.DryerZone3Temp AS [ProcessParametersTable.DRYER_ZONE3_TEMP], + T.DryerBufferLength AS [ProcessParametersTable.DRYER_BUFFER_LENGTH], + T.HeadAirFlow AS [ProcessParametersTable.HEAD_AIR_FLOW], + T.ProcessParametersTablesGroupGuid AS [ProcessParametersTable.PROCESS_PARAMETERS_TABLES_GROUP_GUID], + T.TableIndex AS [ProcessParametersTable.TABLE_INDEX], + T.ID AS ProcessParametersTable_ID, + T.LastUpdated AS [ProcessParametersTable.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.ProcessParametersTables AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.SpoolType. + /// + /// The mapping view. + private static DbMappingView GetView58() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing SpoolType + [CodeFirstDatabaseSchema.SpoolType](T1.SpoolType_GUID, T1.SpoolType_CODE, T1.SpoolType_NAME, T1.SpoolType_LENGTH, T1.SpoolType_WEIGHT, T1.SpoolType_DIAMETER, T1.[SpoolType.START_OFFSET_PULSES], T1.[SpoolType.BACKING_RATE], T1.[SpoolType.SEGMENT_OFFSET_PULSES], T1.[SpoolType.BOTTOM_BACKING_RATE], T1.[SpoolType.ROTATIONS_PER_PASSAGE], T1.SpoolType_ID, T1.[SpoolType.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS SpoolType_GUID, + T.Code AS SpoolType_CODE, + T.Name AS SpoolType_NAME, + T.Length AS SpoolType_LENGTH, + T.Weight AS SpoolType_WEIGHT, + T.Diameter AS SpoolType_DIAMETER, + T.StartOffsetPulses AS [SpoolType.START_OFFSET_PULSES], + T.BackingRate AS [SpoolType.BACKING_RATE], + T.SegmentOffsetPulses AS [SpoolType.SEGMENT_OFFSET_PULSES], + T.BottomBackingRate AS [SpoolType.BOTTOM_BACKING_RATE], + T.RotationsPerPassage AS [SpoolType.ROTATIONS_PER_PASSAGE], + T.ID AS SpoolType_ID, + T.LastUpdated AS [SpoolType.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.SpoolTypes AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.WindingMethod. + /// + /// The mapping view. + private static DbMappingView GetView59() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing WindingMethod + [CodeFirstDatabaseSchema.WindingMethod](T1.WindingMethod_GUID, T1.WindingMethod_CODE, T1.WindingMethod_NAME, T1.WindingMethod_DESCRIPTION, T1.WindingMethod_ID, T1.[WindingMethod.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS WindingMethod_GUID, + T.Code AS WindingMethod_CODE, + T.Name AS WindingMethod_NAME, + T.Description AS WindingMethod_DESCRIPTION, + T.ID AS WindingMethod_ID, + T.LastUpdated AS [WindingMethod.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.WindingMethods AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.MachineStudioVersion. + /// + /// The mapping view. + private static DbMappingView GetView60() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing MachineStudioVersion + [CodeFirstDatabaseSchema.MachineStudioVersion](T1.MachineStudioVersion_GUID, T1.MachineStudioVersion_VERSION, T1.[MachineStudioVersion.FTP_FILE_PATH], T1.MachineStudioVersion_COMMENTS, T1.[MachineStudioVersion.USER_GUID], T1.[MachineStudioVersion.FORCE_UPDATE], T1.MachineStudioVersion_ID, T1.[MachineStudioVersion.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS MachineStudioVersion_GUID, + T.Version AS MachineStudioVersion_VERSION, + T.FtpFilePath AS [MachineStudioVersion.FTP_FILE_PATH], + T.Comments AS MachineStudioVersion_COMMENTS, + T.UserGuid AS [MachineStudioVersion.USER_GUID], + T.ForceUpdate AS [MachineStudioVersion.FORCE_UPDATE], + T.ID AS MachineStudioVersion_ID, + T.LastUpdated AS [MachineStudioVersion.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.MachineStudioVersions AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.UsersRole. + /// + /// The mapping view. + private static DbMappingView GetView61() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing UsersRole + [CodeFirstDatabaseSchema.UsersRole](T1.UsersRole_GUID, T1.UsersRole_DELETED, T1.[UsersRole.USER_GUID], T1.[UsersRole.ROLE_GUID], T1.UsersRole_ID, T1.[UsersRole.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS UsersRole_GUID, + T.Deleted AS UsersRole_DELETED, + T.UserGuid AS [UsersRole.USER_GUID], + T.RoleGuid AS [UsersRole.ROLE_GUID], + T.ID AS UsersRole_ID, + T.LastUpdated AS [UsersRole.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.UsersRoles AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.Role. + /// + /// The mapping view. + private static DbMappingView GetView62() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Role + [CodeFirstDatabaseSchema.Role](T1.Role_GUID, T1.Role_CODE, T1.Role_NAME, T1.Role_DESCRIPTION, T1.Role_ID, T1.[Role.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS Role_GUID, + T.Code AS Role_CODE, + T.Name AS Role_NAME, + T.Description AS Role_DESCRIPTION, + T.ID AS Role_ID, + T.LastUpdated AS [Role.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.Roles AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.RolesPermission. + /// + /// The mapping view. + private static DbMappingView GetView63() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing RolesPermission + [CodeFirstDatabaseSchema.RolesPermission](T1.RolesPermission_GUID, T1.[RolesPermission.ROLE_GUID], T1.[RolesPermission.PERMISSION_GUID], T1.RolesPermission_ID, T1.[RolesPermission.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS RolesPermission_GUID, + T.RoleGuid AS [RolesPermission.ROLE_GUID], + T.PermissionGuid AS [RolesPermission.PERMISSION_GUID], + T.ID AS RolesPermission_ID, + T.LastUpdated AS [RolesPermission.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.RolesPermissions AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.Permission. + /// + /// The mapping view. + private static DbMappingView GetView64() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Permission + [CodeFirstDatabaseSchema.Permission](T1.Permission_GUID, T1.Permission_CODE, T1.Permission_NAME, T1.Permission_DESCRIPTION, T1.Permission_ID, T1.[Permission.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS Permission_GUID, + T.Code AS Permission_CODE, + T.Name AS Permission_NAME, + T.Description AS Permission_DESCRIPTION, + T.ID AS Permission_ID, + T.LastUpdated AS [Permission.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.Permissions AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.DispenserType. + /// + /// The mapping view. + private static DbMappingView GetView65() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing DispenserType + [CodeFirstDatabaseSchema.DispenserType](T1.DispenserType_GUID, T1.DispenserType_CODE, T1.DispenserType_NAME, T1.[DispenserType.NL_PER_PULSE], T1.DispenserType_CAPACITY, T1.DispenserType_ID, T1.[DispenserType.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS DispenserType_GUID, + T.Code AS DispenserType_CODE, + T.Name AS DispenserType_NAME, + T.NlPerPulse AS [DispenserType.NL_PER_PULSE], + T.Capacity AS DispenserType_CAPACITY, + T.ID AS DispenserType_ID, + T.LastUpdated AS [DispenserType.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.DispenserTypes AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.IdsPackFormula. + /// + /// The mapping view. + private static DbMappingView GetView66() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing IdsPackFormula + [CodeFirstDatabaseSchema.IdsPackFormula](T1.IdsPackFormula_GUID, T1.IdsPackFormula_CODE, T1.IdsPackFormula_NAME, T1.IdsPackFormula_DESCRIPTION, T1.[IdsPackFormula.AUTO_CALCULATED], T1.IdsPackFormula_ID, T1.[IdsPackFormula.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS IdsPackFormula_GUID, + T.Code AS IdsPackFormula_CODE, + T.Name AS IdsPackFormula_NAME, + T.Description AS IdsPackFormula_DESCRIPTION, + T.AutoCalculated AS [IdsPackFormula.AUTO_CALCULATED], + T.ID AS IdsPackFormula_ID, + T.LastUpdated AS [IdsPackFormula.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.IdsPackFormulas AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.MidTankType. + /// + /// The mapping view. + private static DbMappingView GetView67() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing MidTankType + [CodeFirstDatabaseSchema.MidTankType](T1.MidTankType_GUID, T1.MidTankType_CODE, T1.MidTankType_NAME, T1.[MidTankType.LITER_CAPACITY], T1.MidTankType_ID, T1.[MidTankType.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS MidTankType_GUID, + T.Code AS MidTankType_CODE, + T.Name AS MidTankType_NAME, + T.LiterCapacity AS [MidTankType.LITER_CAPACITY], + T.ID AS MidTankType_ID, + T.LastUpdated AS [MidTankType.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.MidTankTypes AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.ActionTypes. + /// + /// The mapping view. + private static DbMappingView GetView68() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing ActionTypes + [Tango.BL.ActionType](T1.ActionType_Guid, T1.ActionType_Code, T1.ActionType_Name, T1.ActionType_Description, T1.ActionType_ID, T1.ActionType_LastUpdated) + FROM ( + SELECT + T.GUID AS ActionType_Guid, + T.CODE AS ActionType_Code, + T.NAME AS ActionType_Name, + T.DESCRIPTION AS ActionType_Description, + T.ID AS ActionType_ID, + T.LAST_UPDATED AS ActionType_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.ActionType AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.EventTypesActions. + /// + /// The mapping view. + private static DbMappingView GetView69() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing EventTypesActions + [Tango.BL.EventTypesAction](T1.EventTypesAction_Guid, T1.EventTypesAction_EventTypeGuid, T1.EventTypesAction_ActionTypeGuid, T1.EventTypesAction_ID, T1.EventTypesAction_LastUpdated) + FROM ( + SELECT + T.GUID AS EventTypesAction_Guid, + T.EVENT_TYPE_GUID AS EventTypesAction_EventTypeGuid, + T.ACTION_TYPE_GUID AS EventTypesAction_ActionTypeGuid, + T.ID AS EventTypesAction_ID, + T.LAST_UPDATED AS EventTypesAction_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.EventTypesAction AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.EventTypes. + /// + /// The mapping view. + private static DbMappingView GetView70() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing EventTypes + [Tango.BL.EventType](T1.EventType_Guid, T1.EventType_Code, T1.EventType_Name, T1.EventType_Description, T1.EventType_EventTypesCategoryGuid, T1.EventType_EventTypesGroupGuid, T1.EventType_RequiresUserIntervention, T1.EventType_HtmlPageGuid, T1.EventType_Resolvable, T1.EventType_ID, T1.EventType_LastUpdated) + FROM ( + SELECT + T.GUID AS EventType_Guid, + T.CODE AS EventType_Code, + T.NAME AS EventType_Name, + T.DESCRIPTION AS EventType_Description, + T.EVENT_TYPES_CATEGORY_GUID AS EventType_EventTypesCategoryGuid, + T.EVENT_TYPES_GROUP_GUID AS EventType_EventTypesGroupGuid, + T.REQUIRES_USER_INTERVENTION AS EventType_RequiresUserIntervention, + T.HTML_PAGE_GUID AS EventType_HtmlPageGuid, + T.RESOLVABLE AS EventType_Resolvable, + T.ID AS EventType_ID, + T.LAST_UPDATED AS EventType_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.EventType AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.EventTypesCategories. + /// + /// The mapping view. + private static DbMappingView GetView71() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing EventTypesCategories + [Tango.BL.EventTypesCategory](T1.EventTypesCategory_Guid, T1.EventTypesCategory_Code, T1.EventTypesCategory_Name, T1.EventTypesCategory_Description, T1.EventTypesCategory_ID, T1.EventTypesCategory_LastUpdated) + FROM ( + SELECT + T.GUID AS EventTypesCategory_Guid, + T.CODE AS EventTypesCategory_Code, + T.NAME AS EventTypesCategory_Name, + T.DESCRIPTION AS EventTypesCategory_Description, + T.ID AS EventTypesCategory_ID, + T.LAST_UPDATED AS EventTypesCategory_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.EventTypesCategory AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.EventTypesGroups. + /// + /// The mapping view. + private static DbMappingView GetView72() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing EventTypesGroups + [Tango.BL.EventTypesGroup](T1.EventTypesGroup_Guid, T1.EventTypesGroup_Code, T1.EventTypesGroup_Name, T1.EventTypesGroup_Description, T1.EventTypesGroup_ID, T1.EventTypesGroup_LastUpdated) + FROM ( + SELECT + T.GUID AS EventTypesGroup_Guid, + T.CODE AS EventTypesGroup_Code, + T.NAME AS EventTypesGroup_Name, + T.DESCRIPTION AS EventTypesGroup_Description, + T.ID AS EventTypesGroup_ID, + T.LAST_UPDATED AS EventTypesGroup_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.EventTypesGroup AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.HtmlPages. + /// + /// The mapping view. + private static DbMappingView GetView73() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HtmlPages + [Tango.BL.HtmlPage](T1.HtmlPage_Guid, T1.HtmlPage_Code, T1.HtmlPage_Name, T1.HtmlPage_Description, T1.HtmlPage_Html, T1.HtmlPage_ID, T1.HtmlPage_LastUpdated) + FROM ( + SELECT + T.GUID AS HtmlPage_Guid, + T.CODE AS HtmlPage_Code, + T.NAME AS HtmlPage_Name, + T.DESCRIPTION AS HtmlPage_Description, + T.HTML AS HtmlPage_Html, + T.ID AS HtmlPage_ID, + T.LAST_UPDATED AS HtmlPage_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.HtmlPage AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.MachinesEvents. + /// + /// The mapping view. + private static DbMappingView GetView74() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing MachinesEvents + [Tango.BL.MachinesEvent](T1.MachinesEvent_Guid, T1.MachinesEvent_HostName, T1.MachinesEvent_MachineGuid, T1.MachinesEvent_EventTypeGuid, T1.MachinesEvent_UserGuid, T1.MachinesEvent_DateTime, T1.MachinesEvent_Description, T1.MachinesEvent_ID, T1.MachinesEvent_LastUpdated) + FROM ( + SELECT + T.GUID AS MachinesEvent_Guid, + T.HOST_NAME AS MachinesEvent_HostName, + T.MACHINE_GUID AS MachinesEvent_MachineGuid, + T.EVENT_TYPE_GUID AS MachinesEvent_EventTypeGuid, + T.USER_GUID AS MachinesEvent_UserGuid, + T.DATE_TIME AS MachinesEvent_DateTime, + T.DESCRIPTION AS MachinesEvent_Description, + T.ID AS MachinesEvent_ID, + T.LAST_UPDATED AS MachinesEvent_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.MachinesEvent AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.Machines. + /// + /// The mapping view. + private static DbMappingView GetView75() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Machines + [Tango.BL.Machine](T1.Machine_Guid, T1.Machine_SerialNumber, T1.Machine_Name, T1.Machine_ProductionDate, T1.Machine_OrganizationGuid, T1.Machine_MachineVersionGuid, T1.Machine_ConfigurationGuid, T1.Machine_EnableExternalBridge, T1.Machine_ExternalBridgePassword, T1.Machine_DefaultRmlGuid, T1.Machine_TargetJobTypes, T1.Machine_DefaultColorSpaceGuid, T1.Machine_DefaultSegmentLength, T1.Machine_DefaultSpoolTypeGuid, T1.Machine_Synched, T1.Machine_ID, T1.Machine_LastUpdated) + FROM ( + SELECT + T.GUID AS Machine_Guid, + T.SERIAL_NUMBER AS Machine_SerialNumber, + T.NAME AS Machine_Name, + T.PRODUCTION_DATE AS Machine_ProductionDate, + T.ORGANIZATION_GUID AS Machine_OrganizationGuid, + T.MACHINE_VERSION_GUID AS Machine_MachineVersionGuid, + T.CONFIGURATION_GUID AS Machine_ConfigurationGuid, + T.ENABLE_EXTERNAL_BRIDGE AS Machine_EnableExternalBridge, + T.EXTERNAL_BRIDGE_PASSWORD AS Machine_ExternalBridgePassword, + T.DEFAULT_RML_GUID AS Machine_DefaultRmlGuid, + T.TARGET_JOB_TYPES AS Machine_TargetJobTypes, + T.DEFAULT_COLOR_SPACE_GUID AS Machine_DefaultColorSpaceGuid, + T.DEFAULT_SEGMENT_LENGTH AS Machine_DefaultSegmentLength, + T.DEFAULT_SPOOL_TYPE_GUID AS Machine_DefaultSpoolTypeGuid, + T.SYNCHED AS Machine_Synched, + T.ID AS Machine_ID, + T.LAST_UPDATED AS Machine_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.Machine AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.Cats. + /// + /// The mapping view. + private static DbMappingView GetView76() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Cats + [Tango.BL.Cat](T1.Cat_Guid, T1.Cat_Name, T1.Cat_MachineGuid, T1.Cat_RmlGuid, T1.Cat_LiquidTypeGuid, T1.Cat_Data, T1.Cat_ID, T1.Cat_LastUpdated) + FROM ( + SELECT + T.GUID AS Cat_Guid, + T.NAME AS Cat_Name, + T.MACHINE_GUID AS Cat_MachineGuid, + T.RML_GUID AS Cat_RmlGuid, + T.LIQUID_TYPE_GUID AS Cat_LiquidTypeGuid, + T.DATA AS Cat_Data, + T.ID AS Cat_ID, + T.LAST_UPDATED AS Cat_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.Cat AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.LiquidTypes. + /// + /// The mapping view. + private static DbMappingView GetView77() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing LiquidTypes + [Tango.BL.LiquidType](T1.LiquidType_Guid, T1.LiquidType_Code, T1.LiquidType_Name, T1.LiquidType_Version, T1.LiquidType_Color, T1.LiquidType_ID, T1.LiquidType_LastUpdated) + FROM ( + SELECT + T.GUID AS LiquidType_Guid, + T.CODE AS LiquidType_Code, + T.NAME AS LiquidType_Name, + T.VERSION AS LiquidType_Version, + T.COLOR AS LiquidType_Color, + T.ID AS LiquidType_ID, + T.LAST_UPDATED AS LiquidType_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.LiquidType AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.IdsPacks. + /// + /// The mapping view. + private static DbMappingView GetView78() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing IdsPacks + [Tango.BL.IdsPack](T1.IdsPack_Guid, T1.IdsPack_ConfigurationGuid, T1.IdsPack_DispenserTypeGuid, T1.IdsPack_LiquidTypeGuid, T1.IdsPack_CartridgeTypeGuid, T1.IdsPack_MidTankTypeGuid, T1.IdsPack_IdsPackFormulaGuid, T1.IdsPack_Name, T1.IdsPack_PackIndex, T1.IdsPack_IsEmpty, T1.IdsPack_ID, T1.IdsPack_LastUpdated) + FROM ( + SELECT + T.GUID AS IdsPack_Guid, + T.CONFIGURATION_GUID AS IdsPack_ConfigurationGuid, + T.DISPENSER_TYPE_GUID AS IdsPack_DispenserTypeGuid, + T.LIQUID_TYPE_GUID AS IdsPack_LiquidTypeGuid, + T.CARTRIDGE_TYPE_GUID AS IdsPack_CartridgeTypeGuid, + T.MID_TANK_TYPE_GUID AS IdsPack_MidTankTypeGuid, + T.IDS_PACK_FORMULA_GUID AS IdsPack_IdsPackFormulaGuid, + T.NAME AS IdsPack_Name, + T.PACK_INDEX AS IdsPack_PackIndex, + T.IS_EMPTY AS IdsPack_IsEmpty, + T.ID AS IdsPack_ID, + T.LAST_UPDATED AS IdsPack_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.IdsPack AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.CartridgeTypes. + /// + /// The mapping view. + private static DbMappingView GetView79() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing CartridgeTypes + [Tango.BL.CartridgeType](T1.CartridgeType_Guid, T1.CartridgeType_Code, T1.CartridgeType_Name, T1.CartridgeType_ID, T1.CartridgeType_LastUpdated) + FROM ( + SELECT + T.GUID AS CartridgeType_Guid, + T.CODE AS CartridgeType_Code, + T.NAME AS CartridgeType_Name, + T.ID AS CartridgeType_ID, + T.LAST_UPDATED AS CartridgeType_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.CartridgeType AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.Configurations. + /// + /// The mapping view. + private static DbMappingView GetView80() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Configurations + [Tango.BL.Configuration](T1.Configuration_Guid, T1.Configuration_Name, T1.Configuration_CreationDate, T1.Configuration_ApplicationOsVersionGuid, T1.Configuration_ApplicationFirmwareVersionGuid, T1.Configuration_ApplicationDisplayPanelVersionGuid, T1.Configuration_EmbeddedFirmwareVersionGuid, T1.Configuration_HardwareVersionGuid, T1.Configuration_ID, T1.Configuration_LastUpdated) + FROM ( + SELECT + T.GUID AS Configuration_Guid, + T.NAME AS Configuration_Name, + T.CREATION_DATE AS Configuration_CreationDate, + T.APPLICATION_OS_VERSION_GUID AS Configuration_ApplicationOsVersionGuid, + T.APPLICATION_FIRMWARE_VERSION_GUID AS Configuration_ApplicationFirmwareVersionGuid, + T.APPLICATION_DISPLAY_PANEL_VERSION_GUID AS Configuration_ApplicationDisplayPanelVersionGuid, + T.EMBEDDED_FIRMWARE_VERSION_GUID AS Configuration_EmbeddedFirmwareVersionGuid, + T.HARDWARE_VERSION_GUID AS Configuration_HardwareVersionGuid, + T.ID AS Configuration_ID, + T.LAST_UPDATED AS Configuration_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.Configuration AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.ApplicationDisplayPanelVersions. + /// + /// The mapping view. + private static DbMappingView GetView81() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing ApplicationDisplayPanelVersions + [Tango.BL.ApplicationDisplayPanelVersion](T1.ApplicationDisplayPanelVersion_Guid, T1.ApplicationDisplayPanelVersion_Version, T1.ApplicationDisplayPanelVersion_Name, T1.ApplicationDisplayPanelVersion_ID, T1.ApplicationDisplayPanelVersion_LastUpdated) + FROM ( + SELECT + T.GUID AS ApplicationDisplayPanelVersion_Guid, + T.VERSION AS ApplicationDisplayPanelVersion_Version, + T.NAME AS ApplicationDisplayPanelVersion_Name, + T.ID AS ApplicationDisplayPanelVersion_ID, + T.LAST_UPDATED AS ApplicationDisplayPanelVersion_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.ApplicationDisplayPanelVersion AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.ApplicationFirmwareVersions. + /// + /// The mapping view. + private static DbMappingView GetView82() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing ApplicationFirmwareVersions + [Tango.BL.ApplicationFirmwareVersion](T1.ApplicationFirmwareVersion_Guid, T1.ApplicationFirmwareVersion_Version, T1.ApplicationFirmwareVersion_Name, T1.ApplicationFirmwareVersion_ID, T1.ApplicationFirmwareVersion_LastUpdated) + FROM ( + SELECT + T.GUID AS ApplicationFirmwareVersion_Guid, + T.VERSION AS ApplicationFirmwareVersion_Version, + T.NAME AS ApplicationFirmwareVersion_Name, + T.ID AS ApplicationFirmwareVersion_ID, + T.LAST_UPDATED AS ApplicationFirmwareVersion_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.ApplicationFirmwareVersion AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.ApplicationOsVersions. + /// + /// The mapping view. + private static DbMappingView GetView83() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing ApplicationOsVersions + [Tango.BL.ApplicationOsVersion](T1.ApplicationOsVersion_Guid, T1.ApplicationOsVersion_Version, T1.ApplicationOsVersion_Name, T1.ApplicationOsVersion_ID, T1.ApplicationOsVersion_LastUpdated) + FROM ( + SELECT + T.GUID AS ApplicationOsVersion_Guid, + T.VERSION AS ApplicationOsVersion_Version, + T.NAME AS ApplicationOsVersion_Name, + T.ID AS ApplicationOsVersion_ID, + T.LAST_UPDATED AS ApplicationOsVersion_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.ApplicationOsVersion AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.EmbeddedFirmwareVersions. + /// + /// The mapping view. + private static DbMappingView GetView84() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing EmbeddedFirmwareVersions + [Tango.BL.EmbeddedFirmwareVersion](T1.EmbeddedFirmwareVersion_Guid, T1.EmbeddedFirmwareVersion_Version, T1.EmbeddedFirmwareVersion_Name, T1.EmbeddedFirmwareVersion_ID, T1.EmbeddedFirmwareVersion_LastUpdated) + FROM ( + SELECT + T.GUID AS EmbeddedFirmwareVersion_Guid, + T.VERSION AS EmbeddedFirmwareVersion_Version, + T.NAME AS EmbeddedFirmwareVersion_Name, + T.ID AS EmbeddedFirmwareVersion_ID, + T.LAST_UPDATED AS EmbeddedFirmwareVersion_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.EmbeddedFirmwareVersion AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.HardwareVersions. + /// + /// The mapping view. + private static DbMappingView GetView85() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareVersions + [Tango.BL.HardwareVersion](T1.HardwareVersion_Guid, T1.HardwareVersion_Version, T1.HardwareVersion_Name, T1.HardwareVersion_ID, T1.HardwareVersion_LastUpdated) + FROM ( + SELECT + T.GUID AS HardwareVersion_Guid, + T.VERSION AS HardwareVersion_Version, + T.NAME AS HardwareVersion_Name, + T.ID AS HardwareVersion_ID, + T.LAST_UPDATED AS HardwareVersion_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.HardwareVersion AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.HardwareBlowers. + /// + /// The mapping view. + private static DbMappingView GetView86() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareBlowers + [Tango.BL.HardwareBlower](T1.HardwareBlower_Guid, T1.HardwareBlower_HardwareBlowerTypeGuid, T1.HardwareBlower_HardwareVersionGuid, T1.HardwareBlower_Enabled, T1.HardwareBlower_Voltage, T1.HardwareBlower_Active, T1.HardwareBlower_ID, T1.HardwareBlower_LastUpdated) + FROM ( + SELECT + T.GUID AS HardwareBlower_Guid, + T.HARDWARE_BLOWER_TYPE_GUID AS HardwareBlower_HardwareBlowerTypeGuid, + T.HARDWARE_VERSION_GUID AS HardwareBlower_HardwareVersionGuid, + T.ENABLED AS HardwareBlower_Enabled, + T.VOLTAGE AS HardwareBlower_Voltage, + T.ACTIVE AS HardwareBlower_Active, + T.ID AS HardwareBlower_ID, + T.LAST_UPDATED AS HardwareBlower_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.HardwareBlower AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.HardwareBlowerTypes. + /// + /// The mapping view. + private static DbMappingView GetView87() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareBlowerTypes + [Tango.BL.HardwareBlowerType](T1.HardwareBlowerType_Guid, T1.HardwareBlowerType_Code, T1.HardwareBlowerType_Name, T1.HardwareBlowerType_Description, T1.HardwareBlowerType_ID, T1.HardwareBlowerType_LastUpdated) + FROM ( + SELECT + T.GUID AS HardwareBlowerType_Guid, + T.CODE AS HardwareBlowerType_Code, + T.NAME AS HardwareBlowerType_Name, + T.DESCRIPTION AS HardwareBlowerType_Description, + T.ID AS HardwareBlowerType_ID, + T.LAST_UPDATED AS HardwareBlowerType_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.HardwareBlowerType AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.HardwareBreakSensors. + /// + /// The mapping view. + private static DbMappingView GetView88() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareBreakSensors + [Tango.BL.HardwareBreakSensor](T1.HardwareBreakSensor_Guid, T1.HardwareBreakSensor_HardwareBreakSensorTypeGuid, T1.HardwareBreakSensor_HardwareVersionGuid, T1.HardwareBreakSensor_Enabled, T1.HardwareBreakSensor_DeBounceTimeMilli, T1.HardwareBreakSensor_Active, T1.HardwareBreakSensor_ID, T1.HardwareBreakSensor_LastUpdated) + FROM ( + SELECT + T.GUID AS HardwareBreakSensor_Guid, + T.HARDWARE_BREAK_SENSOR_TYPE_GUID AS HardwareBreakSensor_HardwareBreakSensorTypeGuid, + T.HARDWARE_VERSION_GUID AS HardwareBreakSensor_HardwareVersionGuid, + T.ENABLED AS HardwareBreakSensor_Enabled, + T.DE_BOUNCE_TIME_MILLI AS HardwareBreakSensor_DeBounceTimeMilli, + T.ACTIVE AS HardwareBreakSensor_Active, + T.ID AS HardwareBreakSensor_ID, + T.LAST_UPDATED AS HardwareBreakSensor_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.HardwareBreakSensor AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.HardwareBreakSensorTypes. + /// + /// The mapping view. + private static DbMappingView GetView89() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareBreakSensorTypes + [Tango.BL.HardwareBreakSensorType](T1.HardwareBreakSensorType_Guid, T1.HardwareBreakSensorType_Code, T1.HardwareBreakSensorType_Name, T1.HardwareBreakSensorType_Description, T1.HardwareBreakSensorType_ID, T1.HardwareBreakSensorType_LastUpdated) + FROM ( + SELECT + T.GUID AS HardwareBreakSensorType_Guid, + T.CODE AS HardwareBreakSensorType_Code, + T.NAME AS HardwareBreakSensorType_Name, + T.DESCRIPTION AS HardwareBreakSensorType_Description, + T.ID AS HardwareBreakSensorType_ID, + T.LAST_UPDATED AS HardwareBreakSensorType_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.HardwareBreakSensorType AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.HardwareDancers. + /// + /// The mapping view. + private static DbMappingView GetView90() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareDancers + [Tango.BL.HardwareDancer](T1.HardwareDancer_Guid, T1.HardwareDancer_HardwareDancerTypeGuid, T1.HardwareDancer_HardwareVersionGuid, T1.HardwareDancer_Gradual, T1.HardwareDancer_K, T1.HardwareDancer_X, T1.HardwareDancer_PulsePerMmSpring, T1.HardwareDancer_MaximalMovementMm, T1.HardwareDancer_ZeroPoint, T1.HardwareDancer_ResolutionBits, T1.HardwareDancer_ArmLength, T1.HardwareDancer_AssemblyDirectionRight, T1.HardwareDancer_AccelerateOnTensionRaise, T1.HardwareDancer_Active, T1.HardwareDancer_ID, T1.HardwareDancer_LastUpdated) + FROM ( + SELECT + T.GUID AS HardwareDancer_Guid, + T.HARDWARE_DANCER_TYPE_GUID AS HardwareDancer_HardwareDancerTypeGuid, + T.HARDWARE_VERSION_GUID AS HardwareDancer_HardwareVersionGuid, + T.GRADUAL AS HardwareDancer_Gradual, + T.K AS HardwareDancer_K, + T.X AS HardwareDancer_X, + T.PULSE_PER_MM_SPRING AS HardwareDancer_PulsePerMmSpring, + T.MAXIMAL_MOVEMENT_MM AS HardwareDancer_MaximalMovementMm, + T.ZERO_POINT AS HardwareDancer_ZeroPoint, + T.RESOLUTION_BITS AS HardwareDancer_ResolutionBits, + T.ARM_LENGTH AS HardwareDancer_ArmLength, + T.ASSEMBLY_DIRECTION_RIGHT AS HardwareDancer_AssemblyDirectionRight, + T.ACCELERATE_ON_TENSION_RAISE AS HardwareDancer_AccelerateOnTensionRaise, + T.ACTIVE AS HardwareDancer_Active, + T.ID AS HardwareDancer_ID, + T.LAST_UPDATED AS HardwareDancer_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.HardwareDancer AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.HardwareDancerTypes. + /// + /// The mapping view. + private static DbMappingView GetView91() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareDancerTypes + [Tango.BL.HardwareDancerType](T1.HardwareDancerType_Guid, T1.HardwareDancerType_Code, T1.HardwareDancerType_Name, T1.HardwareDancerType_Description, T1.HardwareDancerType_ID, T1.HardwareDancerType_LastUpdated) + FROM ( + SELECT + T.GUID AS HardwareDancerType_Guid, + T.CODE AS HardwareDancerType_Code, + T.NAME AS HardwareDancerType_Name, + T.DESCRIPTION AS HardwareDancerType_Description, + T.ID AS HardwareDancerType_ID, + T.LAST_UPDATED AS HardwareDancerType_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.HardwareDancerType AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.HardwareMotors. + /// + /// The mapping view. + private static DbMappingView GetView92() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareMotors + [Tango.BL.HardwareMotor](T1.HardwareMotor_Guid, T1.HardwareMotor_HardwareMotorTypeGuid, T1.HardwareMotor_HardwareVersionGuid, T1.HardwareMotor_MinFrequency, T1.HardwareMotor_MaxFrequency, T1.HardwareMotor_SetMicroStep, T1.HardwareMotor_MicroStep, T1.HardwareMotor_MaxChangeSlope, T1.HardwareMotor_HighLengthMicroSecond, T1.HardwareMotor_SpeedMaster, T1.HardwareMotor_PulsePerRound, T1.HardwareMotor_PulleyRadius, T1.HardwareMotor_ConfigWord, T1.HardwareMotor_DirectionThreadWize, T1.HardwareMotor_KvalHold, T1.HardwareMotor_KvalRun, T1.HardwareMotor_KvalAcc, T1.HardwareMotor_KvalDec, T1.HardwareMotor_OverCurrentThreshold, T1.HardwareMotor_StallThreshold, T1.HardwareMotor_ThermalCompensationFactor, T1.HardwareMotor_LowSpeedOptimization, T1.HardwareMotor_StSlp, T1.HardwareMotor_IntSpd, T1.HardwareMotor_FnSlpAcc, T1.HardwareMotor_FnSlpDec, T1.HardwareMotor_FsSpd, T1.HardwareMotor_Active, T1.HardwareMotor_ID, T1.HardwareMotor_LastUpdated) + FROM ( + SELECT + T.GUID AS HardwareMotor_Guid, + T.HARDWARE_MOTOR_TYPE_GUID AS HardwareMotor_HardwareMotorTypeGuid, + T.HARDWARE_VERSION_GUID AS HardwareMotor_HardwareVersionGuid, + T.MIN_FREQUENCY AS HardwareMotor_MinFrequency, + T.MAX_FREQUENCY AS HardwareMotor_MaxFrequency, + T.SET_MICRO_STEP AS HardwareMotor_SetMicroStep, + T.MICRO_STEP AS HardwareMotor_MicroStep, + T.MAX_CHANGE_SLOPE AS HardwareMotor_MaxChangeSlope, + T.HIGH_LENGTH_MICRO_SECOND AS HardwareMotor_HighLengthMicroSecond, + T.SPEED_MASTER AS HardwareMotor_SpeedMaster, + T.PULSE_PER_ROUND AS HardwareMotor_PulsePerRound, + T.PULLEY_RADIUS AS HardwareMotor_PulleyRadius, + T.CONFIG_WORD AS HardwareMotor_ConfigWord, + T.DIRECTION_THREAD_WIZE AS HardwareMotor_DirectionThreadWize, + T.KVAL_HOLD AS HardwareMotor_KvalHold, + T.KVAL_RUN AS HardwareMotor_KvalRun, + T.KVAL_ACC AS HardwareMotor_KvalAcc, + T.KVAL_DEC AS HardwareMotor_KvalDec, + T.OVER_CURRENT_THRESHOLD AS HardwareMotor_OverCurrentThreshold, + T.STALL_THRESHOLD AS HardwareMotor_StallThreshold, + T.THERMAL_COMPENSATION_FACTOR AS HardwareMotor_ThermalCompensationFactor, + T.LOW_SPEED_OPTIMIZATION AS HardwareMotor_LowSpeedOptimization, + T.ST_SLP AS HardwareMotor_StSlp, + T.INT_SPD AS HardwareMotor_IntSpd, + T.FN_SLP_ACC AS HardwareMotor_FnSlpAcc, + T.FN_SLP_DEC AS HardwareMotor_FnSlpDec, + T.FS_SPD AS HardwareMotor_FsSpd, + T.ACTIVE AS HardwareMotor_Active, + T.ID AS HardwareMotor_ID, + T.LAST_UPDATED AS HardwareMotor_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.HardwareMotor AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.HardwareMotorTypes. + /// + /// The mapping view. + private static DbMappingView GetView93() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareMotorTypes + [Tango.BL.HardwareMotorType](T1.HardwareMotorType_Guid, T1.HardwareMotorType_Code, T1.HardwareMotorType_Name, T1.HardwareMotorType_Description, T1.HardwareMotorType_SupportsHoming, T1.HardwareMotorType_ID, T1.HardwareMotorType_LastUpdated) + FROM ( + SELECT + T.GUID AS HardwareMotorType_Guid, + T.CODE AS HardwareMotorType_Code, + T.NAME AS HardwareMotorType_Name, + T.DESCRIPTION AS HardwareMotorType_Description, + T.SUPPORTS_HOMING AS HardwareMotorType_SupportsHoming, + T.ID AS HardwareMotorType_ID, + T.LAST_UPDATED AS HardwareMotorType_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.HardwareMotorType AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.HardwarePidControls. + /// + /// The mapping view. + private static DbMappingView GetView94() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwarePidControls + [Tango.BL.HardwarePidControl](T1.HardwarePidControl_Guid, T1.HardwarePidControl_HardwarePidControlTypeGuid, T1.HardwarePidControl_HardwareVersionGuid, T1.HardwarePidControl_OutputProportionalPowerLimit, T1.HardwarePidControl_OutputProportionalBand, T1.HardwarePidControl_IntegralTime, T1.HardwarePidControl_DerivativeTime, T1.HardwarePidControl_SensorCorrectionAdjustment, T1.HardwarePidControl_SensorMinValue, T1.HardwarePidControl_SensorMaxValue, T1.HardwarePidControl_SetPointRampRateorSoftStartRamp, T1.HardwarePidControl_SetPointControlOutputRate, T1.HardwarePidControl_ControlOutputType, T1.HardwarePidControl_SsrControlOutputType, T1.HardwarePidControl_OutputOnOffHysteresisValue, T1.HardwarePidControl_ProcessVariableSamplingRate, T1.HardwarePidControl_PvInputFilterFactorMode, T1.HardwarePidControl_OutputProportionalCycleTime, T1.HardwarePidControl_AcHeatersHalfCycleTime, T1.HardwarePidControl_ProportionalGain, T1.HardwarePidControl_Active, T1.HardwarePidControl_ID, T1.HardwarePidControl_LastUpdated) + FROM ( + SELECT + T.GUID AS HardwarePidControl_Guid, + T.HARDWARE_PID_CONTROL_TYPE_GUID AS HardwarePidControl_HardwarePidControlTypeGuid, + T.HARDWARE_VERSION_GUID AS HardwarePidControl_HardwareVersionGuid, + T.OUTPUT_PROPORTIONAL_POWER_LIMIT AS HardwarePidControl_OutputProportionalPowerLimit, + T.OUTPUT_PROPORTIONAL_BAND AS HardwarePidControl_OutputProportionalBand, + T.INTEGRAL_TIME AS HardwarePidControl_IntegralTime, + T.DERIVATIVE_TIME AS HardwarePidControl_DerivativeTime, + T.SENSOR_CORRECTION_ADJUSTMENT AS HardwarePidControl_SensorCorrectionAdjustment, + T.SENSOR_MIN_VALUE AS HardwarePidControl_SensorMinValue, + T.SENSOR_MAX_VALUE AS HardwarePidControl_SensorMaxValue, + T.SET_POINT_RAMP_RATEOR_SOFT_START_RAMP AS HardwarePidControl_SetPointRampRateorSoftStartRamp, + T.SET_POINT_CONTROL_OUTPUT_RATE AS HardwarePidControl_SetPointControlOutputRate, + T.CONTROL_OUTPUT_TYPE AS HardwarePidControl_ControlOutputType, + T.SSR_CONTROL_OUTPUT_TYPE AS HardwarePidControl_SsrControlOutputType, + T.OUTPUT_ON_OFF_HYSTERESIS_VALUE AS HardwarePidControl_OutputOnOffHysteresisValue, + T.PROCESS_VARIABLE_SAMPLING_RATE AS HardwarePidControl_ProcessVariableSamplingRate, + T.PV_INPUT_FILTER_FACTOR_MODE AS HardwarePidControl_PvInputFilterFactorMode, + T.OUTPUT_PROPORTIONAL_CYCLE_TIME AS HardwarePidControl_OutputProportionalCycleTime, + T.AC_HEATERS__HALF_CYCLE_TIME AS HardwarePidControl_AcHeatersHalfCycleTime, + T.PROPORTIONAL_GAIN AS HardwarePidControl_ProportionalGain, + T.ACTIVE AS HardwarePidControl_Active, + T.ID AS HardwarePidControl_ID, + T.LAST_UPDATED AS HardwarePidControl_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.HardwarePidControl AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.HardwarePidControlTypes. + /// + /// The mapping view. + private static DbMappingView GetView95() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwarePidControlTypes + [Tango.BL.HardwarePidControlType](T1.HardwarePidControlType_Guid, T1.HardwarePidControlType_Code, T1.HardwarePidControlType_Name, T1.HardwarePidControlType_Description, T1.HardwarePidControlType_ID, T1.HardwarePidControlType_LastUpdated) + FROM ( + SELECT + T.GUID AS HardwarePidControlType_Guid, + T.CODE AS HardwarePidControlType_Code, + T.NAME AS HardwarePidControlType_Name, + T.DESCRIPTION AS HardwarePidControlType_Description, + T.ID AS HardwarePidControlType_ID, + T.LAST_UPDATED AS HardwarePidControlType_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.HardwarePidControlType AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.HardwareSpeedSensors. + /// + /// The mapping view. + private static DbMappingView GetView96() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareSpeedSensors + [Tango.BL.HardwareSpeedSensor](T1.HardwareSpeedSensor_Guid, T1.HardwareSpeedSensor_HardwareSpeedSensorTypeGuid, T1.HardwareSpeedSensor_HardwareVersionGuid, T1.HardwareSpeedSensor_ResolutionBits, T1.HardwareSpeedSensor_Perimeter, T1.HardwareSpeedSensor_Active, T1.HardwareSpeedSensor_ID, T1.HardwareSpeedSensor_LastUpdated) + FROM ( + SELECT + T.GUID AS HardwareSpeedSensor_Guid, + T.HARDWARE_SPEED_SENSOR_TYPE_GUID AS HardwareSpeedSensor_HardwareSpeedSensorTypeGuid, + T.HARDWARE_VERSION_GUID AS HardwareSpeedSensor_HardwareVersionGuid, + T.RESOLUTION_BITS AS HardwareSpeedSensor_ResolutionBits, + T.PERIMETER AS HardwareSpeedSensor_Perimeter, + T.ACTIVE AS HardwareSpeedSensor_Active, + T.ID AS HardwareSpeedSensor_ID, + T.LAST_UPDATED AS HardwareSpeedSensor_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.HardwareSpeedSensor AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.HardwareSpeedSensorTypes. + /// + /// The mapping view. + private static DbMappingView GetView97() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareSpeedSensorTypes + [Tango.BL.HardwareSpeedSensorType](T1.HardwareSpeedSensorType_Guid, T1.HardwareSpeedSensorType_Code, T1.HardwareSpeedSensorType_Name, T1.HardwareSpeedSensorType_Description, T1.HardwareSpeedSensorType_ID, T1.HardwareSpeedSensorType_LastUpdated) + FROM ( + SELECT + T.GUID AS HardwareSpeedSensorType_Guid, + T.CODE AS HardwareSpeedSensorType_Code, + T.NAME AS HardwareSpeedSensorType_Name, + T.DESCRIPTION AS HardwareSpeedSensorType_Description, + T.ID AS HardwareSpeedSensorType_ID, + T.LAST_UPDATED AS HardwareSpeedSensorType_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.HardwareSpeedSensorType AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.HardwareWinders. + /// + /// The mapping view. + private static DbMappingView GetView98() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareWinders + [Tango.BL.HardwareWinder](T1.HardwareWinder_Guid, T1.HardwareWinder_HardwareWinderTypeGuid, T1.HardwareWinder_HardwareVersionGuid, T1.HardwareWinder_MillimeterPerRotation, T1.HardwareWinder_Active, T1.HardwareWinder_ID, T1.HardwareWinder_LastUpdated) + FROM ( + SELECT + T.GUID AS HardwareWinder_Guid, + T.HARDWARE_WINDER_TYPE_GUID AS HardwareWinder_HardwareWinderTypeGuid, + T.HARDWARE_VERSION_GUID AS HardwareWinder_HardwareVersionGuid, + T.MILLIMETER_PER_ROTATION AS HardwareWinder_MillimeterPerRotation, + T.ACTIVE AS HardwareWinder_Active, + T.ID AS HardwareWinder_ID, + T.LAST_UPDATED AS HardwareWinder_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.HardwareWinder AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.HardwareWinderTypes. + /// + /// The mapping view. + private static DbMappingView GetView99() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing HardwareWinderTypes + [Tango.BL.HardwareWinderType](T1.HardwareWinderType_Guid, T1.HardwareWinderType_Code, T1.HardwareWinderType_Name, T1.HardwareWinderType_Description, T1.HardwareWinderType_ID, T1.HardwareWinderType_LastUpdated) + FROM ( + SELECT + T.GUID AS HardwareWinderType_Guid, + T.CODE AS HardwareWinderType_Code, + T.NAME AS HardwareWinderType_Name, + T.DESCRIPTION AS HardwareWinderType_Description, + T.ID AS HardwareWinderType_ID, + T.LAST_UPDATED AS HardwareWinderType_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.HardwareWinderType AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.MachinesConfigurations. + /// + /// The mapping view. + private static DbMappingView GetView100() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing MachinesConfigurations + [Tango.BL.MachinesConfiguration](T1.MachinesConfiguration_Guid, T1.MachinesConfiguration_MachineGuid, T1.MachinesConfiguration_ConfigurationGuid, T1.MachinesConfiguration_ID, T1.MachinesConfiguration_LastUpdated) + FROM ( + SELECT + T.GUID AS MachinesConfiguration_Guid, + T.MACHINE_GUID AS MachinesConfiguration_MachineGuid, + T.CONFIGURATION_GUID AS MachinesConfiguration_ConfigurationGuid, + T.ID AS MachinesConfiguration_ID, + T.LAST_UPDATED AS MachinesConfiguration_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.MachinesConfiguration AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.MachineVersions. + /// + /// The mapping view. + private static DbMappingView GetView101() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing MachineVersions + [Tango.BL.MachineVersion](T1.MachineVersion_Guid, T1.MachineVersion_Version, T1.MachineVersion_Name, T1.MachineVersion_DefaultConfigurationGuid, T1.MachineVersion_ID, T1.MachineVersion_LastUpdated) + FROM ( + SELECT + T.GUID AS MachineVersion_Guid, + T.VERSION AS MachineVersion_Version, + T.NAME AS MachineVersion_Name, + T.DEFAULT_CONFIGURATION_GUID AS MachineVersion_DefaultConfigurationGuid, + T.ID AS MachineVersion_ID, + T.LAST_UPDATED AS MachineVersion_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.MachineVersion AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.TangoVersions. + /// + /// The mapping view. + private static DbMappingView GetView102() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing TangoVersions + [Tango.BL.TangoVersion](T1.TangoVersion_Guid, T1.TangoVersion_Version, T1.TangoVersion_FtpFilePath, T1.TangoVersion_Comments, T1.TangoVersion_UserGuid, T1.TangoVersion_MachineVersionGuid, T1.TangoVersion_ID, T1.TangoVersion_LastUpdated) + FROM ( + SELECT + T.GUID AS TangoVersion_Guid, + T.VERSION AS TangoVersion_Version, + T.FTP_FILE_PATH AS TangoVersion_FtpFilePath, + T.COMMENTS AS TangoVersion_Comments, + T.USER_GUID AS TangoVersion_UserGuid, + T.MACHINE_VERSION_GUID AS TangoVersion_MachineVersionGuid, + T.ID AS TangoVersion_ID, + T.LAST_UPDATED AS TangoVersion_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.TangoVersion AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.Users. + /// + /// The mapping view. + private static DbMappingView GetView103() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Users + [Tango.BL.User](T1.User_Guid, T1.User_Deleted, T1.User_Email, T1.User_Password, T1.User_OrganizationGuid, T1.User_ContactGuid, T1.User_AddressGuid, T1.User_LastLogin, T1.User_ID, T1.User_LastUpdated) + FROM ( + SELECT + T.GUID AS User_Guid, + T.DELETED AS User_Deleted, + T.EMAIL AS User_Email, + T.PASSWORD AS User_Password, + T.ORGANIZATION_GUID AS User_OrganizationGuid, + T.CONTACT_GUID AS User_ContactGuid, + T.ADDRESS_GUID AS User_AddressGuid, + T.LAST_LOGIN AS User_LastLogin, + T.ID AS User_ID, + T.LAST_UPDATED AS User_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.User AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.Addresses. + /// + /// The mapping view. + private static DbMappingView GetView104() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Addresses + [Tango.BL.Address](T1.Address_Guid, T1.Address_Deleted, T1.Address_AddressString, T1.Address_Locality, T1.Address_Country, T1.Address_City, T1.Address_State, T1.Address_CountryCode, T1.Address_PostalCode, T1.Address_ID, T1.Address_LastUpdated) + FROM ( + SELECT + T.GUID AS Address_Guid, + T.DELETED AS Address_Deleted, + T.ADDRESS_STRING AS Address_AddressString, + T.LOCALITY AS Address_Locality, + T.COUNTRY AS Address_Country, + T.CITY AS Address_City, + T.STATE AS Address_State, + T.COUNTRY_CODE AS Address_CountryCode, + T.POSTAL_CODE AS Address_PostalCode, + T.ID AS Address_ID, + T.LAST_UPDATED AS Address_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.Address AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.Organizations. + /// + /// The mapping view. + private static DbMappingView GetView105() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Organizations + [Tango.BL.Organization](T1.Organization_Guid, T1.Organization_Name, T1.Organization_ContactGuid, T1.Organization_AddressGuid, T1.Organization_ID, T1.Organization_LastUpdated) + FROM ( + SELECT + T.GUID AS Organization_Guid, + T.NAME AS Organization_Name, + T.CONTACT_GUID AS Organization_ContactGuid, + T.ADDRESS_GUID AS Organization_AddressGuid, + T.ID AS Organization_ID, + T.LAST_UPDATED AS Organization_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.Organization AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.Contacts. + /// + /// The mapping view. + private static DbMappingView GetView106() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Contacts + [Tango.BL.Contact](T1.Contact_Guid, T1.Contact_Deleted, T1.Contact_FirstName, T1.Contact_LastName, T1.Contact_FullName, T1.Contact_Email, T1.Contact_PhoneNumber, T1.Contact_Fax, T1.Contact_ID, T1.Contact_LastUpdated) + FROM ( + SELECT + T.GUID AS Contact_Guid, + T.DELETED AS Contact_Deleted, + T.FIRST_NAME AS Contact_FirstName, + T.LAST_NAME AS Contact_LastName, + T.FULL_NAME AS Contact_FullName, + T.EMAIL AS Contact_Email, + T.PHONE_NUMBER AS Contact_PhoneNumber, + T.FAX AS Contact_Fax, + T.ID AS Contact_ID, + T.LAST_UPDATED AS Contact_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.Contact AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.Customers. + /// + /// The mapping view. + private static DbMappingView GetView107() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Customers + [Tango.BL.Customer](T1.Customer_Guid, T1.Customer_OrganizationGuid, T1.Customer_Name, T1.Customer_ID, T1.Customer_LastUpdated) + FROM ( + SELECT + T.GUID AS Customer_Guid, + T.ORGANIZATION_GUID AS Customer_OrganizationGuid, + T.NAME AS Customer_Name, + T.ID AS Customer_ID, + T.LAST_UPDATED AS Customer_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.Customer AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.Jobs. + /// + /// The mapping view. + private static DbMappingView GetView108() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Jobs + [Tango.BL.Job](T1.Job_Guid, T1.Job_CreationDate, T1.Job_LastRun, T1.Job_MachineGuid, T1.Job_UserGuid, T1.Job_RmlGuid, T1.Job_WindingMethodGuid, T1.Job_SpoolTypeGuid, T1.Job_Name, T1.Job_Description, T1.Job_InterSegmentLength, T1.Job_EnableInterSegment, T1.Job_EnableLubrication, T1.Job_JobIndex, T1.Job_EstimatedDurationMili, T1.Job_HasEmbroideryFile, T1.Job_EmbroideryFileData, T1.Job_EmbroideryFileName, T1.Job_EmbroideryJpeg, T1.Job_Status, T1.Job_ColorSpaceGuid, T1.Job_NumberOfUnits, T1.Job_Type, T1.Job_CustomerGuid, T1.Job_SpoolsDistribution, T1.Job_NumberOfHeads, T1.Job_SampleUnitsOrMeters, T1.Job_FineTuningStatus, T1.Job_FineTuningApproveDate, T1.Job_SampleDyeStatus, T1.Job_SampleDyeApproveDate, T1.Job_EditingState, T1.Job_LengthPercentageFactor, T1.Job_ID, T1.Job_LastUpdated) + FROM ( + SELECT + T.GUID AS Job_Guid, + T.CREATION_DATE AS Job_CreationDate, + T.LAST_RUN AS Job_LastRun, + T.MACHINE_GUID AS Job_MachineGuid, + T.USER_GUID AS Job_UserGuid, + T.RML_GUID AS Job_RmlGuid, + T.WINDING_METHOD_GUID AS Job_WindingMethodGuid, + T.SPOOL_TYPE_GUID AS Job_SpoolTypeGuid, + T.NAME AS Job_Name, + T.DESCRIPTION AS Job_Description, + T.INTER_SEGMENT_LENGTH AS Job_InterSegmentLength, + T.ENABLE_INTER_SEGMENT AS Job_EnableInterSegment, + T.ENABLE_LUBRICATION AS Job_EnableLubrication, + T.JOB_INDEX AS Job_JobIndex, + T.ESTIMATED_DURATION_MILI AS Job_EstimatedDurationMili, + T.HAS_EMBROIDERY_FILE AS Job_HasEmbroideryFile, + T.EMBROIDERY_FILE_DATA AS Job_EmbroideryFileData, + T.EMBROIDERY_FILE_NAME AS Job_EmbroideryFileName, + T.EMBROIDERY_JPEG AS Job_EmbroideryJpeg, + T.STATUS AS Job_Status, + T.COLOR_SPACE_GUID AS Job_ColorSpaceGuid, + T.NUMBER_OF_UNITS AS Job_NumberOfUnits, + T.TYPE AS Job_Type, + T.CUSTOMER_GUID AS Job_CustomerGuid, + T.SPOOLS_DISTRIBUTION AS Job_SpoolsDistribution, + T.NUMBER_OF_HEADS AS Job_NumberOfHeads, + T.SAMPLE_UNITS_OR_METERS AS Job_SampleUnitsOrMeters, + T.FINE_TUNING_STATUS AS Job_FineTuningStatus, + T.FINE_TUNING_APPROVE_DATE AS Job_FineTuningApproveDate, + T.SAMPLE_DYE_STATUS AS Job_SampleDyeStatus, + T.SAMPLE_DYE_APPROVE_DATE AS Job_SampleDyeApproveDate, + T.EDITING_STATE AS Job_EditingState, + T.LENGTH_PERCENTAGE_FACTOR AS Job_LengthPercentageFactor, + T.ID AS Job_ID, + T.LAST_UPDATED AS Job_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.Job AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.ColorSpaces. + /// + /// The mapping view. + private static DbMappingView GetView109() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing ColorSpaces + [Tango.BL.ColorSpace](T1.ColorSpace_Guid, T1.ColorSpace_Code, T1.ColorSpace_Name, T1.ColorSpace_Description, T1.ColorSpace_ID, T1.ColorSpace_LastUpdated) + FROM ( + SELECT + T.GUID AS ColorSpace_Guid, + T.CODE AS ColorSpace_Code, + T.NAME AS ColorSpace_Name, + T.DESCRIPTION AS ColorSpace_Description, + T.ID AS ColorSpace_ID, + T.LAST_UPDATED AS ColorSpace_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.ColorSpace AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.BrushStops. + /// + /// The mapping view. + private static DbMappingView GetView110() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing BrushStops + [Tango.BL.BrushStop](T1.BrushStop_Guid, T1.BrushStop_SegmentGuid, T1.BrushStop_ColorSpaceGuid, T1.BrushStop_OffsetPercent, T1.BrushStop_StopIndex, T1.BrushStop_Cyan, T1.BrushStop_Magenta, T1.BrushStop_Yellow, T1.BrushStop_Black, T1.BrushStop_Red, T1.BrushStop_Green, T1.BrushStop_Blue, T1.BrushStop_L, T1.BrushStop_A, T1.BrushStop_B, T1.BrushStop_V0, T1.BrushStop_V1, T1.BrushStop_V2, T1.BrushStop_V3, T1.BrushStop_V4, T1.BrushStop_V5, T1.BrushStop_V6, T1.BrushStop_V7, T1.BrushStop_Corrected, T1.BrushStop_ColorCatalogGuid, T1.BrushStop_ColorCatalogCode, T1.BrushStop_ID, T1.BrushStop_LastUpdated) + FROM ( + SELECT + T.GUID AS BrushStop_Guid, + T.SEGMENT_GUID AS BrushStop_SegmentGuid, + T.COLOR_SPACE_GUID AS BrushStop_ColorSpaceGuid, + T.OFFSET_PERCENT AS BrushStop_OffsetPercent, + T.STOP_INDEX AS BrushStop_StopIndex, + T.CYAN AS BrushStop_Cyan, + T.MAGENTA AS BrushStop_Magenta, + T.YELLOW AS BrushStop_Yellow, + T.BLACK AS BrushStop_Black, + T.RED AS BrushStop_Red, + T.GREEN AS BrushStop_Green, + T.BLUE AS BrushStop_Blue, + T.L AS BrushStop_L, + T.A AS BrushStop_A, + T.B AS BrushStop_B, + T.V0 AS BrushStop_V0, + T.V1 AS BrushStop_V1, + T.V2 AS BrushStop_V2, + T.V3 AS BrushStop_V3, + T.V4 AS BrushStop_V4, + T.V5 AS BrushStop_V5, + T.V6 AS BrushStop_V6, + T.V7 AS BrushStop_V7, + T.CORRECTED AS BrushStop_Corrected, + T.COLOR_CATALOG_GUID AS BrushStop_ColorCatalogGuid, + T.COLOR_CATALOG_CODE AS BrushStop_ColorCatalogCode, + T.ID AS BrushStop_ID, + T.LAST_UPDATED AS BrushStop_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.BrushStop AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.ColorCatalogs. + /// + /// The mapping view. + private static DbMappingView GetView111() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing ColorCatalogs + [Tango.BL.ColorCatalog](T1.ColorCatalog_Guid, T1.ColorCatalog_ColorSpaceGuid, T1.ColorCatalog_ColorCode, T1.ColorCatalog_Name, T1.ColorCatalog_ColorGroup, T1.ColorCatalog_Cyan, T1.ColorCatalog_Magenta, T1.ColorCatalog_Yellow, T1.ColorCatalog_Black, T1.ColorCatalog_Red, T1.ColorCatalog_Green, T1.ColorCatalog_Blue, T1.ColorCatalog_L, T1.ColorCatalog_A, T1.ColorCatalog_B, T1.ColorCatalog_V0, T1.ColorCatalog_V1, T1.ColorCatalog_V2, T1.ColorCatalog_V3, T1.ColorCatalog_V4, T1.ColorCatalog_V5, T1.ColorCatalog_V6, T1.ColorCatalog_V7, T1.ColorCatalog_ID, T1.ColorCatalog_LastUpdated) + FROM ( + SELECT + T.GUID AS ColorCatalog_Guid, + T.COLOR_SPACE_GUID AS ColorCatalog_ColorSpaceGuid, + T.COLOR_CODE AS ColorCatalog_ColorCode, + T.NAME AS ColorCatalog_Name, + T.COLOR_GROUP AS ColorCatalog_ColorGroup, + T.CYAN AS ColorCatalog_Cyan, + T.MAGENTA AS ColorCatalog_Magenta, + T.YELLOW AS ColorCatalog_Yellow, + T.BLACK AS ColorCatalog_Black, + T.RED AS ColorCatalog_Red, + T.GREEN AS ColorCatalog_Green, + T.BLUE AS ColorCatalog_Blue, + T.L AS ColorCatalog_L, + T.A AS ColorCatalog_A, + T.B AS ColorCatalog_B, + T.V0 AS ColorCatalog_V0, + T.V1 AS ColorCatalog_V1, + T.V2 AS ColorCatalog_V2, + T.V3 AS ColorCatalog_V3, + T.V4 AS ColorCatalog_V4, + T.V5 AS ColorCatalog_V5, + T.V6 AS ColorCatalog_V6, + T.V7 AS ColorCatalog_V7, + T.ID AS ColorCatalog_ID, + T.LAST_UPDATED AS ColorCatalog_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.ColorCatalog AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.Segments. + /// + /// The mapping view. + private static DbMappingView GetView112() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Segments + [Tango.BL.Segment](T1.Segment_Guid, T1.Segment_Name, T1.Segment_JobGuid, T1.Segment_Length, T1.Segment_SegmentIndex, T1.Segment_ID, T1.Segment_LastUpdated) + FROM ( + SELECT + T.GUID AS Segment_Guid, + T.NAME AS Segment_Name, + T.JOB_GUID AS Segment_JobGuid, + T.LENGTH AS Segment_Length, + T.SEGMENT_INDEX AS Segment_SegmentIndex, + T.ID AS Segment_ID, + T.LAST_UPDATED AS Segment_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.Segment AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.JobRuns. + /// + /// The mapping view. + private static DbMappingView GetView113() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing JobRuns + [Tango.BL.JobRun](T1.JobRun_Guid, T1.JobRun_JobGuid, T1.JobRun_StartDate, T1.JobRun_EndDate, T1.JobRun_Successful, T1.JobRun_ID, T1.JobRun_LastUpdated) + FROM ( + SELECT + T.GUID AS JobRun_Guid, + T.JOB_GUID AS JobRun_JobGuid, + T.START_DATE AS JobRun_StartDate, + T.END_DATE AS JobRun_EndDate, + T.SUCCESSFUL AS JobRun_Successful, + T.ID AS JobRun_ID, + T.LAST_UPDATED AS JobRun_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.JobRun AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.Rmls. + /// + /// The mapping view. + private static DbMappingView GetView114() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Rmls + [Tango.BL.Rml](T1.Rml_Guid, T1.Rml_Name, T1.Rml_Manufacturer, T1.Rml_Code, T1.Rml_MediaMaterialGuid, T1.Rml_MediaColorGuid, T1.Rml_MediaPurposeGuid, T1.Rml_MediaConditionGuid, T1.Rml_LinearMassDensityUnitGuid, T1.Rml_FiberShapeGuid, T1.Rml_FiberSynthGuid, T1.Rml_FiberSize, T1.Rml_NumberOfFibers, T1.Rml_PliesPerFiber, T1.Rml_PliesPerThread, T1.Rml_Twisted, T1.Rml_AirEntanglement, T1.Rml_Lubricant, T1.Rml_TensileStrength, T1.Rml_ElongationAtBreakPercentage, T1.Rml_EstimatedThreadDiameter, T1.Rml_ID, T1.Rml_LastUpdated) + FROM ( + SELECT + T.GUID AS Rml_Guid, + T.NAME AS Rml_Name, + T.MANUFACTURER AS Rml_Manufacturer, + T.CODE AS Rml_Code, + T.MEDIA_MATERIAL_GUID AS Rml_MediaMaterialGuid, + T.MEDIA_COLOR_GUID AS Rml_MediaColorGuid, + T.MEDIA_PURPOSE_GUID AS Rml_MediaPurposeGuid, + T.MEDIA_CONDITION_GUID AS Rml_MediaConditionGuid, + T.LINEAR_MASS_DENSITY_UNIT_GUID AS Rml_LinearMassDensityUnitGuid, + T.FIBER_SHAPE_GUID AS Rml_FiberShapeGuid, + T.FIBER_SYNTH_GUID AS Rml_FiberSynthGuid, + T.FIBER_SIZE AS Rml_FiberSize, + T.NUMBER_OF_FIBERS AS Rml_NumberOfFibers, + T.PLIES_PER_FIBER AS Rml_PliesPerFiber, + T.PLIES_PER_THREAD AS Rml_PliesPerThread, + T.TWISTED AS Rml_Twisted, + T.AIR_ENTANGLEMENT AS Rml_AirEntanglement, + T.LUBRICANT AS Rml_Lubricant, + T.TENSILE_STRENGTH AS Rml_TensileStrength, + T.ELONGATION_AT_BREAK_PERCENTAGE AS Rml_ElongationAtBreakPercentage, + T.ESTIMATED_THREAD_DIAMETER AS Rml_EstimatedThreadDiameter, + T.ID AS Rml_ID, + T.LAST_UPDATED AS Rml_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.Rml AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.Ccts. + /// + /// The mapping view. + private static DbMappingView GetView115() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Ccts + [Tango.BL.Cct](T1.Cct_Guid, T1.Cct_Name, T1.Cct_Description, T1.Cct_ForwardFileName, T1.Cct_InverseFileName, T1.Cct_ForwardData, T1.Cct_InverseData, T1.Cct_Version, T1.Cct_RmlGuid, T1.Cct_ID, T1.Cct_LastUpdated) + FROM ( + SELECT + T.GUID AS Cct_Guid, + T.NAME AS Cct_Name, + T.DESCRIPTION AS Cct_Description, + T.FORWARD_FILE_NAME AS Cct_ForwardFileName, + T.INVERSE_FILE_NAME AS Cct_InverseFileName, + T.FORWARD_DATA AS Cct_ForwardData, + T.INVERSE_DATA AS Cct_InverseData, + T.VERSION AS Cct_Version, + T.RML_GUID AS Cct_RmlGuid, + T.ID AS Cct_ID, + T.LAST_UPDATED AS Cct_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.Cct AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.FiberShapes. + /// + /// The mapping view. + private static DbMappingView GetView116() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing FiberShapes + [Tango.BL.FiberShape](T1.FiberShape_Guid, T1.FiberShape_Name, T1.FiberShape_Code, T1.FiberShape_ID, T1.FiberShape_LastUpdated) + FROM ( + SELECT + T.GUID AS FiberShape_Guid, + T.NAME AS FiberShape_Name, + T.CODE AS FiberShape_Code, + T.ID AS FiberShape_ID, + T.LAST_UPDATED AS FiberShape_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.FiberShape AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.FiberSynths. + /// + /// The mapping view. + private static DbMappingView GetView117() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing FiberSynths + [Tango.BL.FiberSynth](T1.FiberSynth_Guid, T1.FiberSynth_Name, T1.FiberSynth_Code, T1.FiberSynth_ID, T1.FiberSynth_LastUpdated) + FROM ( + SELECT + T.GUID AS FiberSynth_Guid, + T.NAME AS FiberSynth_Name, + T.CODE AS FiberSynth_Code, + T.ID AS FiberSynth_ID, + T.LAST_UPDATED AS FiberSynth_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.FiberSynth AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.LinearMassDensityUnits. + /// + /// The mapping view. + private static DbMappingView GetView118() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing LinearMassDensityUnits + [Tango.BL.LinearMassDensityUnit](T1.LinearMassDensityUnit_Guid, T1.LinearMassDensityUnit_Name, T1.LinearMassDensityUnit_Code, T1.LinearMassDensityUnit_ID, T1.LinearMassDensityUnit_LastUpdated) + FROM ( + SELECT + T.GUID AS LinearMassDensityUnit_Guid, + T.NAME AS LinearMassDensityUnit_Name, + T.CODE AS LinearMassDensityUnit_Code, + T.ID AS LinearMassDensityUnit_ID, + T.LAST_UPDATED AS LinearMassDensityUnit_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.LinearMassDensityUnit AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.LiquidTypesRmls. + /// + /// The mapping view. + private static DbMappingView GetView119() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing LiquidTypesRmls + [Tango.BL.LiquidTypesRml](T1.LiquidTypesRml_Guid, T1.LiquidTypesRml_LiquidTypeGuid, T1.LiquidTypesRml_RmlGuid, T1.LiquidTypesRml_MaxNlPerCm, T1.LiquidTypesRml_ID, T1.LiquidTypesRml_LastUpdated) + FROM ( + SELECT + T.GUID AS LiquidTypesRml_Guid, + T.LIQUID_TYPE_GUID AS LiquidTypesRml_LiquidTypeGuid, + T.RML_GUID AS LiquidTypesRml_RmlGuid, + T.MAX_NL_PER_CM AS LiquidTypesRml_MaxNlPerCm, + T.ID AS LiquidTypesRml_ID, + T.LAST_UPDATED AS LiquidTypesRml_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.LiquidTypesRml AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.MediaColors. + /// + /// The mapping view. + private static DbMappingView GetView120() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing MediaColors + [Tango.BL.MediaColor](T1.MediaColor_Guid, T1.MediaColor_Name, T1.MediaColor_L, T1.MediaColor_A, T1.MediaColor_B, T1.MediaColor_ID, T1.MediaColor_LastUpdated) + FROM ( + SELECT + T.GUID AS MediaColor_Guid, + T.NAME AS MediaColor_Name, + T.L AS MediaColor_L, + T.A AS MediaColor_A, + T.B AS MediaColor_B, + T.ID AS MediaColor_ID, + T.LAST_UPDATED AS MediaColor_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.MediaColor AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.MediaConditions. + /// + /// The mapping view. + private static DbMappingView GetView121() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing MediaConditions + [Tango.BL.MediaCondition](T1.MediaCondition_Guid, T1.MediaCondition_Name, T1.MediaCondition_Code, T1.MediaCondition_ID, T1.MediaCondition_LastUpdated) + FROM ( + SELECT + T.GUID AS MediaCondition_Guid, + T.NAME AS MediaCondition_Name, + T.CODE AS MediaCondition_Code, + T.ID AS MediaCondition_ID, + T.LAST_UPDATED AS MediaCondition_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.MediaCondition AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.MediaMaterials. + /// + /// The mapping view. + private static DbMappingView GetView122() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing MediaMaterials + [Tango.BL.MediaMaterial](T1.MediaMaterial_Guid, T1.MediaMaterial_Name, T1.MediaMaterial_Code, T1.MediaMaterial_ID, T1.MediaMaterial_LastUpdated) + FROM ( + SELECT + T.GUID AS MediaMaterial_Guid, + T.NAME AS MediaMaterial_Name, + T.CODE AS MediaMaterial_Code, + T.ID AS MediaMaterial_ID, + T.LAST_UPDATED AS MediaMaterial_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.MediaMaterial AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.MediaPurposes. + /// + /// The mapping view. + private static DbMappingView GetView123() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing MediaPurposes + [Tango.BL.MediaPurpos](T1.MediaPurpos_Guid, T1.MediaPurpos_Name, T1.MediaPurpos_Code, T1.MediaPurpos_ID, T1.MediaPurpos_LastUpdated) + FROM ( + SELECT + T.GUID AS MediaPurpos_Guid, + T.NAME AS MediaPurpos_Name, + T.CODE AS MediaPurpos_Code, + T.ID AS MediaPurpos_ID, + T.LAST_UPDATED AS MediaPurpos_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.MediaPurpos AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.ProcessParametersTablesGroups. + /// + /// The mapping view. + private static DbMappingView GetView124() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing ProcessParametersTablesGroups + [Tango.BL.ProcessParametersTablesGroup](T1.ProcessParametersTablesGroup_Guid, T1.ProcessParametersTablesGroup_RmlGuid, T1.ProcessParametersTablesGroup_Name, T1.ProcessParametersTablesGroup_Active, T1.ProcessParametersTablesGroup_SaveDate, T1.ProcessParametersTablesGroup_ID, T1.ProcessParametersTablesGroup_LastUpdated) + FROM ( + SELECT + T.GUID AS ProcessParametersTablesGroup_Guid, + T.RML_GUID AS ProcessParametersTablesGroup_RmlGuid, + T.NAME AS ProcessParametersTablesGroup_Name, + T.ACTIVE AS ProcessParametersTablesGroup_Active, + T.SAVE_DATE AS ProcessParametersTablesGroup_SaveDate, + T.ID AS ProcessParametersTablesGroup_ID, + T.LAST_UPDATED AS ProcessParametersTablesGroup_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.ProcessParametersTablesGroup AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.ProcessParametersTables. + /// + /// The mapping view. + private static DbMappingView GetView125() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing ProcessParametersTables + [Tango.BL.ProcessParametersTable](T1.ProcessParametersTable_Guid, T1.ProcessParametersTable_Name, T1.ProcessParametersTable_DyeingSpeed, T1.ProcessParametersTable_MinInkUptake, T1.ProcessParametersTable_FeederTension, T1.ProcessParametersTable_PullerTension, T1.ProcessParametersTable_WinderTension, T1.ProcessParametersTable_MixerTemp, T1.ProcessParametersTable_HeadZone1Temp, T1.ProcessParametersTable_HeadZone2Temp, T1.ProcessParametersTable_HeadZone3Temp, T1.ProcessParametersTable_HeadZone4Temp, T1.ProcessParametersTable_HeadZone5Temp, T1.ProcessParametersTable_HeadZone6Temp, T1.ProcessParametersTable_DryerAirFlow, T1.ProcessParametersTable_DryerZone1Temp, T1.ProcessParametersTable_DryerZone2Temp, T1.ProcessParametersTable_DryerZone3Temp, T1.ProcessParametersTable_DryerBufferLength, T1.ProcessParametersTable_HeadAirFlow, T1.ProcessParametersTable_ProcessParametersTablesGroupGuid, T1.ProcessParametersTable_TableIndex, T1.ProcessParametersTable_ID, T1.ProcessParametersTable_LastUpdated) + FROM ( + SELECT + T.GUID AS ProcessParametersTable_Guid, + T.NAME AS ProcessParametersTable_Name, + T.DYEING_SPEED AS ProcessParametersTable_DyeingSpeed, + T.MIN_INK_UPTAKE AS ProcessParametersTable_MinInkUptake, + T.FEEDER_TENSION AS ProcessParametersTable_FeederTension, + T.PULLER_TENSION AS ProcessParametersTable_PullerTension, + T.WINDER_TENSION AS ProcessParametersTable_WinderTension, + T.MIXER_TEMP AS ProcessParametersTable_MixerTemp, + T.HEAD_ZONE1_TEMP AS ProcessParametersTable_HeadZone1Temp, + T.HEAD_ZONE2_TEMP AS ProcessParametersTable_HeadZone2Temp, + T.HEAD_ZONE3_TEMP AS ProcessParametersTable_HeadZone3Temp, + T.HEAD_ZONE4_TEMP AS ProcessParametersTable_HeadZone4Temp, + T.HEAD_ZONE5_TEMP AS ProcessParametersTable_HeadZone5Temp, + T.HEAD_ZONE6_TEMP AS ProcessParametersTable_HeadZone6Temp, + T.DRYER_AIR_FLOW AS ProcessParametersTable_DryerAirFlow, + T.DRYER_ZONE1_TEMP AS ProcessParametersTable_DryerZone1Temp, + T.DRYER_ZONE2_TEMP AS ProcessParametersTable_DryerZone2Temp, + T.DRYER_ZONE3_TEMP AS ProcessParametersTable_DryerZone3Temp, + T.DRYER_BUFFER_LENGTH AS ProcessParametersTable_DryerBufferLength, + T.HEAD_AIR_FLOW AS ProcessParametersTable_HeadAirFlow, + T.PROCESS_PARAMETERS_TABLES_GROUP_GUID AS ProcessParametersTable_ProcessParametersTablesGroupGuid, + T.TABLE_INDEX AS ProcessParametersTable_TableIndex, + T.ID AS ProcessParametersTable_ID, + T.LAST_UPDATED AS ProcessParametersTable_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.ProcessParametersTable AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.SpoolTypes. + /// + /// The mapping view. + private static DbMappingView GetView126() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing SpoolTypes + [Tango.BL.SpoolType](T1.SpoolType_Guid, T1.SpoolType_Code, T1.SpoolType_Name, T1.SpoolType_Length, T1.SpoolType_Weight, T1.SpoolType_Diameter, T1.SpoolType_StartOffsetPulses, T1.SpoolType_BackingRate, T1.SpoolType_SegmentOffsetPulses, T1.SpoolType_BottomBackingRate, T1.SpoolType_RotationsPerPassage, T1.SpoolType_ID, T1.SpoolType_LastUpdated) + FROM ( + SELECT + T.GUID AS SpoolType_Guid, + T.CODE AS SpoolType_Code, + T.NAME AS SpoolType_Name, + T.LENGTH AS SpoolType_Length, + T.WEIGHT AS SpoolType_Weight, + T.DIAMETER AS SpoolType_Diameter, + T.START_OFFSET_PULSES AS SpoolType_StartOffsetPulses, + T.BACKING_RATE AS SpoolType_BackingRate, + T.SEGMENT_OFFSET_PULSES AS SpoolType_SegmentOffsetPulses, + T.BOTTOM_BACKING_RATE AS SpoolType_BottomBackingRate, + T.ROTATIONS_PER_PASSAGE AS SpoolType_RotationsPerPassage, + T.ID AS SpoolType_ID, + T.LAST_UPDATED AS SpoolType_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.SpoolType AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.WindingMethods. + /// + /// The mapping view. + private static DbMappingView GetView127() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing WindingMethods + [Tango.BL.WindingMethod](T1.WindingMethod_Guid, T1.WindingMethod_Code, T1.WindingMethod_Name, T1.WindingMethod_Description, T1.WindingMethod_ID, T1.WindingMethod_LastUpdated) + FROM ( + SELECT + T.GUID AS WindingMethod_Guid, + T.CODE AS WindingMethod_Code, + T.NAME AS WindingMethod_Name, + T.DESCRIPTION AS WindingMethod_Description, + T.ID AS WindingMethod_ID, + T.LAST_UPDATED AS WindingMethod_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.WindingMethod AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.MachineStudioVersions. + /// + /// The mapping view. + private static DbMappingView GetView128() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing MachineStudioVersions + [Tango.BL.MachineStudioVersion](T1.MachineStudioVersion_Guid, T1.MachineStudioVersion_Version, T1.MachineStudioVersion_FtpFilePath, T1.MachineStudioVersion_Comments, T1.MachineStudioVersion_UserGuid, T1.MachineStudioVersion_ForceUpdate, T1.MachineStudioVersion_ID, T1.MachineStudioVersion_LastUpdated) + FROM ( + SELECT + T.GUID AS MachineStudioVersion_Guid, + T.VERSION AS MachineStudioVersion_Version, + T.FTP_FILE_PATH AS MachineStudioVersion_FtpFilePath, + T.COMMENTS AS MachineStudioVersion_Comments, + T.USER_GUID AS MachineStudioVersion_UserGuid, + T.FORCE_UPDATE AS MachineStudioVersion_ForceUpdate, + T.ID AS MachineStudioVersion_ID, + T.LAST_UPDATED AS MachineStudioVersion_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.MachineStudioVersion AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.UsersRoles. + /// + /// The mapping view. + private static DbMappingView GetView129() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing UsersRoles + [Tango.BL.UsersRole](T1.UsersRole_Guid, T1.UsersRole_Deleted, T1.UsersRole_UserGuid, T1.UsersRole_RoleGuid, T1.UsersRole_ID, T1.UsersRole_LastUpdated) + FROM ( + SELECT + T.GUID AS UsersRole_Guid, + T.DELETED AS UsersRole_Deleted, + T.USER_GUID AS UsersRole_UserGuid, + T.ROLE_GUID AS UsersRole_RoleGuid, + T.ID AS UsersRole_ID, + T.LAST_UPDATED AS UsersRole_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.UsersRole AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.Roles. + /// + /// The mapping view. + private static DbMappingView GetView130() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Roles + [Tango.BL.Role](T1.Role_Guid, T1.Role_Code, T1.Role_Name, T1.Role_Description, T1.Role_ID, T1.Role_LastUpdated) + FROM ( + SELECT + T.GUID AS Role_Guid, + T.CODE AS Role_Code, + T.NAME AS Role_Name, + T.DESCRIPTION AS Role_Description, + T.ID AS Role_ID, + T.LAST_UPDATED AS Role_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.Role AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.RolesPermissions. + /// + /// The mapping view. + private static DbMappingView GetView131() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing RolesPermissions + [Tango.BL.RolesPermission](T1.RolesPermission_Guid, T1.RolesPermission_RoleGuid, T1.RolesPermission_PermissionGuid, T1.RolesPermission_ID, T1.RolesPermission_LastUpdated) + FROM ( + SELECT + T.GUID AS RolesPermission_Guid, + T.ROLE_GUID AS RolesPermission_RoleGuid, + T.PERMISSION_GUID AS RolesPermission_PermissionGuid, + T.ID AS RolesPermission_ID, + T.LAST_UPDATED AS RolesPermission_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.RolesPermission AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.Permissions. + /// + /// The mapping view. + private static DbMappingView GetView132() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Permissions + [Tango.BL.Permission](T1.Permission_Guid, T1.Permission_Code, T1.Permission_Name, T1.Permission_Description, T1.Permission_ID, T1.Permission_LastUpdated) + FROM ( + SELECT + T.GUID AS Permission_Guid, + T.CODE AS Permission_Code, + T.NAME AS Permission_Name, + T.DESCRIPTION AS Permission_Description, + T.ID AS Permission_ID, + T.LAST_UPDATED AS Permission_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.Permission AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.DispenserTypes. + /// + /// The mapping view. + private static DbMappingView GetView133() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing DispenserTypes + [Tango.BL.DispenserType](T1.DispenserType_Guid, T1.DispenserType_Code, T1.DispenserType_Name, T1.DispenserType_NlPerPulse, T1.DispenserType_Capacity, T1.DispenserType_ID, T1.DispenserType_LastUpdated) + FROM ( + SELECT + T.GUID AS DispenserType_Guid, + T.CODE AS DispenserType_Code, + T.NAME AS DispenserType_Name, + T.NL_PER_PULSE AS DispenserType_NlPerPulse, + T.CAPACITY AS DispenserType_Capacity, + T.ID AS DispenserType_ID, + T.LAST_UPDATED AS DispenserType_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.DispenserType AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.IdsPackFormulas. + /// + /// The mapping view. + private static DbMappingView GetView134() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing IdsPackFormulas + [Tango.BL.IdsPackFormula](T1.IdsPackFormula_Guid, T1.IdsPackFormula_Code, T1.IdsPackFormula_Name, T1.IdsPackFormula_Description, T1.IdsPackFormula_AutoCalculated, T1.IdsPackFormula_ID, T1.IdsPackFormula_LastUpdated) + FROM ( + SELECT + T.GUID AS IdsPackFormula_Guid, + T.CODE AS IdsPackFormula_Code, + T.NAME AS IdsPackFormula_Name, + T.DESCRIPTION AS IdsPackFormula_Description, + T.AUTO_CALCULATED AS IdsPackFormula_AutoCalculated, + T.ID AS IdsPackFormula_ID, + T.LAST_UPDATED AS IdsPackFormula_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.IdsPackFormula AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.MidTankTypes. + /// + /// The mapping view. + private static DbMappingView GetView135() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing MidTankTypes + [Tango.BL.MidTankType](T1.MidTankType_Guid, T1.MidTankType_Code, T1.MidTankType_Name, T1.MidTankType_LiterCapacity, T1.MidTankType_ID, T1.MidTankType_LastUpdated) + FROM ( + SELECT + T.GUID AS MidTankType_Guid, + T.CODE AS MidTankType_Code, + T.NAME AS MidTankType_Name, + T.LITER_CAPACITY AS MidTankType_LiterCapacity, + T.ID AS MidTankType_ID, + T.LAST_UPDATED AS MidTankType_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.MidTankType AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.SyncConfiguration. + /// + /// The mapping view. + private static DbMappingView GetView136() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing SyncConfiguration + [CodeFirstDatabaseSchema.SyncConfiguration](T1.SyncConfiguration_GUID, T1.SyncConfiguration_ID, T1.[SyncConfiguration.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS SyncConfiguration_GUID, + T.ID AS SyncConfiguration_ID, + T.LastUpdated AS [SyncConfiguration.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.SyncConfigurations AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.SyncConfigurations. + /// + /// The mapping view. + private static DbMappingView GetView137() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing SyncConfigurations + [Tango.BL.SyncConfiguration](T1.SyncConfiguration_Guid, T1.SyncConfiguration_ID, T1.SyncConfiguration_LastUpdated) + FROM ( + SELECT + T.GUID AS SyncConfiguration_Guid, + T.ID AS SyncConfiguration_ID, + T.LAST_UPDATED AS SyncConfiguration_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.SyncConfiguration AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.Sysdiagram. + /// + /// The mapping view. + private static DbMappingView GetView138() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Sysdiagram + [CodeFirstDatabaseSchema.Sysdiagram](T1.Sysdiagram_GUID, T1.Sysdiagram_definition, T1.Sysdiagram_ID, T1.[Sysdiagram.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS Sysdiagram_GUID, + T.Definition AS Sysdiagram_definition, + T.ID AS Sysdiagram_ID, + T.LastUpdated AS [Sysdiagram.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.Sysdiagrams AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.Sysdiagrams. + /// + /// The mapping view. + private static DbMappingView GetView139() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing Sysdiagrams + [Tango.BL.Sysdiagram](T1.Sysdiagram_Guid, T1.Sysdiagram_Definition, T1.Sysdiagram_ID, T1.Sysdiagram_LastUpdated) + FROM ( + SELECT + T.GUID AS Sysdiagram_Guid, + T.definition AS Sysdiagram_Definition, + T.ID AS Sysdiagram_ID, + T.LAST_UPDATED AS Sysdiagram_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.Sysdiagram AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.TechController. + /// + /// The mapping view. + private static DbMappingView GetView140() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing TechController + [CodeFirstDatabaseSchema.TechController](T1.TechController_GUID, T1.TechController_CODE, T1.TechController_NAME, T1.TechController_DESCRIPTION, T1.TechController_MIN, T1.TechController_MAX, T1.TechController_UNITS, T1.TechController_ID, T1.[TechController.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS TechController_GUID, + T.Code AS TechController_CODE, + T.Name AS TechController_NAME, + T.Description AS TechController_DESCRIPTION, + T.Min AS TechController_MIN, + T.Max AS TechController_MAX, + T.Units AS TechController_UNITS, + T.ID AS TechController_ID, + T.LastUpdated AS [TechController.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.TechControllers AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.TechControllers. + /// + /// The mapping view. + private static DbMappingView GetView141() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing TechControllers + [Tango.BL.TechController](T1.TechController_Guid, T1.TechController_Code, T1.TechController_Name, T1.TechController_Description, T1.TechController_Min, T1.TechController_Max, T1.TechController_Units, T1.TechController_ID, T1.TechController_LastUpdated) + FROM ( + SELECT + T.GUID AS TechController_Guid, + T.CODE AS TechController_Code, + T.NAME AS TechController_Name, + T.DESCRIPTION AS TechController_Description, + T.MIN AS TechController_Min, + T.MAX AS TechController_Max, + T.UNITS AS TechController_Units, + T.ID AS TechController_ID, + T.LAST_UPDATED AS TechController_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.TechController AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.TechDispenser. + /// + /// The mapping view. + private static DbMappingView GetView142() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing TechDispenser + [CodeFirstDatabaseSchema.TechDispenser](T1.TechDispenser_GUID, T1.TechDispenser_CODE, T1.TechDispenser_NAME, T1.TechDispenser_DESCRIPTION, T1.TechDispenser_ID, T1.[TechDispenser.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS TechDispenser_GUID, + T.Code AS TechDispenser_CODE, + T.Name AS TechDispenser_NAME, + T.Description AS TechDispenser_DESCRIPTION, + T.ID AS TechDispenser_ID, + T.LastUpdated AS [TechDispenser.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.TechDispensers AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.TechDispensers. + /// + /// The mapping view. + private static DbMappingView GetView143() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing TechDispensers + [Tango.BL.TechDispenser](T1.TechDispenser_Guid, T1.TechDispenser_Code, T1.TechDispenser_Name, T1.TechDispenser_Description, T1.TechDispenser_ID, T1.TechDispenser_LastUpdated) + FROM ( + SELECT + T.GUID AS TechDispenser_Guid, + T.CODE AS TechDispenser_Code, + T.NAME AS TechDispenser_Name, + T.DESCRIPTION AS TechDispenser_Description, + T.ID AS TechDispenser_ID, + T.LAST_UPDATED AS TechDispenser_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.TechDispenser AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.TechIo. + /// + /// The mapping view. + private static DbMappingView GetView144() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing TechIo + [CodeFirstDatabaseSchema.TechIo](T1.TechIo_GUID, T1.TechIo_PORT, T1.TechIo_TYPE, T1.TechIo_DESIGNATOR, T1.TechIo_ASM, T1.[TechIo.INTERFACE_NAME], T1.TechIo_SENSOR, T1.[TechIo.INIT_VALUE], T1.TechIo_AVERAGING, T1.TechIo_MIN, T1.TechIo_MAX, T1.TechIo_ID, T1.[TechIo.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS TechIo_GUID, + T.Port AS TechIo_PORT, + T.Type AS TechIo_TYPE, + T.Designator AS TechIo_DESIGNATOR, + T.Asm AS TechIo_ASM, + T.InterfaceName AS [TechIo.INTERFACE_NAME], + T.Sensor AS TechIo_SENSOR, + T.InitValue AS [TechIo.INIT_VALUE], + T.Averaging AS TechIo_AVERAGING, + T.Min AS TechIo_MIN, + T.Max AS TechIo_MAX, + T.ID AS TechIo_ID, + T.LastUpdated AS [TechIo.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.TechIos AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.TechIos. + /// + /// The mapping view. + private static DbMappingView GetView145() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing TechIos + [Tango.BL.TechIo](T1.TechIo_Guid, T1.TechIo_Port, T1.TechIo_Type, T1.TechIo_Designator, T1.TechIo_Asm, T1.TechIo_InterfaceName, T1.TechIo_Sensor, T1.TechIo_InitValue, T1.TechIo_Averaging, T1.TechIo_Min, T1.TechIo_Max, T1.TechIo_ID, T1.TechIo_LastUpdated) + FROM ( + SELECT + T.GUID AS TechIo_Guid, + T.PORT AS TechIo_Port, + T.TYPE AS TechIo_Type, + T.DESIGNATOR AS TechIo_Designator, + T.ASM AS TechIo_Asm, + T.INTERFACE_NAME AS TechIo_InterfaceName, + T.SENSOR AS TechIo_Sensor, + T.INIT_VALUE AS TechIo_InitValue, + T.AVERAGING AS TechIo_Averaging, + T.MIN AS TechIo_Min, + T.MAX AS TechIo_Max, + T.ID AS TechIo_ID, + T.LAST_UPDATED AS TechIo_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.TechIo AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.TechMonitor. + /// + /// The mapping view. + private static DbMappingView GetView146() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing TechMonitor + [CodeFirstDatabaseSchema.TechMonitor](T1.TechMonitor_GUID, T1.TechMonitor_CODE, T1.TechMonitor_NAME, T1.TechMonitor_DESCRIPTION, T1.TechMonitor_MIN, T1.TechMonitor_MAX, T1.TechMonitor_UNITS, T1.[TechMonitor.POINTS_PER_FRAME], T1.[TechMonitor.MULTI_CHANNEL], T1.[TechMonitor.CHANNEL_COUNT], T1.TechMonitor_ID, T1.[TechMonitor.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS TechMonitor_GUID, + T.Code AS TechMonitor_CODE, + T.Name AS TechMonitor_NAME, + T.Description AS TechMonitor_DESCRIPTION, + T.Min AS TechMonitor_MIN, + T.Max AS TechMonitor_MAX, + T.Units AS TechMonitor_UNITS, + T.PointsPerFrame AS [TechMonitor.POINTS_PER_FRAME], + T.MultiChannel AS [TechMonitor.MULTI_CHANNEL], + T.ChannelCount AS [TechMonitor.CHANNEL_COUNT], + T.ID AS TechMonitor_ID, + T.LastUpdated AS [TechMonitor.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.TechMonitors AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.TechMonitors. + /// + /// The mapping view. + private static DbMappingView GetView147() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing TechMonitors + [Tango.BL.TechMonitor](T1.TechMonitor_Guid, T1.TechMonitor_Code, T1.TechMonitor_Name, T1.TechMonitor_Description, T1.TechMonitor_Min, T1.TechMonitor_Max, T1.TechMonitor_Units, T1.TechMonitor_PointsPerFrame, T1.TechMonitor_MultiChannel, T1.TechMonitor_ChannelCount, T1.TechMonitor_ID, T1.TechMonitor_LastUpdated) + FROM ( + SELECT + T.GUID AS TechMonitor_Guid, + T.CODE AS TechMonitor_Code, + T.NAME AS TechMonitor_Name, + T.DESCRIPTION AS TechMonitor_Description, + T.MIN AS TechMonitor_Min, + T.MAX AS TechMonitor_Max, + T.UNITS AS TechMonitor_Units, + T.POINTS_PER_FRAME AS TechMonitor_PointsPerFrame, + T.MULTI_CHANNEL AS TechMonitor_MultiChannel, + T.CHANNEL_COUNT AS TechMonitor_ChannelCount, + T.ID AS TechMonitor_ID, + T.LAST_UPDATED AS TechMonitor_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.TechMonitor AS T + ) AS T1"); + } + + /// + /// Gets the view for CodeFirstDatabase.TechValf. + /// + /// The mapping view. + private static DbMappingView GetView148() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing TechValf + [CodeFirstDatabaseSchema.TechValf](T1.TechValf_GUID, T1.TechValf_CODE, T1.TechValf_NAME, T1.TechValf_DESCRIPTION, T1.TechValf_ID, T1.[TechValf.LAST_UPDATED]) + FROM ( + SELECT + T.Guid AS TechValf_GUID, + T.Code AS TechValf_CODE, + T.Name AS TechValf_NAME, + T.Description AS TechValf_DESCRIPTION, + T.ID AS TechValf_ID, + T.LastUpdated AS [TechValf.LAST_UPDATED], + True AS _from0 + FROM ObservablesContext.TechValves AS T + ) AS T1"); + } + + /// + /// Gets the view for ObservablesContext.TechValves. + /// + /// The mapping view. + private static DbMappingView GetView149() + { + return new DbMappingView(@" + SELECT VALUE -- Constructing TechValves + [Tango.BL.TechValf](T1.TechValf_Guid, T1.TechValf_Code, T1.TechValf_Name, T1.TechValf_Description, T1.TechValf_ID, T1.TechValf_LastUpdated) + FROM ( + SELECT + T.GUID AS TechValf_Guid, + T.CODE AS TechValf_Code, + T.NAME AS TechValf_Name, + T.DESCRIPTION AS TechValf_Description, + T.ID AS TechValf_ID, + T.LAST_UPDATED AS TechValf_LastUpdated, + True AS _from0 + FROM CodeFirstDatabase.TechValf AS T + ) AS T1"); + } + } +} diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContextAdapter.cs b/Software/Visual_Studio/Tango.BL/ObservablesContextAdapter.cs new file mode 100644 index 000000000..805afaf67 --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/ObservablesContextAdapter.cs @@ -0,0 +1,188 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using System.Data.Entity; +using System.Collections.ObjectModel; + +namespace Tango.BL +{ + /// + /// Represents an adapter for retrieving aggregated entities. + /// + public class ObservablesContextAdapter : IDisposable + { + private ObservablesContext _db; + /// + /// Gets the underlying . + /// + public ObservablesContext Context + { + get { return _db; } + } + + /// + /// Initializes a new instance of the class. + /// + /// The context. + public ObservablesContextAdapter(ObservablesContext context) + { + _db = context; + } + + /// + /// Creates the a new instance of wrapping a default . + /// + /// + public static ObservablesContextAdapter CreateDefault() + { + var context = ObservablesContext.CreateDefault(); + return new ObservablesContextAdapter(context); + } + + /// + /// Loads the configuration with it's Ids packs. + /// + /// The condition. + /// + public Configuration GetConfiguration(Expression> condition) + { + var config = _db.Configurations.SingleOrDefault(condition); + + config.IdsPacks = _db.IdsPacks.Where(x => x.ConfigurationGuid == config.Guid) + .Include(x => x.LiquidType) + .Include(x => x.DispenserType) + .Include(x => x.CartridgeType) + .Include(x => x.DispenserType) + .Include(x => x.IdsPackFormula).OrderBy(x => x.PackIndex).ToObservableCollection(); + + return config; + } + + /// + /// Gets the hardware version by the specified condition. + /// + /// The condition. + /// + public HardwareVersion GetHardwareVersion(Expression> condition) + { + HardwareVersion version = _db.HardwareVersions.SingleOrDefault(condition); + + version.HardwareBlowers = _db.HardwareBlowers.Where(x => x.HardwareVersionGuid == version.Guid).Include(x => x.HardwareBlowerType).ToList().OrderBy(x => x.HardwareBlowerType.Code).ToObservableCollection(); + version.HardwareBreakSensors = _db.HardwareBreakSensors.Where(x => x.HardwareVersionGuid == version.Guid).Include(x => x.HardwareBreakSensorType).ToList().OrderBy(x => x.HardwareBreakSensorType.Code).ToObservableCollection(); + version.HardwareDancers = _db.HardwareDancers.Where(x => x.HardwareVersionGuid == version.Guid).Include(x => x.HardwareDancerType).ToList().OrderBy(x => x.HardwareDancerType.Code).ToObservableCollection(); + version.HardwareMotors = _db.HardwareMotors.Where(x => x.HardwareVersionGuid == version.Guid).Include(x => x.HardwareMotorType).ToList().OrderBy(x => x.HardwareMotorType.Code).ToObservableCollection(); + version.HardwarePidControls = _db.HardwarePidControls.Where(x => x.HardwareVersionGuid == version.Guid).Include(x => x.HardwarePidControlType).ToList().OrderBy(x => x.HardwarePidControlType.Code).ToObservableCollection(); + version.HardwareSpeedSensors = _db.HardwareSpeedSensors.Where(x => x.HardwareVersionGuid == version.Guid).Include(x => x.HardwareSpeedSensorType).ToList().OrderBy(x => x.HardwareSpeedSensorType.Code).ToObservableCollection(); + version.HardwareWinders = _db.HardwareWinders.Where(x => x.HardwareVersionGuid == version.Guid).Include(x => x.HardwareWinderType).ToList().OrderBy(x => x.HardwareWinderType.Code).ToObservableCollection(); + + return version; + } + + /// + /// Gets the hardware version by machine. + /// + /// The machine unique identifier. + /// + public HardwareVersion GetHardwareVersionByMachine(String machineGuid) + { + var machine = _db.Machines.Where(x => x.Guid == machineGuid).Include(x => x.Configuration).FirstOrDefault(); + return GetHardwareVersion(x => x.Guid == machine.Configuration.HardwareVersionGuid); + } + + /// + /// Gets the active process parameters tables group. + /// + /// The RML unique identifier. + /// + public ProcessParametersTablesGroup GetRmlActiveProcessParametersTablesGroup(String rmlGuid) + { + return _db.ProcessParametersTablesGroups.Where(x => x.RmlGuid == rmlGuid && x.Active).Include(x => x.ProcessParametersTables).FirstOrDefault(); + } + + /// + /// Gets the RML CCTS. + /// + /// The RML unique identifier. + /// + public ObservableCollection GetRmlCCTs(String rmlGuid) + { + return _db.Ccts.Where(x => x.RmlGuid == rmlGuid).ToObservableCollection(); + } + + /// + /// Gets the RML CATS. + /// + /// The RML unique identifier. + /// The machine unique identifier. + /// + public ObservableCollection GetRmlCATs(String rmlGuid, String machineGuid) + { + return _db.Cats.Where(x => x.MachineGuid == machineGuid && x.RmlGuid == rmlGuid).ToObservableCollection(); + } + + /// + /// Gets the RML liquid types factors. + /// + /// The RML unique identifier. + /// + public ObservableCollection GetRmlLiquidTypes(String rmlGuid) + { + return _db.LiquidTypesRmls.Where(x => x.RmlGuid == rmlGuid).ToObservableCollection(); + } + + /// + /// Gets the organization with all it's users addresses and contacts. + /// + /// The organization unique identifier. + /// + public Organization GetOrganizationAndUsers(String organizationGuid) + { + var org = _db.Organizations.SingleOrDefault(x => x.Guid == organizationGuid); + + org.Address = _db.Addresses.SingleOrDefault(x => x.Guid == org.AddressGuid); + org.Contact = _db.Contacts.SingleOrDefault(x => x.Guid == org.ContactGuid); + + _db.Roles.Load(); + _db.Permissions.Load(); + _db.RolesPermissions.Load(); + + + org.Users = _db.Users.Where(x => x.OrganizationGuid == organizationGuid) + .Include(x => x.Address) + .Include(x => x.Contact) + .Include(x => x.UsersRoles).ToObservableCollection(); + + return org; + } + + /// + /// Gets the user with it's address and contact. + /// + /// The user unique identifier. + /// + public User GetUser(String userGuid) + { + _db.Roles.Load(); + _db.Permissions.Load(); + _db.RolesPermissions.Load(); + + return _db.Users.Where(x => x.Guid == userGuid) + .Include(x => x.Address) + .Include(x => x.Contact) + .Include(x => x.UsersRoles) + .FirstOrDefault(); + } + + /// + /// Disposes the underlying . + /// + public void Dispose() + { + _db.Dispose(); + } + } +} diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs b/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs index bff778eec..f387bd1e1 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs @@ -1,13 +1,16 @@ using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Data.Entity; using System.Data.Entity.Infrastructure; using System.Data.SQLite; using System.IO; using System.Linq; +using System.Linq.Expressions; using System.Text; using System.Threading; using System.Threading.Tasks; +using Tango.BL.Entities; using Tango.Core; using Tango.Settings; @@ -16,84 +19,74 @@ namespace Tango.BL public partial class ObservablesContext { private List _pending_notifications = new List(); + private ObservablesContextAdapter _adapter; + + public ObservablesContext() + { + + } /// /// Initializes a new instance of the class. /// /// The server file path. /// if set to true will try to connect to an .mdf file. - public ObservablesContext(String path, String dbName) : base(ComposeConnectionString(path, dbName)) + public ObservablesContext(DataSource dataSource) : base(dataSource.ToConnection(), true) { Database.SetInitializer(null); + Configuration.LazyLoadingEnabled = false; + _adapter = new ObservablesContextAdapter(this); } /// - /// Initializes a new instance of the class. + /// Creates a default remote database context by the address specified in . /// - /// The SQLite connection. - public ObservablesContext(SQLiteConnection sqliteConnection) : base(sqliteConnection, true) + /// + public static ObservablesContext CreateDefault() { - Database.SetInitializer(null); + return new ObservablesContext(SettingsManager.Default.GetOrCreate().DataSource); } /// - /// Composes the connection string. - /// - /// The source. - /// if set to true [is file]. + /// Creates a default remote database context. + /// /// - private static String ComposeConnectionString(String source, String dbName) + public static ObservablesContext CreateDefault(DataSource dataSource) { - if (!File.Exists(source)) - { - return String.Format("Data Source={0};Initial Catalog={1};Integrated Security=True;", source, dbName); - } - else - { - return String.Format("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFileName={0};Initial Catalog={1};Integrated Security=True;MultipleActiveResultSets=True;App=EntityFramework", Path.GetFullPath(source), dbName); - } + return new ObservablesContext(dataSource); } /// - /// Creates a default remote database context by the address specified in . + /// Creates a default remote database context. /// /// - public static ObservablesContext CreateDefault() + public static ObservablesContext CreateDefault(String address, String catalog, DataSourceType type) { - var context = CreateDefault(SettingsManager.Default.GetOrCreate().DataBaseSource); - return context; + return new ObservablesContext(new DataSource() + { + Address = address, + Catalog = catalog, + IntegratedSecurity = true, + Type = type + }); } /// /// Creates a default remote database context. /// /// - public static ObservablesContext CreateDefault(String dataSource) + public static ObservablesContext CreateDefault(String address, DataSourceType type) { - var source = dataSource; - - if (File.Exists(source) && Path.GetExtension(source).ToLower() == ".db") - { - var connection = new SQLiteConnection() - { - ConnectionString = new SQLiteConnectionStringBuilder() { DataSource = Path.GetFullPath(source), ForeignKeys = true }.ConnectionString - }; - - return new ObservablesContext(connection); - } - else - { - return new ObservablesContext(source, "Tango"); - } + return CreateDefault(address, "Tango", type); } /// /// Creates a default remote database context. /// /// - public static ObservablesContext CreateDefault(String address, String database) + public static ObservablesContext CreateDefault(String address) { - return new ObservablesContext(address, database); + return CreateDefault(address, "Tango", DataSourceType.SQLServer); } /// @@ -170,5 +163,13 @@ namespace Tango.BL return base.ShouldValidateEntity(entityEntry); } + + /// + /// Gets an instance of which wraps this instance. + /// + public ObservablesContextAdapter Adapter + { + get { return _adapter; } + } } } diff --git a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapter.cs b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapter.cs index 21f83509d..4fdaf9071 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapter.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesEntitiesAdapter.cs @@ -22,6 +22,7 @@ namespace Tango.BL /// Exposes method for retrieving observable collections of observable entities. /// /// + [Obsolete("ObservablesEntitiesAdapter should not be used. Use ObservablesStaticCollections instead!")] public partial class ObservablesEntitiesAdapter : ExtendedObject { public event Action Initialized; @@ -68,6 +69,7 @@ namespace Tango.BL private ObservablesEntitiesAdapter() { Context = ObservablesContext.CreateDefault(); + Context.Configuration.LazyLoadingEnabled = true; } /// @@ -120,55 +122,16 @@ namespace Tango.BL { _syncLock = new object(); - if (initializing) - { - //Remove Unlinked Configurations.. - List remove_configurations = new List(); - - foreach (var config in Context.Configurations) - { - if (Context.MachineVersions.FirstOrDefault(x => x.DefaultConfigurationGuid == config.Guid) != null) - { - continue; - } - - if (Context.MachinesConfigurations.FirstOrDefault(x => x.ConfigurationGuid == config.Guid) != null) - { - continue; - } - - if (Context.Machines.FirstOrDefault(x => x.ConfigurationGuid == config.Guid) != null) - { - continue; - } - - remove_configurations.Add(config); - } - - foreach (var config in remove_configurations) - { - Context.Configurations.Remove(config); - } - - Context.SaveChanges(); - //Remove Unlinked Configurations.. - } - Organizations = Context.Organizations.ToObservableCollection(); Machines = Context.Machines.ToObservableCollection(); - foreach (var machine in Machines) - { - machine.MachinesConfigurations = machine.MachinesConfigurations.OrderByDescending(x => x.Configuration.CreationDate).Take(30).ToObservableCollection(); - //machine.Jobs = machine.Jobs.OrderByDescending(x => x.CreationDate).ToObservableCollection(); //No need to load jobs. - } - MachinesConfigurations = Context.MachinesConfigurations.ToObservableCollection(); MachineVersions = Context.MachineVersions.ToList().OrderBy(x => x.Version).ToObservableCollection(); Addresses = Context.Addresses.Where(x => !x.Deleted).ToList().OrderBy(x => x.AddressString).ToObservableCollection(); + Contacts = Context.Contacts.Where(x => !x.Deleted).ToList().OrderBy(x => x.FullName).ToObservableCollection(); Roles = Context.Roles.ToList().OrderBy(x => x.Name).ToObservableCollection(); @@ -179,11 +142,6 @@ namespace Tango.BL Users = Context.Users.Where(x => !x.Deleted).ToList().OrderBy(x => x.Contact.FullName).ToObservableCollection(); - //foreach (var user in Users) - //{ - // user.UsersRoles = user.UsersRoles.Where(x => !x.Deleted).ToObservableCollection(); - //} - foreach (var role in Roles) { role.RolesPermissions = role.RolesPermissions.ToObservableCollection(); @@ -318,21 +276,6 @@ namespace Tango.BL { InitCollectionSources(); }); - - //var action = ActionTypes.First(); - - //action.Name = "Action 1 Yesss"; - - //SaveChanges(); - - //BindingOperations.EnableCollectionSynchronization(Machines, _syncLock); - //BindingOperations.EnableCollectionSynchronization(MachinesViewSource, _syncLock); - - //BindingOperations.EnableCollectionSynchronization(MachinesConfigurations, _syncLock); - //BindingOperations.EnableCollectionSynchronization(MachinesConfigurationsViewSource, _syncLock); - - //BindingOperations.EnableCollectionSynchronization(EventTypesActions, _syncLock); - //BindingOperations.EnableCollectionSynchronization(EventTypesActionsViewSource, _syncLock); } catch (Exception ex) { diff --git a/Software/Visual_Studio/Tango.BL/ObservablesStaticCollections.cs b/Software/Visual_Studio/Tango.BL/ObservablesStaticCollections.cs new file mode 100644 index 000000000..4820c784b --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/ObservablesStaticCollections.cs @@ -0,0 +1,128 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using Tango.BL.Entities; +using Tango.Core; +using System.Data.Entity; + +namespace Tango.BL +{ + public partial class ObservablesStaticCollections : ExtendedObject + { + private bool _initialized; + private ObservablesContext db; + + private static ObservablesStaticCollections _instance; + /// + /// Gets the singleton instance. + /// + public static ObservablesStaticCollections Instance + { + get + { + if (_instance == null) + { + _instance = new ObservablesStaticCollections(); + } + return _instance; + } + } + + /// + /// Initializes this instance. + /// + public void Initialize() + { + if (!_initialized) + { + db = ObservablesContext.CreateDefault(); + + WindingMethods = db.WindingMethods.ToObservableCollection(); + ColorSpaces = db.ColorSpaces.ToObservableCollection(); + SpoolTypes = db.SpoolTypes.ToObservableCollection(); + + ActionTypes = db.ActionTypes.ToObservableCollection(); + EventTypes = db.EventTypes.ToObservableCollection(); + EventTypesActions = db.EventTypesActions.ToObservableCollection(); + EventTypesCategories = db.EventTypesCategories.ToObservableCollection(); + EventTypesGroups = db.EventTypesGroups.ToObservableCollection(); + + HardwareBlowerTypes = db.HardwareBlowerTypes.ToObservableCollection(); + HardwareBlowers = db.HardwareBlowers.ToObservableCollection(); + + HardwareBreakSensorTypes = db.HardwareBreakSensorTypes.ToObservableCollection(); + HardwareBreakSensors = db.HardwareBreakSensors.ToObservableCollection(); + + HardwareDancerTypes = db.HardwareDancerTypes.ToObservableCollection(); + HardwareDancers = db.HardwareDancers.ToObservableCollection(); + + HardwareMotorTypes = db.HardwareMotorTypes.ToObservableCollection(); + HardwareMotors = db.HardwareMotors.ToObservableCollection(); + + HardwarePidControlTypes = db.HardwarePidControlTypes.ToObservableCollection(); + HardwarePidControls = db.HardwarePidControls.ToObservableCollection(); + + HardwareSpeedSensorTypes = db.HardwareSpeedSensorTypes.ToObservableCollection(); + HardwareSpeedSensors = db.HardwareSpeedSensors.ToObservableCollection(); + + HardwareWinderTypes = db.HardwareWinderTypes.ToObservableCollection(); + HardwareWinders = db.HardwareWinders.ToObservableCollection(); + + TechControllers = db.TechControllers.ToObservableCollection(); + TechDispensers = db.TechDispensers.ToObservableCollection(); + TechIos = db.TechIos.ToObservableCollection(); + TechMonitors = db.TechMonitors.ToObservableCollection(); + TechValves = db.TechValves.ToObservableCollection(); + + Machines = db.Machines.Include(x => x.Organization).ToObservableCollection(); + + Users = db.Users.Include(x => x.Contact).ToObservableCollection(); + + MachineVersions = db.MachineVersions.ToObservableCollection(); + + + //Load later... + Task.Factory.StartNew(() => + { + LiquidTypes = db.LiquidTypes.ToObservableCollection(); + DispenserTypes = db.DispenserTypes.ToObservableCollection(); + MidTankTypes = db.MidTankTypes.ToObservableCollection(); + CartridgeTypes = db.CartridgeTypes.ToObservableCollection(); + IdsPackFormulas = db.IdsPackFormulas.ToObservableCollection(); + + + Rmls = db.Rmls.ToObservableCollection(); + LiquidTypesRmls = db.LiquidTypesRmls.ToObservableCollection(); + + foreach (var machine in Machines) + { + ObservablesContextAdapter adapter = new ObservablesContextAdapter(db); + + adapter.GetConfiguration(x => x.Guid == machine.ConfigurationGuid); + } + }); + + _initialized = true; + } + + //InitCollectionSources(); + } + + /// + /// Creates a collection view from the specified observable collection. + /// + /// + /// The collection. + /// + private ICollectionView CreateCollectionView(ObservableCollection collection) + { + var view = CollectionViewSource.GetDefaultView(collection); + return view; + } + } +} diff --git a/Software/Visual_Studio/Tango.BL/ObservablesStaticCollectionsExtension.cs b/Software/Visual_Studio/Tango.BL/ObservablesStaticCollectionsExtension.cs new file mode 100644 index 000000000..38db29aab --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/ObservablesStaticCollectionsExtension.cs @@ -0,0 +1,2878 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Tango Observables Generator +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. Do not modify! +// +//------------------------------------------------------------------------------ + +using System.Collections.ObjectModel; +using System.ComponentModel; +using Tango.BL.Entities; + +namespace Tango.BL +{ + public partial class ObservablesStaticCollections + { + + private ObservableCollection _syncconfigurations; + /// + /// Gets or sets the SyncConfigurations. + /// + public ObservableCollection SyncConfigurations + { + get + { + return _syncconfigurations; + } + + set + { + _syncconfigurations = value; RaisePropertyChanged(nameof(SyncConfigurations)); + } + + } + + private ICollectionView _syncconfigurationsViewSource; + /// + /// Gets or sets the SyncConfigurations View Source. + /// + public ICollectionView SyncConfigurationsViewSource + { + get + { + return _syncconfigurationsViewSource; + } + + set + { + _syncconfigurationsViewSource = value; RaisePropertyChanged(nameof(SyncConfigurationsViewSource)); + } + + } + + private ObservableCollection _actiontypes; + /// + /// Gets or sets the ActionTypes. + /// + public ObservableCollection ActionTypes + { + get + { + return _actiontypes; + } + + set + { + _actiontypes = value; RaisePropertyChanged(nameof(ActionTypes)); + } + + } + + private ICollectionView _actiontypesViewSource; + /// + /// Gets or sets the ActionTypes View Source. + /// + public ICollectionView ActionTypesViewSource + { + get + { + return _actiontypesViewSource; + } + + set + { + _actiontypesViewSource = value; RaisePropertyChanged(nameof(ActionTypesViewSource)); + } + + } + + private ObservableCollection
_addresses; + /// + /// Gets or sets the Addresses. + /// + public ObservableCollection
Addresses + { + get + { + return _addresses; + } + + set + { + _addresses = value; RaisePropertyChanged(nameof(Addresses)); + } + + } + + private ICollectionView _addressesViewSource; + /// + /// Gets or sets the Addresses View Source. + /// + public ICollectionView AddressesViewSource + { + get + { + return _addressesViewSource; + } + + set + { + _addressesViewSource = value; RaisePropertyChanged(nameof(AddressesViewSource)); + } + + } + + private ObservableCollection _applicationdisplaypanelversions; + /// + /// Gets or sets the ApplicationDisplayPanelVersions. + /// + public ObservableCollection ApplicationDisplayPanelVersions + { + get + { + return _applicationdisplaypanelversions; + } + + set + { + _applicationdisplaypanelversions = value; RaisePropertyChanged(nameof(ApplicationDisplayPanelVersions)); + } + + } + + private ICollectionView _applicationdisplaypanelversionsViewSource; + /// + /// Gets or sets the ApplicationDisplayPanelVersions View Source. + /// + public ICollectionView ApplicationDisplayPanelVersionsViewSource + { + get + { + return _applicationdisplaypanelversionsViewSource; + } + + set + { + _applicationdisplaypanelversionsViewSource = value; RaisePropertyChanged(nameof(ApplicationDisplayPanelVersionsViewSource)); + } + + } + + private ObservableCollection _applicationfirmwareversions; + /// + /// Gets or sets the ApplicationFirmwareVersions. + /// + public ObservableCollection ApplicationFirmwareVersions + { + get + { + return _applicationfirmwareversions; + } + + set + { + _applicationfirmwareversions = value; RaisePropertyChanged(nameof(ApplicationFirmwareVersions)); + } + + } + + private ICollectionView _applicationfirmwareversionsViewSource; + /// + /// Gets or sets the ApplicationFirmwareVersions View Source. + /// + public ICollectionView ApplicationFirmwareVersionsViewSource + { + get + { + return _applicationfirmwareversionsViewSource; + } + + set + { + _applicationfirmwareversionsViewSource = value; RaisePropertyChanged(nameof(ApplicationFirmwareVersionsViewSource)); + } + + } + + private ObservableCollection _applicationosversions; + /// + /// Gets or sets the ApplicationOsVersions. + /// + public ObservableCollection ApplicationOsVersions + { + get + { + return _applicationosversions; + } + + set + { + _applicationosversions = value; RaisePropertyChanged(nameof(ApplicationOsVersions)); + } + + } + + private ICollectionView _applicationosversionsViewSource; + /// + /// Gets or sets the ApplicationOsVersions View Source. + /// + public ICollectionView ApplicationOsVersionsViewSource + { + get + { + return _applicationosversionsViewSource; + } + + set + { + _applicationosversionsViewSource = value; RaisePropertyChanged(nameof(ApplicationOsVersionsViewSource)); + } + + } + + private ObservableCollection _brushstops; + /// + /// Gets or sets the BrushStops. + /// + public ObservableCollection BrushStops + { + get + { + return _brushstops; + } + + set + { + _brushstops = value; RaisePropertyChanged(nameof(BrushStops)); + } + + } + + private ICollectionView _brushstopsViewSource; + /// + /// Gets or sets the BrushStops View Source. + /// + public ICollectionView BrushStopsViewSource + { + get + { + return _brushstopsViewSource; + } + + set + { + _brushstopsViewSource = value; RaisePropertyChanged(nameof(BrushStopsViewSource)); + } + + } + + private ObservableCollection _cartridgetypes; + /// + /// Gets or sets the CartridgeTypes. + /// + public ObservableCollection CartridgeTypes + { + get + { + return _cartridgetypes; + } + + set + { + _cartridgetypes = value; RaisePropertyChanged(nameof(CartridgeTypes)); + } + + } + + private ICollectionView _cartridgetypesViewSource; + /// + /// Gets or sets the CartridgeTypes View Source. + /// + public ICollectionView CartridgeTypesViewSource + { + get + { + return _cartridgetypesViewSource; + } + + set + { + _cartridgetypesViewSource = value; RaisePropertyChanged(nameof(CartridgeTypesViewSource)); + } + + } + + private ObservableCollection _cats; + /// + /// Gets or sets the Cats. + /// + public ObservableCollection Cats + { + get + { + return _cats; + } + + set + { + _cats = value; RaisePropertyChanged(nameof(Cats)); + } + + } + + private ICollectionView _catsViewSource; + /// + /// Gets or sets the Cats View Source. + /// + public ICollectionView CatsViewSource + { + get + { + return _catsViewSource; + } + + set + { + _catsViewSource = value; RaisePropertyChanged(nameof(CatsViewSource)); + } + + } + + private ObservableCollection _ccts; + /// + /// Gets or sets the Ccts. + /// + public ObservableCollection Ccts + { + get + { + return _ccts; + } + + set + { + _ccts = value; RaisePropertyChanged(nameof(Ccts)); + } + + } + + private ICollectionView _cctsViewSource; + /// + /// Gets or sets the Ccts View Source. + /// + public ICollectionView CctsViewSource + { + get + { + return _cctsViewSource; + } + + set + { + _cctsViewSource = value; RaisePropertyChanged(nameof(CctsViewSource)); + } + + } + + private ObservableCollection _colorcatalogs; + /// + /// Gets or sets the ColorCatalogs. + /// + public ObservableCollection ColorCatalogs + { + get + { + return _colorcatalogs; + } + + set + { + _colorcatalogs = value; RaisePropertyChanged(nameof(ColorCatalogs)); + } + + } + + private ICollectionView _colorcatalogsViewSource; + /// + /// Gets or sets the ColorCatalogs View Source. + /// + public ICollectionView ColorCatalogsViewSource + { + get + { + return _colorcatalogsViewSource; + } + + set + { + _colorcatalogsViewSource = value; RaisePropertyChanged(nameof(ColorCatalogsViewSource)); + } + + } + + private ObservableCollection _colorspaces; + /// + /// Gets or sets the ColorSpaces. + /// + public ObservableCollection ColorSpaces + { + get + { + return _colorspaces; + } + + set + { + _colorspaces = value; RaisePropertyChanged(nameof(ColorSpaces)); + } + + } + + private ICollectionView _colorspacesViewSource; + /// + /// Gets or sets the ColorSpaces View Source. + /// + public ICollectionView ColorSpacesViewSource + { + get + { + return _colorspacesViewSource; + } + + set + { + _colorspacesViewSource = value; RaisePropertyChanged(nameof(ColorSpacesViewSource)); + } + + } + + private ObservableCollection _configurations; + /// + /// Gets or sets the Configurations. + /// + public ObservableCollection Configurations + { + get + { + return _configurations; + } + + set + { + _configurations = value; RaisePropertyChanged(nameof(Configurations)); + } + + } + + private ICollectionView _configurationsViewSource; + /// + /// Gets or sets the Configurations View Source. + /// + public ICollectionView ConfigurationsViewSource + { + get + { + return _configurationsViewSource; + } + + set + { + _configurationsViewSource = value; RaisePropertyChanged(nameof(ConfigurationsViewSource)); + } + + } + + private ObservableCollection _contacts; + /// + /// Gets or sets the Contacts. + /// + public ObservableCollection Contacts + { + get + { + return _contacts; + } + + set + { + _contacts = value; RaisePropertyChanged(nameof(Contacts)); + } + + } + + private ICollectionView _contactsViewSource; + /// + /// Gets or sets the Contacts View Source. + /// + public ICollectionView ContactsViewSource + { + get + { + return _contactsViewSource; + } + + set + { + _contactsViewSource = value; RaisePropertyChanged(nameof(ContactsViewSource)); + } + + } + + private ObservableCollection _customers; + /// + /// Gets or sets the Customers. + /// + public ObservableCollection Customers + { + get + { + return _customers; + } + + set + { + _customers = value; RaisePropertyChanged(nameof(Customers)); + } + + } + + private ICollectionView _customersViewSource; + /// + /// Gets or sets the Customers View Source. + /// + public ICollectionView CustomersViewSource + { + get + { + return _customersViewSource; + } + + set + { + _customersViewSource = value; RaisePropertyChanged(nameof(CustomersViewSource)); + } + + } + + private ObservableCollection _dispensertypes; + /// + /// Gets or sets the DispenserTypes. + /// + public ObservableCollection DispenserTypes + { + get + { + return _dispensertypes; + } + + set + { + _dispensertypes = value; RaisePropertyChanged(nameof(DispenserTypes)); + } + + } + + private ICollectionView _dispensertypesViewSource; + /// + /// Gets or sets the DispenserTypes View Source. + /// + public ICollectionView DispenserTypesViewSource + { + get + { + return _dispensertypesViewSource; + } + + set + { + _dispensertypesViewSource = value; RaisePropertyChanged(nameof(DispenserTypesViewSource)); + } + + } + + private ObservableCollection _embeddedfirmwareversions; + /// + /// Gets or sets the EmbeddedFirmwareVersions. + /// + public ObservableCollection EmbeddedFirmwareVersions + { + get + { + return _embeddedfirmwareversions; + } + + set + { + _embeddedfirmwareversions = value; RaisePropertyChanged(nameof(EmbeddedFirmwareVersions)); + } + + } + + private ICollectionView _embeddedfirmwareversionsViewSource; + /// + /// Gets or sets the EmbeddedFirmwareVersions View Source. + /// + public ICollectionView EmbeddedFirmwareVersionsViewSource + { + get + { + return _embeddedfirmwareversionsViewSource; + } + + set + { + _embeddedfirmwareversionsViewSource = value; RaisePropertyChanged(nameof(EmbeddedFirmwareVersionsViewSource)); + } + + } + + private ObservableCollection _eventtypes; + /// + /// Gets or sets the EventTypes. + /// + public ObservableCollection EventTypes + { + get + { + return _eventtypes; + } + + set + { + _eventtypes = value; RaisePropertyChanged(nameof(EventTypes)); + } + + } + + private ICollectionView _eventtypesViewSource; + /// + /// Gets or sets the EventTypes View Source. + /// + public ICollectionView EventTypesViewSource + { + get + { + return _eventtypesViewSource; + } + + set + { + _eventtypesViewSource = value; RaisePropertyChanged(nameof(EventTypesViewSource)); + } + + } + + private ObservableCollection _eventtypesactions; + /// + /// Gets or sets the EventTypesActions. + /// + public ObservableCollection EventTypesActions + { + get + { + return _eventtypesactions; + } + + set + { + _eventtypesactions = value; RaisePropertyChanged(nameof(EventTypesActions)); + } + + } + + private ICollectionView _eventtypesactionsViewSource; + /// + /// Gets or sets the EventTypesActions View Source. + /// + public ICollectionView EventTypesActionsViewSource + { + get + { + return _eventtypesactionsViewSource; + } + + set + { + _eventtypesactionsViewSource = value; RaisePropertyChanged(nameof(EventTypesActionsViewSource)); + } + + } + + private ObservableCollection _eventtypescategories; + /// + /// Gets or sets the EventTypesCategories. + /// + public ObservableCollection EventTypesCategories + { + get + { + return _eventtypescategories; + } + + set + { + _eventtypescategories = value; RaisePropertyChanged(nameof(EventTypesCategories)); + } + + } + + private ICollectionView _eventtypescategoriesViewSource; + /// + /// Gets or sets the EventTypesCategories View Source. + /// + public ICollectionView EventTypesCategoriesViewSource + { + get + { + return _eventtypescategoriesViewSource; + } + + set + { + _eventtypescategoriesViewSource = value; RaisePropertyChanged(nameof(EventTypesCategoriesViewSource)); + } + + } + + private ObservableCollection _eventtypesgroups; + /// + /// Gets or sets the EventTypesGroups. + /// + public ObservableCollection EventTypesGroups + { + get + { + return _eventtypesgroups; + } + + set + { + _eventtypesgroups = value; RaisePropertyChanged(nameof(EventTypesGroups)); + } + + } + + private ICollectionView _eventtypesgroupsViewSource; + /// + /// Gets or sets the EventTypesGroups View Source. + /// + public ICollectionView EventTypesGroupsViewSource + { + get + { + return _eventtypesgroupsViewSource; + } + + set + { + _eventtypesgroupsViewSource = value; RaisePropertyChanged(nameof(EventTypesGroupsViewSource)); + } + + } + + private ObservableCollection _fibershapes; + /// + /// Gets or sets the FiberShapes. + /// + public ObservableCollection FiberShapes + { + get + { + return _fibershapes; + } + + set + { + _fibershapes = value; RaisePropertyChanged(nameof(FiberShapes)); + } + + } + + private ICollectionView _fibershapesViewSource; + /// + /// Gets or sets the FiberShapes View Source. + /// + public ICollectionView FiberShapesViewSource + { + get + { + return _fibershapesViewSource; + } + + set + { + _fibershapesViewSource = value; RaisePropertyChanged(nameof(FiberShapesViewSource)); + } + + } + + private ObservableCollection _fibersynths; + /// + /// Gets or sets the FiberSynths. + /// + public ObservableCollection FiberSynths + { + get + { + return _fibersynths; + } + + set + { + _fibersynths = value; RaisePropertyChanged(nameof(FiberSynths)); + } + + } + + private ICollectionView _fibersynthsViewSource; + /// + /// Gets or sets the FiberSynths View Source. + /// + public ICollectionView FiberSynthsViewSource + { + get + { + return _fibersynthsViewSource; + } + + set + { + _fibersynthsViewSource = value; RaisePropertyChanged(nameof(FiberSynthsViewSource)); + } + + } + + private ObservableCollection _hardwareblowertypes; + /// + /// Gets or sets the HardwareBlowerTypes. + /// + public ObservableCollection HardwareBlowerTypes + { + get + { + return _hardwareblowertypes; + } + + set + { + _hardwareblowertypes = value; RaisePropertyChanged(nameof(HardwareBlowerTypes)); + } + + } + + private ICollectionView _hardwareblowertypesViewSource; + /// + /// Gets or sets the HardwareBlowerTypes View Source. + /// + public ICollectionView HardwareBlowerTypesViewSource + { + get + { + return _hardwareblowertypesViewSource; + } + + set + { + _hardwareblowertypesViewSource = value; RaisePropertyChanged(nameof(HardwareBlowerTypesViewSource)); + } + + } + + private ObservableCollection _hardwareblowers; + /// + /// Gets or sets the HardwareBlowers. + /// + public ObservableCollection HardwareBlowers + { + get + { + return _hardwareblowers; + } + + set + { + _hardwareblowers = value; RaisePropertyChanged(nameof(HardwareBlowers)); + } + + } + + private ICollectionView _hardwareblowersViewSource; + /// + /// Gets or sets the HardwareBlowers View Source. + /// + public ICollectionView HardwareBlowersViewSource + { + get + { + return _hardwareblowersViewSource; + } + + set + { + _hardwareblowersViewSource = value; RaisePropertyChanged(nameof(HardwareBlowersViewSource)); + } + + } + + private ObservableCollection _hardwarebreaksensortypes; + /// + /// Gets or sets the HardwareBreakSensorTypes. + /// + public ObservableCollection HardwareBreakSensorTypes + { + get + { + return _hardwarebreaksensortypes; + } + + set + { + _hardwarebreaksensortypes = value; RaisePropertyChanged(nameof(HardwareBreakSensorTypes)); + } + + } + + private ICollectionView _hardwarebreaksensortypesViewSource; + /// + /// Gets or sets the HardwareBreakSensorTypes View Source. + /// + public ICollectionView HardwareBreakSensorTypesViewSource + { + get + { + return _hardwarebreaksensortypesViewSource; + } + + set + { + _hardwarebreaksensortypesViewSource = value; RaisePropertyChanged(nameof(HardwareBreakSensorTypesViewSource)); + } + + } + + private ObservableCollection _hardwarebreaksensors; + /// + /// Gets or sets the HardwareBreakSensors. + /// + public ObservableCollection HardwareBreakSensors + { + get + { + return _hardwarebreaksensors; + } + + set + { + _hardwarebreaksensors = value; RaisePropertyChanged(nameof(HardwareBreakSensors)); + } + + } + + private ICollectionView _hardwarebreaksensorsViewSource; + /// + /// Gets or sets the HardwareBreakSensors View Source. + /// + public ICollectionView HardwareBreakSensorsViewSource + { + get + { + return _hardwarebreaksensorsViewSource; + } + + set + { + _hardwarebreaksensorsViewSource = value; RaisePropertyChanged(nameof(HardwareBreakSensorsViewSource)); + } + + } + + private ObservableCollection _hardwaredancertypes; + /// + /// Gets or sets the HardwareDancerTypes. + /// + public ObservableCollection HardwareDancerTypes + { + get + { + return _hardwaredancertypes; + } + + set + { + _hardwaredancertypes = value; RaisePropertyChanged(nameof(HardwareDancerTypes)); + } + + } + + private ICollectionView _hardwaredancertypesViewSource; + /// + /// Gets or sets the HardwareDancerTypes View Source. + /// + public ICollectionView HardwareDancerTypesViewSource + { + get + { + return _hardwaredancertypesViewSource; + } + + set + { + _hardwaredancertypesViewSource = value; RaisePropertyChanged(nameof(HardwareDancerTypesViewSource)); + } + + } + + private ObservableCollection _hardwaredancers; + /// + /// Gets or sets the HardwareDancers. + /// + public ObservableCollection HardwareDancers + { + get + { + return _hardwaredancers; + } + + set + { + _hardwaredancers = value; RaisePropertyChanged(nameof(HardwareDancers)); + } + + } + + private ICollectionView _hardwaredancersViewSource; + /// + /// Gets or sets the HardwareDancers View Source. + /// + public ICollectionView HardwareDancersViewSource + { + get + { + return _hardwaredancersViewSource; + } + + set + { + _hardwaredancersViewSource = value; RaisePropertyChanged(nameof(HardwareDancersViewSource)); + } + + } + + private ObservableCollection _hardwaremotortypes; + /// + /// Gets or sets the HardwareMotorTypes. + /// + public ObservableCollection HardwareMotorTypes + { + get + { + return _hardwaremotortypes; + } + + set + { + _hardwaremotortypes = value; RaisePropertyChanged(nameof(HardwareMotorTypes)); + } + + } + + private ICollectionView _hardwaremotortypesViewSource; + /// + /// Gets or sets the HardwareMotorTypes View Source. + /// + public ICollectionView HardwareMotorTypesViewSource + { + get + { + return _hardwaremotortypesViewSource; + } + + set + { + _hardwaremotortypesViewSource = value; RaisePropertyChanged(nameof(HardwareMotorTypesViewSource)); + } + + } + + private ObservableCollection _hardwaremotors; + /// + /// Gets or sets the HardwareMotors. + /// + public ObservableCollection HardwareMotors + { + get + { + return _hardwaremotors; + } + + set + { + _hardwaremotors = value; RaisePropertyChanged(nameof(HardwareMotors)); + } + + } + + private ICollectionView _hardwaremotorsViewSource; + /// + /// Gets or sets the HardwareMotors View Source. + /// + public ICollectionView HardwareMotorsViewSource + { + get + { + return _hardwaremotorsViewSource; + } + + set + { + _hardwaremotorsViewSource = value; RaisePropertyChanged(nameof(HardwareMotorsViewSource)); + } + + } + + private ObservableCollection _hardwarepidcontroltypes; + /// + /// Gets or sets the HardwarePidControlTypes. + /// + public ObservableCollection HardwarePidControlTypes + { + get + { + return _hardwarepidcontroltypes; + } + + set + { + _hardwarepidcontroltypes = value; RaisePropertyChanged(nameof(HardwarePidControlTypes)); + } + + } + + private ICollectionView _hardwarepidcontroltypesViewSource; + /// + /// Gets or sets the HardwarePidControlTypes View Source. + /// + public ICollectionView HardwarePidControlTypesViewSource + { + get + { + return _hardwarepidcontroltypesViewSource; + } + + set + { + _hardwarepidcontroltypesViewSource = value; RaisePropertyChanged(nameof(HardwarePidControlTypesViewSource)); + } + + } + + private ObservableCollection _hardwarepidcontrols; + /// + /// Gets or sets the HardwarePidControls. + /// + public ObservableCollection HardwarePidControls + { + get + { + return _hardwarepidcontrols; + } + + set + { + _hardwarepidcontrols = value; RaisePropertyChanged(nameof(HardwarePidControls)); + } + + } + + private ICollectionView _hardwarepidcontrolsViewSource; + /// + /// Gets or sets the HardwarePidControls View Source. + /// + public ICollectionView HardwarePidControlsViewSource + { + get + { + return _hardwarepidcontrolsViewSource; + } + + set + { + _hardwarepidcontrolsViewSource = value; RaisePropertyChanged(nameof(HardwarePidControlsViewSource)); + } + + } + + private ObservableCollection _hardwarespeedsensortypes; + /// + /// Gets or sets the HardwareSpeedSensorTypes. + /// + public ObservableCollection HardwareSpeedSensorTypes + { + get + { + return _hardwarespeedsensortypes; + } + + set + { + _hardwarespeedsensortypes = value; RaisePropertyChanged(nameof(HardwareSpeedSensorTypes)); + } + + } + + private ICollectionView _hardwarespeedsensortypesViewSource; + /// + /// Gets or sets the HardwareSpeedSensorTypes View Source. + /// + public ICollectionView HardwareSpeedSensorTypesViewSource + { + get + { + return _hardwarespeedsensortypesViewSource; + } + + set + { + _hardwarespeedsensortypesViewSource = value; RaisePropertyChanged(nameof(HardwareSpeedSensorTypesViewSource)); + } + + } + + private ObservableCollection _hardwarespeedsensors; + /// + /// Gets or sets the HardwareSpeedSensors. + /// + public ObservableCollection HardwareSpeedSensors + { + get + { + return _hardwarespeedsensors; + } + + set + { + _hardwarespeedsensors = value; RaisePropertyChanged(nameof(HardwareSpeedSensors)); + } + + } + + private ICollectionView _hardwarespeedsensorsViewSource; + /// + /// Gets or sets the HardwareSpeedSensors View Source. + /// + public ICollectionView HardwareSpeedSensorsViewSource + { + get + { + return _hardwarespeedsensorsViewSource; + } + + set + { + _hardwarespeedsensorsViewSource = value; RaisePropertyChanged(nameof(HardwareSpeedSensorsViewSource)); + } + + } + + private ObservableCollection _hardwareversions; + /// + /// Gets or sets the HardwareVersions. + /// + public ObservableCollection HardwareVersions + { + get + { + return _hardwareversions; + } + + set + { + _hardwareversions = value; RaisePropertyChanged(nameof(HardwareVersions)); + } + + } + + private ICollectionView _hardwareversionsViewSource; + /// + /// Gets or sets the HardwareVersions View Source. + /// + public ICollectionView HardwareVersionsViewSource + { + get + { + return _hardwareversionsViewSource; + } + + set + { + _hardwareversionsViewSource = value; RaisePropertyChanged(nameof(HardwareVersionsViewSource)); + } + + } + + private ObservableCollection _hardwarewindertypes; + /// + /// Gets or sets the HardwareWinderTypes. + /// + public ObservableCollection HardwareWinderTypes + { + get + { + return _hardwarewindertypes; + } + + set + { + _hardwarewindertypes = value; RaisePropertyChanged(nameof(HardwareWinderTypes)); + } + + } + + private ICollectionView _hardwarewindertypesViewSource; + /// + /// Gets or sets the HardwareWinderTypes View Source. + /// + public ICollectionView HardwareWinderTypesViewSource + { + get + { + return _hardwarewindertypesViewSource; + } + + set + { + _hardwarewindertypesViewSource = value; RaisePropertyChanged(nameof(HardwareWinderTypesViewSource)); + } + + } + + private ObservableCollection _hardwarewinders; + /// + /// Gets or sets the HardwareWinders. + /// + public ObservableCollection HardwareWinders + { + get + { + return _hardwarewinders; + } + + set + { + _hardwarewinders = value; RaisePropertyChanged(nameof(HardwareWinders)); + } + + } + + private ICollectionView _hardwarewindersViewSource; + /// + /// Gets or sets the HardwareWinders View Source. + /// + public ICollectionView HardwareWindersViewSource + { + get + { + return _hardwarewindersViewSource; + } + + set + { + _hardwarewindersViewSource = value; RaisePropertyChanged(nameof(HardwareWindersViewSource)); + } + + } + + private ObservableCollection _htmlpages; + /// + /// Gets or sets the HtmlPages. + /// + public ObservableCollection HtmlPages + { + get + { + return _htmlpages; + } + + set + { + _htmlpages = value; RaisePropertyChanged(nameof(HtmlPages)); + } + + } + + private ICollectionView _htmlpagesViewSource; + /// + /// Gets or sets the HtmlPages View Source. + /// + public ICollectionView HtmlPagesViewSource + { + get + { + return _htmlpagesViewSource; + } + + set + { + _htmlpagesViewSource = value; RaisePropertyChanged(nameof(HtmlPagesViewSource)); + } + + } + + private ObservableCollection _idspackformulas; + /// + /// Gets or sets the IdsPackFormulas. + /// + public ObservableCollection IdsPackFormulas + { + get + { + return _idspackformulas; + } + + set + { + _idspackformulas = value; RaisePropertyChanged(nameof(IdsPackFormulas)); + } + + } + + private ICollectionView _idspackformulasViewSource; + /// + /// Gets or sets the IdsPackFormulas View Source. + /// + public ICollectionView IdsPackFormulasViewSource + { + get + { + return _idspackformulasViewSource; + } + + set + { + _idspackformulasViewSource = value; RaisePropertyChanged(nameof(IdsPackFormulasViewSource)); + } + + } + + private ObservableCollection _idspacks; + /// + /// Gets or sets the IdsPacks. + /// + public ObservableCollection IdsPacks + { + get + { + return _idspacks; + } + + set + { + _idspacks = value; RaisePropertyChanged(nameof(IdsPacks)); + } + + } + + private ICollectionView _idspacksViewSource; + /// + /// Gets or sets the IdsPacks View Source. + /// + public ICollectionView IdsPacksViewSource + { + get + { + return _idspacksViewSource; + } + + set + { + _idspacksViewSource = value; RaisePropertyChanged(nameof(IdsPacksViewSource)); + } + + } + + private ObservableCollection _jobruns; + /// + /// Gets or sets the JobRuns. + /// + public ObservableCollection JobRuns + { + get + { + return _jobruns; + } + + set + { + _jobruns = value; RaisePropertyChanged(nameof(JobRuns)); + } + + } + + private ICollectionView _jobrunsViewSource; + /// + /// Gets or sets the JobRuns View Source. + /// + public ICollectionView JobRunsViewSource + { + get + { + return _jobrunsViewSource; + } + + set + { + _jobrunsViewSource = value; RaisePropertyChanged(nameof(JobRunsViewSource)); + } + + } + + private ObservableCollection _jobs; + /// + /// Gets or sets the Jobs. + /// + public ObservableCollection Jobs + { + get + { + return _jobs; + } + + set + { + _jobs = value; RaisePropertyChanged(nameof(Jobs)); + } + + } + + private ICollectionView _jobsViewSource; + /// + /// Gets or sets the Jobs View Source. + /// + public ICollectionView JobsViewSource + { + get + { + return _jobsViewSource; + } + + set + { + _jobsViewSource = value; RaisePropertyChanged(nameof(JobsViewSource)); + } + + } + + private ObservableCollection _linearmassdensityunits; + /// + /// Gets or sets the LinearMassDensityUnits. + /// + public ObservableCollection LinearMassDensityUnits + { + get + { + return _linearmassdensityunits; + } + + set + { + _linearmassdensityunits = value; RaisePropertyChanged(nameof(LinearMassDensityUnits)); + } + + } + + private ICollectionView _linearmassdensityunitsViewSource; + /// + /// Gets or sets the LinearMassDensityUnits View Source. + /// + public ICollectionView LinearMassDensityUnitsViewSource + { + get + { + return _linearmassdensityunitsViewSource; + } + + set + { + _linearmassdensityunitsViewSource = value; RaisePropertyChanged(nameof(LinearMassDensityUnitsViewSource)); + } + + } + + private ObservableCollection _liquidtypes; + /// + /// Gets or sets the LiquidTypes. + /// + public ObservableCollection LiquidTypes + { + get + { + return _liquidtypes; + } + + set + { + _liquidtypes = value; RaisePropertyChanged(nameof(LiquidTypes)); + } + + } + + private ICollectionView _liquidtypesViewSource; + /// + /// Gets or sets the LiquidTypes View Source. + /// + public ICollectionView LiquidTypesViewSource + { + get + { + return _liquidtypesViewSource; + } + + set + { + _liquidtypesViewSource = value; RaisePropertyChanged(nameof(LiquidTypesViewSource)); + } + + } + + private ObservableCollection _liquidtypesrmls; + /// + /// Gets or sets the LiquidTypesRmls. + /// + public ObservableCollection LiquidTypesRmls + { + get + { + return _liquidtypesrmls; + } + + set + { + _liquidtypesrmls = value; RaisePropertyChanged(nameof(LiquidTypesRmls)); + } + + } + + private ICollectionView _liquidtypesrmlsViewSource; + /// + /// Gets or sets the LiquidTypesRmls View Source. + /// + public ICollectionView LiquidTypesRmlsViewSource + { + get + { + return _liquidtypesrmlsViewSource; + } + + set + { + _liquidtypesrmlsViewSource = value; RaisePropertyChanged(nameof(LiquidTypesRmlsViewSource)); + } + + } + + private ObservableCollection _machinestudioversions; + /// + /// Gets or sets the MachineStudioVersions. + /// + public ObservableCollection MachineStudioVersions + { + get + { + return _machinestudioversions; + } + + set + { + _machinestudioversions = value; RaisePropertyChanged(nameof(MachineStudioVersions)); + } + + } + + private ICollectionView _machinestudioversionsViewSource; + /// + /// Gets or sets the MachineStudioVersions View Source. + /// + public ICollectionView MachineStudioVersionsViewSource + { + get + { + return _machinestudioversionsViewSource; + } + + set + { + _machinestudioversionsViewSource = value; RaisePropertyChanged(nameof(MachineStudioVersionsViewSource)); + } + + } + + private ObservableCollection _machineversions; + /// + /// Gets or sets the MachineVersions. + /// + public ObservableCollection MachineVersions + { + get + { + return _machineversions; + } + + set + { + _machineversions = value; RaisePropertyChanged(nameof(MachineVersions)); + } + + } + + private ICollectionView _machineversionsViewSource; + /// + /// Gets or sets the MachineVersions View Source. + /// + public ICollectionView MachineVersionsViewSource + { + get + { + return _machineversionsViewSource; + } + + set + { + _machineversionsViewSource = value; RaisePropertyChanged(nameof(MachineVersionsViewSource)); + } + + } + + private ObservableCollection _machines; + /// + /// Gets or sets the Machines. + /// + public ObservableCollection Machines + { + get + { + return _machines; + } + + set + { + _machines = value; RaisePropertyChanged(nameof(Machines)); + } + + } + + private ICollectionView _machinesViewSource; + /// + /// Gets or sets the Machines View Source. + /// + public ICollectionView MachinesViewSource + { + get + { + return _machinesViewSource; + } + + set + { + _machinesViewSource = value; RaisePropertyChanged(nameof(MachinesViewSource)); + } + + } + + private ObservableCollection _machinesconfigurations; + /// + /// Gets or sets the MachinesConfigurations. + /// + public ObservableCollection MachinesConfigurations + { + get + { + return _machinesconfigurations; + } + + set + { + _machinesconfigurations = value; RaisePropertyChanged(nameof(MachinesConfigurations)); + } + + } + + private ICollectionView _machinesconfigurationsViewSource; + /// + /// Gets or sets the MachinesConfigurations View Source. + /// + public ICollectionView MachinesConfigurationsViewSource + { + get + { + return _machinesconfigurationsViewSource; + } + + set + { + _machinesconfigurationsViewSource = value; RaisePropertyChanged(nameof(MachinesConfigurationsViewSource)); + } + + } + + private ObservableCollection _machinesevents; + /// + /// Gets or sets the MachinesEvents. + /// + public ObservableCollection MachinesEvents + { + get + { + return _machinesevents; + } + + set + { + _machinesevents = value; RaisePropertyChanged(nameof(MachinesEvents)); + } + + } + + private ICollectionView _machineseventsViewSource; + /// + /// Gets or sets the MachinesEvents View Source. + /// + public ICollectionView MachinesEventsViewSource + { + get + { + return _machineseventsViewSource; + } + + set + { + _machineseventsViewSource = value; RaisePropertyChanged(nameof(MachinesEventsViewSource)); + } + + } + + private ObservableCollection _mediacolors; + /// + /// Gets or sets the MediaColors. + /// + public ObservableCollection MediaColors + { + get + { + return _mediacolors; + } + + set + { + _mediacolors = value; RaisePropertyChanged(nameof(MediaColors)); + } + + } + + private ICollectionView _mediacolorsViewSource; + /// + /// Gets or sets the MediaColors View Source. + /// + public ICollectionView MediaColorsViewSource + { + get + { + return _mediacolorsViewSource; + } + + set + { + _mediacolorsViewSource = value; RaisePropertyChanged(nameof(MediaColorsViewSource)); + } + + } + + private ObservableCollection _mediaconditions; + /// + /// Gets or sets the MediaConditions. + /// + public ObservableCollection MediaConditions + { + get + { + return _mediaconditions; + } + + set + { + _mediaconditions = value; RaisePropertyChanged(nameof(MediaConditions)); + } + + } + + private ICollectionView _mediaconditionsViewSource; + /// + /// Gets or sets the MediaConditions View Source. + /// + public ICollectionView MediaConditionsViewSource + { + get + { + return _mediaconditionsViewSource; + } + + set + { + _mediaconditionsViewSource = value; RaisePropertyChanged(nameof(MediaConditionsViewSource)); + } + + } + + private ObservableCollection _mediamaterials; + /// + /// Gets or sets the MediaMaterials. + /// + public ObservableCollection MediaMaterials + { + get + { + return _mediamaterials; + } + + set + { + _mediamaterials = value; RaisePropertyChanged(nameof(MediaMaterials)); + } + + } + + private ICollectionView _mediamaterialsViewSource; + /// + /// Gets or sets the MediaMaterials View Source. + /// + public ICollectionView MediaMaterialsViewSource + { + get + { + return _mediamaterialsViewSource; + } + + set + { + _mediamaterialsViewSource = value; RaisePropertyChanged(nameof(MediaMaterialsViewSource)); + } + + } + + private ObservableCollection _mediapurposes; + /// + /// Gets or sets the MediaPurposes. + /// + public ObservableCollection MediaPurposes + { + get + { + return _mediapurposes; + } + + set + { + _mediapurposes = value; RaisePropertyChanged(nameof(MediaPurposes)); + } + + } + + private ICollectionView _mediapurposesViewSource; + /// + /// Gets or sets the MediaPurposes View Source. + /// + public ICollectionView MediaPurposesViewSource + { + get + { + return _mediapurposesViewSource; + } + + set + { + _mediapurposesViewSource = value; RaisePropertyChanged(nameof(MediaPurposesViewSource)); + } + + } + + private ObservableCollection _midtanktypes; + /// + /// Gets or sets the MidTankTypes. + /// + public ObservableCollection MidTankTypes + { + get + { + return _midtanktypes; + } + + set + { + _midtanktypes = value; RaisePropertyChanged(nameof(MidTankTypes)); + } + + } + + private ICollectionView _midtanktypesViewSource; + /// + /// Gets or sets the MidTankTypes View Source. + /// + public ICollectionView MidTankTypesViewSource + { + get + { + return _midtanktypesViewSource; + } + + set + { + _midtanktypesViewSource = value; RaisePropertyChanged(nameof(MidTankTypesViewSource)); + } + + } + + private ObservableCollection _organizations; + /// + /// Gets or sets the Organizations. + /// + public ObservableCollection Organizations + { + get + { + return _organizations; + } + + set + { + _organizations = value; RaisePropertyChanged(nameof(Organizations)); + } + + } + + private ICollectionView _organizationsViewSource; + /// + /// Gets or sets the Organizations View Source. + /// + public ICollectionView OrganizationsViewSource + { + get + { + return _organizationsViewSource; + } + + set + { + _organizationsViewSource = value; RaisePropertyChanged(nameof(OrganizationsViewSource)); + } + + } + + private ObservableCollection _permissions; + /// + /// Gets or sets the Permissions. + /// + public ObservableCollection Permissions + { + get + { + return _permissions; + } + + set + { + _permissions = value; RaisePropertyChanged(nameof(Permissions)); + } + + } + + private ICollectionView _permissionsViewSource; + /// + /// Gets or sets the Permissions View Source. + /// + public ICollectionView PermissionsViewSource + { + get + { + return _permissionsViewSource; + } + + set + { + _permissionsViewSource = value; RaisePropertyChanged(nameof(PermissionsViewSource)); + } + + } + + private ObservableCollection _processparameterstables; + /// + /// Gets or sets the ProcessParametersTables. + /// + public ObservableCollection ProcessParametersTables + { + get + { + return _processparameterstables; + } + + set + { + _processparameterstables = value; RaisePropertyChanged(nameof(ProcessParametersTables)); + } + + } + + private ICollectionView _processparameterstablesViewSource; + /// + /// Gets or sets the ProcessParametersTables View Source. + /// + public ICollectionView ProcessParametersTablesViewSource + { + get + { + return _processparameterstablesViewSource; + } + + set + { + _processparameterstablesViewSource = value; RaisePropertyChanged(nameof(ProcessParametersTablesViewSource)); + } + + } + + private ObservableCollection _processparameterstablesgroups; + /// + /// Gets or sets the ProcessParametersTablesGroups. + /// + public ObservableCollection ProcessParametersTablesGroups + { + get + { + return _processparameterstablesgroups; + } + + set + { + _processparameterstablesgroups = value; RaisePropertyChanged(nameof(ProcessParametersTablesGroups)); + } + + } + + private ICollectionView _processparameterstablesgroupsViewSource; + /// + /// Gets or sets the ProcessParametersTablesGroups View Source. + /// + public ICollectionView ProcessParametersTablesGroupsViewSource + { + get + { + return _processparameterstablesgroupsViewSource; + } + + set + { + _processparameterstablesgroupsViewSource = value; RaisePropertyChanged(nameof(ProcessParametersTablesGroupsViewSource)); + } + + } + + private ObservableCollection _rmls; + /// + /// Gets or sets the Rmls. + /// + public ObservableCollection Rmls + { + get + { + return _rmls; + } + + set + { + _rmls = value; RaisePropertyChanged(nameof(Rmls)); + } + + } + + private ICollectionView _rmlsViewSource; + /// + /// Gets or sets the Rmls View Source. + /// + public ICollectionView RmlsViewSource + { + get + { + return _rmlsViewSource; + } + + set + { + _rmlsViewSource = value; RaisePropertyChanged(nameof(RmlsViewSource)); + } + + } + + private ObservableCollection _roles; + /// + /// Gets or sets the Roles. + /// + public ObservableCollection Roles + { + get + { + return _roles; + } + + set + { + _roles = value; RaisePropertyChanged(nameof(Roles)); + } + + } + + private ICollectionView _rolesViewSource; + /// + /// Gets or sets the Roles View Source. + /// + public ICollectionView RolesViewSource + { + get + { + return _rolesViewSource; + } + + set + { + _rolesViewSource = value; RaisePropertyChanged(nameof(RolesViewSource)); + } + + } + + private ObservableCollection _rolespermissions; + /// + /// Gets or sets the RolesPermissions. + /// + public ObservableCollection RolesPermissions + { + get + { + return _rolespermissions; + } + + set + { + _rolespermissions = value; RaisePropertyChanged(nameof(RolesPermissions)); + } + + } + + private ICollectionView _rolespermissionsViewSource; + /// + /// Gets or sets the RolesPermissions View Source. + /// + public ICollectionView RolesPermissionsViewSource + { + get + { + return _rolespermissionsViewSource; + } + + set + { + _rolespermissionsViewSource = value; RaisePropertyChanged(nameof(RolesPermissionsViewSource)); + } + + } + + private ObservableCollection _segments; + /// + /// Gets or sets the Segments. + /// + public ObservableCollection Segments + { + get + { + return _segments; + } + + set + { + _segments = value; RaisePropertyChanged(nameof(Segments)); + } + + } + + private ICollectionView _segmentsViewSource; + /// + /// Gets or sets the Segments View Source. + /// + public ICollectionView SegmentsViewSource + { + get + { + return _segmentsViewSource; + } + + set + { + _segmentsViewSource = value; RaisePropertyChanged(nameof(SegmentsViewSource)); + } + + } + + private ObservableCollection _spooltypes; + /// + /// Gets or sets the SpoolTypes. + /// + public ObservableCollection SpoolTypes + { + get + { + return _spooltypes; + } + + set + { + _spooltypes = value; RaisePropertyChanged(nameof(SpoolTypes)); + } + + } + + private ICollectionView _spooltypesViewSource; + /// + /// Gets or sets the SpoolTypes View Source. + /// + public ICollectionView SpoolTypesViewSource + { + get + { + return _spooltypesViewSource; + } + + set + { + _spooltypesViewSource = value; RaisePropertyChanged(nameof(SpoolTypesViewSource)); + } + + } + + private ObservableCollection _sysdiagrams; + /// + /// Gets or sets the Sysdiagrams. + /// + public ObservableCollection Sysdiagrams + { + get + { + return _sysdiagrams; + } + + set + { + _sysdiagrams = value; RaisePropertyChanged(nameof(Sysdiagrams)); + } + + } + + private ICollectionView _sysdiagramsViewSource; + /// + /// Gets or sets the Sysdiagrams View Source. + /// + public ICollectionView SysdiagramsViewSource + { + get + { + return _sysdiagramsViewSource; + } + + set + { + _sysdiagramsViewSource = value; RaisePropertyChanged(nameof(SysdiagramsViewSource)); + } + + } + + private ObservableCollection _tangoversions; + /// + /// Gets or sets the TangoVersions. + /// + public ObservableCollection TangoVersions + { + get + { + return _tangoversions; + } + + set + { + _tangoversions = value; RaisePropertyChanged(nameof(TangoVersions)); + } + + } + + private ICollectionView _tangoversionsViewSource; + /// + /// Gets or sets the TangoVersions View Source. + /// + public ICollectionView TangoVersionsViewSource + { + get + { + return _tangoversionsViewSource; + } + + set + { + _tangoversionsViewSource = value; RaisePropertyChanged(nameof(TangoVersionsViewSource)); + } + + } + + private ObservableCollection _techcontrollers; + /// + /// Gets or sets the TechControllers. + /// + public ObservableCollection TechControllers + { + get + { + return _techcontrollers; + } + + set + { + _techcontrollers = value; RaisePropertyChanged(nameof(TechControllers)); + } + + } + + private ICollectionView _techcontrollersViewSource; + /// + /// Gets or sets the TechControllers View Source. + /// + public ICollectionView TechControllersViewSource + { + get + { + return _techcontrollersViewSource; + } + + set + { + _techcontrollersViewSource = value; RaisePropertyChanged(nameof(TechControllersViewSource)); + } + + } + + private ObservableCollection _techdispensers; + /// + /// Gets or sets the TechDispensers. + /// + public ObservableCollection TechDispensers + { + get + { + return _techdispensers; + } + + set + { + _techdispensers = value; RaisePropertyChanged(nameof(TechDispensers)); + } + + } + + private ICollectionView _techdispensersViewSource; + /// + /// Gets or sets the TechDispensers View Source. + /// + public ICollectionView TechDispensersViewSource + { + get + { + return _techdispensersViewSource; + } + + set + { + _techdispensersViewSource = value; RaisePropertyChanged(nameof(TechDispensersViewSource)); + } + + } + + private ObservableCollection _techios; + /// + /// Gets or sets the TechIos. + /// + public ObservableCollection TechIos + { + get + { + return _techios; + } + + set + { + _techios = value; RaisePropertyChanged(nameof(TechIos)); + } + + } + + private ICollectionView _techiosViewSource; + /// + /// Gets or sets the TechIos View Source. + /// + public ICollectionView TechIosViewSource + { + get + { + return _techiosViewSource; + } + + set + { + _techiosViewSource = value; RaisePropertyChanged(nameof(TechIosViewSource)); + } + + } + + private ObservableCollection _techmonitors; + /// + /// Gets or sets the TechMonitors. + /// + public ObservableCollection TechMonitors + { + get + { + return _techmonitors; + } + + set + { + _techmonitors = value; RaisePropertyChanged(nameof(TechMonitors)); + } + + } + + private ICollectionView _techmonitorsViewSource; + /// + /// Gets or sets the TechMonitors View Source. + /// + public ICollectionView TechMonitorsViewSource + { + get + { + return _techmonitorsViewSource; + } + + set + { + _techmonitorsViewSource = value; RaisePropertyChanged(nameof(TechMonitorsViewSource)); + } + + } + + private ObservableCollection _techvalves; + /// + /// Gets or sets the TechValves. + /// + public ObservableCollection TechValves + { + get + { + return _techvalves; + } + + set + { + _techvalves = value; RaisePropertyChanged(nameof(TechValves)); + } + + } + + private ICollectionView _techvalvesViewSource; + /// + /// Gets or sets the TechValves View Source. + /// + public ICollectionView TechValvesViewSource + { + get + { + return _techvalvesViewSource; + } + + set + { + _techvalvesViewSource = value; RaisePropertyChanged(nameof(TechValvesViewSource)); + } + + } + + private ObservableCollection _users; + /// + /// Gets or sets the Users. + /// + public ObservableCollection Users + { + get + { + return _users; + } + + set + { + _users = value; RaisePropertyChanged(nameof(Users)); + } + + } + + private ICollectionView _usersViewSource; + /// + /// Gets or sets the Users View Source. + /// + public ICollectionView UsersViewSource + { + get + { + return _usersViewSource; + } + + set + { + _usersViewSource = value; RaisePropertyChanged(nameof(UsersViewSource)); + } + + } + + private ObservableCollection _usersroles; + /// + /// Gets or sets the UsersRoles. + /// + public ObservableCollection UsersRoles + { + get + { + return _usersroles; + } + + set + { + _usersroles = value; RaisePropertyChanged(nameof(UsersRoles)); + } + + } + + private ICollectionView _usersrolesViewSource; + /// + /// Gets or sets the UsersRoles View Source. + /// + public ICollectionView UsersRolesViewSource + { + get + { + return _usersrolesViewSource; + } + + set + { + _usersrolesViewSource = value; RaisePropertyChanged(nameof(UsersRolesViewSource)); + } + + } + + private ObservableCollection _windingmethods; + /// + /// Gets or sets the WindingMethods. + /// + public ObservableCollection WindingMethods + { + get + { + return _windingmethods; + } + + set + { + _windingmethods = value; RaisePropertyChanged(nameof(WindingMethods)); + } + + } + + private ICollectionView _windingmethodsViewSource; + /// + /// Gets or sets the WindingMethods View Source. + /// + public ICollectionView WindingMethodsViewSource + { + get + { + return _windingmethodsViewSource; + } + + set + { + _windingmethodsViewSource = value; RaisePropertyChanged(nameof(WindingMethodsViewSource)); + } + + } + + /// + /// Initialize collection sources. + /// + public void InitCollectionSources() + { + + SyncConfigurationsViewSource = CreateCollectionView(SyncConfigurations); + + ActionTypesViewSource = CreateCollectionView(ActionTypes); + + AddressesViewSource = CreateCollectionView(Addresses); + + ApplicationDisplayPanelVersionsViewSource = CreateCollectionView(ApplicationDisplayPanelVersions); + + ApplicationFirmwareVersionsViewSource = CreateCollectionView(ApplicationFirmwareVersions); + + ApplicationOsVersionsViewSource = CreateCollectionView(ApplicationOsVersions); + + BrushStopsViewSource = CreateCollectionView(BrushStops); + + CartridgeTypesViewSource = CreateCollectionView(CartridgeTypes); + + CatsViewSource = CreateCollectionView(Cats); + + CctsViewSource = CreateCollectionView(Ccts); + + ColorCatalogsViewSource = CreateCollectionView(ColorCatalogs); + + ColorSpacesViewSource = CreateCollectionView(ColorSpaces); + + ConfigurationsViewSource = CreateCollectionView(Configurations); + + ContactsViewSource = CreateCollectionView(Contacts); + + CustomersViewSource = CreateCollectionView(Customers); + + DispenserTypesViewSource = CreateCollectionView(DispenserTypes); + + EmbeddedFirmwareVersionsViewSource = CreateCollectionView(EmbeddedFirmwareVersions); + + EventTypesViewSource = CreateCollectionView(EventTypes); + + EventTypesActionsViewSource = CreateCollectionView(EventTypesActions); + + EventTypesCategoriesViewSource = CreateCollectionView(EventTypesCategories); + + EventTypesGroupsViewSource = CreateCollectionView(EventTypesGroups); + + FiberShapesViewSource = CreateCollectionView(FiberShapes); + + FiberSynthsViewSource = CreateCollectionView(FiberSynths); + + HardwareBlowerTypesViewSource = CreateCollectionView(HardwareBlowerTypes); + + HardwareBlowersViewSource = CreateCollectionView(HardwareBlowers); + + HardwareBreakSensorTypesViewSource = CreateCollectionView(HardwareBreakSensorTypes); + + HardwareBreakSensorsViewSource = CreateCollectionView(HardwareBreakSensors); + + HardwareDancerTypesViewSource = CreateCollectionView(HardwareDancerTypes); + + HardwareDancersViewSource = CreateCollectionView(HardwareDancers); + + HardwareMotorTypesViewSource = CreateCollectionView(HardwareMotorTypes); + + HardwareMotorsViewSource = CreateCollectionView(HardwareMotors); + + HardwarePidControlTypesViewSource = CreateCollectionView(HardwarePidControlTypes); + + HardwarePidControlsViewSource = CreateCollectionView(HardwarePidControls); + + HardwareSpeedSensorTypesViewSource = CreateCollectionView(HardwareSpeedSensorTypes); + + HardwareSpeedSensorsViewSource = CreateCollectionView(HardwareSpeedSensors); + + HardwareVersionsViewSource = CreateCollectionView(HardwareVersions); + + HardwareWinderTypesViewSource = CreateCollectionView(HardwareWinderTypes); + + HardwareWindersViewSource = CreateCollectionView(HardwareWinders); + + HtmlPagesViewSource = CreateCollectionView(HtmlPages); + + IdsPackFormulasViewSource = CreateCollectionView(IdsPackFormulas); + + IdsPacksViewSource = CreateCollectionView(IdsPacks); + + JobRunsViewSource = CreateCollectionView(JobRuns); + + JobsViewSource = CreateCollectionView(Jobs); + + LinearMassDensityUnitsViewSource = CreateCollectionView(LinearMassDensityUnits); + + LiquidTypesViewSource = CreateCollectionView(LiquidTypes); + + LiquidTypesRmlsViewSource = CreateCollectionView(LiquidTypesRmls); + + MachineStudioVersionsViewSource = CreateCollectionView(MachineStudioVersions); + + MachineVersionsViewSource = CreateCollectionView(MachineVersions); + + MachinesViewSource = CreateCollectionView(Machines); + + MachinesConfigurationsViewSource = CreateCollectionView(MachinesConfigurations); + + MachinesEventsViewSource = CreateCollectionView(MachinesEvents); + + MediaColorsViewSource = CreateCollectionView(MediaColors); + + MediaConditionsViewSource = CreateCollectionView(MediaConditions); + + MediaMaterialsViewSource = CreateCollectionView(MediaMaterials); + + MediaPurposesViewSource = CreateCollectionView(MediaPurposes); + + MidTankTypesViewSource = CreateCollectionView(MidTankTypes); + + OrganizationsViewSource = CreateCollectionView(Organizations); + + PermissionsViewSource = CreateCollectionView(Permissions); + + ProcessParametersTablesViewSource = CreateCollectionView(ProcessParametersTables); + + ProcessParametersTablesGroupsViewSource = CreateCollectionView(ProcessParametersTablesGroups); + + RmlsViewSource = CreateCollectionView(Rmls); + + RolesViewSource = CreateCollectionView(Roles); + + RolesPermissionsViewSource = CreateCollectionView(RolesPermissions); + + SegmentsViewSource = CreateCollectionView(Segments); + + SpoolTypesViewSource = CreateCollectionView(SpoolTypes); + + SysdiagramsViewSource = CreateCollectionView(Sysdiagrams); + + TangoVersionsViewSource = CreateCollectionView(TangoVersions); + + TechControllersViewSource = CreateCollectionView(TechControllers); + + TechDispensersViewSource = CreateCollectionView(TechDispensers); + + TechIosViewSource = CreateCollectionView(TechIos); + + TechMonitorsViewSource = CreateCollectionView(TechMonitors); + + TechValvesViewSource = CreateCollectionView(TechValves); + + UsersViewSource = CreateCollectionView(Users); + + UsersRolesViewSource = CreateCollectionView(UsersRoles); + + WindingMethodsViewSource = CreateCollectionView(WindingMethods); + + } + } +} diff --git a/Software/Visual_Studio/Tango.BL/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.BL/Properties/AssemblyInfo.cs index 7443b6538..61f03b23b 100644 --- a/Software/Visual_Studio/Tango.BL/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Tango.BL/Properties/AssemblyInfo.cs @@ -4,4 +4,4 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle("Tango - Business logic components")] [assembly: ComVisible(false)] -[assembly: AssemblyVersion("2.0.30.1647")] \ No newline at end of file +[assembly: AssemblyVersion("2.0.31.1119")] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.BrushPicker/Tango.BrushPicker.csproj b/Software/Visual_Studio/Tango.BrushPicker/Tango.BrushPicker.csproj index 6cde62c7b..13655c3ce 100644 --- a/Software/Visual_Studio/Tango.BrushPicker/Tango.BrushPicker.csproj +++ b/Software/Visual_Studio/Tango.BrushPicker/Tango.BrushPicker.csproj @@ -9,7 +9,7 @@ Properties Tango.BrushPicker Tango.BrushPicker - v4.6 + v4.7.2 512 SAK SAK diff --git a/Software/Visual_Studio/Tango.CSV/Tango.CSV.csproj b/Software/Visual_Studio/Tango.CSV/Tango.CSV.csproj index 7a2417457..f6bd6e949 100644 --- a/Software/Visual_Studio/Tango.CSV/Tango.CSV.csproj +++ b/Software/Visual_Studio/Tango.CSV/Tango.CSV.csproj @@ -9,7 +9,7 @@ Properties Tango.CSV Tango.CSV - v4.6 + v4.7.2 512 diff --git a/Software/Visual_Studio/Tango.CircularGauge/Tango.CircularGauge.csproj b/Software/Visual_Studio/Tango.CircularGauge/Tango.CircularGauge.csproj index 09042eca0..658b0a0b0 100644 --- a/Software/Visual_Studio/Tango.CircularGauge/Tango.CircularGauge.csproj +++ b/Software/Visual_Studio/Tango.CircularGauge/Tango.CircularGauge.csproj @@ -10,7 +10,7 @@ Properties Tango.CircularGauge Tango.CircularGauge - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/Tango.CodeGeneration/ObservablesStaticCollectionsFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/ObservablesStaticCollectionsFile.cs new file mode 100644 index 000000000..0e4e4bf3e --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/ObservablesStaticCollectionsFile.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.CodeGeneration +{ + public class ObservablesStaticCollectionsFile : Class + { + } +} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.CodeGeneration/Properties/AssemblyInfo.cs index 3aa9e6fbd..0af1368ea 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Tango.CodeGeneration/Properties/AssemblyInfo.cs @@ -3,5 +3,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Tango - Code Generation Components")] -[assembly: AssemblyVersion("2.0.14.1633")] +[assembly: AssemblyVersion("2.0.15.1119")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj index a9517f3b2..ef89bd682 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj +++ b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj @@ -70,6 +70,7 @@ + @@ -114,11 +115,12 @@ + - + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Core/CoreSettings.cs b/Software/Visual_Studio/Tango.Core/CoreSettings.cs index 2f40d0ef0..b9ce9412b 100644 --- a/Software/Visual_Studio/Tango.Core/CoreSettings.cs +++ b/Software/Visual_Studio/Tango.Core/CoreSettings.cs @@ -10,21 +10,21 @@ namespace Tango.Core public class CoreSettings : SettingsBase { /// - /// Gets or sets the default data base source. + /// Gets or sets the default SQL data base source. /// - public static String DefaultDataBaseSource { get; set; } + public static DataSource DefaultDataSource { get; set; } /// - /// Gets or sets the SQL server address. + /// Gets or sets the SQL data source. /// - public String DataBaseSource { get; set; } + public DataSource DataSource { get; set; } /// /// Initializes the class. /// static CoreSettings() { - DefaultDataBaseSource = "localhost\\SQLEXPRESS"; + DefaultDataSource = new DataSource(); } /// @@ -32,7 +32,7 @@ namespace Tango.Core /// public CoreSettings() { - DataBaseSource = DefaultDataBaseSource; + DataSource = DefaultDataSource; } } } diff --git a/Software/Visual_Studio/Tango.Core/DataSource.cs b/Software/Visual_Studio/Tango.Core/DataSource.cs new file mode 100644 index 000000000..bc4274276 --- /dev/null +++ b/Software/Visual_Studio/Tango.Core/DataSource.cs @@ -0,0 +1,139 @@ +using System; +using System.Collections.Generic; +using System.Data.Common; +using System.Data.SqlClient; +using System.Data.SQLite; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Core +{ + /// + /// Represents an SQL data source. + /// + public class DataSource + { + private static bool _has_provider; + + /// + /// Gets or sets the type of source. + /// + public DataSourceType Type { get; set; } + + /// + /// Gets or sets the address. + /// + public String Address { get; set; } + + /// + /// Gets or sets the catalog name. + /// + public String Catalog { get; set; } + + /// + /// Gets or sets a value indicating whether to use integrated security. + /// + public bool IntegratedSecurity { get; set; } + + /// + /// Gets or sets the user name to use if is false. + /// + public String UserName { get; set; } + + /// + /// Gets or sets the password to use if is false. + /// + public String Password { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public DataSource() + { + Type = DataSourceType.SQLServer; + Address = "localhost\\SQLEXPRESS"; + Catalog = "Tango"; + IntegratedSecurity = true; + UserName = String.Empty; + Password = String.Empty; + } + + /// + /// Creates a DBConnection instance which represents this data source. + /// + /// + public DbConnection ToConnection() + { + switch (Type) + { + case DataSourceType.SQLite: + + var connection = new SQLiteConnection() + { + ConnectionString = new SQLiteConnectionStringBuilder() { DataSource = Path.GetFullPath(Address), ForeignKeys = true }.ConnectionString + }; + return connection; + + case DataSourceType.MDF: + + if (IntegratedSecurity) + { + return new SqlConnection(String.Format("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFileName={0};Initial Catalog={1};Integrated Security=True;MultipleActiveResultSets=True;App=EntityFramework", Path.GetFullPath(Address), Catalog)); + } + else + { + return new SqlConnection(String.Format("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFileName={0};Initial Catalog={1};Integrated Security=False;User Id={2};Password={3};MultipleActiveResultSets=True;App=EntityFramework", Path.GetFullPath(Address), Catalog, UserName, Password)); + } + + case DataSourceType.SQLServer: + + if (IntegratedSecurity) + { + return new SqlConnection(String.Format("Data Source={0};Initial Catalog={1};Integrated Security=True;MultipleActiveResultSets=True;App=EntityFramework", Address, Catalog)); + } + else + { + return new SqlConnection(String.Format("Data Source={0};Initial Catalog={1};Integrated Security=False;User Id={2};Password={3};MultipleActiveResultSets=True;App=EntityFramework", Address, Catalog, UserName, Password)); + } + + case DataSourceType.Azure: + + if (IntegratedSecurity) + { + + if (!_has_provider) + { + var provider = new ActiveDirectoryAuthProvider(); + SqlAuthenticationProvider.SetProvider(SqlAuthenticationMethod.ActiveDirectoryInteractive, provider); + _has_provider = true; + } + + SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(); + + builder.DataSource = Address; + builder.InitialCatalog = Catalog; + builder.UserID = UserName; + builder.TrustServerCertificate = true; + builder.ConnectTimeout = 15; + builder.Pooling = false; + + builder.Authentication = SqlAuthenticationMethod.ActiveDirectoryInteractive; + + SqlConnection sqlConnection = new SqlConnection(builder.ConnectionString); + + return sqlConnection; + } + else + { + return new SqlConnection(String.Format("Server=tcp:{0},1433;Initial Catalog={1};Persist Security Info=False;User ID={2};Password={3};MultipleActiveResultSets=True;App=EntityFramework;Encrypt=True;TrustServerCertificate=False;Authentication=\"Active Directory Password\";", Address, Catalog, UserName, Password)); + } + + default: + + return null; + } + } + } +} diff --git a/Software/Visual_Studio/Tango.Core/DataSourceType.cs b/Software/Visual_Studio/Tango.Core/DataSourceType.cs new file mode 100644 index 000000000..c447dd5eb --- /dev/null +++ b/Software/Visual_Studio/Tango.Core/DataSourceType.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Core +{ + /// + /// Represents an SQL data source type. + /// + public enum DataSourceType + { + /// + /// Microsoft SQL Server. + /// + SQLServer, + /// + /// Microsoft SQL .mdf file. + /// + MDF, + /// + /// Azure SQL Database. + /// + Azure, + /// + /// SQLite database file. + /// + SQLite + } +} diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs index 0ae7973a1..7d0c86e06 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs @@ -73,6 +73,27 @@ public static class ObjectExtensions } } + /// + /// Maps the object properties values to the destination object. + /// + /// The source. + /// The destination. + public static void MapPrimitivesTo(this object source, object destination, Func condition) + { + foreach (var prop in source.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsPrimitive)) + { + var desProp = destination.GetType().GetProperty(prop.Name, BindingFlags.Public | BindingFlags.Instance); + + if (desProp != null && desProp.PropertyType.IsPrimitive && desProp.SetMethod != null) + { + if (condition(prop)) + { + desProp.SetValue(destination, prop.GetValue(source)); + } + } + } + } + /// /// Serializes the specified object to indented json string. /// diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObservableCollectionExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObservableCollectionExtensions.cs index db3ced188..a60121e63 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObservableCollectionExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObservableCollectionExtensions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -66,5 +67,16 @@ public static class ObservableCollectionExtensions { BindingOperations.EnableCollectionSynchronization(collection, _syncLock); } + + /// + /// Creates a collection view from the observable collection. + /// + /// + /// The collection. + /// + public static ICollectionView ToCollectionView(this ObservableCollection collection) + { + return CollectionViewSource.GetDefaultView(collection); + } } diff --git a/Software/Visual_Studio/Tango.Core/ProducerConsumerQueue.cs b/Software/Visual_Studio/Tango.Core/ProducerConsumerQueue.cs new file mode 100644 index 000000000..02d116e05 --- /dev/null +++ b/Software/Visual_Studio/Tango.Core/ProducerConsumerQueue.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace Tango.Core +{ + /// + /// Represents a blocking concurrent queue for a producer consumer multi threading scenario. + /// + /// + /// + public class ProducerConsumerQueue : BlockingCollection + { + /// + /// Initializes a new instance of the ProducerConsumerQueue, Use Add and TryAdd for Enqueue and TryEnqueue and Take and TryTake for Dequeue and TryDequeue functionality + /// + public ProducerConsumerQueue() + : base(new ConcurrentQueue()) + { + } + + /// + /// Initializes a new instance of the ProducerConsumerQueue, Use Add and TryAdd for Enqueue and TryEnqueue and Take and TryTake for Dequeue and TryDequeue functionality + /// + /// + public ProducerConsumerQueue(int maxSize) + : base(new ConcurrentQueue(), maxSize) + { + } + + /// + /// Enqueues the specified item. + /// + /// The item. + public void BlockEnqueue(T item) + { + Add(item); + } + + /// + /// Blocks until an item is available for dequeuing. + /// + /// + public T BlockDequeue() + { + return Take(); + } + + /// + /// Blocks until an item is available for dequeuing. + /// + /// The cancellation token. + /// + public T BlockDequeue(CancellationToken cancellationToken) + { + return Take(cancellationToken); + } + } +} diff --git a/Software/Visual_Studio/Tango.Core/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.Core/Properties/AssemblyInfo.cs index 9d26b436f..317a279c1 100644 --- a/Software/Visual_Studio/Tango.Core/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Tango.Core/Properties/AssemblyInfo.cs @@ -3,5 +3,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Tango - Core Components")] -[assembly: AssemblyVersion("2.0.27.1647")] +[assembly: AssemblyVersion("2.0.28.1119")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Core/Properties/Resources.Designer.cs b/Software/Visual_Studio/Tango.Core/Properties/Resources.Designer.cs index 4f47c533a..29ed0e72b 100644 --- a/Software/Visual_Studio/Tango.Core/Properties/Resources.Designer.cs +++ b/Software/Visual_Studio/Tango.Core/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace Tango.Core.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/Software/Visual_Studio/Tango.Core/Tango.Core.csproj b/Software/Visual_Studio/Tango.Core/Tango.Core.csproj index d3af5d59b..194a2ec54 100644 --- a/Software/Visual_Studio/Tango.Core/Tango.Core.csproj +++ b/Software/Visual_Studio/Tango.Core/Tango.Core.csproj @@ -9,9 +9,11 @@ Properties Tango.Core Tango.Core - v4.6 + v4.7.2 512 + + true @@ -31,9 +33,21 @@ 4 + + ..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll + ..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll + + ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.19.8\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + + + ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.19.8\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll + ..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll @@ -43,17 +57,27 @@ ..\packages\SimpleValidator.0.6.1.0\lib\net40\SimpleValidator.dll + + + ..\packages\System.Data.SQLite.Core.1.0.108.0\lib\net46\System.Data.SQLite.dll + + + ..\packages\System.Data.SQLite.EF6.1.0.108.0\lib\net46\System.Data.SQLite.EF6.dll + + + ..\packages\System.Data.SQLite.Linq.1.0.108.0\lib\net46\System.Data.SQLite.Linq.dll + + - @@ -61,6 +85,7 @@ GlobalVersionInfo.cs + @@ -73,6 +98,8 @@ + + @@ -99,6 +126,9 @@ + + Designer + @@ -120,6 +150,7 @@ + True @@ -153,7 +184,14 @@ - + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Core/packages.config b/Software/Visual_Studio/Tango.Core/packages.config index a9ac483b5..2d48269eb 100644 --- a/Software/Visual_Studio/Tango.Core/packages.config +++ b/Software/Visual_Studio/Tango.Core/packages.config @@ -1,7 +1,13 @@  + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Local/Tango.DAL.Local.csproj b/Software/Visual_Studio/Tango.DAL.Local/Tango.DAL.Local.csproj index b8051c108..9bcc7f849 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/Tango.DAL.Local.csproj +++ b/Software/Visual_Studio/Tango.DAL.Local/Tango.DAL.Local.csproj @@ -9,7 +9,7 @@ Properties Tango.DAL.Local Tango.DAL.Local - v4.6 + v4.7.2 512 diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BLOWERS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BLOWERS.cs index 8507177fd..42aebd1a8 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BLOWERS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BLOWERS.cs @@ -21,6 +21,7 @@ namespace Tango.DAL.Remote.DB public string HARDWARE_VERSION_GUID { get; set; } public bool ENABLED { get; set; } public double VOLTAGE { get; set; } + public bool ACTIVE { get; set; } public virtual HARDWARE_BLOWER_TYPES HARDWARE_BLOWER_TYPES { get; set; } public virtual HARDWARE_VERSIONS HARDWARE_VERSIONS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BREAK_SENSORS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BREAK_SENSORS.cs index d907bbc69..2ed17ba6a 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BREAK_SENSORS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_BREAK_SENSORS.cs @@ -21,6 +21,7 @@ namespace Tango.DAL.Remote.DB public string HARDWARE_VERSION_GUID { get; set; } public bool ENABLED { get; set; } public int DE_BOUNCE_TIME_MILLI { get; set; } + public bool ACTIVE { get; set; } public virtual HARDWARE_BREAK_SENSOR_TYPES HARDWARE_BREAK_SENSOR_TYPES { get; set; } public virtual HARDWARE_VERSIONS HARDWARE_VERSIONS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_DANCERS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_DANCERS.cs index d3bd42ac7..b71388f87 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_DANCERS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_DANCERS.cs @@ -29,6 +29,7 @@ namespace Tango.DAL.Remote.DB public int ARM_LENGTH { get; set; } public bool ASSEMBLY_DIRECTION_RIGHT { get; set; } public bool ACCELERATE_ON_TENSION_RAISE { get; set; } + public bool ACTIVE { get; set; } public virtual HARDWARE_DANCER_TYPES HARDWARE_DANCER_TYPES { get; set; } public virtual HARDWARE_VERSIONS HARDWARE_VERSIONS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_MOTORS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_MOTORS.cs index ee79c4457..98933b434 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_MOTORS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_MOTORS.cs @@ -43,6 +43,7 @@ namespace Tango.DAL.Remote.DB public int FN_SLP_ACC { get; set; } public int FN_SLP_DEC { get; set; } public int FS_SPD { get; set; } + public bool ACTIVE { get; set; } public virtual HARDWARE_MOTOR_TYPES HARDWARE_MOTOR_TYPES { get; set; } public virtual HARDWARE_VERSIONS HARDWARE_VERSIONS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_PID_CONTROLS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_PID_CONTROLS.cs index 50b0efa47..977431083 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_PID_CONTROLS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_PID_CONTROLS.cs @@ -36,6 +36,7 @@ namespace Tango.DAL.Remote.DB public int OUTPUT_PROPORTIONAL_CYCLE_TIME { get; set; } public int AC_HEATERS__HALF_CYCLE_TIME { get; set; } public double PROPORTIONAL_GAIN { get; set; } + public bool ACTIVE { get; set; } public virtual HARDWARE_PID_CONTROL_TYPES HARDWARE_PID_CONTROL_TYPES { get; set; } public virtual HARDWARE_VERSIONS HARDWARE_VERSIONS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_SPEED_SENSORS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_SPEED_SENSORS.cs index 789fb0903..c7f2d1fdc 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_SPEED_SENSORS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_SPEED_SENSORS.cs @@ -21,6 +21,7 @@ namespace Tango.DAL.Remote.DB public string HARDWARE_VERSION_GUID { get; set; } public int RESOLUTION_BITS { get; set; } public double PERIMETER { get; set; } + public bool ACTIVE { get; set; } public virtual HARDWARE_SPEED_SENSOR_TYPES HARDWARE_SPEED_SENSOR_TYPES { get; set; } public virtual HARDWARE_VERSIONS HARDWARE_VERSIONS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_WINDERS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_WINDERS.cs index 314ed994a..f25a3c8ff 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_WINDERS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/HARDWARE_WINDERS.cs @@ -20,6 +20,7 @@ namespace Tango.DAL.Remote.DB public string HARDWARE_WINDER_TYPE_GUID { get; set; } public string HARDWARE_VERSION_GUID { get; set; } public int MILLIMETER_PER_ROTATION { get; set; } + public bool ACTIVE { get; set; } public virtual HARDWARE_VERSIONS HARDWARE_VERSIONS { get; set; } public virtual HARDWARE_WINDER_TYPES HARDWARE_WINDER_TYPES { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx index 8809518b5..a8faf7597 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -327,6 +327,7 @@ + @@ -350,6 +351,7 @@ + @@ -381,6 +383,7 @@ + @@ -427,6 +430,7 @@ + @@ -465,6 +469,7 @@ + @@ -488,6 +493,7 @@ + @@ -520,6 +526,7 @@ + @@ -3322,6 +3329,7 @@ + @@ -3348,6 +3356,7 @@ + @@ -3382,6 +3391,7 @@ + @@ -3431,6 +3441,7 @@ + @@ -3472,6 +3483,7 @@ + @@ -3498,6 +3510,7 @@ + @@ -3541,6 +3554,7 @@ + @@ -5581,6 +5595,7 @@ + @@ -5606,6 +5621,7 @@ + @@ -5631,6 +5647,7 @@ + @@ -5665,6 +5682,7 @@ + @@ -5712,6 +5730,7 @@ + @@ -5752,6 +5771,7 @@ + @@ -5788,6 +5808,7 @@ + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram index cc0d83531..bbbfab153 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,80 +5,80 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/Partials/RemoteDB.cs b/Software/Visual_Studio/Tango.DAL.Remote/Partials/RemoteDB.cs index a492df462..a29857262 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/Partials/RemoteDB.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/Partials/RemoteDB.cs @@ -20,36 +20,9 @@ namespace Tango.DAL.Remote.DB ///
/// The server file path. /// if set to true will try to connect to an .mdf file. - public RemoteDB(String path, bool isFile) : base(ComposeConnectionString(path, isFile)) + public RemoteDB(DataSource dataSource) : base(String.Format("metadata=res://*/DB.RemoteADO.csdl|res://*/DB.RemoteADO.ssdl|res://*/DB.RemoteADO.msl;provider=System.Data.SqlClient;provider connection string=\"{0}\"", dataSource.ToConnection().ConnectionString)) { } - - /// - /// Composes the connection string. - /// - /// The source. - /// if set to true [is file]. - /// - private static String ComposeConnectionString(String source, bool isFile) - { - if (!isFile) - { - return String.Format("metadata=res://*/DB.RemoteADO.csdl|res://*/DB.RemoteADO.ssdl|res://*/DB.RemoteADO.msl;provider=System.Data.SqlClient;provider connection string=\"data source={0};initial catalog=Tango;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework\"", source); - } - else - { - return null; - } - } - - /// - /// Creates a default remote database context by the address specified in . - /// - /// - public static RemoteDB CreateDefault() - { - return new RemoteDB(SettingsManager.Default.GetOrCreate().DataBaseSource, false); - } } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.DAL.Remote/Properties/AssemblyInfo.cs index c2935e60d..3e0ab9b2a 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/Properties/AssemblyInfo.cs @@ -3,5 +3,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Tango - Remote Data Access Layer")] -[assembly: AssemblyVersion("2.0.26.1647")] +[assembly: AssemblyVersion("2.0.27.1119")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj index 3ab4194f9..c242d3837 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj +++ b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj @@ -9,7 +9,7 @@ Properties Tango.DAL.Remote Tango.DAL.Remote - v4.6 + v4.7.2 512 diff --git a/Software/Visual_Studio/Tango.Documents/Tango.Documents.csproj b/Software/Visual_Studio/Tango.Documents/Tango.Documents.csproj index f688f005b..cbfd9c79b 100644 --- a/Software/Visual_Studio/Tango.Documents/Tango.Documents.csproj +++ b/Software/Visual_Studio/Tango.Documents/Tango.Documents.csproj @@ -8,7 +8,7 @@ library Tango.Documents Tango.Documents - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/Tango.DragAndDrop/Tango.DragAndDrop.csproj b/Software/Visual_Studio/Tango.DragAndDrop/Tango.DragAndDrop.csproj index 41c31954a..7f72ffcc0 100644 --- a/Software/Visual_Studio/Tango.DragAndDrop/Tango.DragAndDrop.csproj +++ b/Software/Visual_Studio/Tango.DragAndDrop/Tango.DragAndDrop.csproj @@ -9,7 +9,7 @@ Properties Tango.DragAndDrop Tango.DragAndDrop - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/Tango.Editors/ElementsEditor.xaml.cs b/Software/Visual_Studio/Tango.Editors/ElementsEditor.xaml.cs index 98a813fc0..e32ae6dd3 100644 --- a/Software/Visual_Studio/Tango.Editors/ElementsEditor.xaml.cs +++ b/Software/Visual_Studio/Tango.Editors/ElementsEditor.xaml.cs @@ -15,30 +15,8 @@ using Tango.Editors; namespace Tango.Editors { /// - /// /// Represents a collection container and editor. The editor supports Undo, Redo, Cut, Copy and Paste operations. - /// The whole editor state can easily be saved and load using the and methods. /// - /// - /// - /// - /// - /// The following example demonstrates a basic scenario of using and by creating a simple video projection application with the following features: - /// - /// - /// Use the mouse to draw any type of tile of the editor surface. - /// Apply any input shape on any tile. - /// Load any video and display it on any of the selected tile. - /// Built in support for undo, redo, cut, copy and paste, delete and select operations. - /// Built in support for saving/loading the editor state to memory or file. - /// Built in support for tile and editor properties adjustment using the . - /// - /// - /// - /// - /// Code-Behind. - /// - /// /// /// /// @@ -745,7 +723,7 @@ namespace Tango.Editors /// The instance containing the event data. private void Element_PreviewMouseDown(object sender, MouseButtonEventArgs e) { - if (e.ChangedButton == MouseButton.Left && !Keyboard.IsKeyDown(Key.LeftShift) && IsEditable) + if (e.ChangedButton == MouseButton.Left && !Keyboard.IsKeyDown(Key.LeftShift)) { SelectedElement = sender as IElementEditor; } @@ -1219,6 +1197,8 @@ namespace Tango.Editors { base.OnPreviewKeyDown(e); + if (!IsEditable) return; + if (e.Key == Key.Right) { GetSelectedElements().ForEach(x => x.PushMove(new DragDeltaEventArgs(1, 0))); diff --git a/Software/Visual_Studio/Tango.Editors/Tango.Editors.csproj b/Software/Visual_Studio/Tango.Editors/Tango.Editors.csproj index b0f6184ae..613e6df7e 100644 --- a/Software/Visual_Studio/Tango.Editors/Tango.Editors.csproj +++ b/Software/Visual_Studio/Tango.Editors/Tango.Editors.csproj @@ -8,7 +8,7 @@ library Tango.Editors Tango.Editors - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/Tango.EmbroideryUI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.EmbroideryUI/Properties/AssemblyInfo.cs index 352105b64..c9257949f 100644 --- a/Software/Visual_Studio/Tango.EmbroideryUI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Tango.EmbroideryUI/Properties/AssemblyInfo.cs @@ -44,5 +44,5 @@ using System.Windows; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.5.1633")] +[assembly: AssemblyVersion("1.0.6.1119")] [assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Software/Visual_Studio/Tango.EmbroideryUI/Tango.EmbroideryUI.csproj b/Software/Visual_Studio/Tango.EmbroideryUI/Tango.EmbroideryUI.csproj index c68b620a1..4054ab567 100644 --- a/Software/Visual_Studio/Tango.EmbroideryUI/Tango.EmbroideryUI.csproj +++ b/Software/Visual_Studio/Tango.EmbroideryUI/Tango.EmbroideryUI.csproj @@ -8,7 +8,7 @@ library Tango.EmbroideryUI Tango.EmbroideryUI - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/Tango.EmbroideryUI/app.config b/Software/Visual_Studio/Tango.EmbroideryUI/app.config index 462d17b27..72700d700 100644 --- a/Software/Visual_Studio/Tango.EmbroideryUI/app.config +++ b/Software/Visual_Studio/Tango.EmbroideryUI/app.config @@ -42,6 +42,14 @@ + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Emulations/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.Emulations/Properties/AssemblyInfo.cs index b2bd0b458..9b5c07f0c 100644 --- a/Software/Visual_Studio/Tango.Emulations/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Tango.Emulations/Properties/AssemblyInfo.cs @@ -3,5 +3,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Tango - Emulation Components")] -[assembly: AssemblyVersion("2.0.9.1633")] +[assembly: AssemblyVersion("2.0.10.1119")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Emulations/Tango.Emulations.csproj b/Software/Visual_Studio/Tango.Emulations/Tango.Emulations.csproj index ec7315668..05be1077a 100644 --- a/Software/Visual_Studio/Tango.Emulations/Tango.Emulations.csproj +++ b/Software/Visual_Studio/Tango.Emulations/Tango.Emulations.csproj @@ -9,7 +9,7 @@ Properties Tango.Emulations Tango.Emulations - v4.6 + v4.7.2 512 diff --git a/Software/Visual_Studio/Tango.Hive/Tango.Hive.csproj b/Software/Visual_Studio/Tango.Hive/Tango.Hive.csproj index bda3d1d85..21aea4a42 100644 --- a/Software/Visual_Studio/Tango.Hive/Tango.Hive.csproj +++ b/Software/Visual_Studio/Tango.Hive/Tango.Hive.csproj @@ -9,7 +9,7 @@ Properties Tango.Hive Tango.Hive - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFileEvent.cs b/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFileEvent.cs index a6132c6d3..49027f447 100644 --- a/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFileEvent.cs +++ b/Software/Visual_Studio/Tango.Integration/Diagnostics/DiagnosticsFileEvent.cs @@ -42,9 +42,9 @@ namespace Tango.Integration.Diagnostics { MachinesEvent ev = new MachinesEvent(); ev.DateTime = DateTime; - ev.EventType = ObservablesEntitiesAdapter.Instance.EventTypes.SingleOrDefault(x => x.Guid == EventTypeGuid); - ev.Machine = ObservablesEntitiesAdapter.Instance.Machines.SingleOrDefault(x => x.Guid == MachineGuid); - ev.User = ObservablesEntitiesAdapter.Instance.Users.SingleOrDefault(x => x.Guid == UserGuid); + ev.EventType = ObservablesStaticCollections.Instance.EventTypes.SingleOrDefault(x => x.Guid == EventTypeGuid); + ev.Machine = ObservablesStaticCollections.Instance.Machines.SingleOrDefault(x => x.Guid == MachineGuid); + ev.User = ObservablesStaticCollections.Instance.Users.SingleOrDefault(x => x.Guid == UserGuid); ev.Description = Description; ev.HostName = HostName; diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeTcpClient.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeTcpClient.cs index 3de8c8dde..c2ab97c2f 100644 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeTcpClient.cs +++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeTcpClient.cs @@ -38,7 +38,7 @@ namespace Tango.Integration.ExternalBridge _serialNumber = value; RaisePropertyChangedAuto(); - Machine = ObservablesEntitiesAdapter.Instance.Machines.SingleOrDefault(x => x.SerialNumber == _serialNumber); + Machine = ObservablesStaticCollections.Instance.Machines.SingleOrDefault(x => x.SerialNumber == _serialNumber); } } diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeUsbClient.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeUsbClient.cs index 0e5dca2d0..f610de206 100644 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeUsbClient.cs +++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeUsbClient.cs @@ -35,7 +35,7 @@ namespace Tango.Integration.ExternalBridge _serialNumber = value; RaisePropertyChangedAuto(); - Machine = ObservablesEntitiesAdapter.Instance.Machines.SingleOrDefault(x => x.SerialNumber == _serialNumber); + Machine = ObservablesStaticCollections.Instance.Machines.SingleOrDefault(x => x.SerialNumber == _serialNumber); RaisePropertyChanged(nameof(Machine)); } } diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 4675c8017..5e942fe36 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -969,7 +969,7 @@ namespace Tango.Integration.Operation { HardwareConfiguration hardwareConfiguration = new HardwareConfiguration(); - foreach (var dancer in hardwareVersion.HardwareDancers) + foreach (var dancer in hardwareVersion.HardwareDancers.Where(x => x.Active)) { PMR.Hardware.HardwareDancer item = new PMR.Hardware.HardwareDancer(); dancer.MapPrimitivesTo(item); @@ -977,7 +977,7 @@ namespace Tango.Integration.Operation hardwareConfiguration.Dancers.Add(item); } - foreach (var motor in hardwareVersion.HardwareMotors) + foreach (var motor in hardwareVersion.HardwareMotors.Where(x => x.Active)) { PMR.Hardware.HardwareMotor item = new PMR.Hardware.HardwareMotor(); motor.MapPrimitivesTo(item); @@ -985,7 +985,7 @@ namespace Tango.Integration.Operation hardwareConfiguration.Motors.Add(item); } - foreach (var pid in hardwareVersion.HardwarePidControls) + foreach (var pid in hardwareVersion.HardwarePidControls.Where(x => x.Active)) { PMR.Hardware.HardwarePidControl item = new PMR.Hardware.HardwarePidControl(); pid.MapPrimitivesTo(item); @@ -993,7 +993,7 @@ namespace Tango.Integration.Operation hardwareConfiguration.PidControls.Add(item); } - foreach (var winder in hardwareVersion.HardwareWinders) + foreach (var winder in hardwareVersion.HardwareWinders.Where(x => x.Active)) { PMR.Hardware.HardwareWinder item = new PMR.Hardware.HardwareWinder(); winder.MapPrimitivesTo(item); @@ -1001,7 +1001,7 @@ namespace Tango.Integration.Operation hardwareConfiguration.Winders.Add(item); } - foreach (var sensor in hardwareVersion.HardwareSpeedSensors) + foreach (var sensor in hardwareVersion.HardwareSpeedSensors.Where(x => x.Active)) { PMR.Hardware.HardwareSpeedSensor item = new PMR.Hardware.HardwareSpeedSensor(); sensor.MapPrimitivesTo(item); @@ -1009,7 +1009,7 @@ namespace Tango.Integration.Operation hardwareConfiguration.SpeedSensors.Add(item); } - foreach (var blower in hardwareVersion.HardwareBlowers) + foreach (var blower in hardwareVersion.HardwareBlowers.Where(x => x.Active)) { PMR.Hardware.HardwareBlower item = new PMR.Hardware.HardwareBlower(); blower.MapPrimitivesTo(item); @@ -1017,7 +1017,7 @@ namespace Tango.Integration.Operation hardwareConfiguration.Blowers.Add(item); } - foreach (var breakSensor in hardwareVersion.HardwareBreakSensors) + foreach (var breakSensor in hardwareVersion.HardwareBreakSensors.Where(x => x.Active)) { PMR.Hardware.HardwareBreakSensor item = new PMR.Hardware.HardwareBreakSensor(); breakSensor.MapPrimitivesTo(item); diff --git a/Software/Visual_Studio/Tango.Integration/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.Integration/Properties/AssemblyInfo.cs index 26a247d72..8aa4a48a5 100644 --- a/Software/Visual_Studio/Tango.Integration/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Tango.Integration/Properties/AssemblyInfo.cs @@ -3,5 +3,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Tango - Logging Library")] -[assembly: AssemblyVersion("2.0.26.1647")] +[assembly: AssemblyVersion("2.0.27.1119")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj index 035bbbe1f..a89bb0a6f 100644 --- a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj +++ b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj @@ -9,7 +9,7 @@ Properties Tango.Integration Tango.Integration - v4.6 + v4.7.2 512 diff --git a/Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs b/Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs index 3ceb78b17..5ee714cb6 100644 --- a/Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs +++ b/Software/Visual_Studio/Tango.Logging/GlobalExceptionTrapper.cs @@ -15,7 +15,7 @@ namespace Tango.Logging /// public class WpfGlobalExceptionTrapper : IGlobalExceptionTrapper { - private DateTime _lastGlobalExceptionTime = DateTime.Now; + private DateTime _lastGlobalExceptionTime = DateTime.Now.AddMinutes(-1); /// /// Occurs when the global exception trapper has detected an unhandled exception. @@ -41,6 +41,7 @@ namespace Tango.Logging /// The instance containing the event data. private void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e) { + e.SetObserved(); OnApplicationCrash(e.Exception); } @@ -80,8 +81,9 @@ namespace Tango.Logging /// The error. private bool OnApplicationCrash(Exception exception) { - if (DateTime.Now - _lastGlobalExceptionTime > TimeSpan.FromSeconds(1)) + if (DateTime.Now < _lastGlobalExceptionTime.AddSeconds(1)) { + LogManager.Default.Log(exception, LogCategory.Critical); _lastGlobalExceptionTime = DateTime.Now; return true; } @@ -89,7 +91,6 @@ namespace Tango.Logging _lastGlobalExceptionTime = DateTime.Now; LogManager.Default.Log("Application Crashed", LogCategory.Critical); LogManager.Default.Log(exception, LogCategory.Critical); - LogManager.Default.Flush(); ApplicationCrashedEventArgs e = new ApplicationCrashedEventArgs(exception); diff --git a/Software/Visual_Studio/Tango.Logging/LogManager.cs b/Software/Visual_Studio/Tango.Logging/LogManager.cs index 2d99c4fac..b67128a8d 100644 --- a/Software/Visual_Studio/Tango.Logging/LogManager.cs +++ b/Software/Visual_Studio/Tango.Logging/LogManager.cs @@ -19,10 +19,9 @@ namespace Tango.Logging public class LogManager { private List _loggers; - private ConcurrentQueue _logs; + private ProducerConsumerQueue _logs; private Thread _loggingThread; private bool _isStarted; - private AutoResetEvent _semaphore; /// /// Occurs when a new log as been received. @@ -59,9 +58,8 @@ namespace Tango.Logging /// public LogManager() { - _semaphore = new AutoResetEvent(false); _loggers = new List(); - _logs = new ConcurrentQueue(); + _logs = new ProducerConsumerQueue(); Categories = new List(); Categories.Add(LogCategory.Critical); @@ -231,9 +229,8 @@ namespace Tango.Logging /// The log. private void AppendLog(LogItemBase log) { - _logs.Enqueue(log); + _logs.BlockEnqueue(log); StartLoggingThread(); - _semaphore.Set(); } /// @@ -259,41 +256,10 @@ namespace Tango.Logging { while (_isStarted) { - while (_logs.Count > 0) - { - LogItemBase log; - - if (_logs.TryDequeue(out log)) - { - if (log != null) - { - _loggers.Where(x => x.Enabled).ToList().ForEach(x => x.OnLog(log)); - NewLog?.Invoke(this, log); - } - } - } - - _semaphore.WaitOne(); - } - } - - /// - /// Ensures all registered loggers be notified about current logs in queue immediately. - /// - public void Flush() - { - while (_logs.Count > 0) - { - LogItemBase log; + LogItemBase log = _logs.BlockDequeue(); - if (_logs.TryDequeue(out log)) - { - if (log != null) - { - _loggers.Where(x => x.Enabled).ToList().ForEach(x => x.OnLog(log)); - NewLog?.Invoke(this, log); - } - } + _loggers.Where(x => x.Enabled).ToList().ForEach(x => x.OnLog(log)); + NewLog?.Invoke(this, log); } } } diff --git a/Software/Visual_Studio/Tango.Logging/ProducerConsumerQueue.cs b/Software/Visual_Studio/Tango.Logging/ProducerConsumerQueue.cs new file mode 100644 index 000000000..a95544479 --- /dev/null +++ b/Software/Visual_Studio/Tango.Logging/ProducerConsumerQueue.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace Tango.Logging +{ + /// + /// Represents a blocking concurrent queue for a producer consumer multi threading scenario. + /// + /// + /// + internal class ProducerConsumerQueue : BlockingCollection + { + /// + /// Initializes a new instance of the ProducerConsumerQueue, Use Add and TryAdd for Enqueue and TryEnqueue and Take and TryTake for Dequeue and TryDequeue functionality + /// + public ProducerConsumerQueue() + : base(new ConcurrentQueue()) + { + } + + /// + /// Initializes a new instance of the ProducerConsumerQueue, Use Add and TryAdd for Enqueue and TryEnqueue and Take and TryTake for Dequeue and TryDequeue functionality + /// + /// + public ProducerConsumerQueue(int maxSize) + : base(new ConcurrentQueue(), maxSize) + { + } + + /// + /// Enqueues the specified item. + /// + /// The item. + public void BlockEnqueue(T item) + { + Add(item); + } + + /// + /// Blocks until an item is available for dequeuing. + /// + /// + public T BlockDequeue() + { + return Take(); + } + + /// + /// Blocks until an item is available for dequeuing. + /// + /// The cancellation token. + /// + public T BlockDequeue(CancellationToken cancellationToken) + { + return Take(cancellationToken); + } + } +} diff --git a/Software/Visual_Studio/Tango.Logging/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.Logging/Properties/AssemblyInfo.cs index e31de5a02..66407c1bd 100644 --- a/Software/Visual_Studio/Tango.Logging/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Tango.Logging/Properties/AssemblyInfo.cs @@ -3,5 +3,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Tango - Logging Library")] -[assembly: AssemblyVersion("2.0.31.1647")] +[assembly: AssemblyVersion("2.0.32.1119")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Logging/Tango.Logging.csproj b/Software/Visual_Studio/Tango.Logging/Tango.Logging.csproj index 4f4918e19..69a47819a 100644 --- a/Software/Visual_Studio/Tango.Logging/Tango.Logging.csproj +++ b/Software/Visual_Studio/Tango.Logging/Tango.Logging.csproj @@ -9,7 +9,7 @@ Properties Tango.Logging Tango.Logging - v4.6 + v4.7.2 512 @@ -64,6 +64,7 @@ + @@ -77,7 +78,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.PMR/NativePMR.cs b/Software/Visual_Studio/Tango.PMR/NativePMR.cs index 1b56f12dc..14e740656 100644 --- a/Software/Visual_Studio/Tango.PMR/NativePMR.cs +++ b/Software/Visual_Studio/Tango.PMR/NativePMR.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Runtime.InteropServices; +using System.Runtime.ExceptionServices; namespace Tango.PMR { @@ -41,41 +42,49 @@ namespace Tango.PMR /// The request. /// The native method. /// + [HandleProcessCorruptedStateExceptions] public Response Invoke(Request request) { - //Serialize the request to byte array. - byte[] messageData = request.ToByteArray(); + try + { + //Serialize the request to byte array. + byte[] messageData = request.ToByteArray(); - //Allocate unmanaged array on memory. - IntPtr unmanagedArr = Marshal.AllocHGlobal(messageData.Length); + //Allocate unmanaged array on memory. + IntPtr unmanagedArr = Marshal.AllocHGlobal(messageData.Length); - //Copy the request data to the unmanaged array. - Marshal.Copy(messageData, 0, unmanagedArr, messageData.Length); + //Copy the request data to the unmanaged array. + Marshal.Copy(messageData, 0, unmanagedArr, messageData.Length); - //Initialize pointer for pointing to the result array. - IntPtr output = IntPtr.Zero; + //Initialize pointer for pointing to the result array. + IntPtr output = IntPtr.Zero; - //Invoke the native method. - int size = _nativeMethod(unmanagedArr, messageData.Length, ref output); + //Invoke the native method. + int size = _nativeMethod(unmanagedArr, messageData.Length, ref output); - if (size == 0) return null; + if (size == 0) return null; - //Initialize a new byte array for holding the native result. - byte[] responseData = new byte[size]; + //Initialize a new byte array for holding the native result. + byte[] responseData = new byte[size]; - //Copy the unmanaged byte array result to the managed result array. - Marshal.Copy(output, responseData, 0, size); + //Copy the unmanaged byte array result to the managed result array. + Marshal.Copy(output, responseData, 0, size); - //Generate response parser. - MessageParser parser = new MessageParser(() => Activator.CreateInstance()); + //Generate response parser. + MessageParser parser = new MessageParser(() => Activator.CreateInstance()); - //Parse the response - Response response = parser.ParseFrom(responseData); + //Parse the response + Response response = parser.ParseFrom(responseData); - //Free unmanaged memory. - Marshal.FreeHGlobal(unmanagedArr); + //Free unmanaged memory. + Marshal.FreeHGlobal(unmanagedArr); - return response; + return response; + } + catch (Exception) + { + throw; + } } } } diff --git a/Software/Visual_Studio/Tango.PMR/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.PMR/Properties/AssemblyInfo.cs index 48d625525..ece92e475 100644 --- a/Software/Visual_Studio/Tango.PMR/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Tango.PMR/Properties/AssemblyInfo.cs @@ -3,5 +3,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Tango - Protobuf Message Repository")] -[assembly: AssemblyVersion("2.0.34.1647")] +[assembly: AssemblyVersion("2.0.35.1119")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj index 0609b7bff..4090031e9 100644 --- a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj +++ b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj @@ -9,7 +9,7 @@ Properties Tango.PMR Tango.PMR - v4.6 + v4.7.2 512 diff --git a/Software/Visual_Studio/Tango.Protobuf/Tango.Protobuf.csproj b/Software/Visual_Studio/Tango.Protobuf/Tango.Protobuf.csproj index 1b1abc9f4..bf01bc079 100644 --- a/Software/Visual_Studio/Tango.Protobuf/Tango.Protobuf.csproj +++ b/Software/Visual_Studio/Tango.Protobuf/Tango.Protobuf.csproj @@ -9,7 +9,7 @@ Properties Tango.Protobuf Tango.Protobuf - v4.6 + v4.7.2 512 diff --git a/Software/Visual_Studio/Tango.SQLExaminer/Tango.SQLExaminer.csproj b/Software/Visual_Studio/Tango.SQLExaminer/Tango.SQLExaminer.csproj index cfa6aa282..a00259c58 100644 --- a/Software/Visual_Studio/Tango.SQLExaminer/Tango.SQLExaminer.csproj +++ b/Software/Visual_Studio/Tango.SQLExaminer/Tango.SQLExaminer.csproj @@ -9,7 +9,7 @@ Properties Tango.SQLExaminer Tango.SQLExaminer - v4.6 + v4.7.2 512 diff --git a/Software/Visual_Studio/Tango.Scripting/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.Scripting/Properties/AssemblyInfo.cs index d35ece44d..c57f365f8 100644 --- a/Software/Visual_Studio/Tango.Scripting/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Tango.Scripting/Properties/AssemblyInfo.cs @@ -3,5 +3,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Tango - Roslyn Scripting Components")] -[assembly: AssemblyVersion("2.0.24.1647")] +[assembly: AssemblyVersion("2.0.25.1119")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Scripting/Tango.Scripting.csproj b/Software/Visual_Studio/Tango.Scripting/Tango.Scripting.csproj index b6503101c..66cf56c98 100644 --- a/Software/Visual_Studio/Tango.Scripting/Tango.Scripting.csproj +++ b/Software/Visual_Studio/Tango.Scripting/Tango.Scripting.csproj @@ -9,7 +9,7 @@ Properties Tango.Scripting Tango.Scripting - v4.6 + v4.7.2 512 true diff --git a/Software/Visual_Studio/Tango.Scripting/app.config b/Software/Visual_Studio/Tango.Scripting/app.config index 8766b29db..3a5d80ead 100644 --- a/Software/Visual_Studio/Tango.Scripting/app.config +++ b/Software/Visual_Studio/Tango.Scripting/app.config @@ -42,6 +42,10 @@ + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Serialization/Tango.Serialization.csproj b/Software/Visual_Studio/Tango.Serialization/Tango.Serialization.csproj index 91cac4c16..c9ec3cd12 100644 --- a/Software/Visual_Studio/Tango.Serialization/Tango.Serialization.csproj +++ b/Software/Visual_Studio/Tango.Serialization/Tango.Serialization.csproj @@ -9,7 +9,7 @@ Properties Tango.Serialization Tango.Serialization - v4.6 + v4.7.2 512 diff --git a/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj b/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj index 1f6596c0d..e4aafab3d 100644 --- a/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj +++ b/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj @@ -9,7 +9,7 @@ Properties Tango.Settings Tango.Settings - v4.6 + v4.7.2 512 diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs index c8b6d3afb..d21a562fd 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs +++ b/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs @@ -378,21 +378,28 @@ namespace Tango.SharedUI.Controls fromElement.Deactivate(!KeepElementsAttached); }; + bool completed = false; + toAnimation.Completed += (_, __) => { - INavigationView navigationView = toElement.Element as INavigationView; - if (navigationView != null) + if (!completed) { - navigationView.OnNavigated(); - } + completed = true; + + INavigationView navigationView = toElement.Element as INavigationView; + if (navigationView != null) + { + navigationView.OnNavigated(); + } - INavigationViewModel fromVM = fromElement.Element.DataContext as INavigationViewModel; - INavigationViewModel toVM = toElement.Element.DataContext as INavigationViewModel; + INavigationViewModel fromVM = fromElement.Element.DataContext as INavigationViewModel; + INavigationViewModel toVM = toElement.Element.DataContext as INavigationViewModel; - if (fromVM != null && fromVM != toVM) fromVM.OnNavigatedFrom(); - if (toVM != null) toVM.OnNavigatedTo(); + if (fromVM != null && fromVM != toVM) fromVM.OnNavigatedFrom(); + if (toVM != null) toVM.OnNavigatedTo(); - _onCompleted?.Invoke(); + _onCompleted?.Invoke(); + } }; switch (TransitionType) diff --git a/Software/Visual_Studio/Tango.SharedUI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.SharedUI/Properties/AssemblyInfo.cs index 22751be2f..53327e27f 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Tango.SharedUI/Properties/AssemblyInfo.cs @@ -5,7 +5,7 @@ using System.Runtime.InteropServices; using System.Windows; [assembly: AssemblyTitle("Tango - Shared UI Components")] -[assembly: AssemblyVersion("2.0.25.1647")] +[assembly: AssemblyVersion("2.0.26.1119")] [assembly: ComVisible(false)] diff --git a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj index a17b66caf..d1bb5ce38 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj +++ b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj @@ -8,7 +8,7 @@ library Tango.SharedUI Tango.SharedUI - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 @@ -32,6 +32,12 @@ 4 + + ..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll + ..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll @@ -225,7 +231,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs b/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs index 7d215cd06..421e098ce 100644 --- a/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs +++ b/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs @@ -34,6 +34,25 @@ namespace Tango.SharedUI set { _hasErrors = value; RaisePropertyChangedAuto(); } } + private bool _isBusy; + /// + /// Gets or sets a value indicating whether this view model is currently busy doing operations. + /// + public bool IsBusy + { + get { return _isBusy; } + set { _isBusy = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(IsFree)); InvalidateRelayCommands(); } + } + + /// + /// Gets or sets a value indicating whether this view model is free to perform actions. + /// + public bool IsFree + { + get { return !IsBusy; } + set { IsBusy = !value; } + } + private ObservableCollection _validationErrors; /// /// Gets or sets the validation errors. @@ -49,6 +68,14 @@ namespace Tango.SharedUI /// public event EventHandler ErrorsChanged; + /// + /// Initializes a new instance of the class. + /// + public ViewModel() + { + IsFree = true; + } + /// /// Gets the validation errors for a specified property or for the entire entity. /// @@ -160,42 +187,15 @@ namespace Tango.SharedUI /// public T View { get; set; } - - /// - /// Initializes a new instance of the class. - /// - /// The view. - public ViewModel(T view) - { - View = view; - View.ViewAttached += (x, e) => - { - View = (T)e; - OnViewAttached(); - }; - } - /// /// Initializes a new instance of the class. /// - /// The view. - /// if set to true waits for the view to be valid before registering for the event. - public ViewModel(T view, bool delayed) + public ViewModel() : base() { - Task.Factory.StartNew(() => - { - while (view == null) - { - Thread.Sleep(10); - } - }).ContinueWith((c) => + TangoIOC.Default.GetInstanceWhenAvailable((view) => { View = view; - View.ViewAttached += (x, e) => - { - View = (T)e; - OnViewAttached(); - }; + OnViewAttached(); }); } diff --git a/Software/Visual_Studio/Tango.SharedUI/app.config b/Software/Visual_Studio/Tango.SharedUI/app.config index 462d17b27..4001bf6c8 100644 --- a/Software/Visual_Studio/Tango.SharedUI/app.config +++ b/Software/Visual_Studio/Tango.SharedUI/app.config @@ -1,5 +1,9 @@  + + +
+ @@ -42,6 +46,16 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.SharedUI/packages.config b/Software/Visual_Studio/Tango.SharedUI/packages.config index f67be0fe2..d25558b0d 100644 --- a/Software/Visual_Studio/Tango.SharedUI/packages.config +++ b/Software/Visual_Studio/Tango.SharedUI/packages.config @@ -1,5 +1,6 @@  + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Stubs/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.Stubs/Properties/AssemblyInfo.cs index 983208128..5abb6dfae 100644 --- a/Software/Visual_Studio/Tango.Stubs/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Tango.Stubs/Properties/AssemblyInfo.cs @@ -3,5 +3,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Tango - Stubs Collection")] -[assembly: AssemblyVersion("2.0.7.1633")] +[assembly: AssemblyVersion("2.0.8.1119")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Stubs/Tango.Stubs.csproj b/Software/Visual_Studio/Tango.Stubs/Tango.Stubs.csproj index f270043c1..7408e6108 100644 --- a/Software/Visual_Studio/Tango.Stubs/Tango.Stubs.csproj +++ b/Software/Visual_Studio/Tango.Stubs/Tango.Stubs.csproj @@ -9,7 +9,7 @@ Properties Tango.Stubs Tango.Stubs - v4.6 + v4.7.2 512 @@ -31,6 +31,12 @@ 4 + + ..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll + ..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll @@ -46,6 +52,7 @@ + ..\packages\System.Reactive.Core.3.1.1\lib\net46\System.Reactive.Core.dll @@ -179,7 +186,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Stubs/ViewModels/StubsViewVM.cs b/Software/Visual_Studio/Tango.Stubs/ViewModels/StubsViewVM.cs index ba7ef3610..fd210dc1a 100644 --- a/Software/Visual_Studio/Tango.Stubs/ViewModels/StubsViewVM.cs +++ b/Software/Visual_Studio/Tango.Stubs/ViewModels/StubsViewVM.cs @@ -634,6 +634,10 @@ namespace Tango.Stubs.ViewModels { AppendTextLog(ex.Message + Environment.NewLine); } + finally + { + Mouse.OverrideCursor = null; + } } /// diff --git a/Software/Visual_Studio/Tango.Stubs/app.config b/Software/Visual_Studio/Tango.Stubs/app.config index 5d794b958..0e58ccf54 100644 --- a/Software/Visual_Studio/Tango.Stubs/app.config +++ b/Software/Visual_Studio/Tango.Stubs/app.config @@ -1,5 +1,9 @@  + + +
+ @@ -46,6 +50,16 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Stubs/packages.config b/Software/Visual_Studio/Tango.Stubs/packages.config index 1e9950efc..862bebc3f 100644 --- a/Software/Visual_Studio/Tango.Stubs/packages.config +++ b/Software/Visual_Studio/Tango.Stubs/packages.config @@ -1,5 +1,6 @@  + diff --git a/Software/Visual_Studio/Tango.Synchronization/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.Synchronization/Properties/AssemblyInfo.cs index f798e9167..6a3285308 100644 --- a/Software/Visual_Studio/Tango.Synchronization/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Tango.Synchronization/Properties/AssemblyInfo.cs @@ -3,5 +3,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Tango - DataBase Synchronization Components")] -[assembly: AssemblyVersion("2.0.14.1633")] +[assembly: AssemblyVersion("2.0.15.1119")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Synchronization/Remote/RemoteDBSynchronizer.cs b/Software/Visual_Studio/Tango.Synchronization/Remote/RemoteDBSynchronizer.cs index 79c719d0e..778a24b86 100644 --- a/Software/Visual_Studio/Tango.Synchronization/Remote/RemoteDBSynchronizer.cs +++ b/Software/Visual_Studio/Tango.Synchronization/Remote/RemoteDBSynchronizer.cs @@ -32,7 +32,7 @@ namespace Tango.Synchronization.Remote sqlite.ClearDataBase(); } - using (var remoteDB = new remote.RemoteDB(SettingsManager.Default.GetOrCreate().DataBaseSource, false)) + using (var remoteDB = new remote.RemoteDB(SettingsManager.Default.GetOrCreate().DataSource)) { using (var localDB = new local.LocalDB(sqliteDbFile)) { diff --git a/Software/Visual_Studio/Tango.Synchronization/Tango.Synchronization.csproj b/Software/Visual_Studio/Tango.Synchronization/Tango.Synchronization.csproj index e02b737ab..6150888da 100644 --- a/Software/Visual_Studio/Tango.Synchronization/Tango.Synchronization.csproj +++ b/Software/Visual_Studio/Tango.Synchronization/Tango.Synchronization.csproj @@ -9,7 +9,7 @@ Properties Tango.Synchronization Tango.Synchronization - v4.6 + v4.7.2 512 diff --git a/Software/Visual_Studio/Tango.TFS/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.TFS/Properties/AssemblyInfo.cs index 734806851..c9d4e6264 100644 --- a/Software/Visual_Studio/Tango.TFS/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Tango.TFS/Properties/AssemblyInfo.cs @@ -3,5 +3,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Tango - VSTS API Library")] -[assembly: AssemblyVersion("2.0.17.1633")] +[assembly: AssemblyVersion("2.0.18.1119")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.TFS/Tango.TFS.csproj b/Software/Visual_Studio/Tango.TFS/Tango.TFS.csproj index f34892c4e..0d84fa56e 100644 --- a/Software/Visual_Studio/Tango.TFS/Tango.TFS.csproj +++ b/Software/Visual_Studio/Tango.TFS/Tango.TFS.csproj @@ -8,7 +8,7 @@ library Tango.TFS Tango.TFS - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/Tango.Touch/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.Touch/Properties/AssemblyInfo.cs index 061fe0c09..1fba0f954 100644 --- a/Software/Visual_Studio/Tango.Touch/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Tango.Touch/Properties/AssemblyInfo.cs @@ -5,7 +5,7 @@ using System.Runtime.InteropServices; using System.Windows; [assembly: AssemblyTitle("Tango - Touch Components")] -[assembly: AssemblyVersion("2.0.7.1657")] +[assembly: AssemblyVersion("2.0.8.1119")] [assembly: ComVisible(false)] [assembly:ThemeInfo( diff --git a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj index 3b66f6c61..4a9b7c7aa 100644 --- a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj +++ b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj @@ -8,7 +8,7 @@ library Tango.Touch Tango.Touch - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/Tango.Touch/app.config b/Software/Visual_Studio/Tango.Touch/app.config index 462d17b27..72700d700 100644 --- a/Software/Visual_Studio/Tango.Touch/app.config +++ b/Software/Visual_Studio/Tango.Touch/app.config @@ -42,6 +42,14 @@ + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Transport/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.Transport/Properties/AssemblyInfo.cs index 5b0835ed8..111b194c1 100644 --- a/Software/Visual_Studio/Tango.Transport/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Tango.Transport/Properties/AssemblyInfo.cs @@ -3,5 +3,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Tango - Transport Components")] -[assembly: AssemblyVersion("2.0.26.1647")] +[assembly: AssemblyVersion("2.0.27.1119")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Transport/Tango.Transport.csproj b/Software/Visual_Studio/Tango.Transport/Tango.Transport.csproj index 608538578..c0d37b76c 100644 --- a/Software/Visual_Studio/Tango.Transport/Tango.Transport.csproj +++ b/Software/Visual_Studio/Tango.Transport/Tango.Transport.csproj @@ -9,7 +9,7 @@ Properties Tango.Transport Tango.Transport - v4.6 + v4.7.2 512 diff --git a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs index 6376a43ce..94dbd54f7 100644 --- a/Software/Visual_Studio/Tango.Transport/TransporterBase.cs +++ b/Software/Visual_Studio/Tango.Transport/TransporterBase.cs @@ -26,16 +26,14 @@ namespace Tango.Transport public abstract class TransporterBase : ExtendedObject, ITransporter { private const int MESSAGE_TOKEN_LENGTH = 36; - private ConcurrentQueue _sendingQueue; + private ProducerConsumerQueue _sendingQueue; private List _pendingRequests; - private ConcurrentQueue _arrivedResponses; + private ProducerConsumerQueue _arrivedResponses; private Thread _pushThread; private Thread _pullThread; private Thread _keepAliveThread; private ITransportAdapter _adapter; private Dictionary _pendingResponses; - private AutoResetEvent _pull_wait_handle; - private AutoResetEvent _push_wait_handle; #region Events @@ -157,8 +155,8 @@ namespace Tango.Transport { _pendingRequests.Clear(); _pendingResponses.Clear(); - _arrivedResponses = new ConcurrentQueue(); - _sendingQueue = new ConcurrentQueue(); + _arrivedResponses = new ProducerConsumerQueue(); + _sendingQueue = new ProducerConsumerQueue(); } if (oldAdapter != null) @@ -250,14 +248,11 @@ namespace Tango.Transport { MaxMessageBufferCount = 1000; - _pull_wait_handle = new AutoResetEvent(false); - _push_wait_handle = new AutoResetEvent(false); - Encoder = new ProtoEncoder(); _pendingResponses = new Dictionary(); - _sendingQueue = new ConcurrentQueue(); + _sendingQueue = new ProducerConsumerQueue(); _pendingRequests = new List(); - _arrivedResponses = new ConcurrentQueue(); + _arrivedResponses = new ProducerConsumerQueue(); RequestTimeout = TimeSpan.FromSeconds(5); } @@ -279,9 +274,9 @@ namespace Tango.Transport ///
public void ClearQueues() { - _sendingQueue = new ConcurrentQueue(); + _sendingQueue = new ProducerConsumerQueue(); _pendingRequests = new List(); - _arrivedResponses = new ConcurrentQueue(); + _arrivedResponses = new ProducerConsumerQueue(); } /// @@ -793,9 +788,8 @@ namespace Tango.Transport /// The message. private void EnqueueMessageOut(TransportMessageBase message) { - _sendingQueue.Enqueue(message); + _sendingQueue.BlockEnqueue(message); MessageBufferCount = _sendingQueue.Count + _arrivedResponses.Count; - _push_wait_handle.Set(); } /// @@ -804,9 +798,8 @@ namespace Tango.Transport /// The data. private void EnqueueMessageIn(byte[] data) { - _arrivedResponses.Enqueue(data); + _arrivedResponses.BlockEnqueue(data); MessageBufferCount = _sendingQueue.Count + _arrivedResponses.Count; - _pull_wait_handle.Set(); } #endregion @@ -822,62 +815,57 @@ namespace Tango.Transport { while (State == TransportComponentState.Connected) { - while (Adapter != null && _sendingQueue.Count > 0) + while (Adapter != null) { - TransportMessageBase message; - if (_sendingQueue.TryDequeue(out message)) - { - if (_sendingQueue.Count > MaxMessageBufferCount) - { - var toDropItems = _sendingQueue.Where(x => x.Message.GetType() == message.GetType()).ToList(); + TransportMessageBase message = _sendingQueue.BlockDequeue(); - foreach (var item in toDropItems) - { - TransportMessageBase toDrop; - _sendingQueue.TryDequeue(out toDrop); - } + if (_sendingQueue.Count > MaxMessageBufferCount) + { + var toDropItems = _sendingQueue.Where(x => x.Message.GetType() == message.GetType()).ToList(); - if (toDropItems.Count > 0) - { - LogManager.Log(String.Format("Dropped {0} outgoing messages of type {1}.", toDropItems.Count, message.Message.GetType()), LogCategory.Warning); - } + foreach (var item in toDropItems) + { + TransportMessageBase toDrop = _sendingQueue.BlockDequeue(); } - try + if (toDropItems.Count > 0) { - if (Adapter.State == TransportComponentState.Connected) - { - if (message.Token.Length != MESSAGE_TOKEN_LENGTH) - { - message.SetException(LogManager.Log(new InvalidOperationException("Invalid message token length: " + message.Token))); - continue; - } + LogManager.Log(String.Format("Dropped {0} outgoing messages of type {1}.", toDropItems.Count, message.Message.GetType()), LogCategory.Warning); + } + } - Adapter.Write(message.Serialize()); - LogManager.Log("Message sent on adapter: " + Adapter.Address + "...", LogCategory.Debug, message.Message); - } - else + try + { + if (Adapter.State == TransportComponentState.Connected) + { + if (message.Token.Length != MESSAGE_TOKEN_LENGTH) { - LogManager.Log("Could not send message " + message.Message.GetType().Name + ". Adapter is disconnected.", LogCategory.Warning); + message.SetException(LogManager.Log(new InvalidOperationException("Invalid message token length: " + message.Token))); + continue; } - if (message.Direction == TransportMessageDirection.Request) - { - _pendingRequests.Add(message); - } - else - { - message.SetResult(true, true); - } + Adapter.Write(message.Serialize()); + LogManager.Log("Message sent on adapter: " + Adapter.Address + "...", LogCategory.Debug, message.Message); } - catch (Exception ex) + else + { + LogManager.Log("Could not send message " + message.Message.GetType().Name + ". Adapter is disconnected.", LogCategory.Warning); + } + + if (message.Direction == TransportMessageDirection.Request) + { + _pendingRequests.Add(message); + } + else { - message.SetException(ex); + message.SetResult(true, true); } } + catch (Exception ex) + { + message.SetException(ex); + } } - - _push_wait_handle.WaitOne(); } } catch (Exception ex) @@ -899,137 +887,132 @@ namespace Tango.Transport { while (State == TransportComponentState.Connected) { - byte[] data; - - while (Adapter != null && _arrivedResponses.Count > 0) + while (Adapter != null) { - if (_arrivedResponses.TryDequeue(out data)) - { - LogManager.Log("Message received on adapter: " + Adapter.Address, LogCategory.Debug); + byte[] data = _arrivedResponses.BlockDequeue(); - LogManager.Log("Parsing message container...", LogCategory.Debug); - MessageContainer container = Encoder.DecodeContainer(data); + LogManager.Log("Message received on adapter: " + Adapter.Address, LogCategory.Debug); - LogManager.Log("Message was identified as " + container.Type + ".", LogCategory.Debug); + LogManager.Log("Parsing message container...", LogCategory.Debug); + MessageContainer container = Encoder.DecodeContainer(data); - if (container.Token.Length != MESSAGE_TOKEN_LENGTH) - { - LogManager.Log("Invalid message token length received: " + container.Token, LogCategory.Error); - continue; - } + LogManager.Log("Message was identified as " + container.Type + ".", LogCategory.Debug); - LogManager.Log("Searching for pending request token: " + container.Token, LogCategory.Debug); + if (container.Token.Length != MESSAGE_TOKEN_LENGTH) + { + LogManager.Log("Invalid message token length received: " + container.Token, LogCategory.Error); + continue; + } - TransportMessageBase request = _pendingRequests.ToList().SingleOrDefault(x => x.Token == container.Token); + LogManager.Log("Searching for pending request token: " + container.Token, LogCategory.Debug); - if (request != null) - { - LogManager.Log("Found pending request: " + (request.Message.GetType().IsGenericType ? request.Message.GetType().GetGenericArguments()[0].Name : request.Message.GetType().Name), LogCategory.Debug); + TransportMessageBase request = _pendingRequests.ToList().SingleOrDefault(x => x.Token == container.Token); - if (!request.IsContinuous) - { - LogManager.Log("Pending request was identified as 'single response'. Removing pending request.", LogCategory.Debug); + if (request != null) + { + LogManager.Log("Found pending request: " + (request.Message.GetType().IsGenericType ? request.Message.GetType().GetGenericArguments()[0].Name : request.Message.GetType().Name), LogCategory.Debug); - _pendingRequests.Remove(request); + if (!request.IsContinuous) + { + LogManager.Log("Pending request was identified as 'single response'. Removing pending request.", LogCategory.Debug); - try + _pendingRequests.Remove(request); + + try + { + if (container.Error == ErrorCode.None) { - if (container.Error == ErrorCode.None) - { - var message = Encoder.Decode(data); - LogManager.Log("Parsing inner response message and setting pending request task result...", LogCategory.Debug, message); - request.SetResult(message, true); - LogManager.Log("Message enquirer released...", LogCategory.Debug); - } - else - { - request.SetException(LogManager.Log(new ResponseErrorException(container), LogCategory.Warning)); - } + var message = Encoder.Decode(data); + LogManager.Log("Parsing inner response message and setting pending request task result...", LogCategory.Debug, message); + request.SetResult(message, true); + LogManager.Log("Message enquirer released...", LogCategory.Debug); } - catch (Exception ex) + else { - request.SetException(LogManager.Log(ex, "Error parsing response message.")); + request.SetException(LogManager.Log(new ResponseErrorException(container), LogCategory.Warning)); } } - else + catch (Exception ex) { - LogManager.Log("Pending request was identified as 'continuous response'. keeping pending request.", LogCategory.Debug); + request.SetException(LogManager.Log(ex, "Error parsing response message.")); + } + } + else + { + LogManager.Log("Pending request was identified as 'continuous response'. keeping pending request.", LogCategory.Debug); - try + try + { + if (container.Error == ErrorCode.None) { - if (container.Error == ErrorCode.None) - { - var message = Encoder.Decode(data); + var message = Encoder.Decode(data); - LogManager.Log("Parsing inner response message and invoking continuous response callback...", LogCategory.Debug, message); + LogManager.Log("Parsing inner response message and invoking continuous response callback...", LogCategory.Debug, message); - if (container.Completed) - { - LogManager.Log("Continuous sequence completed.", LogCategory.Debug); - } - request.SetResult(message, container.Completed); - } - else if (container.Error == ErrorCode.ContinuousResponseAborted) - { - String m = "Continuous response " + container.Type + " has been aborted: " + container.Error.ToString(); - LogManager.Log(m, LogCategory.Info); - request.SetException(new ContinuousResponseAbortedException(m)); - } - else + if (container.Completed) { - LogManager.Log("Continuous response has returned with error: " + container.Error.ToString(), LogCategory.Warning); - request.SetException(new ResponseErrorException(container)); + LogManager.Log("Continuous sequence completed.", LogCategory.Debug); } + request.SetResult(message, container.Completed); } - catch (Exception ex) + else if (container.Error == ErrorCode.ContinuousResponseAborted) + { + String m = "Continuous response " + container.Type + " has been aborted: " + container.Error.ToString(); + LogManager.Log(m, LogCategory.Info); + request.SetException(new ContinuousResponseAbortedException(m)); + } + else { - LogManager.Log(ex, "Error parsing response message."); + LogManager.Log("Continuous response has returned with error: " + container.Error.ToString(), LogCategory.Warning); + request.SetException(new ResponseErrorException(container)); } } - } - else - { - if (container.Type.ToString().EndsWith("Response")) + catch (Exception ex) { - LogManager.Log(String.Format("A response message with no awaiting request was identified. {0}, Token: {1}. Message ignored.", container.Type, container.Token), LogCategory.Warning); - continue; + LogManager.Log(ex, "Error parsing response message."); } + } + } + else + { + if (container.Type.ToString().EndsWith("Response")) + { + LogManager.Log(String.Format("A response message with no awaiting request was identified. {0}, Token: {1}. Message ignored.", container.Type, container.Token), LogCategory.Warning); + continue; + } - LogManager.Log("Message was identified as a new request message: " + container.Type.ToString(), LogCategory.Debug); + LogManager.Log("Message was identified as a new request message: " + container.Type.ToString(), LogCategory.Debug); - try + try + { + LogManager.Log("Saving request token: " + container.Token, LogCategory.Debug); + _pendingResponses.Add(container.Token, new PendingResponse(container.Continuous)); + + if (container.Type == MessageType.KeepAliveRequest) + { + LogManager.Log("Submitting keep alive response...", LogCategory.Debug); + SendResponse(new KeepAliveResponse(), container.Token); + } + else { - LogManager.Log("Saving request token: " + container.Token, LogCategory.Debug); - _pendingResponses.Add(container.Token, new PendingResponse(container.Continuous)); + LogManager.Log("Invoking RequestReceived event...", LogCategory.Debug, container); - if (container.Type == MessageType.KeepAliveRequest) + try { - LogManager.Log("Submitting keep alive response...", LogCategory.Debug); - SendResponse(new KeepAliveResponse(), container.Token); + Task.Factory.StartNew(() => OnRequestReceived(container)); } - else + catch { - LogManager.Log("Invoking RequestReceived event...", LogCategory.Debug, container); - - try - { - Task.Factory.StartNew(() => OnRequestReceived(container)); - } - catch - { - //Ignore any exceptions that may raise on the client side.. - } + //Ignore any exceptions that may raise on the client side.. } } - catch (Exception ex) - { - LogManager.Log(ex); - } + } + catch (Exception ex) + { + LogManager.Log(ex); } } } - - _pull_wait_handle.WaitOne(); } } catch (Exception ex) diff --git a/Software/Visual_Studio/Tango.UnitTesting/App.config b/Software/Visual_Studio/Tango.UnitTesting/App.config index 5c4ce34ef..da15f5d2c 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/App.config +++ b/Software/Visual_Studio/Tango.UnitTesting/App.config @@ -66,6 +66,14 @@ + + + + + + + + diff --git a/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs index 305849694..0ea7b59ef 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs @@ -17,7 +17,7 @@ namespace Tango.UnitTesting { String guid = Guid.NewGuid().ToString(); - using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.GetOrCreate().DataBaseSource, false)) + using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.GetOrCreate().DataSource)) { var action = new DAL.Remote.DB.ACTION_TYPES(); action.CODE = 1; @@ -30,7 +30,7 @@ namespace Tango.UnitTesting db.SaveChanges(); } - using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.GetOrCreate().DataBaseSource, false)) + using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.GetOrCreate().DataSource)) { var action = db.ACTION_TYPES.Single(x => x.GUID == guid); db.ACTION_TYPES.Remove(action); @@ -67,7 +67,7 @@ namespace Tango.UnitTesting [TestMethod] public void Validate_SQLite_Connection_Using_Observables() { - using (ObservablesContext db = ObservablesContext.CreateDefault(@"D:\Development\Tango\Software\DB\Tango.db")) + using (ObservablesContext db = ObservablesContext.CreateDefault(@"D:\Development\Tango\Software\DB\Tango.db", DataSourceType.SQLite)) { var actions = db.ActionTypes.ToList(); } diff --git a/Software/Visual_Studio/Tango.UnitTesting/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.UnitTesting/Properties/AssemblyInfo.cs index ec0be482c..b9f6f9990 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/Properties/AssemblyInfo.cs @@ -3,5 +3,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Tango - Unit Testing")] -[assembly: AssemblyVersion("2.0.11.1645")] +[assembly: AssemblyVersion("2.0.12.1119")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.UnitTesting/SQLExaminer_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/SQLExaminer_TST.cs index 5ab70938c..5b7ce16ca 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/SQLExaminer_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/SQLExaminer_TST.cs @@ -9,6 +9,7 @@ using System.Text; using System.Threading.Tasks; using Tango.BL; using Tango.BL.Entities; +using Tango.Core; using Tango.Core.DB; using Tango.Core.IO; using Tango.SQLExaminer; @@ -274,7 +275,7 @@ namespace Tango.UnitTesting String job_guid = String.Empty; - using (var context = ObservablesContext.CreateDefault("localhost\\SQLEXPRESS", target_db)) + using (var context = ObservablesContext.CreateDefault("localhost\\SQLEXPRESS", target_db, DataSourceType.SQLServer)) { context.Configuration.LazyLoadingEnabled = false; Assert.IsTrue(context.Machines.Count() == 1); @@ -323,13 +324,13 @@ namespace Tango.UnitTesting Assert.IsTrue(data_report.HasDifferences); //Check the new job exists on source.. - using (var context = ObservablesContext.CreateDefault("localhost\\SQLEXPRESS", source_db)) + using (var context = ObservablesContext.CreateDefault("localhost\\SQLEXPRESS", source_db, DataSourceType.SQLServer)) { Assert.IsTrue(context.Jobs.Any(x => x.Guid == job_guid)); } //Now change configuration in source and push to machine - using (var context = ObservablesContext.CreateDefault("localhost\\SQLEXPRESS", source_db)) + using (var context = ObservablesContext.CreateDefault("localhost\\SQLEXPRESS", source_db, DataSourceType.SQLServer)) { var machine = context.Machines.SingleOrDefault(x => x.SerialNumber == machine_serial_number); machine.Configuration.Name = "Test Name " + new Random().Next(0, 1000); diff --git a/Software/Visual_Studio/Tango.UnitTesting/Synchronization_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/Synchronization_TST.cs index e4bbcaf51..d6713c2ac 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Synchronization_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/Synchronization_TST.cs @@ -21,7 +21,7 @@ namespace Tango.UnitTesting { var console = Helper.InitializeLogging(true); - using (var remoteDB = new remote.RemoteDB(SettingsManager.Default.GetOrCreate().DataBaseSource, false)) + using (var remoteDB = new remote.RemoteDB(SettingsManager.Default.GetOrCreate().DataSource)) { using (var localDB = new local.LocalDB(Helper.GetSQLiteFilePath())) { @@ -45,7 +45,7 @@ namespace Tango.UnitTesting [TestMethod] public void Generate_Demo_Remote_Machine() { - using (var remoteDB = new remote.RemoteDB(SettingsManager.Default.GetOrCreate().DataBaseSource, false)) + using (var remoteDB = new remote.RemoteDB(SettingsManager.Default.GetOrCreate().DataSource)) { var organization = new remote.ORGANIZATION() { diff --git a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj index 0bf97caa6..7a37655a8 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj +++ b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj @@ -9,7 +9,7 @@ Properties Tango.UnitTesting Tango.UnitTesting - v4.6 + v4.7.2 512 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15.0 diff --git a/Software/Visual_Studio/Tango.Video/Tango.Video.csproj b/Software/Visual_Studio/Tango.Video/Tango.Video.csproj index e485ce615..d60bf3f88 100644 --- a/Software/Visual_Studio/Tango.Video/Tango.Video.csproj +++ b/Software/Visual_Studio/Tango.Video/Tango.Video.csproj @@ -8,7 +8,7 @@ library Tango.Video Tango.Video - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/Tango.Visuals/Knob/Knob.xaml.cs b/Software/Visual_Studio/Tango.Visuals/Knob/Knob.xaml.cs index 44b9a7fa4..357582a17 100644 --- a/Software/Visual_Studio/Tango.Visuals/Knob/Knob.xaml.cs +++ b/Software/Visual_Studio/Tango.Visuals/Knob/Knob.xaml.cs @@ -298,7 +298,7 @@ namespace Tango.Visuals set { SetValue(ChangeProperty, value); } } public static readonly DependencyProperty ChangeProperty = - DependencyProperty.Register("Change", typeof(double), typeof(Knob), new PropertyMetadata(0.01)); + DependencyProperty.Register("Change", typeof(double), typeof(Knob), new PropertyMetadata(1.0)); /// /// Gets or sets the width of the ticks. @@ -387,7 +387,7 @@ namespace Tango.Visuals this.Loaded += Knob_Loaded; moveThumb.AddHandler(Thumb.MouseEnterEvent, new MouseEventHandler(ellipseGrid_MouseEnter), true); moveThumb.AddHandler(Thumb.MouseLeaveEvent, new MouseEventHandler(ellipseGrid_MouseLeave), true); - this.PreviewKeyDown += Knob_PreviewKeyDown; + this.AddHandler(UserControl.PreviewKeyDownEvent, new KeyEventHandler(Knob_PreviewKeyDown), true); this.PreviewMouseDown += Knob_PreviewMouseDown; this.Focusable = true; diff --git a/Software/Visual_Studio/Tango.Visuals/Tango.Visuals.csproj b/Software/Visual_Studio/Tango.Visuals/Tango.Visuals.csproj index 337b91faa..682b64c39 100644 --- a/Software/Visual_Studio/Tango.Visuals/Tango.Visuals.csproj +++ b/Software/Visual_Studio/Tango.Visuals/Tango.Visuals.csproj @@ -9,7 +9,7 @@ Properties Tango.Visuals Tango.Visuals - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/Tango.WiFi/Tango.WiFi.csproj b/Software/Visual_Studio/Tango.WiFi/Tango.WiFi.csproj index 7e4d85621..22d1e4d4d 100644 --- a/Software/Visual_Studio/Tango.WiFi/Tango.WiFi.csproj +++ b/Software/Visual_Studio/Tango.WiFi/Tango.WiFi.csproj @@ -10,7 +10,7 @@ Properties Tango.WiFi Tango.WiFi - v4.6 + v4.7.2 @@ -120,6 +120,11 @@ + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Properties/AssemblyInfo.cs index 4251bcef5..dbd169b02 100644 --- a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Properties/AssemblyInfo.cs @@ -3,5 +3,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Tango - Stubs execution GUI utility")] -[assembly: AssemblyVersion("3.2.4.1347")] +[assembly: AssemblyVersion("3.2.5.1119")] diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Tango.Stubs.UI.csproj b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Tango.Stubs.UI.csproj index e2f57e4c6..0dd165bb4 100644 --- a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Tango.Stubs.UI.csproj +++ b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Tango.Stubs.UI.csproj @@ -8,7 +8,7 @@ WinExe Tango.Stubs.UI StubsExecutionGUI - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/Utilities/Tango.TransportRouter.UI/App.config b/Software/Visual_Studio/Utilities/Tango.TransportRouter.UI/App.config index d14be49eb..adc853f50 100644 --- a/Software/Visual_Studio/Utilities/Tango.TransportRouter.UI/App.config +++ b/Software/Visual_Studio/Utilities/Tango.TransportRouter.UI/App.config @@ -49,6 +49,14 @@ + + + + + + + + diff --git a/Software/Visual_Studio/Utilities/Tango.TransportRouter.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Utilities/Tango.TransportRouter.UI/Properties/AssemblyInfo.cs index 159a803f0..bebe7e316 100644 --- a/Software/Visual_Studio/Utilities/Tango.TransportRouter.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Utilities/Tango.TransportRouter.UI/Properties/AssemblyInfo.cs @@ -3,5 +3,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Tango - Transport Routing Utility")] -[assembly: AssemblyVersion("2.0.1.1407")] +[assembly: AssemblyVersion("2.0.2.1119")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.TransportRouter.UI/Tango.TransportRouter.UI.csproj b/Software/Visual_Studio/Utilities/Tango.TransportRouter.UI/Tango.TransportRouter.UI.csproj index 89d7aa2f9..831db6598 100644 --- a/Software/Visual_Studio/Utilities/Tango.TransportRouter.UI/Tango.TransportRouter.UI.csproj +++ b/Software/Visual_Studio/Utilities/Tango.TransportRouter.UI/Tango.TransportRouter.UI.csproj @@ -8,7 +8,7 @@ WinExe Tango.TransportRouter.UI Tango.TransportRouter.UI - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/Utilities/Tango.UITests/App.config b/Software/Visual_Studio/Utilities/Tango.UITests/App.config index f6e6de0cc..77c59fc95 100644 --- a/Software/Visual_Studio/Utilities/Tango.UITests/App.config +++ b/Software/Visual_Studio/Utilities/Tango.UITests/App.config @@ -56,6 +56,10 @@ + + + + diff --git a/Software/Visual_Studio/Utilities/Tango.UITests/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Utilities/Tango.UITests/Properties/AssemblyInfo.cs index 686d8056f..0cceda897 100644 --- a/Software/Visual_Studio/Utilities/Tango.UITests/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Utilities/Tango.UITests/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ using System.Windows; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.16.1645")] +[assembly: AssemblyVersion("1.0.17.1119")] [assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Software/Visual_Studio/Utilities/Tango.UITests/Tango.UITests.csproj b/Software/Visual_Studio/Utilities/Tango.UITests/Tango.UITests.csproj index a89b67dfb..593b1ecd3 100644 --- a/Software/Visual_Studio/Utilities/Tango.UITests/Tango.UITests.csproj +++ b/Software/Visual_Studio/Utilities/Tango.UITests/Tango.UITests.csproj @@ -8,7 +8,7 @@ WinExe Tango.UITests Tango.UITests - v4.6 + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 diff --git a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/Properties/AssemblyInfo.cs b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/Properties/AssemblyInfo.cs index e1969199b..80eec3400 100644 --- a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.1119")] [assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/Tango.BuildExtensions.csproj b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/Tango.BuildExtensions.csproj index ccc33aac4..f2aee8e22 100644 --- a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/Tango.BuildExtensions.csproj +++ b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/Tango.BuildExtensions.csproj @@ -40,7 +40,7 @@ Properties Tango.BuildExtensions Tango.BuildExtensions - v4.6 + v4.7.2 true true true diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj b/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj index 87d50b99d..bc05f04bc 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj +++ b/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj @@ -15,7 +15,7 @@ Properties Tango.MachineService Tango.MachineService - v4.6 + v4.7.2 false true -- cgit v1.3.1 From 9f112324a1196bffd1660122285aafc2aff63219 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 26 Aug 2018 10:37:06 +0300 Subject: some bug correction tests (heaters change, job end) #221, #224 --- .../Embedded/Drivers/FPGA/FPGA_SPI_Comm.c | 4 +- .../Embedded/Modules/Diagnostics/Diagnostics.c | 110 ++++++++++++++------- .../Embedded/Modules/Heaters/Heaters_print.c | 4 + .../Modules/Stubs_Handler/Stub_Cartridge.c | 43 +------- .../Embedded/StateMachines/Printing/JobSTM.c | 6 +- 5 files changed, 85 insertions(+), 82 deletions(-) (limited to 'Software') diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c index 537bacea0..608b8d0ad 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c @@ -90,7 +90,7 @@ static FpgaMotMap_t FpgaMotMap[NUM_OF_MOTORS] = {&F1_MOTO_RLOADARM_A1_TX_00, &F1_MOTO_RLOADARM_A1_TX_01, &F1_MOTO_RLOADARM_A1_RX_00 ,&F1_MOTO_RLOADARM_A1_RX_01 ,&F1_MOTO_RLOADARM_A1_WORDS ,&F1_Moto_Driver_NBUSY2_D, &F1_SPI_Busy1_D}, //MOTOR_RLOADING - Right Loading {&F1_MOTO_RLOADING_A1_TX_00, &F1_MOTO_RLOADING_A1_TX_01, &F1_MOTO_RLOADING_A1_RX_00, &F1_MOTO_RLOADING_A1_RX_01, &F1_MOTO_RLOADING_A1_WORDS, &F1_Moto_Driver_NBUSY2_D, &F1_SPI_Busy1_D}, - +/* //MOTOR_SPARE1_1 - Spare {&F3_MOTO_SPARE1_1_A1_TX_00, &F3_MOTO_SPARE1_1_A1_TX_01, &F3_MOTO_SPARE1_1_A1_RX_00 ,&F3_MOTO_SPARE1_1_A1_RX_01 ,&F3_MOTO_SPARE1_1_A1_WORDS ,&F3_Moto_Driver_NBUSY1_D, &F3_SPI_Busy1_D}, //MOTOR_SPARE1_2 - Spare @@ -99,7 +99,7 @@ static FpgaMotMap_t FpgaMotMap[NUM_OF_MOTORS] = {&F3_MOTO_SPARE2_1_A1_TX_00, &F3_MOTO_SPARE2_1_A1_TX_01, &F3_MOTO_SPARE2_1_A1_RX_00 ,&F3_MOTO_SPARE2_1_A1_RX_01 ,&F3_MOTO_SPARE2_1_A1_WORDS ,&F3_Moto_Driver_NBUSY1_D, &F3_SPI_Busy1_D}, //MOTOR_SPARE2_2 - Spare {&F3_MOTO_SPARE2_2_A1_TX_00, &F3_MOTO_SPARE2_2_A1_TX_01, &F3_MOTO_SPARE2_2_A1_RX_00 ,&F3_MOTO_SPARE2_2_A1_RX_01 ,&F3_MOTO_SPARE2_2_A1_WORDS ,&F3_Moto_Driver_NBUSY1_D, &F3_SPI_Busy1_D}, - +*/ }; uint8_t FPGA_SPI_Transnit(TimerMotors_t _motorId) diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 477fc0732..1eabcdeba 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -50,12 +50,17 @@ uint32_t Diagnostics_ControlTrigger(uint32_t IfIndex, uint32_t ReadValue); uint32_t Diagnostics_TenMiliControlTrigger(uint32_t IfIndex, uint32_t ReadValue); +DiagnosticsMonitors DiagnosticsMonitor = DIAGNOSTICS_MONITORS__INIT; + #define DIAGNOSTICS_LIMIT 10 #define DIAGNOSTICS_DANCER_LIMIT 100 int DiagnosticsIndex = 0; int DiagnosticCollectionLimit = 3; //number of data samples to collect before sending to the host -int DiagnosticLimit = eHundredMillisecond; //frequency of data collection +//int DiagnosticLimit = eHundredMillisecond; //frequency of data collection +//int DiagnosticFastLimit = eTenMillisecond; //frequency of data collection +int DiagnosticLimit =eHundredMillisecond; //frequency of data collection int DiagnosticFastLimit = eTenMillisecond; //frequency of data collection + //DigitalPin DigitalPinArray[1][DIAGNOSTICS_LIMIT]; double dancer1angle[DIAGNOSTICS_LIMIT]; double dancer2angle[DIAGNOSTICS_LIMIT]; @@ -81,6 +86,9 @@ double dryerzone3temperature[DIAGNOSTICS_LIMIT]; double dispensermotorfrequency[MAX_SYSTEM_DISPENSERS][DIAGNOSTICS_LIMIT]; double dispenserspressure[MAX_SYSTEM_DISPENSERS][DIAGNOSTICS_LIMIT]; +DoubleArray DispenserFreq[MAX_SYSTEM_DISPENSERS]; +DoubleArray DiagnosticsDispenserPressure[MAX_SYSTEM_DISPENSERS]; + /*double dispenser1motorfrequency[DIAGNOSTICS_LIMIT]; double dispenser2motorfrequency[DIAGNOSTICS_LIMIT]; double dispenser3motorfrequency[DIAGNOSTICS_LIMIT]; @@ -116,12 +124,23 @@ typedef struct DiagnosticsMessage{ void DiagnosticsInit(void) { + int i; Error_Block eb; Error_init(&eb); DiagnosticsMsgQ = Mailbox_create(sizeof(DiagnosticsMessageStruc), 20, NULL,&eb); + DiagnosticsMonitor.dispensersmotorsfrequency = (DoubleArray**)malloc(sizeof(DoubleArray *)*8); + DiagnosticsMonitor.dispenserspressure = (DoubleArray**)malloc(sizeof(DoubleArray)*8); + DiagnosticsMonitor.dispenserslinearpositions = (DoubleArray**)malloc(sizeof(DoubleArray)*8); + DiagnosticsMonitor.dispensersangularencoders = (DoubleArray**)malloc(sizeof(DoubleArray)*8); + for (i = 0; icartridgeid - //writeLine("cartridge Request: "); - - //writeFloat(request->cartridgeid); - /* int i; for( i=0;i<8;i++) @@ -57,20 +51,8 @@ void Stub_CartridgeReadRequest(MessageContainer* requestContainer) response.has_cartridgeused = false; status_response(status,&response.status, &response.statusword ,&response.has_statusword); -/* - writeLine("Sending Response: "); - - writeFloat(response.cartridgeid); - writeString(", "); - writeFloat(response.cartridgecolor); - writeString(", "); - writeFloat(response.cartridgeversion); - writeString(", "); - writeFloat(response.cartridgedata); - writeString(", "); - writeFloat(response.cartridgeused); - writeString(", "); -*/ + + Write_status_response(status); responseContainer = createContainer(MESSAGE_TYPE__StubCartridgeReadResponse, requestContainer->token, true, &response, &stub_cartridge_read_response__pack, &stub_cartridge_read_response__get_packed_size); @@ -97,19 +79,8 @@ void Stub_CartridgeWriteRequest(MessageContainer* requestContainer) //request->cartridgeversion //request->cartridgedata //request->cartridgeused -/* - writeLine("Cartridge Request: "); - - writeFloat(request->cartridgeid); - writeString(", "); - writeFloat(request->cartridgecolor); - writeString(", "); - writeFloat(request->cartridgeversion); - writeString(", "); - writeFloat(request->cartridgedata); - writeString(", "); - writeFloat(request->cartridgeused); -*/ + + StubCartridgeWriteResponse response = STUB_CARTRIDGE_WRITE_RESPONSE__INIT; response.cartridgeid = request->cartridgeid; @@ -120,13 +91,7 @@ void Stub_CartridgeWriteRequest(MessageContainer* requestContainer) // response.statusword = OK; // response.has_statusword = true; status_response(status,&response.status, &response.statusword ,&response.has_statusword); -/* - writeLine("Sending Response: "); - writeFloat(response.cartridgeid); - writeString(", ");*/ -// writeFloat(response.statusword); -// WRITELINESTATUS; Write_status_response(status); responseContainer = createContainer(MESSAGE_TYPE__StubCartridgeWriteResponse, requestContainer->token, true, &response, &stub_cartridge_write_response__pack, &stub_cartridge_write_response__get_packed_size); diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index 7b95c9c4d..79eacf9b3 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -303,12 +303,12 @@ void JobAbortFunc(MessageContainer* requestContainer) free(responseContainer.data.data); SendChars((char*)container_buffer, container_size); abort_job_request__free_unpacked(request,NULL); - //We keep the job request until it is done - if (CurrentJobRequest!= NULL) - job_request__free_unpacked(CurrentJobRequest,NULL); JobAbortedByUser = true; EndState(CurrentJob, "Job Aborted by user"); CurrentJob = NULL; + //We keep the job request until it is done + if (CurrentJobRequest!= NULL) + job_request__free_unpacked(CurrentJobRequest,NULL); CurrentJobRequest = NULL; -- cgit v1.3.1 From db3dc558ec5fe5f3584081795865cd22f912da7d Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 26 Aug 2018 10:54:35 +0300 Subject: Set Digital request --- .../Embedded_SW/Embedded/Communication/Container.c | 3 ++ .../Modules/Stubs_Handler/Stub_Cartridge.c | 43 +++------------------- 2 files changed, 8 insertions(+), 38 deletions(-) (limited to 'Software') diff --git a/Software/Embedded_SW/Embedded/Communication/Container.c b/Software/Embedded_SW/Embedded/Communication/Container.c index 74c64b8b5..96f5b6a3e 100644 --- a/Software/Embedded_SW/Embedded/Communication/Container.c +++ b/Software/Embedded_SW/Embedded/Communication/Container.c @@ -281,6 +281,9 @@ void receive_callback(char* buffer, size_t length) case MESSAGE_TYPE__SetComponentValueRequest: SetComponentValueRequestRequestFunc(requestContainer); break; + case MESSAGE_TYPE__SetDigitalOutRequest: + SetDigitalOutRequestRequestFunc(requestContainer); + break; case MESSAGE_TYPE__StubI2CReadBytesRequest: Stub_I2CReadBytesRequest(requestContainer); break; diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c index 68b79edeb..6203b40cc 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c @@ -12,7 +12,7 @@ #include "Drivers/USB_Communication/USBCDCD.h" -//#include "drivers/twine_graphicslib/graphics_adapter.h" + #include "Stub_Status.h" @@ -25,10 +25,6 @@ void Stub_CartridgeReadRequest(MessageContainer* requestContainer) //request->cartridgeid - //writeLine("cartridge Request: "); - - //writeFloat(request->cartridgeid); - /* int i; for( i=0;i<8;i++) @@ -57,20 +53,8 @@ void Stub_CartridgeReadRequest(MessageContainer* requestContainer) response.has_cartridgeused = false; status_response(status,&response.status, &response.statusword ,&response.has_statusword); -/* - writeLine("Sending Response: "); - - writeFloat(response.cartridgeid); - writeString(", "); - writeFloat(response.cartridgecolor); - writeString(", "); - writeFloat(response.cartridgeversion); - writeString(", "); - writeFloat(response.cartridgedata); - writeString(", "); - writeFloat(response.cartridgeused); - writeString(", "); -*/ + + Write_status_response(status); responseContainer = createContainer(MESSAGE_TYPE__StubCartridgeReadResponse, requestContainer->token, true, &response, &stub_cartridge_read_response__pack, &stub_cartridge_read_response__get_packed_size); @@ -97,19 +81,8 @@ void Stub_CartridgeWriteRequest(MessageContainer* requestContainer) //request->cartridgeversion //request->cartridgedata //request->cartridgeused -/* - writeLine("Cartridge Request: "); - - writeFloat(request->cartridgeid); - writeString(", "); - writeFloat(request->cartridgecolor); - writeString(", "); - writeFloat(request->cartridgeversion); - writeString(", "); - writeFloat(request->cartridgedata); - writeString(", "); - writeFloat(request->cartridgeused); -*/ + + StubCartridgeWriteResponse response = STUB_CARTRIDGE_WRITE_RESPONSE__INIT; response.cartridgeid = request->cartridgeid; @@ -120,13 +93,7 @@ void Stub_CartridgeWriteRequest(MessageContainer* requestContainer) // response.statusword = OK; // response.has_statusword = true; status_response(status,&response.status, &response.statusword ,&response.has_statusword); -/* - writeLine("Sending Response: "); - writeFloat(response.cartridgeid); - writeString(", ");*/ -// writeFloat(response.statusword); -// WRITELINESTATUS; Write_status_response(status); responseContainer = createContainer(MESSAGE_TYPE__StubCartridgeWriteResponse, requestContainer->token, true, &response, &stub_cartridge_write_response__pack, &stub_cartridge_write_response__get_packed_size); -- cgit v1.3.1 From adac7c57abd94534ef8037ba5748712864605969 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 26 Aug 2018 12:24:58 +0300 Subject: send dancer/motor data all the time --- .../Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Software') diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 1eabcdeba..b95b35eb2 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -180,7 +180,7 @@ void DiagnosticLoadTemperature(int HeaterId, int temperature) } void DiagnosticLoadSpeedSensor(uint32_t value) { - SpeedValue[SpeedCounterIndex] = value/100; + SpeedValue[SpeedCounterIndex] = value; SpeedCounterIndex++; if (SpeedCounterIndex>=DIAGNOSTICS_DANCER_LIMIT ) SpeedCounterIndex = 0; @@ -202,8 +202,8 @@ void DiagnosticTenMsecCollection(void) { if (DiagnosticsActive == false) return; - if (JobIsActive()== false) - return; + /*if (JobIsActive()== false) + return;*/ DiagnosticLoadDancer(WINDER_DANCER,Control_Read_Dancer_Position(WINDER_DANCER, 0,0)); DiagnosticLoadDancer(POOLER_DANCER,Control_Read_Dancer_Position(POOLER_DANCER, 0,0)); DiagnosticLoadDancer(FEEDER_DANCER,Control_Read_Dancer_Position(FEEDER_DANCER, 0,0)); @@ -220,7 +220,7 @@ void Diagnostic100msecCollection(void) // dancer2angle[DiagnosticsIndex] = Control_Read_Dancer_Position(POOLER_DANCER, 0,0); // dancer3angle[DiagnosticsIndex] = Control_Read_Dancer_Position(FEEDER_DANCER, 0,0); - if (JobIsActive()) + //if (JobIsActive()) { /* DiagnosticLoadMotor(FEEDER_MOTOR, MotorGetSpeed (HARDWARE_MOTOR_TYPE__MOTO_RDRIVING)); ThreadGetMotorSpeed DiagnosticLoadMotor(DRYER_MOTOR, MotorGetSpeed (HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING)); @@ -320,7 +320,7 @@ void SendDiagnostics(void) - if (JobIsActive()) + //if (JobIsActive()) { DiagnosticsMonitor.n_dispenser1motorfrequency = DiagnosticsIndex; DiagnosticsMonitor.n_dispenser2motorfrequency = DiagnosticsIndex; @@ -347,7 +347,7 @@ void SendDiagnostics(void) DiagnosticsMonitor.dancer2angle = dancer2angle; DiagnosticsMonitor.dancer3angle = dancer3angle; */ - if (JobIsActive()) + //if (JobIsActive()) { DiagnosticsMonitor.n_dancer1angle = DancerCounterIndex[0]; DiagnosticsMonitor.n_dancer2angle = DancerCounterIndex[1]; -- cgit v1.3.1 From 1fdc92d718ee8e0087b5846e54bbff983ef27d39 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 26 Aug 2018 14:28:37 +0300 Subject: read real time stub --- .../Embedded/Modules/Diagnostics/Diagnostics.c | 10 +- .../Modules/Stubs_Handler/StubRealTimeUsage.c | 14 ++- Software/Stubs Collection/stubs/2Way_Valves_new.cs | 102 +++++++++++++++++++++ Software/Stubs Collection/stubs/Blower.cs | 37 ++++++++ Software/Stubs Collection/stubs/I2C_scanner.c | 38 ++++++++ Software/Stubs Collection/stubs/Midtank_Valves.cs | 74 +++++++++++++++ .../stubs/New Text Document (2).txt | 0 .../Stubs Collection/stubs/New Text Document.txt | 0 Software/Stubs Collection/stubs/SSR4_control.cs | 20 ++++ .../Stubs Collection/stubs/calculate - Copy.cs | 22 ----- Software/Stubs Collection/stubs/read real time.cs | 30 ++++++ Software/Stubs Collection/stubs/stubs.zip | Bin 101506 -> 0 bytes 12 files changed, 315 insertions(+), 32 deletions(-) create mode 100644 Software/Stubs Collection/stubs/2Way_Valves_new.cs create mode 100644 Software/Stubs Collection/stubs/Blower.cs create mode 100644 Software/Stubs Collection/stubs/I2C_scanner.c create mode 100644 Software/Stubs Collection/stubs/Midtank_Valves.cs delete mode 100644 Software/Stubs Collection/stubs/New Text Document (2).txt delete mode 100644 Software/Stubs Collection/stubs/New Text Document.txt create mode 100644 Software/Stubs Collection/stubs/SSR4_control.cs delete mode 100644 Software/Stubs Collection/stubs/calculate - Copy.cs create mode 100644 Software/Stubs Collection/stubs/read real time.cs delete mode 100644 Software/Stubs Collection/stubs/stubs.zip (limited to 'Software') diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 1eabcdeba..1bce3a39d 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -180,7 +180,7 @@ void DiagnosticLoadTemperature(int HeaterId, int temperature) } void DiagnosticLoadSpeedSensor(uint32_t value) { - SpeedValue[SpeedCounterIndex] = value/100; + SpeedValue[SpeedCounterIndex] = value; SpeedCounterIndex++; if (SpeedCounterIndex>=DIAGNOSTICS_DANCER_LIMIT ) SpeedCounterIndex = 0; @@ -401,7 +401,7 @@ void SendDiagnostics(void) int i; DiagnosticsMonitor.n_dispensersmotorsfrequency = 0; - /* + /**/ if (JobIsActive()) { j++; @@ -418,9 +418,9 @@ void SendDiagnostics(void) } } } - */ + /**/ DiagnosticsMonitor.n_dispenserspressure = 0; - /* + /**/ DiagnosticsMonitor.n_dispenserspressure = MAX_SYSTEM_DISPENSERS; if (DiagnosticsMonitor.dispenserspressure) { @@ -433,7 +433,7 @@ void SendDiagnostics(void) DiagnosticsMonitor.dispenserspressure[i] = &DiagnosticsDispenserPressure[i]; } } -*/ + /**/ DiagnosticsMonitor.n_dispenserslinearpositions = 0; DiagnosticsMonitor.n_dispensersangularencoders = 0; diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/StubRealTimeUsage.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/StubRealTimeUsage.c index 997d67973..22c8432b6 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/StubRealTimeUsage.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/StubRealTimeUsage.c @@ -46,20 +46,24 @@ void Stub_RealTimeUsageRequest(MessageContainer* requestContainer) StubRealTimeUsageResponse response = STUB_REAL_TIME_USAGE_RESPONSE__INIT; - responseContainer = createContainer(MESSAGE_TYPE__StubRealTimeUsageResponse, requestContainer->token, true, &response, &stub_real_time_usage_response__pack, &stub_real_time_usage_response__get_packed_size); uint32_t Percentile[101] = {0}; - IdleTaskGetLoadTable(Percentile); response.n_percentile = 100; - response.percentile = Percentile; + response.percentile = malloc(sizeof(response.percentile)*response.n_percentile); + if (response.percentile) + IdleTaskGetLoadTable(response.percentile); + else + response.n_percentile = 0; //free(request); //------------------------------------------------------------------------------------------- + responseContainer = createContainer(MESSAGE_TYPE__StubRealTimeUsageResponse, requestContainer->token, true, &response, &stub_real_time_usage_response__pack, &stub_real_time_usage_response__get_packed_size); uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); size_t container_size = message_container__pack(&responseContainer, container_buffer); free(responseContainer.data.data); SendChars((char*)container_buffer, container_size); - //free(container_buffer); - //free(requestContainer); + if (response.percentile) + free(response.percentile); + stub_real_time_usage_request__free_unpacked(request,NULL); } diff --git a/Software/Stubs Collection/stubs/2Way_Valves_new.cs b/Software/Stubs Collection/stubs/2Way_Valves_new.cs new file mode 100644 index 000000000..22fa91ca1 --- /dev/null +++ b/Software/Stubs Collection/stubs/2Way_Valves_new.cs @@ -0,0 +1,102 @@ +using System; +using System.Text; +using System.Linq; +using System.Drawing; +using System.Diagnostics; +using System.Windows.Forms; +using System.Threading; +using System.Threading.Tasks; +using System.Collections.Generic; +using Tango.PMR.Stubs; +using Tango.Stubs; + +const Int32 FPGA3 = 0x60000800; +const Int32 F3_VALVE_OUT = 0x0E2; + +/* + +7 8 +5 6 +3 4 +1 2 +FRONT + +*/ + +const Int32 MIDTANK2MANIF4_VALVE_2 = 1 << 0;//8 +const Int32 MIDTANK2MANIF4_VALVE_1 = 1 << 1;//4 +const Int32 MIDTANK2MANIF3_VALVE_2 = 1 << 2;//7 +const Int32 MIDTANK2MANIF3_VALVE_1 = 1 << 3;//3 +const Int32 MIDTANK2MANIF2_VALVE_2 = 1 << 4;//6 +const Int32 MIDTANK2MANIF2_VALVE_1 = 1 << 5;//2 +const Int32 MIDTANK2MANIF1_VALVE_2 = 1 << 6;//5 +const Int32 MIDTANK2MANIF1_VALVE_1 = 1 << 7;//1 + +const Int32 CART2MIDTANK4_VALVE_2 = 1 << 8 ;//8 +const Int32 CART2MIDTANK4_VALVE_1 = 1 << 9 ;//4 +const Int32 CART2MIDTANK3_VALVE_2 = 1 << 10;//7 +const Int32 CART2MIDTANK3_VALVE_1 = 1 << 11;//3 +const Int32 CART2MIDTANK2_VALVE_2 = 1 << 12;//6 +const Int32 CART2MIDTANK2_VALVE_1 = 1 << 13;//2 +const Int32 CART2MIDTANK1_VALVE_2 = 1 << 14;//5 +const Int32 CART2MIDTANK1_VALVE_1 = 1 << 15;//1 + + +public void OnExecute(StubManager stubManager) +{ + int MidTank_No = 0; + + var response = stubManager.ShowResponseWindow("Enter Midtank number to OPEN the 2Way valves (1-8), \nOr '0' to CLOSE all :", ""); + stubManager.Write("\n"); + MidTank_No = int.Parse(response); + + switch (MidTank_No) + { + case 1: + stubManager.Run("StubFpgaWriteRegRequest" ,FPGA3 | F3_VALVE_OUT, CART2MIDTANK1_VALVE_1); + stubManager.Run("StubFpgaWriteRegRequest" ,FPGA3 | F3_VALVE_OUT, MIDTANK2MANIF1_VALVE_1); + break; + case 2: + stubManager.Run("StubFpgaWriteRegRequest" ,FPGA3 | F3_VALVE_OUT, CART2MIDTANK2_VALVE_1); + stubManager.Run("StubFpgaWriteRegRequest" ,FPGA3 | F3_VALVE_OUT, MIDTANK2MANIF2_VALVE_1); + break; + case 3: + stubManager.Run("StubFpgaWriteRegRequest" ,FPGA3 | F3_VALVE_OUT, CART2MIDTANK3_VALVE_1); + stubManager.Run("StubFpgaWriteRegRequest" ,FPGA3 | F3_VALVE_OUT, MIDTANK2MANIF3_VALVE_1); + break; + case 4: + stubManager.Run("StubFpgaWriteRegRequest" ,FPGA3 | F3_VALVE_OUT, CART2MIDTANK4_VALVE_1); + stubManager.Run("StubFpgaWriteRegRequest" ,FPGA3 | F3_VALVE_OUT, MIDTANK2MANIF4_VALVE_1); + break; + case 5: + stubManager.Run("StubFpgaWriteRegRequest" ,FPGA3 | F3_VALVE_OUT, CART2MIDTANK1_VALVE_2); + stubManager.Run("StubFpgaWriteRegRequest" ,FPGA3 | F3_VALVE_OUT, MIDTANK2MANIF1_VALVE_2); + break; + case 6: + stubManager.Run("StubFpgaWriteRegRequest" ,FPGA3 | F3_VALVE_OUT, CART2MIDTANK2_VALVE_2); + stubManager.Run("StubFpgaWriteRegRequest" ,FPGA3 | F3_VALVE_OUT, MIDTANK2MANIF2_VALVE_2); + break; + case 7: + stubManager.Run("StubFpgaWriteRegRequest" ,FPGA3 | F3_VALVE_OUT, CART2MIDTANK3_VALVE_2); + stubManager.Run("StubFpgaWriteRegRequest" ,FPGA3 | F3_VALVE_OUT, MIDTANK2MANIF3_VALVE_2); + break; + case 8: + stubManager.Run("StubFpgaWriteRegRequest" ,FPGA3 | F3_VALVE_OUT, CART2MIDTANK4_VALVE_2); + stubManager.Run("StubFpgaWriteRegRequest" ,FPGA3 | F3_VALVE_OUT, MIDTANK2MANIF4_VALVE_2); + break; + default: + stubManager.Run("StubFpgaWriteRegRequest" ,FPGA3 + F3_VALVE_OUT, 0); // OFF + break; + } + + if(MidTank_No > 0 && MidTank_No < 9) + { + stubManager.Write("Open Valves #"); + stubManager.Write(MidTank_No); + stubManager.Write("\n"); + } + else + { + stubManager.WriteLine("Close all Valves !"); + } +} diff --git a/Software/Stubs Collection/stubs/Blower.cs b/Software/Stubs Collection/stubs/Blower.cs new file mode 100644 index 000000000..55ee6a943 --- /dev/null +++ b/Software/Stubs Collection/stubs/Blower.cs @@ -0,0 +1,37 @@ +using System; +using System.Text; +using System.Linq; +using System.Drawing; +using System.Diagnostics; +using System.Windows.Forms; +using System.Threading; +using System.Threading.Tasks; +using System.Collections.Generic; +using Tango.PMR.Stubs; +using Tango.Stubs; + +//---------------------- +const Int32 I2C_ID = 2; +const Int32 I2C_Slave_Add = 0x98; +//---------------------- + +public void OnExecute(StubManager stubManager) +{ + + // --------------------- I2C write multibyte --------------------- + StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest(); + stubI2CWriteBytesRequest.I2CId = I2C_ID; + stubI2CWriteBytesRequest.SlaveAddress = I2C_Slave_Add; + + UInt32 uInt32 = new UInt32(); + stubI2CWriteBytesRequest.BytesTWrite.Add(0x30);//AD5691R_CMD_WRITE_INPUT_N_UPDATE_REG + stubI2CWriteBytesRequest.BytesTWrite.Add(0xff);//0 (0V) - 0xFF (8V) + stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);// + + + var response = stubManager.Run(stubI2CWriteBytesRequest); + + + + +} \ No newline at end of file diff --git a/Software/Stubs Collection/stubs/I2C_scanner.c b/Software/Stubs Collection/stubs/I2C_scanner.c new file mode 100644 index 000000000..f7e87506c --- /dev/null +++ b/Software/Stubs Collection/stubs/I2C_scanner.c @@ -0,0 +1,38 @@ +// I2C scanner by Nick Gammon. Thanks Nick. + +#include + +void setup() { + Serial.begin (115200); //*********** make sure serial monitor baud matches ********** + + // Leonardo: wait for serial port to connect + while (!Serial) + { + } + + Serial.println (); + Serial.println ("I2C scanner. Scanning ..."); + byte count = 0; + + Wire.begin(); + for (byte i = 1; i < 120; i++) + { + Wire.beginTransmission (i); + if (Wire.endTransmission () == 0) + { + Serial.print ("Found address: "); + Serial.print (i, DEC); + Serial.print (" (0x"); + Serial.print (i, HEX); + Serial.println (")"); + count++; + delay (1); // maybe unneeded? + } // end of good response + } // end of for loop + Serial.println ("Done."); + Serial.print ("Found "); + Serial.print (count, DEC); + Serial.println (" device(s)."); +} // end of setup + +void loop() {} diff --git a/Software/Stubs Collection/stubs/Midtank_Valves.cs b/Software/Stubs Collection/stubs/Midtank_Valves.cs new file mode 100644 index 000000000..f99d08d88 --- /dev/null +++ b/Software/Stubs Collection/stubs/Midtank_Valves.cs @@ -0,0 +1,74 @@ +using System; +using System.Text; +using System.Linq; +using System.Drawing; +using System.Diagnostics; +using System.Windows.Forms; +using System.Threading; +using System.Threading.Tasks; +using System.Collections.Generic; +using Tango.PMR.Stubs; +using Tango.Stubs; + +include "..\..\Defines\Tango_Defines_Basic.cs" +include "..\Defines\Tango_Defines_GPO.cs" +//include "C:\To_Backup\Mulberry\Mulberry_current\Customers\Twine\Tango\LAB_Tests\Main_PCB\ATP_Test\Scripts\Defines\Tango_Defines_Basic.cs" +//include "C:\To_Backup\Mulberry\Mulberry_current\Customers\Twine\Tango\LAB_Tests\Main_PCB\ATP_Test\Scripts\Defines\Tango_Defines_GPO.cs" + + +public void OnExecute(StubManager stubManager) +{ + int midtankno = 0; + + var response = stubManager.ShowResponseWindow("Enter Midtank number to test (1-8):", ""); + //stubManager.WriteLine(response); + stubManager.Write("\n"); + midtankno = int.Parse(response); + +switch (midtankno) + { + case 1: + midtankno=1; + break; + case 2: + midtankno=3; + break; + case 3: + midtankno=5; + break; + case 4: + midtankno=7; + break; + case 5: + midtankno=2; + break; + case 6: + midtankno=4; + break; + case 7: + midtankno=6; + break; + case 8: + midtankno=8; + break; + + } + + + + SetBit (FPGA3, F3_VALVE_OUT,8- midtankno, 1); + stubManager.Write("\n\nSetting GPO F3_VALVE_OUT, bit "); stubManager.Write(8-midtankno); stubManager.Write(", "); stubManager.Write(F3_VALVE_Bits[8-midtankno]); + Thread.Sleep(1000); + SetBit (FPGA3, F3_VALVE_OUT,8- midtankno, 0); + stubManager.Write("\nClearing GPO F3_VALVE_OUT, bit "); stubManager.Write(8-midtankno); stubManager.Write(", "); stubManager.Write(F3_VALVE_Bits[8-midtankno]); + Thread.Sleep(1000); + + SetBit (FPGA3, F3_VALVE_OUT, 16-midtankno, 1); + stubManager.Write("\n\nSetting GPO F3_VALVE_OUT, bit "); stubManager.Write(16-midtankno); stubManager.Write(", "); stubManager.Write(F3_VALVE_Bits[16-midtankno]); + Thread.Sleep(1000); + SetBit (FPGA3, F3_VALVE_OUT, 16-midtankno, 0); + stubManager.Write("\nClearing GPO F3_VALVE_OUT, bit "); stubManager.Write(16-midtankno); stubManager.Write(", "); stubManager.Write(F3_VALVE_Bits[16-midtankno]); + Thread.Sleep(1000); + + +} \ No newline at end of file diff --git a/Software/Stubs Collection/stubs/New Text Document (2).txt b/Software/Stubs Collection/stubs/New Text Document (2).txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/Software/Stubs Collection/stubs/New Text Document.txt b/Software/Stubs Collection/stubs/New Text Document.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/Software/Stubs Collection/stubs/SSR4_control.cs b/Software/Stubs Collection/stubs/SSR4_control.cs new file mode 100644 index 000000000..049fb3dff --- /dev/null +++ b/Software/Stubs Collection/stubs/SSR4_control.cs @@ -0,0 +1,20 @@ +using System; +using System.Text; +using System.Linq; +using System.Drawing; +using System.Diagnostics; +using System.Windows.Forms; +using System.Threading; +using System.Threading.Tasks; +using System.Collections.Generic; +using Tango.PMR.Stubs; +using Tango.Stubs; + +const Int32 SSR_REG = 0x80; + +public void OnExecute(StubManager stubManager) +{ + stubManager.Run("StubFpgaWriteRegRequest" ,0x60000400 | 0x0E2, SSR_REG); // turn ON SSR4 + + //stubManager.Run("StubFpgaWriteRegRequest" ,0x60000400 | 0x0E2, 0x0000); // turn OFF SSR_REG +} \ No newline at end of file diff --git a/Software/Stubs Collection/stubs/calculate - Copy.cs b/Software/Stubs Collection/stubs/calculate - Copy.cs deleted file mode 100644 index 22a83dd2d..000000000 --- a/Software/Stubs Collection/stubs/calculate - Copy.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Text; -using System.Linq; -using System.Drawing; -using System.Diagnostics; -using System.Windows.Forms; -using System.Threading; -using System.Threading.Tasks; -using System.Collections.Generic; -using Tango.Stubs.UI; - -public void OnExecute(StubManager stubManager) -{ - for (int i = 0; i < 10; i++) - { - // Double : A - // Double : B - stubManager.Run("calculate", 10, 5); - Thread.Sleep(10); - } -} - diff --git a/Software/Stubs Collection/stubs/read real time.cs b/Software/Stubs Collection/stubs/read real time.cs new file mode 100644 index 000000000..51d0b570a --- /dev/null +++ b/Software/Stubs Collection/stubs/read real time.cs @@ -0,0 +1,30 @@ +using System; +using System.Text; +using System.Linq; +using System.Drawing; +using System.Diagnostics; +using System.Windows.Forms; +using System.Threading; +using System.Threading.Tasks; +using System.Collections.Generic; +using Tango.PMR.Stubs; +using Tango.Stubs; + +public void OnExecute(StubManager stubManager) +{ + //for (int i = 0; i < 10; i++) + { + var response = stubManager.Run("StubRealTimeUsageRequest"); + for (int i = 0; i < 100; i++) + { + if (response.Percentile[i]>0) + { + stubManager.Write("\r\n "); + stubManager.Write( i); + stubManager.Write(" "); + stubManager.Write(response.Percentile[i]); + } + } + + } +} \ No newline at end of file diff --git a/Software/Stubs Collection/stubs/stubs.zip b/Software/Stubs Collection/stubs/stubs.zip deleted file mode 100644 index 9b8a98765..000000000 Binary files a/Software/Stubs Collection/stubs/stubs.zip and /dev/null differ -- cgit v1.3.1 From d3ec83acd93eb8338f3d846e9e3c1bedfb480ce1 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 26 Aug 2018 16:41:06 +0300 Subject: added data on idle time --- Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Software') diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 9e15771be..a85e1cfde 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -402,7 +402,7 @@ void SendDiagnostics(void) int i; DiagnosticsMonitor.n_dispensersmotorsfrequency = 0; /**/ - if (JobIsActive()) + //if (JobIsActive()) { j++; DiagnosticsMonitor.n_dispensersmotorsfrequency = MAX_SYSTEM_DISPENSERS; -- cgit v1.3.1