From 48071f784b19ea8ed2859fb03642b8cc856406b1 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 14 Jan 2018 15:49:39 +0200 Subject: Added code comments for: MachineStudio.UI --- .../MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs index 70912ba98..5f315f7f4 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs @@ -65,8 +65,11 @@ namespace Tango.MachineStudio.UI SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); - LogManager.RegisterLogger(new VSOutputLogger()); - LogManager.RegisterLogger(new FileLogger()); + if (!ViewModelBase.IsInDesignModeStatic) + { + LogManager.RegisterLogger(new VSOutputLogger()); + LogManager.RegisterLogger(new FileLogger()); + } //Register View (Supervising Controller Pattern). if (!ViewModelBase.IsInDesignModeStatic) -- cgit v1.3.1 From 0fda2ba3ff49bdc1ffc6833f658e2164af187008 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 16 Jan 2018 12:17:10 +0200 Subject: Embedded RealTimeGraphEx library to solution. Added graphs to technician view. Implemented simple sensors data test using Machine Emulator. --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 8388608 -> 8388608 bytes Software/PMR/Messages/Common/MessageType.proto | 4 + .../Messages/Diagnostics/PushSensorsRequest.proto | 9 + .../Messages/Diagnostics/PushSensorsResponse.proto | 9 + .../Modules/Tango.MachineStudio.DB/DBModule.cs | 9 +- .../DeveloperModule.cs | 6 + .../MachineDesignerModule.cs | 7 + .../Tango.MachineStudio.Stubs/StubsModule.cs | 7 + .../SynchronizationModule.cs | 9 +- .../ViewModels/MainViewVM.cs | 2 +- .../Converters/SecondsToGraphPointsConverter.cs | 23 + .../Converters/TransitionLinkConverter.cs | 55 + .../Helpers/GraphsMaxPointsHelper.cs | 26 + .../Navigation/TechNavigationManager.cs | 17 + .../Navigation/TechNavigationView.cs | 15 + .../Resources/GraphEx.xaml | 126 + .../Tango.MachineStudio.Technician.csproj | 35 + .../TechnicianModule.cs | 14 + .../ViewModelLocator.cs | 15 + .../ViewModels/MainViewVM.cs | 27 + .../ViewModels/SensorsViewVM.cs | 139 + .../Views/MainView.xaml | 90 +- .../Views/MainView.xaml.cs | 3 + .../Views/MotorsView.xaml | 12 + .../Views/MotorsView.xaml.cs | 28 + .../Views/OverviewView.xaml | 12 + .../Views/OverviewView.xaml.cs | 28 + .../Views/SensorsView.xaml | 141 + .../Views/SensorsView.xaml.cs | 53 + .../Tango.MachineStudio.Common/IStudioModule.cs | 5 + .../StudioApplication/IStudioApplicationManager.cs | 5 + .../MachineStudio/Tango.MachineStudio.UI/App.xaml | 5 +- .../Modules/DefaultStudioModuleLoader.cs | 3 + .../Navigation/DefaultNavigationManager.cs | 1 + .../DefaultStudioApplicationManager.cs | 7 + .../SupervisingController/IMainView.cs | 7 +- .../Tango.MachineStudio.UI.csproj | 4 + .../Tango.MachineStudio.UI/ViewModelLocator.cs | 2 +- .../ViewModels/MainViewVM.cs | 11 +- .../Tango.MachineStudio.UI/Views/MainView.xaml | 145 +- .../Tango.MachineStudio.UI/Views/MainView.xaml.cs | 29 + .../RealTimeGraphEx/Components/ComponentBase.cs | 101 + .../Components/ComponentLocationEnum.cs | 17 + .../RealTimeGraphEx/Components/GridLines.cs | 121 + .../Components/MouseValueToolTip.cs | 73 + .../RealTimeGraphEx/Components/YAxisLegends.cs | 61 + .../RealTimeGraphEx/Components/YAxisScroll.cs | 205 + .../RealTimeGraphEx/Components/YAxisTicks.cs | 192 + .../RealTimeGraphEx/Components/YAxisWave.cs | 107 + .../ComponentsItems/YAxisBigTick.cs | 14 + .../RealTimeGraphEx/ComponentsItems/YAxisLabel.cs | 14 + .../RealTimeGraphEx/ComponentsItems/YAxisLegend.cs | 15 + .../ComponentsItems/YAxisSmallTick.cs | 14 + .../RealTimeGraphEx/Controllers/GraphController.cs | 96 + .../Controllers/GraphControllerBase.cs | 62 + .../Controllers/GraphMultiController.cs | 200 + .../RealTimeGraphEx/DX2D/DX10ImageSource.cs | 147 + .../DX2D/DXGraphSurfaceMultiErase.cs | 100 + .../DX2D/DXGraphSurfaceMultiScroll.cs | 85 + .../DX2D/DXGraphSurfaceSingleErase.cs | 91 + .../DX2D/DXGraphSurfaceSingleScroll.cs | 76 + .../RealTimeGraphEx/DX2D/Direct2DControl.cs | 261 + .../SideChains/RealTimeGraphEx/DX2D/Disposer.cs | 35 + .../RealTimeGraphEx/DX2D/NativeMethods.cs | 18 + .../RealTimeGraphEx/DataSeries/DataYSeries.cs | 176 + .../RealTimeGraphExDirectXLineErase.cs | 186 + .../RealTimeGraphExDirectXLineScroll.cs | 276 + .../RealTimeGraphExDirectXMultiLineErase.cs | 225 + .../RealTimeGraphExDirectXMultiLineScroll.cs | 266 + .../RealTimeGraphEx/Enums/OpacityTypeEnum.cs | 15 + .../RealTimeGraphEx/Enums/ZoomDirectionEnum.cs | 15 + .../RealTimeGraphEx/Enums/ZoomModeEnum.cs | 16 + .../ExtensionMethods/BrushExtensions.cs | 72 + .../ExtensionMethods/ColorExtensions.cs | 18 + .../ExtensionMethods/RenderTargetExtensions.cs | 83 + .../FastGraphs/RealTimeGraphExEllipseScroll.cs | 122 + .../FastGraphs/RealTimeGraphExLineErase.cs | 257 + .../FastGraphs/RealTimeGraphExLineScroll.cs | 251 + .../FastGraphs/RealTimeGraphExMultiLineErase.cs | 233 + .../FastGraphs/RealTimeGraphExMultiLineScroll.cs | 267 + .../FastGraphs/RealTimeGraphExShapeErase.cs | 287 + .../FastGraphs/RealTimeGraphExShapeScroll.cs | 276 + .../FastGraphs/RealTimeGraphExWaveErase.cs | 79 + .../FastGraphs/RealTimeGraphExWaveScroll.cs | 66 + .../RealTimeGraphEx/FastGraphs/ShapeTypeEnum.cs | 15 + .../SideChains/RealTimeGraphEx/FodyWeavers.xml | 4 + .../RealTimeGraphEx/Models/ConcurrentPointsList.cs | 429 + .../SideChains/RealTimeGraphEx/Models/RangeData.cs | 33 + .../Models/RealTimeGraphColumnsCollection.cs | 68 + .../Models/RealTimeGraphExColumn.cs | 24 + .../RealTimeGraphEx/Models/RealTimeGraphExPoint.cs | 15 + .../Models/RealTimeGraphExPolygon.cs | 383 + .../Models/RealTimeGraphExReachPolygon.cs | 244 + .../RealTimeGraphEx/Properties/AssemblyInfo.cs | 55 + .../Properties/Resources.Designer.cs | 62 + .../RealTimeGraphEx/Properties/Resources.resx | 117 + .../Properties/Settings.Designer.cs | 30 + .../RealTimeGraphEx/Properties/Settings.settings | 7 + .../ReachGraphs/RealTimeGraphExReachCircle.cs | 295 + .../ReachGraphs/RealTimeGraphExReachLineErase.cs | 210 + .../ReachGraphs/RealTimeGraphExReachLineScroll.cs | 270 + .../RealTimeGraphExReachMultiLineErase.cs | 196 + .../RealTimeGraphExReachMultiLineScroll.cs | 229 + .../ReachGraphs/RealTimeGraphExReachVUMeter.cs | 289 + .../ReachGraphs/RealTimeGraphExReachWaveScroll.cs | 44 + .../RealTimeGraphEx/RealTimeGraphEx.csproj | 225 + .../RealTimeGraphEx/RealTimeGraphExBase.cs | 1346 + .../RealTimeGraphEx/RealTimeGraphExMultiBase.cs | 74 + .../Referenced Assemblies/SharpDX.DXGI.dll | Bin 0 -> 90624 bytes .../Referenced Assemblies/SharpDX.DXGI.xml | 4365 ++ .../Referenced Assemblies/SharpDX.Direct2D1.dll | Bin 0 -> 230912 bytes .../Referenced Assemblies/SharpDX.Direct2D1.xml | 24418 ++++++++++ .../Referenced Assemblies/SharpDX.Direct3D10.dll | Bin 0 -> 179200 bytes .../Referenced Assemblies/SharpDX.Direct3D10.xml | 23120 +++++++++ .../Referenced Assemblies/SharpDX.Direct3D9.dll | Bin 0 -> 349696 bytes .../Referenced Assemblies/SharpDX.Direct3D9.xml | 36476 ++++++++++++++ .../Referenced Assemblies/SharpDX.dll | Bin 0 -> 558080 bytes .../Referenced Assemblies/SharpDX.xml | 48704 +++++++++++++++++++ .../RealTimeGraphEx/Resources/Resources.xaml | 74 + .../RealTimeGraphEx/Synchronization/SyncManager.cs | 63 + .../WriteableBitmap/BitmapContext.cs | 468 + .../WriteableBitmap/BitmapFactory.cs | 214 + .../WriteableBitmap/NativeMethods.cs | 41 + .../WriteableBitmapAntialiasingExtensions.cs | 444 + .../WriteableBitmapBaseExtensions.cs | 480 + .../WriteableBitmapBlitExtensions.cs | 704 + .../WriteableBitmapContextExtensions.cs | 55 + .../WriteableBitmapConvertExtensions.cs | 344 + .../WriteableBitmapFillExtensions.cs | 1205 + .../WriteableBitmapFilterExtensions.cs | 423 + .../WriteableBitmapLineExtensions.cs | 1316 + .../WriteableBitmapShapeExtensions.cs | 489 + .../WriteableBitmapSplineExtensions.cs | 341 + .../WriteableBitmapTransformationExtensions.cs | 623 + .../SideChains/RealTimeGraphEx/packages.config | 5 + .../Tango.Emulations/Emulators/MachineEmulator.cs | 24 + .../Operators/IMachineOperator.cs | 23 + .../Tango.Integration/Operators/MachineOperator.cs | 85 + .../Tango.Integration/Services/ComPortInfo.cs | 74 + .../Services/ExternalBridgeScanner.cs | 17 +- .../Services/ExternalBridgeTcpClient.cs | 3 +- .../Services/ExternalBridgeUsbClient.cs | 3 +- .../Services/IExternalBridgeClient.cs | 3 +- .../Tango.Integration/Tango.Integration.csproj | 20 + .../Tango.Integration/packages.config | 6 + .../Visual_Studio/Tango.PMR/Common/MessageType.cs | 12 +- .../Tango.PMR/Diagnostics/PushSensorsRequest.cs | 131 + .../Tango.PMR/Diagnostics/PushSensorsResponse.cs | 153 + Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj | 2 + Software/Visual_Studio/Tango.PMR/TangoMessage.cs | 4 +- .../Visual_Studio/Tango.Settings/Integration.cs | 9 +- .../MachineStudioSettings/MachineStudio.cs | 6 + .../MachineStudioSettings/TechnicianModule.cs | 21 + .../Tango.Settings/Tango.Settings.csproj | 1 + .../Controls/MultiTransitionControl.xaml.cs | 31 +- Software/Visual_Studio/Tango.SharedUI/ViewModel.cs | 9 + Software/Visual_Studio/Tango.sln | 23 + .../Tango.MachineEM.UI/ViewModels/MainViewVM.cs | 8 +- 159 files changed, 156002 insertions(+), 138 deletions(-) create mode 100644 Software/PMR/Messages/Diagnostics/PushSensorsRequest.proto create mode 100644 Software/PMR/Messages/Diagnostics/PushSensorsResponse.proto create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Converters/SecondsToGraphPointsConverter.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Converters/TransitionLinkConverter.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Helpers/GraphsMaxPointsHelper.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Navigation/TechNavigationManager.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Navigation/TechNavigationView.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Resources/GraphEx.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/SensorsViewVM.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MotorsView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MotorsView.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/OverviewView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/OverviewView.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/SensorsView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/SensorsView.xaml.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Components/ComponentBase.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Components/ComponentLocationEnum.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Components/GridLines.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Components/MouseValueToolTip.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Components/YAxisLegends.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Components/YAxisScroll.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Components/YAxisTicks.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Components/YAxisWave.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/ComponentsItems/YAxisBigTick.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/ComponentsItems/YAxisLabel.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/ComponentsItems/YAxisLegend.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/ComponentsItems/YAxisSmallTick.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Controllers/GraphController.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Controllers/GraphControllerBase.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Controllers/GraphMultiController.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/DX2D/DX10ImageSource.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/DX2D/DXGraphSurfaceMultiErase.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/DX2D/DXGraphSurfaceMultiScroll.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/DX2D/DXGraphSurfaceSingleErase.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/DX2D/DXGraphSurfaceSingleScroll.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/DX2D/Direct2DControl.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/DX2D/Disposer.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/DX2D/NativeMethods.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/DataSeries/DataYSeries.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/DirectXGraphs/RealTimeGraphExDirectXLineErase.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/DirectXGraphs/RealTimeGraphExDirectXLineScroll.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/DirectXGraphs/RealTimeGraphExDirectXMultiLineErase.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/DirectXGraphs/RealTimeGraphExDirectXMultiLineScroll.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Enums/OpacityTypeEnum.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Enums/ZoomDirectionEnum.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Enums/ZoomModeEnum.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/ExtensionMethods/BrushExtensions.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/ExtensionMethods/ColorExtensions.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/ExtensionMethods/RenderTargetExtensions.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/FastGraphs/RealTimeGraphExEllipseScroll.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/FastGraphs/RealTimeGraphExLineErase.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/FastGraphs/RealTimeGraphExLineScroll.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/FastGraphs/RealTimeGraphExMultiLineErase.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/FastGraphs/RealTimeGraphExMultiLineScroll.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/FastGraphs/RealTimeGraphExShapeErase.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/FastGraphs/RealTimeGraphExShapeScroll.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/FastGraphs/RealTimeGraphExWaveErase.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/FastGraphs/RealTimeGraphExWaveScroll.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/FastGraphs/ShapeTypeEnum.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/FodyWeavers.xml create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Models/ConcurrentPointsList.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Models/RangeData.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Models/RealTimeGraphColumnsCollection.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Models/RealTimeGraphExColumn.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Models/RealTimeGraphExPoint.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Models/RealTimeGraphExPolygon.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Models/RealTimeGraphExReachPolygon.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Properties/Resources.Designer.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Properties/Resources.resx create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Properties/Settings.Designer.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Properties/Settings.settings create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/ReachGraphs/RealTimeGraphExReachCircle.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/ReachGraphs/RealTimeGraphExReachLineErase.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/ReachGraphs/RealTimeGraphExReachLineScroll.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/ReachGraphs/RealTimeGraphExReachMultiLineErase.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/ReachGraphs/RealTimeGraphExReachMultiLineScroll.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/ReachGraphs/RealTimeGraphExReachVUMeter.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/ReachGraphs/RealTimeGraphExReachWaveScroll.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/RealTimeGraphEx.csproj create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/RealTimeGraphExBase.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/RealTimeGraphExMultiBase.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Referenced Assemblies/SharpDX.DXGI.dll create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Referenced Assemblies/SharpDX.DXGI.xml create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Referenced Assemblies/SharpDX.Direct2D1.dll create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Referenced Assemblies/SharpDX.Direct2D1.xml create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Referenced Assemblies/SharpDX.Direct3D10.dll create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Referenced Assemblies/SharpDX.Direct3D10.xml create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Referenced Assemblies/SharpDX.Direct3D9.dll create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Referenced Assemblies/SharpDX.Direct3D9.xml create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Referenced Assemblies/SharpDX.dll create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Referenced Assemblies/SharpDX.xml create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Resources/Resources.xaml create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/Synchronization/SyncManager.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/BitmapContext.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/BitmapFactory.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/NativeMethods.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/WriteableBitmapAntialiasingExtensions.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/WriteableBitmapBaseExtensions.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/WriteableBitmapBlitExtensions.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/WriteableBitmapContextExtensions.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/WriteableBitmapConvertExtensions.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/WriteableBitmapFillExtensions.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/WriteableBitmapFilterExtensions.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/WriteableBitmapLineExtensions.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/WriteableBitmapShapeExtensions.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/WriteableBitmapSplineExtensions.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/WriteableBitmap/WriteableBitmapTransformationExtensions.cs create mode 100644 Software/Visual_Studio/SideChains/RealTimeGraphEx/packages.config create mode 100644 Software/Visual_Studio/Tango.Integration/Operators/IMachineOperator.cs create mode 100644 Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs create mode 100644 Software/Visual_Studio/Tango.Integration/Services/ComPortInfo.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Diagnostics/PushSensorsRequest.cs create mode 100644 Software/Visual_Studio/Tango.PMR/Diagnostics/PushSensorsResponse.cs create mode 100644 Software/Visual_Studio/Tango.Settings/MachineStudioSettings/TechnicianModule.cs (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index da5cc939b..6ec476601 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index 35f93651b..3d4d754ea 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/PMR/Messages/Common/MessageType.proto b/Software/PMR/Messages/Common/MessageType.proto index d1b34ba77..c34263440 100644 --- a/Software/PMR/Messages/Common/MessageType.proto +++ b/Software/PMR/Messages/Common/MessageType.proto @@ -57,4 +57,8 @@ enum MessageType OverrideDataBaseResponse = 1006; KeepAliveRequest = 1007; KeepAliveResponse = 1008; + + //Diagnostics + PushSensorsRequest = 2000; + PushSensorsResponse = 2001; } diff --git a/Software/PMR/Messages/Diagnostics/PushSensorsRequest.proto b/Software/PMR/Messages/Diagnostics/PushSensorsRequest.proto new file mode 100644 index 000000000..0617a656f --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/PushSensorsRequest.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +message PushSensorsRequest +{ + +} \ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/PushSensorsResponse.proto b/Software/PMR/Messages/Diagnostics/PushSensorsResponse.proto new file mode 100644 index 000000000..710e31bcd --- /dev/null +++ b/Software/PMR/Messages/Diagnostics/PushSensorsResponse.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package Tango.PMR.Diagnostics; +option java_package = "com.twine.tango.pmr.diagnostics"; + +message PushSensorsResponse +{ + repeated int32 Temperature = 1; +} \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/DBModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/DBModule.cs index 4f751d9da..c433a4cd4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/DBModule.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/DBModule.cs @@ -17,10 +17,8 @@ namespace Tango.MachineStudio.DB /// public class DBModule : IStudioModule { - /// - /// The is initialized - /// private bool _isInitialized; + private bool _isLoaded; /// /// Gets the module name. @@ -52,6 +50,11 @@ namespace Tango.MachineStudio.DB /// public Permissions Permission => Permissions.RunDataBaseModule; + /// + /// Sets a value indicating whether this module is loaded. + /// + public bool IsLoaded { get => _isLoaded; set => _isLoaded = value; } + /// /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModule.cs index c3d351468..4401245a9 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModule.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModule.cs @@ -15,6 +15,7 @@ namespace Tango.MachineStudio.Developer public class DeveloperModule : IStudioModule { private bool _isInitialized; + private bool _isLoaded; public string Name => "Developer"; @@ -26,6 +27,11 @@ namespace Tango.MachineStudio.Developer public bool IsInitialized => _isInitialized; + /// + /// Sets a value indicating whether this module is loaded. + /// + public bool IsLoaded { get => _isLoaded; set => _isLoaded = value; } + public Permissions Permission => Permissions.RunDeveloperModule; public void Dispose() diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/MachineDesignerModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/MachineDesignerModule.cs index ca13bd350..8fbac790f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/MachineDesignerModule.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/MachineDesignerModule.cs @@ -18,6 +18,8 @@ namespace Tango.MachineStudio.MachineDesigner /// public class MachineDesignerModule : IStudioModule { + private bool _isLoaded; + /// /// Gets the module name. /// @@ -33,6 +35,11 @@ namespace Tango.MachineStudio.MachineDesigner /// public BitmapSource Image => ResourceHelper.GetImageFromResources("Images/machine-designer-module.jpg"); + /// + /// Sets a value indicating whether this module is loaded. + /// + public bool IsLoaded { get => _isLoaded; set => _isLoaded = value; } + /// /// Gets the module entry point view. /// diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/StubsModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/StubsModule.cs index 23214cf55..8b072ea46 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/StubsModule.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/StubsModule.cs @@ -18,6 +18,8 @@ namespace Tango.MachineStudio.Stubs /// public class StubsModule : IStudioModule { + private bool _isLoaded; + /// /// Gets the module name. /// @@ -38,6 +40,11 @@ namespace Tango.MachineStudio.Stubs /// public FrameworkElement MainView => new MainView(); + /// + /// Sets a value indicating whether this module is loaded. + /// + public bool IsLoaded { get => _isLoaded; set => _isLoaded = value; } + /// /// Gets the permission required to see and load this module. /// diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/SynchronizationModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/SynchronizationModule.cs index f6381a482..4a753b05e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/SynchronizationModule.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/SynchronizationModule.cs @@ -18,9 +18,7 @@ namespace Tango.MachineStudio.Synchronization /// public class SynchronizationModule : IStudioModule { - /// - /// The is initialized - /// + private bool _isLoaded; private bool _isInitialized; /// @@ -43,6 +41,11 @@ namespace Tango.MachineStudio.Synchronization /// public FrameworkElement MainView => new MainView(); + /// + /// Sets a value indicating whether this module is loaded. + /// + public bool IsLoaded { get => _isLoaded; set => _isLoaded = value; } + /// /// Gets a value indicating whether this module has been initialized. /// diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/MainViewVM.cs index 48a5c64bd..21d76d7d7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/MainViewVM.cs @@ -22,7 +22,7 @@ namespace Tango.MachineStudio.Synchronization.ViewModels MainViewLogger logger = new MainViewLogger(); logger.NewLog += (output) => { - Log += output + Environment.NewLine; + //Log += output + Environment.NewLine; }; LogManager.RegisterLogger(logger); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Converters/SecondsToGraphPointsConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Converters/SecondsToGraphPointsConverter.cs new file mode 100644 index 000000000..3120c44a6 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Converters/SecondsToGraphPointsConverter.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.MachineStudio.Technician.Converters +{ + public class SecondsToGraphPointsConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + double arrLength = double.Parse(parameter.ToString()); + return Helpers.GraphsMaxPointsHelper.GetMaxPoints(arrLength); + } + + public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + return value; + } + } +} \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Converters/TransitionLinkConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Converters/TransitionLinkConverter.cs new file mode 100644 index 000000000..d67f3a259 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Converters/TransitionLinkConverter.cs @@ -0,0 +1,55 @@ +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; + +namespace Tango.MachineStudio.Technician.Converters +{ + /// + /// Binding converter for converting TransitionControl child Tag to text style. + /// + /// + /// This converter is used by the patient page tabs, changing the selected tab text style to bold/normal. + /// + public class TransitionLinkConverter : IValueConverter + { + /// + /// Converts a ContentControl to font style. + /// + /// Content control. + /// + /// + /// + /// Font style. + public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + ContentControl control = value as ContentControl; + + if (control != null && control.Tag != null && control.Tag.ToString().ToLower() == parameter.ToString().ToLower()) + { + return FontWeights.Bold; + } + else + { + return FontWeights.Normal; + } + } + + /// + /// Not Implemented. + /// + /// + /// + /// + /// + /// + public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + return value; + } + } +} \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Helpers/GraphsMaxPointsHelper.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Helpers/GraphsMaxPointsHelper.cs new file mode 100644 index 000000000..87aab5967 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Helpers/GraphsMaxPointsHelper.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Settings; + +namespace Tango.MachineStudio.Technician.Helpers +{ + public static class GraphsMaxPointsHelper + { + public static int GetMaxPoints(double arrLength) + { + try + { + double seconds = SettingsManager.Default.MachineStudio.TechnicianModule.GraphsDuration; + double pullRate = SettingsManager.Default.MachineStudio.TechnicianModule.GraphsPullingInterval; + return (int)(((pullRate * arrLength * 10 * seconds) * (10 / pullRate)) * 0.65); + } + catch (Exception) + { + return 300; + } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Navigation/TechNavigationManager.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Navigation/TechNavigationManager.cs new file mode 100644 index 000000000..f473776d1 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Navigation/TechNavigationManager.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.MachineStudio.Technician.Views; + +namespace Tango.MachineStudio.Technician.Navigation +{ + public class TechNavigationManager + { + public void NavigateTo(TechNavigationView view) + { + MainView.Instance.TransitionControl.AutoNavigate(view.ToString()); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Navigation/TechNavigationView.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Navigation/TechNavigationView.cs new file mode 100644 index 000000000..27d9fb09b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Navigation/TechNavigationView.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.Technician.Navigation +{ + public enum TechNavigationView + { + Overview, + Motors, + Sensors, + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Resources/GraphEx.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Resources/GraphEx.xaml new file mode 100644 index 000000000..85cccc2dd --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Resources/GraphEx.xaml @@ -0,0 +1,126 @@ + + + Segoe UI + Lucida Console + + 28 + 26 + 20 + 16 + 14 + 12 + 9 + + + Silver + #FFE9E9E9 + Gray + #03A9F4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file 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 2c5df42fc..097917fef 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 @@ -77,15 +77,46 @@ + + + + + + + + MotorsView.xaml + + + OverviewView.xaml + + + SensorsView.xaml + MainView.xaml GlobalVersionInfo.cs + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -117,6 +148,10 @@ + + {b9ae25d6-be35-492f-9079-21a7f3e6f7cc} + RealTimeGraphEx + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechnicianModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechnicianModule.cs index a4eaff71e..b715b6710 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechnicianModule.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechnicianModule.cs @@ -14,6 +14,10 @@ namespace Tango.MachineStudio.Technician { public class TechnicianModule : IStudioModule { + private bool _isLoaded; + + public event EventHandler IsLoadedChanged; + public string Name => "Technician"; public string Description => "Provides access to low level machine components by exposing diagnostics and profiling tools."; @@ -26,6 +30,16 @@ namespace Tango.MachineStudio.Technician public bool IsInitialized => true; + /// + /// Sets a value indicating whether this module is loaded. + /// + public bool IsLoaded + { + get { return _isLoaded; } + set { _isLoaded = value; IsLoadedChanged?.Invoke(this, value); } + } + + public void Dispose() { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModelLocator.cs index f922d5ec4..e7fea686d 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModelLocator.cs @@ -1,6 +1,7 @@ using GalaSoft.MvvmLight; using GalaSoft.MvvmLight.Ioc; using Microsoft.Practices.ServiceLocation; +using Tango.MachineStudio.Technician.Navigation; using Tango.MachineStudio.Technician.ViewModels; namespace Tango.MachineStudio.Technician @@ -17,7 +18,13 @@ namespace Tango.MachineStudio.Technician static ViewModelLocator() { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + + SimpleIoc.Default.Unregister(); + + SimpleIoc.Default.Register(); } public static MainViewVM MainViewVM @@ -27,5 +34,13 @@ namespace Tango.MachineStudio.Technician return ServiceLocator.Current.GetInstance(); } } + + public static SensorsViewVM SensorsViewVM + { + get + { + return ServiceLocator.Current.GetInstance(); + } + } } } \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MainViewVM.cs index c715af6cb..68852fe20 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MainViewVM.cs @@ -3,12 +3,39 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.MachineStudio.Technician.Navigation; using Tango.SharedUI; namespace Tango.MachineStudio.Technician.ViewModels { public class MainViewVM : ViewModel { + private TechNavigationManager _navigation; + #region Constructors + + public MainViewVM(TechNavigationManager navigationManager) + { + _navigation = navigationManager; + NavigateToViewCommand = new RelayCommand(NavigateToView); + } + + #endregion + + #region Commands + + public RelayCommand NavigateToViewCommand { get; set; } + + #endregion + + #region Private Methods + + private void NavigateToView(string view) + { + _navigation.NavigateTo((TechNavigationView)Enum.Parse(typeof(TechNavigationView), view, true)); + } + + #endregion } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/SensorsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/SensorsViewVM.cs new file mode 100644 index 000000000..cb3114f4c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/SensorsViewVM.cs @@ -0,0 +1,139 @@ +using RealTimeGraphEx.Controllers; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Integration.Operators; +using Tango.Logging; +using Tango.MachineStudio.Common.Modules; +using Tango.MachineStudio.Common.StudioApplication; +using Tango.PMR.Diagnostics; +using Tango.Settings; +using Tango.SharedUI; + +namespace Tango.MachineStudio.Technician.ViewModels +{ + public class SensorsViewVM : ViewModel + { + private List _controllers; + + public IStudioApplicationManager ApplicationManager { get; set; } + + private IMachineOperator _machineOperator; + public IMachineOperator MachineOperator + { + get { return _machineOperator; } + set { _machineOperator = value; RaisePropertyChangedAuto(); } + } + + public SensorsViewVM(IStudioApplicationManager applicationManager, IStudioModuleLoader moduleLoader) + { + ApplicationManager = applicationManager; + ApplicationManager.ConnectedMachineChanged += ApplicationManager_ConnectedMachineChanged; + + InitializeConnectedMachine(ApplicationManager.ConnectedMachine); + + if (!DesignMode) + { + //Set graphs FIFO capacity by seconds (this will be converted to MaxPoints by the view). + GraphSeconds = SettingsManager.Default.MachineStudio.TechnicianModule.GraphsDuration; + + _controllers = new List(); + + TemperatureController = new GraphController(); + PressureController = new GraphController(); + + _controllers.Add(TemperatureController); + _controllers.Add(PressureController); + + var module = moduleLoader.UserModules.SingleOrDefault(x => x is TechnicianModule) as TechnicianModule; + + if (module != null) + { + module.IsLoadedChanged += Module_IsLoadedChanged; + } + } + } + + private void Module_IsLoadedChanged(object sender, bool loaded) + { + //_controllers.ForEach(x => x.ChangeRenderMode(loaded)); + } + + private void ApplicationManager_ConnectedMachineChanged(object sender, Integration.Services.IExternalBridgeClient machineOperator) + { + InitializeConnectedMachine(machineOperator); + } + + private void MachineOperator_SensorsDataAvailable(object sender, PushSensorsResponse data) + { + TemperatureController.PushData(data.Temperature.ToArray().Select(Convert.ToDouble).ToArray()); + PressureController.PushData(data.Temperature.ToArray().Select(Convert.ToDouble).ToArray()); + } + + private void InitializeConnectedMachine(IMachineOperator machineOperator) + { + MachineOperator = machineOperator; + + if (MachineOperator != null) + { + MachineOperator.EnableSensorsUpdate = true; + MachineOperator.SensorsDataAvailable -= MachineOperator_SensorsDataAvailable; + MachineOperator.SensorsDataAvailable += MachineOperator_SensorsDataAvailable; + } + } + + #region Graphs Controllers + + private GraphController _temperatureController; + /// + /// Gets or sets the temperature sensor graph controller . + /// + public GraphController TemperatureController + { + get { return _temperatureController; } + set { _temperatureController = value; RaisePropertyChanged(nameof(TemperatureController)); } + } + + private GraphController _pressureController; + /// + /// Gets or sets the pressure sensor graph controller . + /// + public GraphController PressureController + { + get { return _pressureController; } + set { _pressureController = value; RaisePropertyChanged(nameof(PressureController)); } + } + + #endregion + + private int _graphSeconds; + /// + /// Gets or sets the graphs number of seconds to complete FIFO capacity. + /// + public int GraphSeconds + { + get { return _graphSeconds; } + set { _graphSeconds = value; RaisePropertyChanged(nameof(GraphSeconds)); } + } + + /// + /// Clears the graphs. + /// + public void ClearGraphs() + { + _controllers.ForEach(x => x.Clear()); + } + + /// + /// Creates a dummy list with default value of -1000 (used to fill graphs buffer). + /// + /// List length. + /// + private List CreateDummyList(int count) + { + return Enumerable.Repeat(-1000, count + 1).ToList(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MainView.xaml index 1337358e1..6b84881fd 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MainView.xaml @@ -5,10 +5,98 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:global="clr-namespace:Tango.MachineStudio.Technician" xmlns:vm="clr-namespace:Tango.MachineStudio.Technician.ViewModels" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:sharedUI="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:local="clr-namespace:Tango.MachineStudio.Technician.Views" + xmlns:converters="clr-namespace:Tango.MachineStudio.Technician.Converters" mc:Ignorable="d" d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}" Background="White"> + + + + + + + + + + + + + - Technician + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MainView.xaml.cs index 0701fbc50..b07fc597e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MainView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MainView.xaml.cs @@ -20,9 +20,12 @@ namespace Tango.MachineStudio.Technician.Views /// public partial class MainView : UserControl { + public static MainView Instance { get; set; } + public MainView() { InitializeComponent(); + Instance = this; } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MotorsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MotorsView.xaml new file mode 100644 index 000000000..3fb49d457 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MotorsView.xaml @@ -0,0 +1,12 @@ + + + MOTORS + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MotorsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MotorsView.xaml.cs new file mode 100644 index 000000000..bd548766c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MotorsView.xaml.cs @@ -0,0 +1,28 @@ +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.Technician.Views +{ + /// + /// Interaction logic for MotorsView.xaml + /// + public partial class MotorsView : UserControl + { + public MotorsView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/OverviewView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/OverviewView.xaml new file mode 100644 index 000000000..3c064346d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/OverviewView.xaml @@ -0,0 +1,12 @@ + + + OVERVIEW + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/OverviewView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/OverviewView.xaml.cs new file mode 100644 index 000000000..aeba42c00 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/OverviewView.xaml.cs @@ -0,0 +1,28 @@ +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.Technician.Views +{ + /// + /// Interaction logic for OverviewView.xaml + /// + public partial class OverviewView : UserControl + { + public OverviewView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/SensorsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/SensorsView.xaml new file mode 100644 index 000000000..2e074ec3c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/SensorsView.xaml @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/SensorsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/SensorsView.xaml.cs new file mode 100644 index 000000000..4727a3603 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/SensorsView.xaml.cs @@ -0,0 +1,53 @@ +using Microsoft.Practices.ServiceLocation; +using RealTimeGraphEx.Synchronization; +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.Technician.Views +{ + /// + /// Interaction logic for DebugView.xaml + /// + public partial class SensorsView : UserControl + { + private SyncManager _syncManager; + + public SensorsView() + { + InitializeComponent(); + + _syncManager = new SyncManager(); + _syncManager.AddGraph(graphTemperature); + _syncManager.AddGraph(graphPressure); + _syncManager.RefreshRate = 30; + _syncManager.Start(); + } + + private void OnGraphFullScreen(object sender, RoutedEventArgs e) + { + + } + + private void Graph_MouseEnter(object sender, MouseEventArgs e) + { + + } + + private void Graph_MouseLeave(object sender, MouseEventArgs e) + { + + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioModule.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioModule.cs index 21377fb5f..118afff7e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioModule.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioModule.cs @@ -49,5 +49,10 @@ namespace Tango.MachineStudio.Common /// Perform any operations required to initialize this module. /// void Initialize(); + + /// + /// Sets a value indicating whether this module is loaded. + /// + bool IsLoaded { set; get; } } } 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 dfdac67c7..a88a045a6 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs @@ -12,6 +12,11 @@ namespace Tango.MachineStudio.Common.StudioApplication /// public interface IStudioApplicationManager { + /// + /// Occurs when the connected machine property has changed. + /// + event EventHandler ConnectedMachineChanged; + /// /// Gets a value indicating whether Machine Studio is shutting down. /// diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml index 8e5876e79..fe50851a0 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml @@ -11,7 +11,10 @@ - + + + + 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 5944af2d1..0e1bd829b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs @@ -25,6 +25,7 @@ namespace Tango.MachineStudio.UI.Modules { private IAuthenticationProvider _authenticationProvider; private bool _loaded; + public event EventHandler ModulesLoaded; /// /// Initializes a new instance of the class. @@ -115,6 +116,8 @@ namespace Tango.MachineStudio.UI.Modules { UserModules = AllModules.Where(x => _authenticationProvider.CurrentUser.HasPermission(x.Permission)).ToObservableCollection(); } + + ModulesLoaded?.Invoke(this, new EventArgs()); } } } 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 2fa8c7562..56abbd702 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Navigation/DefaultNavigationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Navigation/DefaultNavigationManager.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.Navigation; namespace Tango.MachineStudio.UI.Navigation 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 68af7bdc3..06b4dca7c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs @@ -48,6 +48,11 @@ namespace Tango.MachineStudio.UI.StudioApplication /// private IExternalBridgeClient _connectedMachine; + /// + /// Occurs when the connected machine property has changed. + /// + public event EventHandler ConnectedMachineChanged; + /// /// Gets or sets the currently connected machine if any. /// @@ -66,6 +71,8 @@ namespace Tango.MachineStudio.UI.StudioApplication _connectedMachine.StateChanged -= ConnectedMachine_StateChanged; _connectedMachine.StateChanged += ConnectedMachine_StateChanged; } + + ConnectedMachineChanged?.Invoke(this, _connectedMachine); } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/SupervisingController/IMainView.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/SupervisingController/IMainView.cs index 3de061de8..fd8ef4be5 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/SupervisingController/IMainView.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/SupervisingController/IMainView.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.MachineStudio.Common; using Tango.SharedUI; namespace Tango.MachineStudio.UI.SupervisingController @@ -13,6 +14,10 @@ namespace Tango.MachineStudio.UI.SupervisingController /// public interface IMainView : IView { - + /// + /// Navigates to the specified studio module. + /// + /// The module. + void NavigateToModule(IStudioModule module); } } 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 b752ca4b7..9b498cfb6 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 @@ -241,6 +241,10 @@ + + {b9ae25d6-be35-492f-9079-21a7f3e6f7cc} + RealTimeGraphEx + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs index 5f315f7f4..7ceab8268 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs @@ -67,7 +67,7 @@ namespace Tango.MachineStudio.UI if (!ViewModelBase.IsInDesignModeStatic) { - LogManager.RegisterLogger(new VSOutputLogger()); + //LogManager.RegisterLogger(new VSOutputLogger()); LogManager.RegisterLogger(new FileLogger()); } 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 fcbdc90a3..fdab1a93c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -1,4 +1,5 @@ -using System; +using GalaSoft.MvvmLight.Ioc; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; @@ -275,14 +276,22 @@ namespace Tango.MachineStudio.UI.ViewModels { IsMenuOpened = false; + foreach (var m in StudioModuleLoader.AllModules.Where(x => x != module)) + { + m.IsLoaded = false; + } + if (module != null) { CurrentModule = module; + CurrentModule.IsLoaded = true; IsModuleLoaded = true; + View.NavigateToModule(module); } else { IsModuleLoaded = false; + View.NavigateToModule(null); } } 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 616187288..99654f602 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml @@ -165,95 +165,66 @@ - - - - - - - Welcome to Machine Studio - Select Your Studio Module... - - + + + + + + + + + + + Welcome to Machine Studio + Select Your Studio Module... + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + +