From e45e0ab91282061c2692887aca7f66e6b3ea43df Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 23 Jan 2018 20:44:04 +0200 Subject: Working on Developer Module. --- .../Tango.MachineStudio.Developer/Images/calendar.png | Bin 0 -> 1240 bytes .../Images/description.png | Bin 0 -> 576 bytes .../Images/inter-segment.png | Bin 0 -> 1983 bytes .../Images/lubrication.png | Bin 0 -> 1380 bytes .../Images/machine-trans.png | Bin 0 -> 45618 bytes .../Tango.MachineStudio.Developer/Images/name.png | Bin 0 -> 600 bytes .../Tango.MachineStudio.Developer/Images/rgb.png | Bin 0 -> 1524 bytes .../Tango.MachineStudio.Developer/Images/wind.png | Bin 0 -> 1267 bytes 8 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/calendar.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/description.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/inter-segment.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/lubrication.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/machine-trans.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/name.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/rgb.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/wind.png (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/calendar.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/calendar.png new file mode 100644 index 000000000..763783514 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/calendar.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/description.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/description.png new file mode 100644 index 000000000..d6e3d76ea Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/description.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/inter-segment.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/inter-segment.png new file mode 100644 index 000000000..e7c25faa2 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/inter-segment.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/lubrication.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/lubrication.png new file mode 100644 index 000000000..bba463b31 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/lubrication.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/machine-trans.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/machine-trans.png new file mode 100644 index 000000000..a7cf65852 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/machine-trans.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/name.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/name.png new file mode 100644 index 000000000..a25bded5c Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/name.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/rgb.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/rgb.png new file mode 100644 index 000000000..42f69513b Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/rgb.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/wind.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/wind.png new file mode 100644 index 000000000..23d2e0035 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/wind.png differ -- cgit v1.3.1 From 11e64f69d00d84974bb09bef6f921c7eeab7c47e Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 24 Jan 2018 18:30:53 +0200 Subject: Added Graphs Drag & Drop to Developer Module. --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 8388608 -> 8388608 bytes Software/Graphics/camera.png | Bin 0 -> 1360 bytes Software/Graphics/graphs.png | Bin 0 -> 1666 bytes Software/Graphics/line_graph.png | Bin 0 -> 14612 bytes Software/Graphics/no-signal.jpg | Bin 0 -> 611002 bytes .../Images/camera.png | Bin 0 -> 1360 bytes .../Images/graphs.png | Bin 0 -> 1666 bytes .../Images/line_graph.png | Bin 0 -> 14612 bytes .../Images/no-signal.jpg | Bin 0 -> 611002 bytes .../Resources/GraphEx.xaml | 126 ++++++++++++ .../Tango.MachineStudio.Developer.csproj | 24 +++ .../ViewModels/MainViewVM.cs | 221 ++++++++++++++++++--- .../Views/MainView.xaml | 179 ++++++++++++++++- .../Views/MainView.xaml.cs | 27 +++ .../Controls/RealTimeGraphControl.xaml | 90 +++++++++ .../Controls/RealTimeGraphControl.xaml.cs | 94 +++++++++ .../Converters/SecondsToGraphPointsConverter.cs | 27 +++ .../Helpers/GraphsHelper.cs | 34 ++++ .../Resources/MaterialDesign.xaml | 97 +++++++++ .../Tango.MachineStudio.Common.csproj | 17 ++ .../Tango.DAL.Observables/Entities/Sensor.cs | 38 ++++ .../Tango.DAL.Remote/DB/RemoteADO.edmx | 12 +- .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 74 +++---- .../Visual_Studio/Tango.DAL.Remote/DB/SENSOR.cs | 4 +- 25 files changed, 984 insertions(+), 80 deletions(-) create mode 100644 Software/Graphics/camera.png create mode 100644 Software/Graphics/graphs.png create mode 100644 Software/Graphics/line_graph.png create mode 100644 Software/Graphics/no-signal.jpg create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/camera.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/graphs.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/line_graph.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/no-signal.jpg create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Resources/GraphEx.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Converters/SecondsToGraphPointsConverter.cs create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Helpers/GraphsHelper.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index a5bb7694c..27da03f9b 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 9be50cc60..bdff96627 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Graphics/camera.png b/Software/Graphics/camera.png new file mode 100644 index 000000000..526573632 Binary files /dev/null and b/Software/Graphics/camera.png differ diff --git a/Software/Graphics/graphs.png b/Software/Graphics/graphs.png new file mode 100644 index 000000000..6a211693d Binary files /dev/null and b/Software/Graphics/graphs.png differ diff --git a/Software/Graphics/line_graph.png b/Software/Graphics/line_graph.png new file mode 100644 index 000000000..7e21f4e97 Binary files /dev/null and b/Software/Graphics/line_graph.png differ diff --git a/Software/Graphics/no-signal.jpg b/Software/Graphics/no-signal.jpg new file mode 100644 index 000000000..e8b1313c9 Binary files /dev/null and b/Software/Graphics/no-signal.jpg differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/camera.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/camera.png new file mode 100644 index 000000000..526573632 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/camera.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/graphs.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/graphs.png new file mode 100644 index 000000000..6a211693d Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/graphs.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/line_graph.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/line_graph.png new file mode 100644 index 000000000..7e21f4e97 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/line_graph.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/no-signal.jpg b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/no-signal.jpg new file mode 100644 index 000000000..e8b1313c9 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/no-signal.jpg differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Resources/GraphEx.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Resources/GraphEx.xaml new file mode 100644 index 000000000..a44a8191c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/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.Developer/Tango.MachineStudio.Developer.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj index f5da6fca4..276dd6c54 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 @@ -82,6 +82,10 @@ GlobalVersionInfo.cs + + MSBuild:Compile + Designer + Designer MSBuild:Compile @@ -113,6 +117,10 @@ + + {b9ae25d6-be35-492f-9079-21a7f3e6f7cc} + RealTimeGraphEx + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core @@ -125,6 +133,10 @@ {38197109-8610-4d3f-92b9-16d48df94d7c} Tango.DAL.Remote + + {b112d89a-a106-41ae-a0c1-4abc84c477f5} + Tango.DragAndDrop + {8491d07b-c1f6-4b62-a412-41b9fd2d6538} Tango.SharedUI @@ -161,5 +173,17 @@ + + + + + + + + + + + + \ No newline at end of file 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 2013de3c8..590474f9d 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 @@ -7,22 +7,37 @@ using System.Text; using System.Threading.Tasks; using Tango.Core.Commands; using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Controls; using Tango.MachineStudio.Common.Notifications; using Tango.MachineStudio.Common.StudioApplication; using Tango.SharedUI; namespace Tango.MachineStudio.Developer.ViewModels { + /// + /// Represents the developer module main view, view model. + /// + /// public class MainViewVM : ViewModel { private INotificationProvider _notification; + #region Properties + + /// + /// Gets or sets the application manager. + /// public IStudioApplicationManager ApplicationManager { get; set; } + /// + /// Gets or sets observable entites database the adapter. + /// public ObservablesEntitiesAdapter Adapter { get; set; } private Machine _selectedMachine; - + /// + /// Gets or sets the selected machine. + /// public Machine SelectedMachine { get { return _selectedMachine; } @@ -30,7 +45,9 @@ namespace Tango.MachineStudio.Developer.ViewModels } private List _liquidTypesRmls; - + /// + /// Gets or sets the liquid types RMLS. + /// public List LiquidTypesRmls { get { return _liquidTypesRmls; } @@ -38,48 +55,49 @@ namespace Tango.MachineStudio.Developer.ViewModels } private ProcessParametersTablesGroup _rmlProcessParametersTablesGroup; - + /// + /// Gets or sets the RML process parameters table group (cloned). + /// public ProcessParametersTablesGroup RmlProcessParametersTableGroup { get { return _rmlProcessParametersTablesGroup; } set { _rmlProcessParametersTablesGroup = value; RaisePropertyChangedAuto(); } } - private ProcessParametersTablesGroup _selectedGroupHistory; - - public ProcessParametersTablesGroup SelectedGroupHistory - { - get { return _selectedGroupHistory; } - set { _selectedGroupHistory = value; RaisePropertyChangedAuto(); OnSelectedGroupHistoryChanged(); } - } - - private void OnSelectedGroupHistoryChanged() - { - if (SelectedGroupHistory != null) - { - RmlProcessParametersTableGroup = SelectedGroupHistory.CloneGroup(); - } - } - private ObservableCollection _groupsHistory; - + /// + /// Gets or sets the RML process parameters groups history. + /// public ObservableCollection GroupsHistory { get { return _groupsHistory; } set { _groupsHistory = value; RaisePropertyChangedAuto(); } } - private Job _selectedJob; + private ProcessParametersTablesGroup _selectedGroupHistory; + /// + /// Gets or sets the selected process parameters tables group history. + /// + public ProcessParametersTablesGroup SelectedGroupHistory + { + get { return _selectedGroupHistory; } + set { _selectedGroupHistory = value; RaisePropertyChangedAuto(); OnSelectedGroupHistoryChanged(); } + } + private Job _selectedJob; + /// + /// Gets or sets the selected machine job. + /// public Job SelectedJob { get { return _selectedJob; } set { _selectedJob = value; RaisePropertyChangedAuto(); } } - private Rml _selectedRML; - + /// + /// Gets or sets the selected RML. + /// public Rml SelectedRML { get { return _selectedRML; } @@ -87,43 +105,131 @@ namespace Tango.MachineStudio.Developer.ViewModels } private bool _isSideBarOpened; - + /// + /// Gets or sets a value indicating whether the configuration panels are opened. + /// public bool IsSideBarOpened { get { return _isSideBarOpened; } set { _isSideBarOpened = value; RaisePropertyChangedAuto(); } } + private ObservableCollection _availableSensors; + /// + /// Gets or sets the available sensors. + /// + public ObservableCollection AvailableSensors + { + get { return _availableSensors; } + set { _availableSensors = value; RaisePropertyChangedAuto(); } + } + private ObservableCollection _graphs; + /// + /// Gets or sets the collection of displayed graph controls. + /// + public ObservableCollection Graphs + { + get { return _graphs; } + set { _graphs = value; RaisePropertyChangedAuto(); } + } + + #endregion + + #region Commands + + /// + /// Gets or sets the edit machine command. + /// public RelayCommand EditMachineCommand { get; set; } + /// + /// Gets or sets the edit RML command. + /// public RelayCommand EditRMLCommand { get; set; } + /// + /// Gets or sets the toggle side bar command. + /// public RelayCommand ToggleSideBarCommand { get; set; } + /// + /// Gets or sets the save process parameters command. + /// public RelayCommand SaveProcessParametersCommand { get; set; } + /// + /// Gets or sets the save liquid factors command. + /// public RelayCommand SaveLiquidFactorsCommand { get; set; } + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// public MainViewVM() { IsSideBarOpened = true; + + if (!this.DesignMode) + { + Adapter = ObservablesEntitiesAdapter.Instance; + AvailableSensors = Adapter.Sensors.ToObservableCollection(); + } + + Graphs = new ObservableCollection(); } + /// + /// Initializes a new instance of the class. + /// + /// The application manager. + /// The notification provider. [PreferredConstructor] - public MainViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider) + public MainViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider) : this() { _notification = notificationProvider; - Adapter = ObservablesEntitiesAdapter.Instance; EditMachineCommand = new RelayCommand(EditMachine, (x) => SelectedMachine != null); ApplicationManager = applicationManager; EditRMLCommand = new RelayCommand(EditRML, (x) => SelectedRML != null); ToggleSideBarCommand = new RelayCommand(() => IsSideBarOpened = !IsSideBarOpened); SaveProcessParametersCommand = new RelayCommand(SaveProcessParameters); SaveLiquidFactorsCommand = new RelayCommand(SaveLiquidFactors); - IsSideBarOpened = true; } + #endregion + + #region Virtual Methods + + /// + /// Called when the selected group history has been changed + /// + protected virtual void OnSelectedGroupHistoryChanged() + { + if (SelectedGroupHistory != null) + { + RmlProcessParametersTableGroup = SelectedGroupHistory.CloneGroup(); + } + } + + /// + /// Called when the machine has been changed + /// + protected virtual void OnMachineChanged() + { + InvalidateLiquidFactorsAndProcessTables(); + } + + #endregion + + #region Private Methods + + /// + /// Saves the liquid factors. + /// private async void SaveLiquidFactors() { if (SelectedRML != null) @@ -141,21 +247,25 @@ namespace Tango.MachineStudio.Developer.ViewModels } } + /// + /// Navigates to the DB Module in order to edit the selected RML. + /// private void EditRML() { ApplicationManager.RequestModule("Data Base", SelectedRML); } + /// + /// Navigates to the Machine Designer Module in order to edit the selected machine. + /// private void EditMachine() { ApplicationManager.RequestModule("Machine Designer", SelectedMachine); } - private void OnMachineChanged() - { - InvalidateLiquidFactorsAndProcessTables(); - } - + /// + /// Saves the process parameters group. + /// private async void SaveProcessParameters() { var response = _notification.ShowTextInput("Enter Group Name", "Group Name"); @@ -196,6 +306,9 @@ namespace Tango.MachineStudio.Developer.ViewModels } } + /// + /// Invalidates the liquid factors and process parameters tables. + /// private void InvalidateLiquidFactorsAndProcessTables() { if (SelectedRML != null && SelectedMachine != null) @@ -212,5 +325,49 @@ namespace Tango.MachineStudio.Developer.ViewModels GroupsHistory = SelectedRML.ProcessParametersTablesGroups.OrderByDescending(x => x.SaveDate).OrderBy(x => !x.Active).ToObservableCollection(); } } + + #endregion + + #region Public Events + + /// + /// Add sensor graph from available sensors to displayed graphs. + /// + /// The sensor. + public void OnDropAvailableSensor(Sensor sensor) + { + if (Graphs.Count < 8) + { + RealTimeGraphControl graphControl = new RealTimeGraphControl(); + graphControl.Tag = sensor; + graphControl.SensorName = sensor.Description; + graphControl.SensorUnits = sensor.Units; + graphControl.Graph.Minimum = sensor.Min; + graphControl.Graph.Maximum = sensor.Max; + graphControl.Graph.MaxPoints = Common.Helpers.GraphsHelper.GetMaxPoints(sensor.PointsPerFrame); + graphControl.GraphRemoveButtonPressed += (sender, __) => + { + RemoveGraph(sender as RealTimeGraphControl); + }; + Graphs.Add(graphControl); + AvailableSensors.Remove(sensor); + } + else + { + _notification.ShowInfo("The maximum number of real-time graphs is eight. Please remove a graph to add another."); + } + } + + /// + /// Removes the graph. + /// + /// The graph. + public void RemoveGraph(RealTimeGraphControl graph) + { + Graphs.Remove(graph); + AvailableSensors.Insert(0, graph.Tag as Sensor); + } + + #endregion } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml index 7d98fe2d7..40babfc74 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml @@ -5,6 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:global="clr-namespace:Tango.MachineStudio.Developer" + xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" 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" @@ -31,6 +32,51 @@ + + + + @@ -291,7 +337,7 @@ - + @@ -331,9 +377,9 @@ - + - + @@ -402,7 +448,7 @@ - + - CAMERAS + + + + + USB CAMERAS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + AVAILABLE GRAPHS + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + DRAG & DROP GRAPHS + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs index 6ebfd9832..9eeff4975 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs @@ -12,6 +12,9 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.DAL.Observables; +using Tango.DragAndDrop; +using Tango.MachineStudio.Developer.ViewModels; namespace Tango.MachineStudio.Developer.Views { @@ -20,9 +23,33 @@ namespace Tango.MachineStudio.Developer.Views /// public partial class MainView : UserControl { + private MainViewVM _vm; + + public DraggingSurface DraggingSurface + { + get { return (DraggingSurface)GetValue(DraggingSurfaceProperty); } + set { SetValue(DraggingSurfaceProperty, value); } + } + public static readonly DependencyProperty DraggingSurfaceProperty = + DependencyProperty.Register("DraggingSurface", typeof(DraggingSurface), typeof(MainView), new PropertyMetadata(null)); + public MainView() { InitializeComponent(); + + DraggingSurface = draggingSurface; + this.Loaded += (x, y) => + { + _vm = DataContext as MainViewVM; + }; + } + + private void OnDropAvailableSensor(object sender, DropEventArgs e) + { + if (e.Draggable.DataContext is Sensor) + { + _vm.OnDropAvailableSensor(e.Draggable.DataContext as Sensor); + } } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml new file mode 100644 index 000000000..687bc6030 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml.cs new file mode 100644 index 000000000..6396ab91a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +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.Animation; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.Common.Controls +{ + /// + /// Interaction logic for RealTimeGraphControl.xaml + /// + public partial class RealTimeGraphControl : UserControl + { + #region Properties + + /// + /// Gets or sets the name of the sensor. + /// + public String SensorName + { + get { return (String)GetValue(SensorNameProperty); } + set { SetValue(SensorNameProperty, value); } + } + public static readonly DependencyProperty SensorNameProperty = + DependencyProperty.Register("SensorName", typeof(String), typeof(RealTimeGraphControl), new PropertyMetadata(null)); + + /// + /// Gets or sets the sensor units. + /// + public String SensorUnits + { + get { return (String)GetValue(SensorUnitsProperty); } + set { SetValue(SensorUnitsProperty, value); } + } + public static readonly DependencyProperty SensorUnitsProperty = + DependencyProperty.Register("SensorUnits", typeof(String), typeof(RealTimeGraphControl), new PropertyMetadata(null)); + + + #endregion + + #region Events + + public event EventHandler GraphRemoveButtonPressed; + public event EventHandler GraphFullScreenButtonPressed; + + #endregion + + public RealTimeGraphControl() + { + InitializeComponent(); + } + + private void OnGraphFullScreen(object sender, RoutedEventArgs e) + { + GraphFullScreenButtonPressed?.Invoke(this, new EventArgs()); + } + + private void Graph_MouseEnter(object sender, MouseEventArgs e) + { + Grid mainGrid = sender as Grid; + var headerGrid = mainGrid.Children.OfType().ToList().First(); + ThicknessAnimation ani = new ThicknessAnimation(); + ani.To = new Thickness(0, 0, 0, 0); + ani.Duration = TimeSpan.FromSeconds(0.2); + headerGrid.BeginAnimation(Grid.MarginProperty, ani); + } + + private void Graph_MouseLeave(object sender, MouseEventArgs e) + { + Grid mainGrid = sender as Grid; + var headerGrid = mainGrid.Children.OfType().ToList().First(); + ThicknessAnimation ani = new ThicknessAnimation(); + ani.To = new Thickness(0, -35, 0, 0); + ani.Duration = TimeSpan.FromSeconds(0.2); + headerGrid.BeginAnimation(Grid.MarginProperty, ani); + } + + private void OnGraphRemove(object sender, RoutedEventArgs e) + { + GraphRemoveButtonPressed?.Invoke(this, new EventArgs()); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Converters/SecondsToGraphPointsConverter.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Converters/SecondsToGraphPointsConverter.cs new file mode 100644 index 000000000..17df7b9d5 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Converters/SecondsToGraphPointsConverter.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.MachineStudio.Common.Converters +{ + /// + /// Converts number of seconds to graph FIFO capacity. + /// + /// + 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.GraphsHelper.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/Tango.MachineStudio.Common/Helpers/GraphsHelper.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Helpers/GraphsHelper.cs new file mode 100644 index 000000000..53e832eb5 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Helpers/GraphsHelper.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Settings; + +namespace Tango.MachineStudio.Common.Helpers +{ + /// + /// Contains RealTimeGraphEx helper methods. + /// + public static class GraphsHelper + { + /// + /// Gets the maximum points graph points by correlating between seconds duration from settings and expected graph points per frame. + /// + /// Length of graph points per frame. + /// + public static int GetMaxPoints(double pointsPerFrame) + { + try + { + double seconds = SettingsManager.Default.MachineStudio.TechnicianModule.GraphsDuration; + double pullRate = SettingsManager.Default.MachineStudio.TechnicianModule.GraphsPullingInterval; + return (int)(((pullRate * pointsPerFrame * 10 * seconds) * (10 / pullRate)) * 0.65); + } + catch (Exception) + { + return 300; + } + } + } +} 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 58bb9ef34..cc18c31c5 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml @@ -2,6 +2,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf" xmlns:editors="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" + xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:local="clr-namespace:Tango.MachineStudio.Common.Resources"> @@ -172,6 +173,102 @@ + + + + + Segoe UI + Lucida Console + + 28 + 26 + 20 + 16 + 14 + 12 + 9 + + + Silver + #FFE9E9E9 + Gray + #03A9F4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 e16703cfa..b89ec2e09 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 @@ -71,7 +71,12 @@ + + RealTimeGraphControl.xaml + + + @@ -98,6 +103,10 @@ + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -129,6 +138,10 @@ + + {b9ae25d6-be35-492f-9079-21a7f3e6f7cc} + RealTimeGraphEx + {bb2abb74-ba58-4812-83aa-ec8171f42df4} Tango.AutoComplete @@ -149,6 +162,10 @@ {4206ac58-3b57-4699-8835-90bf6db01a61} Tango.Integration + + {d8f1ad85-526a-4f50-b6dc-d437af63d8d8} + Tango.Settings + {8491d07b-c1f6-4b62-a412-41b9fd2d6538} Tango.SharedUI diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Sensor.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Sensor.cs index 11d86ddec..c71a1524d 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Sensor.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Sensor.cs @@ -10,6 +10,44 @@ namespace Tango.DAL.Observables public partial class Sensor : ObservableEntity { + private Int32 _code; + /// + /// Gets or sets the sensor code. + /// + [EntityFieldName("CODE")] + public Int32 Code + { + get + { + return _code; + } + + set + { + _code = value; RaisePropertyChanged(nameof(Code)); + } + + } + + private String _name; + /// + /// Gets or sets the sensor name. + /// + [EntityFieldName("NAME")] + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + private String _description; /// /// Gets or sets the sensor description. diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx index a6b839b02..50ffe89cf 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -558,8 +558,10 @@ - + + + @@ -2455,8 +2457,10 @@ - + + + @@ -3787,8 +3791,10 @@ - + + + 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 cc9a72473..9ff8be4cb 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,55 +5,55 @@ - - - + + + - - + + - - + + - - - - - - - - - - - + + + + + + + + + + + - + - - + + - - - - - - - - - - - + + + + + + + + + + + - - + + - - - + + + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/SENSOR.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/SENSOR.cs index 0320679ea..e01ba8d5a 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/SENSOR.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/SENSOR.cs @@ -15,8 +15,10 @@ namespace Tango.DAL.Remote.DB public partial class SENSOR { public int ID { get; set; } - public string NAME { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } public int CODE { get; set; } + public string NAME { get; set; } public string DESCRIPTION { get; set; } public double MIN { get; set; } public double MAX { get; set; } -- cgit v1.3.1 From dc11398ba5728af943256ca99eba8c9d66e1b6e2 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 25 Jan 2018 14:12:56 +0200 Subject: Refactored ObservableEntity: Observables comparison is now done by GUID. Implemented != == Equals overrides. Save and load are now done only on decorated properties so properties on partial class are allowed! Implemented dynamic graph sizes on developer module. --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 8388608 -> 8388608 bytes .../ViewModels/DbTableViewModel.cs | 8 +- .../Images/video-frame.png | Bin 0 -> 107600 bytes .../Tango.MachineStudio.Developer.csproj | 3 + .../ViewModels/MainViewVM.cs | 17 +- .../Views/MainView.xaml | 246 ++++++++++++++------- .../Tango.Core/ExtensionMethods/TypeExtensions.cs | 23 ++ .../Tango.DAL.Observables/ObservableEntity.cs | 54 ++++- .../Tango.DAL.Observables/Partials/User.cs | 12 +- .../Converters/GreaterThanToBooleanConverter.cs | 25 +++ .../Converters/SmallerThanToBooleanConverter.cs | 25 +++ .../Tango.SharedUI/Tango.SharedUI.csproj | 2 + 13 files changed, 309 insertions(+), 106 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/video-frame.png create mode 100644 Software/Visual_Studio/Tango.SharedUI/Converters/GreaterThanToBooleanConverter.cs create mode 100644 Software/Visual_Studio/Tango.SharedUI/Converters/SmallerThanToBooleanConverter.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 875b88771..b2f5b395c 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 3a65c84fa..3bab614f7 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs index a3d3e2486..ae4fa8a07 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs @@ -140,7 +140,7 @@ namespace Tango.MachineStudio.DB.ViewModels base.OnValidating(); ValidationErrors.Clear(); - foreach (var prop in typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => !x.PropertyType.IsGenericType && x.PropertyType.IsClass && !x.Name.Contains("Guid"))) + foreach (var prop in typeof(T).GetPropertiesWithAttribute(BindingFlags.Public | BindingFlags.Instance).Where(x => !x.PropertyType.IsGenericType && x.PropertyType.IsClass && !x.Name.Contains("Guid"))) { if (prop.GetValue(EditEntity) == null) { @@ -298,13 +298,13 @@ namespace Tango.MachineStudio.DB.ViewModels private bool FilterEntity(T entity, String filter) { - foreach (var prop in entity.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsClass && x.PropertyType != typeof(String) && x.PropertyType != typeof(byte[]) && !x.PropertyType.IsGenericType)) + foreach (var prop in entity.GetType().GetPropertiesWithAttribute(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsClass && x.PropertyType != typeof(String) && x.PropertyType != typeof(byte[]) && !x.PropertyType.IsGenericType)) { object obj = prop.GetValue(entity); if (obj != null) { - foreach (var innerProp in obj.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.Name != "Deleted" && x.Name != "ID" && x.Name != "LastUpdated").Where(x => !x.PropertyType.IsGenericType && (x.PropertyType.IsClass || x.PropertyType == typeof(String)))) + foreach (var innerProp in obj.GetType().GetPropertiesWithAttribute(BindingFlags.Public | BindingFlags.Instance).Where(x => x.Name != "Deleted" && x.Name != "ID" && x.Name != "LastUpdated").Where(x => !x.PropertyType.IsGenericType && (x.PropertyType.IsClass || x.PropertyType == typeof(String)))) { object value = innerProp.GetValue(obj); @@ -322,7 +322,7 @@ namespace Tango.MachineStudio.DB.ViewModels return entity. GetType(). - GetProperties(BindingFlags.Public | BindingFlags.Instance). + GetPropertiesWithAttribute(BindingFlags.Public | BindingFlags.Instance). Where(x => x.Name != "Deleted" && x.Name != "ID" && x.Name != "LastUpdated"). Where(x => !x.PropertyType.IsGenericType && (x.PropertyType.IsClass || x.PropertyType == typeof(String))). Select(prop => prop.GetValue(entity).ToString()). diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/video-frame.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/video-frame.png new file mode 100644 index 000000000..a052b62cf Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/video-frame.png differ 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 276dd6c54..970556986 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 @@ -185,5 +185,8 @@ + + + \ No newline at end of file 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 dc3ba0ec5..0742ca752 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 @@ -239,13 +239,8 @@ namespace Tango.MachineStudio.Developer.ViewModels { using (_notification.PushTaskItem("Saving Liquid Factors...")) { - String machineGuid = SelectedMachine.Guid; - String rmlGuid = SelectedRML.Guid; - await SelectedRML.SaveAsync(); - - SelectedMachine = Adapter.Machines.SingleOrDefault(x => x.Guid == machineGuid); - SelectedRML = Adapter.Rmls.SingleOrDefault(x => x.Guid == rmlGuid); + InvalidateLiquidFactorsAndProcessTables(); } } } @@ -298,14 +293,16 @@ namespace Tango.MachineStudio.Developer.ViewModels g.Active = false; } - String machineGuid = SelectedMachine.Guid; - String rmlGuid = SelectedRML.Guid; + //String machineGuid = SelectedMachine.Guid; + //String rmlGuid = SelectedRML.Guid; SelectedRML.ProcessParametersTablesGroups.Add(group); await SelectedRML.SaveAsync(); - SelectedMachine = Adapter.Machines.SingleOrDefault(x => x.Guid == machineGuid); - SelectedRML = Adapter.Rmls.SingleOrDefault(x => x.Guid == rmlGuid); + //SelectedMachine = Adapter.Machines.SingleOrDefault(x => x.Guid == machineGuid); + //SelectedRML = Adapter.Rmls.SingleOrDefault(x => x.Guid == rmlGuid); + + InvalidateLiquidFactorsAndProcessTables(); } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml index 40babfc74..a18e4145e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml @@ -28,6 +28,8 @@ + + @@ -77,6 +79,24 @@ + + @@ -171,127 +191,149 @@ - + + + + + + + + + + + - + Dyeing Speed: - + - + Min Ink Uptake: - + - + Mixer Temp: - + - + Head Zone1 Temp: - + - + Head Zone2 Temp: - + - + Head Zone3 Temp: - + - + Head Air Flow: - + - + Feeder Tension: - + - + Puller Tension: - + - + Dryer Buffer Length: - + - + Dryer Zone1 Temp: - + - + Dryer Zone2 Temp: - + - + Dryer Zone3 Temp: - + - + Dryer Air Flow: - + - + Winder Tension: - + @@ -351,7 +393,7 @@ - MACHINE JOBS + MACHINE JOBS @@ -397,43 +439,50 @@ - - - - Name + + + + + Name + + - - + - - - - Winding Method + + + + + Winding Method + + - - + - - - - Inter Segment + + + + + Inter Segment + + + + + - - - - - + - - - - Lubrication + + + + + Lubrication + + + + - - - Enable - - + @@ -484,36 +533,36 @@ USB CAMERAS - + - + - - + - + - - + - + - @@ -569,7 +618,40 @@ - + + + + + @@ -766,7 +848,7 @@ public RelayCommand SaveLiquidFactorsCommand { get; set; } + /// + /// Gets or sets the add segment command. + /// + public RelayCommand AddSegmentCommand { get; set; } + + /// + /// Gets or sets the remove segment command. + /// + public RelayCommand RemoveSegmentCommand { get; set; } + + /// + /// Gets or sets the add job command. + /// + public RelayCommand AddJobCommand { get; set; } + + /// + /// Gets or sets the remove job command. + /// + public RelayCommand RemoveJobCommand { get; set; } + #endregion #region Constructors @@ -219,6 +254,10 @@ namespace Tango.MachineStudio.Developer.ViewModels ToggleSideBarCommand = new RelayCommand(() => IsSideBarOpened = !IsSideBarOpened); SaveProcessParametersCommand = new RelayCommand(SaveProcessParameters); SaveLiquidFactorsCommand = new RelayCommand(SaveLiquidFactors); + AddSegmentCommand = new RelayCommand(AddSegment); + RemoveSegmentCommand = new RelayCommand(RemoveSegment); + AddJobCommand = new RelayCommand(AddJob); + RemoveJobCommand = new RelayCommand(RemoveJob); } #endregion @@ -239,6 +278,17 @@ namespace Tango.MachineStudio.Developer.ViewModels #region Virtual Methods + /// + /// Called when the selected job has been changed. + /// + private void OnSelectedJobChanged() + { + if (SelectedJob != null) + { + SelectedSegment = SelectedJob.Segments.FirstOrDefault(); + } + } + /// /// Called when the selected group history has been changed /// @@ -358,6 +408,58 @@ namespace Tango.MachineStudio.Developer.ViewModels } } + /// + /// Removes the selected segment. + /// + private void RemoveSegment() + { + if (SelectedJob != null && SelectedSegment != null) + { + SelectedSegment.DefferedDelete(); + SelectedJob.Segments.Remove(SelectedSegment); + } + } + + /// + /// Adds a new segment. + /// + private void AddSegment() + { + if (SelectedJob != null) + { + Segment seg = new Segment(); + seg.Name = "New Seg"; + SelectedJob.Segments.Add(seg); + } + } + + /// + /// Removes the selected job. + /// + private void RemoveJob() + { + if (SelectedMachine != null && SelectedJob != null) + { + SelectedJob.Delete(); + SelectedMachine.Jobs.Remove(SelectedJob); + } + } + + /// + /// Adds a new job to the selected machine. + /// + private void AddJob() + { + if (SelectedMachine != null) + { + SelectedMachine.Jobs.Add(new Job() + { + Name = "New Job", + CreationDate = DateTime.UtcNow, + }); + } + } + #endregion #region Public Events diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml index 243165cd5..b971d9124 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml @@ -398,6 +398,14 @@ + + + + @@ -425,6 +433,10 @@ + + + + @@ -494,7 +506,81 @@ + + + + + + + + + + + + + SEGMENTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name + + + + + + + + + Length + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/formula.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/formula.png new file mode 100644 index 000000000..6f476e79c Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/formula.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj index 64c54b357..bebcf2480 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj @@ -226,5 +226,8 @@ + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs index 5cb216a6c..f4da7beaa 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs @@ -361,6 +361,18 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels idsPack.LiquidTypeGuid = liquidType.Guid; } + /// + /// Drops the ids formula. + /// + /// The ids pack formula. + /// The ids pack. + /// + public void DropIdsFormula(IdsPackFormula idsPackFormula, IdsPack idsPack) + { + idsPack.IdsPackFormula = idsPackFormula; + idsPack.IdsPackFormulaGuid = idsPackFormula.Guid; + } + #endregion #region Private Methods diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml index e442e0e6f..61259508a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml @@ -226,6 +226,12 @@ + + + + + + @@ -417,6 +423,10 @@ Liquid: + + + Formula: + @@ -618,6 +628,32 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml.cs index 6d08a10e0..70e127b6c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml.cs @@ -62,7 +62,7 @@ namespace Tango.MachineStudio.MachineDesigner.Views { SetHighlightRegion(hardwareGrid); } - else if (e.DataContext is ApplicationVersion || e.DataContext is ApplicationOsVersion || e.DataContext is ApplicationDisplayPanelVersion) + else if (e.DataContext is ApplicationVersion || e.DataContext is ApplicationOsVersion || e.DataContext is ApplicationDisplayPanelVersion || e.DataContext is ApplicationFirmwareVersion) { SetHighlightRegion(gridTablet); } @@ -70,7 +70,7 @@ namespace Tango.MachineStudio.MachineDesigner.Views { SetHighlightRegion(gridEmbedded); } - else if (e.DataContext is DispenserType || e.DataContext is CartridgeType || e.DataContext is LiquidType || e.DataContext is MidTankType) + else if (e.DataContext is DispenserType || e.DataContext is CartridgeType || e.DataContext is LiquidType || e.DataContext is MidTankType || e.DataContext is IdsPackFormula) { SetHighlightRegion(gridIds); } @@ -102,6 +102,10 @@ namespace Tango.MachineStudio.MachineDesigner.Views { _vm.DropMidTankType(e.Draggable.DataContext as MidTankType, e.Droppable.DataContext as IdsPack); } + else if (e.Draggable.DataContext is IdsPackFormula) + { + _vm.DropIdsFormula(e.Draggable.DataContext as IdsPackFormula, e.Droppable.DataContext as IdsPack); + } else if (e.Draggable.DataContext is IdsPack) { _vm.DropIdsPack(e.Draggable.DataContext as IdsPack, e.Droppable.DataContext as IdsPack); diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml index 001a2bb3f..9d5ac4bb1 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("@(Model.TableName)")] - public partial class @(Model.Name) : ObservableEntity + public partial class @(Model.Name) : ObservableEntity<@(Model.Name)> { @foreach (var prop in Model.Fields) { diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ActionType.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ActionType.cs index ffdde45d3..f3b675bbe 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ActionType.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ActionType.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("ACTION_TYPES")] - public partial class ActionType : ObservableEntity + public partial class ActionType : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Address.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Address.cs index f2ba8d4e4..cb144e7bf 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Address.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Address.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("ADDRESSES")] - public partial class Address : ObservableEntity + public partial class Address : ObservableEntity
{ private Boolean _deleted; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationDisplayPanelVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationDisplayPanelVersion.cs index 1f56718d1..8848bb59a 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationDisplayPanelVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationDisplayPanelVersion.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("APPLICATION_DISPLAY_PANEL_VERSIONS")] - public partial class ApplicationDisplayPanelVersion : ObservableEntity + public partial class ApplicationDisplayPanelVersion : ObservableEntity { private Double _version; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationFirmwareVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationFirmwareVersion.cs index 5c5f44205..e85186be2 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationFirmwareVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationFirmwareVersion.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("APPLICATION_FIRMWARE_VERSIONS")] - public partial class ApplicationFirmwareVersion : ObservableEntity + public partial class ApplicationFirmwareVersion : ObservableEntity { private Double _version; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationOsVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationOsVersion.cs index b4cff06e9..5c7cd70b5 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationOsVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationOsVersion.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("APPLICATION_OS_VERSIONS")] - public partial class ApplicationOsVersion : ObservableEntity + public partial class ApplicationOsVersion : ObservableEntity { private Double _version; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationVersion.cs index 98f8a1e7f..885f647f0 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationVersion.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("APPLICATION_VERSIONS")] - public partial class ApplicationVersion : ObservableEntity + public partial class ApplicationVersion : ObservableEntity { private Double _version; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/BrushStop.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/BrushStop.cs index 4646f3178..477aa8efb 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/BrushStop.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/BrushStop.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("BRUSH_STOPS")] - public partial class BrushStop : ObservableEntity + public partial class BrushStop : ObservableEntity { private String _segmentguid; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/CartridgeType.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/CartridgeType.cs index 28dab4039..3b1bba423 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/CartridgeType.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/CartridgeType.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("CARTRIDGE_TYPES")] - public partial class CartridgeType : ObservableEntity + public partial class CartridgeType : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cat.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cat.cs index 0ffaacfd8..89a00cc85 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cat.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cat.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("CATS")] - public partial class Cat : ObservableEntity + public partial class Cat : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cct.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cct.cs index 737d3e127..dcca67aab 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cct.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Cct.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("CCTS")] - public partial class Cct : ObservableEntity + public partial class Cct : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ColorSpace.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ColorSpace.cs index de99fb775..98f745bff 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ColorSpace.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ColorSpace.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("COLOR_SPACES")] - public partial class ColorSpace : ObservableEntity + public partial class ColorSpace : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Configuration.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Configuration.cs index 999491915..323fb7b39 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Configuration.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Configuration.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("CONFIGURATIONS")] - public partial class Configuration : ObservableEntity + public partial class Configuration : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Contact.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Contact.cs index ad95c490d..c310451ac 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Contact.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Contact.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("CONTACTS")] - public partial class Contact : ObservableEntity + public partial class Contact : ObservableEntity { private Boolean _deleted; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/DispenserType.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/DispenserType.cs index 0d464f0bf..04b3258e3 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/DispenserType.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/DispenserType.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("DISPENSER_TYPES")] - public partial class DispenserType : ObservableEntity + public partial class DispenserType : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedFirmwareVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedFirmwareVersion.cs index da4bae985..d10426933 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedFirmwareVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedFirmwareVersion.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("EMBEDDED_FIRMWARE_VERSIONS")] - public partial class EmbeddedFirmwareVersion : ObservableEntity + public partial class EmbeddedFirmwareVersion : ObservableEntity { private Double _version; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedSoftwareVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedSoftwareVersion.cs index 2b35dc05d..55a8ca985 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedSoftwareVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedSoftwareVersion.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("EMBEDDED_SOFTWARE_VERSIONS")] - public partial class EmbeddedSoftwareVersion : ObservableEntity + public partial class EmbeddedSoftwareVersion : ObservableEntity { private Double _version; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EventType.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EventType.cs index 77b22e35c..a26fe70dc 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EventType.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EventType.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("EVENT_TYPES")] - public partial class EventType : ObservableEntity + public partial class EventType : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EventTypesAction.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EventTypesAction.cs index 46219549c..87f552957 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/EventTypesAction.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/EventTypesAction.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("EVENT_TYPES_ACTIONS")] - public partial class EventTypesAction : ObservableEntity + public partial class EventTypesAction : ObservableEntity { private String _eventtypeguid; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberShape.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberShape.cs index 01abfb0a5..4d91a522b 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberShape.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberShape.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("FIBER_SHAPES")] - public partial class FiberShape : ObservableEntity + public partial class FiberShape : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberSynth.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberSynth.cs index 2251bc36f..3b099b4de 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberSynth.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberSynth.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("FIBER_SYNTHS")] - public partial class FiberSynth : ObservableEntity + public partial class FiberSynth : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/HardwareVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/HardwareVersion.cs index 49ad1220d..bddc684d3 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/HardwareVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/HardwareVersion.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("HARDWARE_VERSIONS")] - public partial class HardwareVersion : ObservableEntity + public partial class HardwareVersion : ObservableEntity { private Double _version; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPack.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPack.cs index dc55d3612..e3a48c422 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPack.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPack.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("IDS_PACKS")] - public partial class IdsPack : ObservableEntity + public partial class IdsPack : ObservableEntity { private String _configurationguid; @@ -152,6 +152,26 @@ namespace Tango.DAL.Observables } + private String _idspackformulaguid; + /// + /// Gets or sets the idspack ids pack formula guid. + /// + [Column("IDS_PACK_FORMULA_GUID")] + [ForeignKey("IdsPackFormula")] + public String IdsPackFormulaGuid + { + get + { + return _idspackformulaguid; + } + + set + { + _idspackformulaguid = value; RaisePropertyChanged(nameof(IdsPackFormulaGuid)); + } + + } + private CartridgeType _cartridgetype; /// /// Gets or sets the idspack cartridge types. @@ -209,6 +229,25 @@ namespace Tango.DAL.Observables } + private IdsPackFormula _idspackformula; + /// + /// Gets or sets the idspack ids pack formulas. + /// + + public virtual IdsPackFormula IdsPackFormula + { + get + { + return _idspackformula; + } + + set + { + _idspackformula = value; RaisePropertyChanged(nameof(IdsPackFormula)); + } + + } + private LiquidType _liquidtype; /// /// Gets or sets the idspack liquid types. diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPackFormula.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPackFormula.cs new file mode 100644 index 000000000..0ad754233 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPackFormula.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using Tango.DAL.Remote.DB; + +namespace Tango.DAL.Observables +{ + [Table("IDS_PACK_FORMULAS")] + public partial class IdsPackFormula : ObservableEntity + { + + private Int32 _code; + /// + /// Gets or sets the idspackformula code. + /// + [Column("CODE")] + + public Int32 Code + { + get + { + return _code; + } + + set + { + _code = value; RaisePropertyChanged(nameof(Code)); + } + + } + + private String _name; + /// + /// Gets or sets the idspackformula name. + /// + [Column("NAME")] + + public String Name + { + get + { + return _name; + } + + set + { + _name = value; RaisePropertyChanged(nameof(Name)); + } + + } + + private String _description; + /// + /// Gets or sets the idspackformula description. + /// + [Column("DESCRIPTION")] + + public String Description + { + get + { + return _description; + } + + set + { + _description = value; RaisePropertyChanged(nameof(Description)); + } + + } + + private Boolean _autocalculated; + /// + /// Gets or sets the idspackformula auto calculated. + /// + [Column("AUTO_CALCULATED")] + + public Boolean AutoCalculated + { + get + { + return _autocalculated; + } + + set + { + _autocalculated = value; RaisePropertyChanged(nameof(AutoCalculated)); + } + + } + + private ObservableCollection _idspacks; + /// + /// Gets or sets the idspackformula ids packs. + /// + + public virtual ObservableCollection IdsPacks + { + get + { + return _idspacks; + } + + set + { + _idspacks = value; RaisePropertyChanged(nameof(IdsPacks)); + } + + } + + /// + /// Initializes a new instance of the class. + /// + public IdsPackFormula() : base() + { + + IdsPacks = new ObservableCollection(); + + } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Job.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Job.cs index fb3c20032..37c8e6736 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Job.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("JOBS")] - public partial class Job : ObservableEntity + public partial class Job : ObservableEntity { private DateTime _creationdate; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/JobRun.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/JobRun.cs index 3d8c1cb48..b15ca1511 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/JobRun.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/JobRun.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("JOB_RUNS")] - public partial class JobRun : ObservableEntity + public partial class JobRun : ObservableEntity { private String _jobguid; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/LinearMassDensityUnit.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/LinearMassDensityUnit.cs index 5767c5533..d0740e583 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/LinearMassDensityUnit.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/LinearMassDensityUnit.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("LINEAR_MASS_DENSITY_UNITS")] - public partial class LinearMassDensityUnit : ObservableEntity + public partial class LinearMassDensityUnit : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidType.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidType.cs index b59a1d0c6..a166d8ec4 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidType.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidType.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("LIQUID_TYPES")] - public partial class LiquidType : ObservableEntity + public partial class LiquidType : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidTypesRml.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidTypesRml.cs index 4a4136bf9..3f8fb6bad 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidTypesRml.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidTypesRml.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("LIQUID_TYPES_RMLS")] - public partial class LiquidTypesRml : ObservableEntity + public partial class LiquidTypesRml : ObservableEntity { private String _liquidtypeguid; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Machine.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Machine.cs index 7328f411c..3b41da138 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Machine.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Machine.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("MACHINES")] - public partial class Machine : ObservableEntity + public partial class Machine : ObservableEntity { private String _serialnumber; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachineVersion.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachineVersion.cs index 95dc7d261..a47ee4232 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachineVersion.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachineVersion.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("MACHINE_VERSIONS")] - public partial class MachineVersion : ObservableEntity + public partial class MachineVersion : ObservableEntity { private Double _version; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachinesConfiguration.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachinesConfiguration.cs index 9958a0fcd..4ecaa0ad4 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachinesConfiguration.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachinesConfiguration.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("MACHINES_CONFIGURATIONS")] - public partial class MachinesConfiguration : ObservableEntity + public partial class MachinesConfiguration : ObservableEntity { private String _machineguid; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachinesEvent.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachinesEvent.cs index 659c0c0ed..28fac4bbe 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachinesEvent.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MachinesEvent.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("MACHINES_EVENTS")] - public partial class MachinesEvent : ObservableEntity + public partial class MachinesEvent : ObservableEntity { private String _machineguid; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaColor.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaColor.cs index bd9b55b10..158edebc5 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaColor.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaColor.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("MEDIA_COLORS")] - public partial class MediaColor : ObservableEntity + public partial class MediaColor : ObservableEntity { private Int32 _color; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaCondition.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaCondition.cs index 1ad80393f..105e046f5 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaCondition.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaCondition.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("MEDIA_CONDITIONS")] - public partial class MediaCondition : ObservableEntity + public partial class MediaCondition : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaMaterial.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaMaterial.cs index c27a7a91b..f03d2c7a1 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaMaterial.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaMaterial.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("MEDIA_MATERIALS")] - public partial class MediaMaterial : ObservableEntity + public partial class MediaMaterial : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaPurpos.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaPurpos.cs index d40a87ae9..a09bdd1b8 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaPurpos.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaPurpos.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("MEDIA_PURPOSES")] - public partial class MediaPurpos : ObservableEntity + public partial class MediaPurpos : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MidTankType.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MidTankType.cs index 591f8c3ff..5fef06004 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/MidTankType.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/MidTankType.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("MID_TANK_TYPES")] - public partial class MidTankType : ObservableEntity + public partial class MidTankType : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Organization.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Organization.cs index 44e4edc4f..28ea5f835 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Organization.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Organization.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("ORGANIZATIONS")] - public partial class Organization : ObservableEntity + public partial class Organization : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Permission.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Permission.cs index 1a3fcd108..9057ecbd5 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Permission.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Permission.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("PERMISSIONS")] - public partial class Permission : ObservableEntity + public partial class Permission : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTable.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTable.cs index 167c2ebef..163d3da53 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTable.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTable.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("PROCESS_PARAMETERS_TABLES")] - public partial class ProcessParametersTable : ObservableEntity + public partial class ProcessParametersTable : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTablesGroup.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTablesGroup.cs index 55f5dba33..ab8ae2ed8 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTablesGroup.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTablesGroup.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("PROCESS_PARAMETERS_TABLES_GROUPS")] - public partial class ProcessParametersTablesGroup : ObservableEntity + public partial class ProcessParametersTablesGroup : ObservableEntity { private String _rmlguid; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs index 18e04f9b9..429773e0c 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("RMLS")] - public partial class Rml : ObservableEntity + public partial class Rml : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Role.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Role.cs index e0a183544..b9bb8244c 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Role.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Role.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("ROLES")] - public partial class Role : ObservableEntity + public partial class Role : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/RolesPermission.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/RolesPermission.cs index 8a2195331..3c7d4eb19 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/RolesPermission.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/RolesPermission.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("ROLES_PERMISSIONS")] - public partial class RolesPermission : ObservableEntity + public partial class RolesPermission : ObservableEntity { private String _roleguid; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Segment.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Segment.cs index 8fa4bb4f7..b018f2934 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Segment.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Segment.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("SEGMENTS")] - public partial class Segment : ObservableEntity + public partial class Segment : ObservableEntity { private String _name; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Sensor.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Sensor.cs index 7d09a0cc2..6b581f086 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/Sensor.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/Sensor.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("SENSORS")] - public partial class Sensor : ObservableEntity + public partial class Sensor : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/SyncConfiguration.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/SyncConfiguration.cs index 2aac73502..595757139 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/SyncConfiguration.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/SyncConfiguration.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("SYNC_CONFIGURATIONS")] - public partial class SyncConfiguration : ObservableEntity + public partial class SyncConfiguration : ObservableEntity { /// diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/User.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/User.cs index 9739e5b62..1a73b3750 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/User.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/User.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("USERS")] - public partial class User : ObservableEntity + public partial class User : ObservableEntity { private Boolean _deleted; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/UsersRole.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/UsersRole.cs index e96ea1fe4..934bb8822 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/UsersRole.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/UsersRole.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("USERS_ROLES")] - public partial class UsersRole : ObservableEntity + public partial class UsersRole : ObservableEntity { private Boolean _deleted; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/WindingMethod.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/WindingMethod.cs index 296774138..f14cf43cc 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/WindingMethod.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/WindingMethod.cs @@ -9,7 +9,7 @@ using Tango.DAL.Remote.DB; namespace Tango.DAL.Observables { [Table("WINDING_METHODS")] - public partial class WindingMethod : ObservableEntity + public partial class WindingMethod : ObservableEntity { private Int32 _code; diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/ActionTypes.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/ActionTypes.cs index 3473559e6..ef45931de 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/ActionTypes.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/ActionTypes.cs @@ -19,7 +19,7 @@ namespace Tango.DAL.Observables /// (Some action 2 description) /// [Description("Some action 2 description")] - Action2 = 2, + Action2yesss = 2, } } diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/IdsPackFormulas.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/IdsPackFormulas.cs new file mode 100644 index 000000000..595cb176b --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/IdsPackFormulas.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.ComponentModel; + +namespace Tango.DAL.Observables +{ + public enum IdsPackFormulas + { + + /// + /// (Standard Color IDS Pack Formula) + /// + [Description("Standard Color IDS Pack Formula")] + StandardColor = 0, + + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/IObservableEntity.cs b/Software/Visual_Studio/Tango.DAL.Observables/IObservableEntity.cs index 62bfe9e86..a957dacd1 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/IObservableEntity.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/IObservableEntity.cs @@ -44,6 +44,16 @@ namespace Tango.DAL.Observables /// void Save(); + /// + /// Attaches this observable to the proper DbSet. + /// + void Attach(); + + /// + /// Detaches this observable from the proper DbSet. + /// + void Detach(); + /// /// Saves the changes on this entity to database asynchronously. /// diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservableEntity.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservableEntity.cs index 493939ca4..b36577870 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ObservableEntity.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ObservableEntity.cs @@ -17,6 +17,7 @@ using Tango.Core.Helpers; using Force.DeepCloner; using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations; +using System.Runtime.CompilerServices; namespace Tango.DAL.Observables { @@ -26,7 +27,7 @@ namespace Tango.DAL.Observables /// /// /// - public abstract class ObservableEntity : ExtendedObject, IObservableEntity + public abstract class ObservableEntity : ExtendedObject, IObservableEntity where T : class, IObservableEntity { private Regex regExDAL; @@ -92,6 +93,22 @@ namespace Tango.DAL.Observables Saved?.Invoke(this, new EventArgs()); } + /// + /// Attaches this entity to the proper DbSet. + /// + public virtual void Attach() + { + GetDbSet().Add(this as T); + } + + /// + /// Detaches this observable from the proper DbSet. + /// + public virtual void Detach() + { + GetDbSet().Remove(this as T); + } + /// /// Saves the changes on this entity to database asynchronously. /// @@ -118,12 +135,8 @@ namespace Tango.DAL.Observables } else { - String tabelName = this.GetType().BaseType.Name.PluralizeMVC(); - var p = typeof(ObservablesContext).GetProperty(tabelName); - var dbSet = p.GetValue(ObservablesEntitiesAdapter.Instance.Context); - var method = dbSet.GetType().GetMethod("Remove"); - method.Invoke(dbSet, new object[] { this }); - ObservablesEntitiesAdapter.Instance.SaveChanges(); + GetDbSet().Remove(this as T); + Save(); } } @@ -132,11 +145,7 @@ namespace Tango.DAL.Observables /// public virtual void DefferedDelete() { - String tabelName = this.GetType().BaseType.Name.PluralizeMVC(); - var p = typeof(ObservablesContext).GetProperty(tabelName); - var dbSet = p.GetValue(ObservablesEntitiesAdapter.Instance.Context); - var method = dbSet.GetType().GetMethod("Remove"); - method.Invoke(dbSet, new object[] { this }); + GetDbSet().Remove(this as T); } /// @@ -151,23 +160,30 @@ namespace Tango.DAL.Observables } /// - /// Converts the specified database conventional name to the observables conventional name. + /// Gets the observable database set. /// - /// DAL name. /// - public static String DalNameToStandardName(String dalName) + public DbSet GetDbSet() { - return String.Join("", dalName.Split('_').Select(x => ToTitleCase(x))); - } + String tabelName = this.GetType().Name.PluralizeMVC(); + var p = typeof(ObservablesContext).GetProperty(tabelName); + if (p != null) + { + var set1 = p.GetValue(ObservablesEntitiesAdapter.Instance.Context) as DbSet; + return set1; + } + else + { + tabelName = this.GetType().BaseType.Name.PluralizeMVC(); + p = typeof(ObservablesContext).GetProperty(tabelName); + if (p != null) + { + var set2 = p.GetValue(ObservablesEntitiesAdapter.Instance.Context) as DbSet; + return set2; + } + } - /// - /// Converts the specified text to title case. - /// - /// The text. - /// - public static string ToTitleCase(string text) - { - return CultureInfo.CurrentCulture.TextInfo.ToTitleCase(text.ToLower()); + return null; } #region Operator Overloading diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesContext.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesContext.cs index 52310d446..63dc901ba 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesContext.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesContext.cs @@ -215,6 +215,14 @@ namespace Tango.DAL.Observables get; set; } + /// + /// Gets or sets the IdsPackFormulas. + /// + public DbSet IdsPackFormulas + { + get; set; + } + /// /// Gets or sets the IdsPacks. /// diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs index eff9e274d..89e43c2a8 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs @@ -263,6 +263,8 @@ namespace Tango.DAL.Observables Sensors = Context.Sensors.ToObservableCollection(); + IdsPackFormulas = Context.IdsPackFormulas.ToObservableCollection(); + InitCollectionSources(); //var action = ActionTypes.First(); diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs index 62c5ef260..3123a453d 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs @@ -762,6 +762,42 @@ namespace Tango.DAL.Observables } + 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. @@ -1818,6 +1854,8 @@ namespace Tango.DAL.Observables HardwareVersionsViewSource = CreateCollectionView(HardwareVersions); + IdsPackFormulasViewSource = CreateCollectionView(IdsPackFormulas); + IdsPacksViewSource = CreateCollectionView(IdsPacks); JobRunsViewSource = CreateCollectionView(JobRuns); diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj b/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj index ed5cadaa8..f9aa7cc5d 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj +++ b/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj @@ -67,6 +67,7 @@ + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACKS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACKS.cs index cddce2f6d..6275098a8 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACKS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACKS.cs @@ -24,10 +24,12 @@ namespace Tango.DAL.Remote.DB public string MID_TANK_TYPE_GUID { get; set; } public string NAME { get; set; } public int PACK_INDEX { get; set; } + public string IDS_PACK_FORMULA_GUID { get; set; } public virtual CARTRIDGE_TYPES CARTRIDGE_TYPES { get; set; } public virtual CONFIGURATION CONFIGURATION { get; set; } public virtual DISPENSER_TYPES DISPENSER_TYPES { get; set; } + public virtual IDS_PACK_FORMULAS IDS_PACK_FORMULAS { get; set; } public virtual LIQUID_TYPES LIQUID_TYPES { get; set; } public virtual MID_TANK_TYPES MID_TANK_TYPES { get; set; } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACK_FORMULAS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACK_FORMULAS.cs new file mode 100644 index 000000000..e4b4ca1c5 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACK_FORMULAS.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Remote.DB +{ + using System; + using System.Collections.Generic; + + public partial class IDS_PACK_FORMULAS + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] + public IDS_PACK_FORMULAS() + { + this.IDS_PACKS = new HashSet(); + } + + public int ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public int CODE { get; set; } + public string NAME { get; set; } + public string DESCRIPTION { get; set; } + public bool AUTO_CALCULATED { get; set; } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection IDS_PACKS { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs index df3d26227..65d93da83 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs @@ -46,6 +46,7 @@ namespace Tango.DAL.Remote.DB public virtual DbSet FIBER_SHAPES { get; set; } public virtual DbSet FIBER_SYNTHS { get; set; } public virtual DbSet HARDWARE_VERSIONS { get; set; } + public virtual DbSet IDS_PACK_FORMULAS { get; set; } public virtual DbSet IDS_PACKS { get; set; } public virtual DbSet JOB_RUNS { get; set; } public virtual DbSet JOBS { 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 46919f0ab..191370fdd 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -258,6 +258,18 @@ + + + + + + + + + + + + @@ -272,6 +284,7 @@ + @@ -834,6 +847,18 @@ + + + + + + + + + + + + @@ -1300,6 +1325,7 @@ + @@ -1400,6 +1426,10 @@ + + + + @@ -1567,6 +1597,7 @@ + @@ -1703,6 +1734,10 @@ + + + + @@ -2098,6 +2133,19 @@ + + + + + + + + + + + + + @@ -2112,9 +2160,11 @@ + + @@ -2855,6 +2905,18 @@ + + + + + + + + + + + + @@ -3467,9 +3529,23 @@ + + + + + + + + + + + + + + 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 4c973eb66..f7e4c0cc1 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,55 +5,56 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -81,6 +82,7 @@ + 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 6228a08fb..8300ed567 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj +++ b/Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj @@ -131,6 +131,9 @@ RemoteADO.tt + + RemoteADO.tt + RemoteADO.tt diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs index af0e1a08d..3973e8ad5 100644 --- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs +++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs @@ -11,7 +11,7 @@ using Tango.CodeGeneration; using Tango.DAL.Remote.DB; using Tango.Settings; using Humanizer; -using Tango.DAL.Observables; +using System.Globalization; namespace Tango.DBObservablesGenerator.CLI { @@ -29,32 +29,32 @@ namespace Tango.DBObservablesGenerator.CLI //Generate Entities... foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType))) { - EntityCodeFile codeFile = new EntityCodeFile(ObservableEntity.DalNameToStandardName(table.Name).SingularizeMVC()) + EntityCodeFile codeFile = new EntityCodeFile(DalNameToStandardName(table.Name).SingularizeMVC()) { EntityName = table.Name.SingularizeMVC(), TableName = table.Name, }; - List foreignKeys = table.PropertyType.GenericTypeArguments.First().GetProperties().Skip(3).Where(x => x.PropertyType == typeof(String)).Where(x => x.Name.ToLower().Contains("guid")).Select(x => ObservableEntity.DalNameToStandardName(x.Name).SingularizeMVC().Replace("Guid", "")).ToList(); + List foreignKeys = table.PropertyType.GenericTypeArguments.First().GetProperties().Skip(3).Where(x => x.PropertyType == typeof(String)).Where(x => x.Name.ToLower().Contains("guid")).Select(x => DalNameToStandardName(x.Name).SingularizeMVC().Replace("Guid", "")).ToList(); foreach (var field in table.PropertyType.GenericTypeArguments.First().GetProperties().Skip(3)) { EntityCodeFileField codeField = new EntityCodeFileField(); codeField.FieldName = field.Name; - codeField.Name = ObservableEntity.DalNameToStandardName(field.Name); + codeField.Name = DalNameToStandardName(field.Name); codeField.Description = field.Name.Replace("_", " ").ToLower(); if (field.PropertyType.IsGenericType) { - codeField.Type = String.Format("ObservableCollection<{0}>", ObservableEntity.DalNameToStandardName(field.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()); + codeField.Type = String.Format("ObservableCollection<{0}>", DalNameToStandardName(field.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()); codeField.Construct = true; } else { if (field.PropertyType.IsClass && field.PropertyType != typeof(String) && field.PropertyType != typeof(byte[])) { - codeField.Type = ObservableEntity.DalNameToStandardName(field.PropertyType.Name).SingularizeMVC(); + codeField.Type = DalNameToStandardName(field.PropertyType.Name).SingularizeMVC(); codeField.Name = codeField.Type; var fk = foreignKeys.SingleOrDefault(x => x.Contains(codeField.Name)); @@ -103,7 +103,7 @@ namespace Tango.DBObservablesGenerator.CLI if (codeProp != null && nameProp != null) { EnumerationFile enumFile = new EnumerationFile(); - enumFile.Name = ObservableEntity.DalNameToStandardName(tableProp.Name); + enumFile.Name = DalNameToStandardName(tableProp.Name); foreach (var row in tableProp.GetValue(db) as IEnumerable) { @@ -135,14 +135,14 @@ namespace Tango.DBObservablesGenerator.CLI //Generate Observables Adapter Extensions... ObservablesAdapterFile adapterFile = new ObservablesAdapterFile(); - adapterFile.Name = nameof(ObservablesEntitiesAdapter); + adapterFile.Name = "ObservablesEntitiesAdapter"; foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType))) { adapterFile.Properties.Add(new Property() { - Name = ObservableEntity.DalNameToStandardName(table.Name), - Type = String.Format("ObservableCollection<{0}>", ObservableEntity.DalNameToStandardName(table.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()), + Name = DalNameToStandardName(table.Name), + Type = String.Format("ObservableCollection<{0}>", DalNameToStandardName(table.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()), }); } @@ -158,8 +158,8 @@ namespace Tango.DBObservablesGenerator.CLI { contextFile.Properties.Add(new Property() { - Name = ObservableEntity.DalNameToStandardName(table.Name), - Type = String.Format("DbSet<{0}>", ObservableEntity.DalNameToStandardName(table.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()), + Name = DalNameToStandardName(table.Name), + Type = String.Format("DbSet<{0}>", DalNameToStandardName(table.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()), }); } String contextCode = contextFile.GenerateCode(); @@ -176,7 +176,7 @@ namespace Tango.DBObservablesGenerator.CLI //Generate Entities... foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType))) { - EntityCodeFileJava codeFile = new EntityCodeFileJava(ObservableEntity.DalNameToStandardName(table.Name).Singularize(false)) + EntityCodeFileJava codeFile = new EntityCodeFileJava(DalNameToStandardName(table.Name).Singularize(false)) { EntityName = table.Name.Singularize(false), TableName = table.Name, @@ -188,8 +188,8 @@ namespace Tango.DBObservablesGenerator.CLI { EntityCodeFileField codeField = new EntityCodeFileField(); codeField.FieldName = field.Name; - codeField.Name = ObservableEntity.DalNameToStandardName(field.Name); - codeField.Description = FirstCharacterToLower(ObservableEntity.DalNameToStandardName(field.Name)); + codeField.Name = DalNameToStandardName(field.Name); + codeField.Description = FirstCharacterToLower(DalNameToStandardName(field.Name)); if (field.PropertyType.IsGenericType) @@ -200,7 +200,7 @@ namespace Tango.DBObservablesGenerator.CLI { if (field.PropertyType.IsClass && field.PropertyType != typeof(String) && field.PropertyType != typeof(Byte[])) { - codeField.Type = ObservableEntity.DalNameToStandardName(field.PropertyType.Name).Singularize(false); + codeField.Type = DalNameToStandardName(field.PropertyType.Name).Singularize(false); codeField.Construct = true; } else if (field.PropertyType == typeof(Byte[])) @@ -239,7 +239,7 @@ namespace Tango.DBObservablesGenerator.CLI if (codeProp != null && nameProp != null) { EnumerationFileJava enumFile = new EnumerationFileJava(); - enumFile.Name = ObservableEntity.DalNameToStandardName(tableProp.Name); + enumFile.Name = DalNameToStandardName(tableProp.Name); foreach (var row in tableProp.GetValue(db) as IEnumerable) { @@ -277,8 +277,8 @@ namespace Tango.DBObservablesGenerator.CLI { daoFile.Entities.Add(new TangoDAOJavaFile.TangoDAOEntity() { - Name = ObservableEntity.DalNameToStandardName(table.Name).Singularize(false), - TableName = ObservableEntity.DalNameToStandardName(table.Name), + Name = DalNameToStandardName(table.Name).Singularize(false), + TableName = DalNameToStandardName(table.Name), }); } @@ -301,5 +301,25 @@ namespace Tango.DBObservablesGenerator.CLI return Char.ToLowerInvariant(str[0]) + str.Substring(1); } + + /// + /// Converts the specified database conventional name to the observables conventional name. + /// + /// DAL name. + /// + private static String DalNameToStandardName(String dalName) + { + return String.Join("", dalName.Split('_').Select(x => ToTitleCase(x))); + } + + /// + /// Converts the specified text to title case. + /// + /// The text. + /// + private static string ToTitleCase(string text) + { + return CultureInfo.CurrentCulture.TextInfo.ToTitleCase(text.ToLower()); + } } } diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Tango.DBObservablesGenerator.CLI.csproj b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Tango.DBObservablesGenerator.CLI.csproj index fa573208b..87baf3a3f 100644 --- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Tango.DBObservablesGenerator.CLI.csproj +++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Tango.DBObservablesGenerator.CLI.csproj @@ -72,10 +72,6 @@ {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core - - {0ecd6da8-7aa6-48d9-8b65-279d176ad9af} - Tango.DAL.Observables - {38197109-8610-4d3f-92b9-16d48df94d7c} Tango.DAL.Remote -- cgit v1.3.1 From 10eec8df1dfce197b31d51cfa49746b0ce07a5e5 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 28 Jan 2018 17:27:49 +0200 Subject: Added Segment Brush Stops and Dynamic Ink Volumes! --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 8388608 -> 8388608 bytes Software/Graphics/color-palette.png | Bin 0 -> 1880 bytes Software/Graphics/colorspace.png | Bin 0 -> 4232 bytes .../Images/color-palette.png | Bin 0 -> 1880 bytes .../Images/colorspace.png | Bin 0 -> 4232 bytes .../Tango.MachineStudio.Developer.csproj | 6 + .../ViewModels/MainViewVM.cs | 71 ++++++++- .../Views/MainView.xaml | 99 ++++++++++++- .../Resources/MaterialDesign.xaml | 33 +++++ .../Tango.DAL.Observables/Entities/BrushStop.cs | 160 +++++++++++++++++++++ .../ObservablesEntitiesAdapter.cs | 2 + .../Tango.DAL.Observables/Partials/BrushStop.cs | 84 +++++++++++ .../Tango.DAL.Observables.csproj | 1 + .../Tango.DAL.Remote/DB/BRUSH_STOPS.cs | 8 ++ .../Tango.DAL.Remote/DB/RemoteADO.edmx | 24 ++++ .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 100 ++++++------- Software/Visual_Studio/Tango.sln | 4 +- 18 files changed, 533 insertions(+), 59 deletions(-) create mode 100644 Software/Graphics/color-palette.png create mode 100644 Software/Graphics/colorspace.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/color-palette.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/colorspace.png create mode 100644 Software/Visual_Studio/Tango.DAL.Observables/Partials/BrushStop.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 4e0163c19..ee5f5c2e5 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 1b0003406..79cf41527 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Graphics/color-palette.png b/Software/Graphics/color-palette.png new file mode 100644 index 000000000..b1c58876f Binary files /dev/null and b/Software/Graphics/color-palette.png differ diff --git a/Software/Graphics/colorspace.png b/Software/Graphics/colorspace.png new file mode 100644 index 000000000..fca9f226e Binary files /dev/null and b/Software/Graphics/colorspace.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/color-palette.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/color-palette.png new file mode 100644 index 000000000..b1c58876f Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/color-palette.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/colorspace.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/colorspace.png new file mode 100644 index 000000000..fca9f226e Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/colorspace.png differ 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 71527d1dc..dc3f9947a 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 @@ -197,5 +197,11 @@ + + + + + + \ No newline at end of file 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 e77093eee..4e3b4ec13 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 @@ -121,7 +121,17 @@ namespace Tango.MachineStudio.Developer.ViewModels public Segment SelectedSegment { get { return _selectedSegment; } - set { _selectedSegment = value; RaisePropertyChangedAuto(); } + set { _selectedSegment = value; RaisePropertyChangedAuto(); OnSelectedSegmentChanged(); } + } + + private BrushStop _selectedBrushStop; + /// + /// Gets or sets the selected segment selected brush stop. + /// + public BrushStop SelectedBrushStop + { + get { return _selectedBrushStop; } + set { _selectedBrushStop = value; RaisePropertyChangedAuto(); } } private Rml _selectedRML; @@ -219,6 +229,16 @@ namespace Tango.MachineStudio.Developer.ViewModels /// public RelayCommand RemoveJobCommand { get; set; } + /// + /// Gets or sets the add brush stop command. + /// + public RelayCommand AddBrushStopCommand { get; set; } + + /// + /// Gets or sets the remove brush stop command. + /// + public RelayCommand RemoveBrushStopCommand { get; set; } + #endregion #region Constructors @@ -258,6 +278,8 @@ namespace Tango.MachineStudio.Developer.ViewModels RemoveSegmentCommand = new RelayCommand(RemoveSegment); AddJobCommand = new RelayCommand(AddJob); RemoveJobCommand = new RelayCommand(RemoveJob); + AddBrushStopCommand = new RelayCommand(AddBrushStop); + RemoveBrushStopCommand = new RelayCommand(RemoveBrushStop); } #endregion @@ -278,10 +300,22 @@ namespace Tango.MachineStudio.Developer.ViewModels #region Virtual Methods + /// + /// Called when the selected segment has been changed + /// + protected virtual void OnSelectedSegmentChanged() + { + if (SelectedSegment != null) + { + SetSegmentBrushStopsInkVolumes(SelectedSegment); + SelectedBrushStop = SelectedSegment.BrushStops.FirstOrDefault(); + } + } + /// /// Called when the selected job has been changed. /// - private void OnSelectedJobChanged() + protected virtual void OnSelectedJobChanged() { if (SelectedJob != null) { @@ -312,6 +346,14 @@ namespace Tango.MachineStudio.Developer.ViewModels #region Private Methods + private void SetSegmentBrushStopsInkVolumes(Segment segment) + { + foreach (var stop in segment.BrushStops) + { + stop.SetInkVolumes(SelectedMachine.Configuration); + } + } + /// /// Saves the liquid factors. /// @@ -460,6 +502,31 @@ namespace Tango.MachineStudio.Developer.ViewModels } } + /// + /// Removes the selected brush stop. + /// + private void RemoveBrushStop() + { + if (SelectedBrushStop != null && SelectedSegment != null) + { + SelectedSegment.BrushStops.Remove(SelectedBrushStop); + } + } + + /// + /// Adds a new brush stop to the selected segment. + /// + private void AddBrushStop() + { + if (SelectedSegment != null) + { + var stop = new BrushStop(); + stop.ColorSpace = Adapter.ColorSpaces.FirstOrDefault(); + stop.SetInkVolumes(SelectedMachine.Configuration); + SelectedSegment.BrushStops.Add(stop); + } + } + #endregion #region Public Events diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml index 572ebc785..e7aa85fb8 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml @@ -312,10 +312,10 @@ @@ -437,10 +437,10 @@ @@ -486,8 +486,97 @@ - + + + + + + + + + + + + SEGMENT BRUSH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Color Space + + + + + + + + + + + + + + + + + + + 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 8c5464930..37ed4cd3c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml @@ -307,6 +307,39 @@ + + diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Entities/BrushStop.cs b/Software/Visual_Studio/Tango.DAL.Observables/Entities/BrushStop.cs index 477aa8efb..6ec10b560 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Entities/BrushStop.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Entities/BrushStop.cs @@ -272,6 +272,166 @@ namespace Tango.DAL.Observables } + private Double _v0; + /// + /// Gets or sets the brushstop v0. + /// + [Column("V0")] + + public Double V0 + { + get + { + return _v0; + } + + set + { + _v0 = value; RaisePropertyChanged(nameof(V0)); + } + + } + + private Double _v1; + /// + /// Gets or sets the brushstop v1. + /// + [Column("V1")] + + public Double V1 + { + get + { + return _v1; + } + + set + { + _v1 = value; RaisePropertyChanged(nameof(V1)); + } + + } + + private Double _v2; + /// + /// Gets or sets the brushstop v2. + /// + [Column("V2")] + + public Double V2 + { + get + { + return _v2; + } + + set + { + _v2 = value; RaisePropertyChanged(nameof(V2)); + } + + } + + private Double _v3; + /// + /// Gets or sets the brushstop v3. + /// + [Column("V3")] + + public Double V3 + { + get + { + return _v3; + } + + set + { + _v3 = value; RaisePropertyChanged(nameof(V3)); + } + + } + + private Double _v4; + /// + /// Gets or sets the brushstop v4. + /// + [Column("V4")] + + public Double V4 + { + get + { + return _v4; + } + + set + { + _v4 = value; RaisePropertyChanged(nameof(V4)); + } + + } + + private Double _v5; + /// + /// Gets or sets the brushstop v5. + /// + [Column("V5")] + + public Double V5 + { + get + { + return _v5; + } + + set + { + _v5 = value; RaisePropertyChanged(nameof(V5)); + } + + } + + private Double _v6; + /// + /// Gets or sets the brushstop v6. + /// + [Column("V6")] + + public Double V6 + { + get + { + return _v6; + } + + set + { + _v6 = value; RaisePropertyChanged(nameof(V6)); + } + + } + + private Double _v7; + /// + /// Gets or sets the brushstop v7. + /// + [Column("V7")] + + public Double V7 + { + get + { + return _v7; + } + + set + { + _v7 = value; RaisePropertyChanged(nameof(V7)); + } + + } + private String _pantonguid; /// /// Gets or sets the brushstop panton guid. diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs index 89e43c2a8..4b0f8747d 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs @@ -265,6 +265,8 @@ namespace Tango.DAL.Observables IdsPackFormulas = Context.IdsPackFormulas.ToObservableCollection(); + ColorSpaces = Context.ColorSpaces.ToObservableCollection(); + InitCollectionSources(); //var action = ActionTypes.First(); diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Partials/BrushStop.cs b/Software/Visual_Studio/Tango.DAL.Observables/Partials/BrushStop.cs new file mode 100644 index 000000000..73595fce3 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Observables/Partials/BrushStop.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.DAL.Observables +{ + public partial class BrushStop + { + private ObservableCollection _inkVolumes; + [NotMapped] + public ObservableCollection InkVolumes + { + get { return _inkVolumes; } + set { _inkVolumes = value; RaisePropertyChangedAuto(); } + } + + public void SetInkVolumes(Configuration configuration) + { + InkVolumes = new ObservableCollection(); + + foreach (var idsPack in configuration.IdsPacks) + { + InkVolumes.Add(new InkVolume(configuration, idsPack, this)); + } + } + + [NotMapped] + public class InkVolume : ExtendedObject + { + private BrushStop _brushStop; + public BrushStop BrushStop + { + get { return _brushStop; } + set { _brushStop = value; RaisePropertyChangedAuto(); } + } + + private Configuration _configuration; + + public Configuration Configuration + { + get { return _configuration; } + set { _configuration = value; RaisePropertyChangedAuto(); } + } + + private IdsPack _idsPack; + public IdsPack IdsPack + { + get { return _idsPack; } + set { _idsPack = value; RaisePropertyChangedAuto(); } + } + + private double _volume; + public double Volume + { + get { return _volume; } + set { _volume = value; RaisePropertyChangedAuto(); OnVolumeChanged(); } + } + + public void Invalidate() + { + typeof(BrushStop).GetProperty("V" + Configuration.IdsPacks.IndexOf(IdsPack)).SetValue(BrushStop, Volume); + } + + public InkVolume(Configuration configuration, IdsPack idsPack, BrushStop brushStop) + { + BrushStop = brushStop; + IdsPack = idsPack; + Configuration = configuration; + + Volume = (double)typeof(BrushStop).GetProperty("V" + Configuration.IdsPacks.IndexOf(IdsPack)).GetValue(BrushStop); + } + + private void OnVolumeChanged() + { + Invalidate(); + } + } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj b/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj index d827f4bb1..1e08ab92a 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj +++ b/Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj @@ -103,6 +103,7 @@ + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/BRUSH_STOPS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/BRUSH_STOPS.cs index 8f3cb5c06..0c7a29322 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/BRUSH_STOPS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/BRUSH_STOPS.cs @@ -30,6 +30,14 @@ namespace Tango.DAL.Remote.DB public int L { get; set; } public int A { get; set; } public int B { get; set; } + public double V0 { get; set; } + public double V1 { get; set; } + public double V2 { get; set; } + public double V3 { get; set; } + public double V4 { get; set; } + public double V5 { get; set; } + public double V6 { get; set; } + public double V7 { get; set; } public string PANTON_GUID { get; set; } public virtual COLOR_SPACES COLOR_SPACES { 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 191370fdd..ae0018a35 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -92,6 +92,14 @@ + + + + + + + + @@ -1937,6 +1945,14 @@ + + + + + + + + @@ -3332,6 +3348,14 @@ + + + + + + + + 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 f7e4c0cc1..0adc65bec 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,56 +5,56 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index e60e1e1a0..a533cf1cd 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -884,8 +884,8 @@ Global {FC0FB4A1-360E-42B1-8372-9208A3098B2A}.Release|x64.Build.0 = Release|Any CPU {FC0FB4A1-360E-42B1-8372-9208A3098B2A}.Release|x86.ActiveCfg = Release|Any CPU {FC0FB4A1-360E-42B1-8372-9208A3098B2A}.Release|x86.Build.0 = Release|Any CPU - {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|Any CPU.Build.0 = Release|Any CPU {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|ARM.ActiveCfg = Debug|Any CPU {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|ARM.Build.0 = Debug|Any CPU {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Debug|ARM64.ActiveCfg = Debug|Any CPU -- cgit v1.3.1