aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy <roy.mail.net@gmail.com>2018-01-27 22:57:48 +0200
committerRoy <roy.mail.net@gmail.com>2018-01-27 22:57:48 +0200
commitbfc6aeabda4b320f9365f5eef4c8f1bcab9b24af (patch)
tree9dc44c02e8f4128232f0c4c4ae87115221131605
parent20482140c124fd1d5caaffcc9b0dfe853b30dd6f (diff)
downloadTango-bfc6aeabda4b320f9365f5eef4c8f1bcab9b24af.tar.gz
Tango-bfc6aeabda4b320f9365f5eef4c8f1bcab9b24af.zip
Added IDS_PACK_FORMULA.
Added necessary login to machine designer & db module. Started working on job segments.
-rw-r--r--Software/DB/Tango.mdfbin75497472 -> 75497472 bytes
-rw-r--r--Software/DB/Tango_log.ldfbin8388608 -> 8388608 bytes
-rw-r--r--Software/Graphics/formula.pngbin0 -> 853 bytes
-rw-r--r--Software/Graphics/ruler.pngbin0 -> 1110 bytes
-rw-r--r--Software/Graphics/segment-single.pngbin0 -> 535 bytes
-rw-r--r--Software/Graphics/segment.pngbin0 -> 1610 bytes
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj15
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs9
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs17
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/IdsPackFormulasViewVM.cs17
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulaView.xaml33
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulaView.xaml.cs28
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulasView.xaml31
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulasView.xaml.cs32
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackView.xaml13
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml3
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/ruler.pngbin0 -> 1110 bytes
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/segment-single.pngbin0 -> 535 bytes
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/segment.pngbin0 -> 1610 bytes
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj9
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs104
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml86
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/formula.pngbin0 -> 853 bytes
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj3
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs12
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml36
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml.cs8
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/ActionType.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/Address.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationDisplayPanelVersion.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationFirmwareVersion.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationOsVersion.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/ApplicationVersion.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/BrushStop.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/CartridgeType.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/Cat.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/Cct.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/ColorSpace.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/Configuration.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/Contact.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/DispenserType.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedFirmwareVersion.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/EmbeddedSoftwareVersion.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/EventType.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/EventTypesAction.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberShape.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/FiberSynth.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/HardwareVersion.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPack.cs41
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/IdsPackFormula.cs124
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/Job.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/JobRun.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/LinearMassDensityUnit.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidType.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/LiquidTypesRml.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/Machine.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/MachineVersion.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/MachinesConfiguration.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/MachinesEvent.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaColor.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaCondition.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaMaterial.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/MediaPurpos.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/MidTankType.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/Organization.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/Permission.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTable.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/ProcessParametersTablesGroup.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/Rml.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/Role.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/RolesPermission.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/Segment.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/Sensor.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/SyncConfiguration.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/User.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/UsersRole.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Entities/WindingMethod.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Enumerations/ActionTypes.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Enumerations/IdsPackFormulas.cs19
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/IObservableEntity.cs10
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/ObservableEntity.cs66
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/ObservablesContext.cs8
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapter.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/ObservablesEntitiesAdapterExtension.cs38
-rw-r--r--Software/Visual_Studio/Tango.DAL.Observables/Tango.DAL.Observables.csproj1
-rw-r--r--Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACKS.cs2
-rw-r--r--Software/Visual_Studio/Tango.DAL.Remote/DB/IDS_PACK_FORMULAS.cs34
-rw-r--r--Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.Context.cs1
-rw-r--r--Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx76
-rw-r--r--Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram100
-rw-r--r--Software/Visual_Studio/Tango.DAL.Remote/Tango.DAL.Remote.csproj3
-rw-r--r--Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs58
-rw-r--r--Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/Tango.DBObservablesGenerator.CLI.csproj4
94 files changed, 983 insertions, 160 deletions
diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf
index a9a08206b..b58b97bc8 100644
--- a/Software/DB/Tango.mdf
+++ b/Software/DB/Tango.mdf
Binary files differ
diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf
index c220a4591..e6da55e17 100644
--- a/Software/DB/Tango_log.ldf
+++ b/Software/DB/Tango_log.ldf
Binary files differ
diff --git a/Software/Graphics/formula.png b/Software/Graphics/formula.png
new file mode 100644
index 000000000..6f476e79c
--- /dev/null
+++ b/Software/Graphics/formula.png
Binary files differ
diff --git a/Software/Graphics/ruler.png b/Software/Graphics/ruler.png
new file mode 100644
index 000000000..173e4c204
--- /dev/null
+++ b/Software/Graphics/ruler.png
Binary files differ
diff --git a/Software/Graphics/segment-single.png b/Software/Graphics/segment-single.png
new file mode 100644
index 000000000..016666122
--- /dev/null
+++ b/Software/Graphics/segment-single.png
Binary files differ
diff --git a/Software/Graphics/segment.png b/Software/Graphics/segment.png
new file mode 100644
index 000000000..d0f85b83f
--- /dev/null
+++ b/Software/Graphics/segment.png
Binary files differ
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj
index 54c29f7f3..c17c43aa0 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj
@@ -114,6 +114,7 @@
<Compile Include="ViewModels\FiberShapesViewVM.cs" />
<Compile Include="ViewModels\FiberSynthsViewVM.cs" />
<Compile Include="ViewModels\HardwareVersionsViewVM.cs" />
+ <Compile Include="ViewModels\IdsPackFormulasViewVM.cs" />
<Compile Include="ViewModels\IdsPacksViewVM.cs" />
<Compile Include="ViewModels\LinearMassDensityUnitsViewVM.cs" />
<Compile Include="ViewModels\LiquidTypesRmlsViewVM.cs" />
@@ -142,6 +143,12 @@
<Compile Include="Views\DBViews\ActionTypeView.xaml.cs">
<DependentUpon>ActionTypeView.xaml</DependentUpon>
</Compile>
+ <Compile Include="Views\DBViews\IdsPackFormulasView.xaml.cs">
+ <DependentUpon>IdsPackFormulasView.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Views\DBViews\IdsPackFormulaView.xaml.cs">
+ <DependentUpon>IdsPackFormulaView.xaml</DependentUpon>
+ </Compile>
<Compile Include="Views\DBViews\ProcessParametersTablesGroupsView.xaml.cs">
<DependentUpon>ProcessParametersTablesGroupsView.xaml</DependentUpon>
</Compile>
@@ -378,6 +385,14 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
+ <Page Include="Views\DBViews\IdsPackFormulasView.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ <Page Include="Views\DBViews\IdsPackFormulaView.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
<Page Include="Views\DBViews\ProcessParametersTablesGroupsView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs
index 8a7afc067..46223d9f4 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs
@@ -36,6 +36,7 @@ namespace Tango.MachineStudio.DB
SimpleIoc.Default.Register<HardwareVersionsViewVM>();
SimpleIoc.Default.Register<IdsPacksViewVM>();
+ SimpleIoc.Default.Register<IdsPackFormulasViewVM>();
SimpleIoc.Default.Register<DispenserTypesViewVM>();
SimpleIoc.Default.Register<LiquidTypesViewVM>();
SimpleIoc.Default.Register<CartridgeTypesViewVM>();
@@ -358,5 +359,13 @@ namespace Tango.MachineStudio.DB
return ServiceLocator.Current.GetInstance<ProcessParametersTablesGroupsViewVM>();
}
}
+
+ public static IdsPackFormulasViewVM IdsPackFormulasViewVM
+ {
+ get
+ {
+ return ServiceLocator.Current.GetInstance<IdsPackFormulasViewVM>();
+ }
+ }
}
} \ No newline at end of file
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 ae4fa8a07..e1be2aa9b 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
@@ -156,14 +156,6 @@ namespace Tango.MachineStudio.DB.ViewModels
{
using (_notification.PushTaskItem("Saving changes to database..."))
{
- //var dependenctEntities = SelectedEntity.GetDependentEntitiesNameAndGuid();
-
- //if (dependenctEntities.Count > 0)
- //{
- // _notification.ShowError("The selected entity is being used by " + dependenctEntities.Count + " other entities." + Environment.NewLine + "Please delete any dependencies and try again." + Environment.NewLine + Environment.NewLine + String.Join(Environment.NewLine, dependenctEntities.Select(x => x.Key + ", ID: " + x.Value)));
- // return;
- //}
-
try
{
await SelectedEntity.DeleteAsync();
@@ -226,12 +218,21 @@ namespace Tango.MachineStudio.DB.ViewModels
using (_notification.PushTaskItem("Saving changes to database..."))
{
+ if (mode == DialogOpenMode.Adding)
+ {
+ entity.Attach();
+ }
+
try
{
await entity.SaveAsync();
}
catch (DbUpdateException ex)
{
+ if (mode == DialogOpenMode.Adding)
+ {
+ entity.Detach();
+ }
Adapter.Invalidate();
_notification.ShowError("Could not save entity." + Environment.NewLine + ex.InnerException.InnerException != null ? ex.InnerException.InnerException.Message : ex.InnerException.Message);
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/IdsPackFormulasViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/IdsPackFormulasViewVM.cs
new file mode 100644
index 000000000..a2763a257
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/IdsPackFormulasViewVM.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.DAL.Observables;
+using Tango.MachineStudio.Common.Notifications;
+
+namespace Tango.MachineStudio.DB.ViewModels
+{
+ public class IdsPackFormulasViewVM : DbTableViewModel<IdsPackFormula>
+ {
+ public IdsPackFormulasViewVM(INotificationProvider notification) : base(notification)
+ {
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulaView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulaView.xaml
new file mode 100644
index 000000000..83b2cc3d7
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulaView.xaml
@@ -0,0 +1,33 @@
+<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.IdsPackFormulaView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
+ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls"
+ xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker"
+ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
+ xmlns:vm="clr-namespace:Tango.MachineStudio.DB.ViewModels"
+ xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews"
+ mc:Ignorable="d"
+ d:DesignHeight="400" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:IdsPackFormulasViewVM, IsDesignTimeCreatable=False}">
+
+ <Grid>
+ <controls:TableGrid>
+ <TextBlock Text="ID:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox>
+ <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox>
+ <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox>
+ <TextBlock Text="Code:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Code,Mode=TwoWay}"></mahapps:NumericUpDown>
+ <TextBlock Text="Name:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox>
+ <TextBlock Text="Description:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.Description,Mode=TwoWay}"></TextBox>
+ <TextBlock Text="Auto Calculated:" FontWeight="Bold"></TextBlock>
+ <ToggleButton HorizontalAlignment="Right" IsChecked="{Binding EditEntity.AutoCalculated}"></ToggleButton>
+ </controls:TableGrid>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulaView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulaView.xaml.cs
new file mode 100644
index 000000000..4c289ddd2
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulaView.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Tango.MachineStudio.DB.Views.DBViews
+{
+ /// <summary>
+ /// Interaction logic for MachineView.xaml
+ /// </summary>
+ public partial class IdsPackFormulaView : UserControl
+ {
+ public IdsPackFormulaView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulasView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulasView.xaml
new file mode 100644
index 000000000..81c9124f3
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulasView.xaml
@@ -0,0 +1,31 @@
+<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.IdsPackFormulasView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:global="clr-namespace:Tango.MachineStudio.DB"
+ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls"
+ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
+ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+ mc:Ignorable="d"
+ d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.IdsPackFormulasViewVM}">
+
+ <UserControl.Resources>
+ <converters:BooleanToYesNoConverter x:Key="BooleanToYesNoConverter" />
+ </UserControl.Resources>
+
+ <Grid>
+ <controls:DbTableView>
+ <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.IdsPackFormulasViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True">
+ <DataGrid.Columns>
+ <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn>
+ <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Code" Binding="{Binding Code}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Description" Binding="{Binding Description}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Auto Calculated" Binding="{Binding AutoCalculated,Converter={StaticResource BooleanToYesNoConverter}}"></DataGridTextColumn>
+ </DataGrid.Columns>
+ </DataGrid>
+ </controls:DbTableView>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulasView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulasView.xaml.cs
new file mode 100644
index 000000000..079c48746
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackFormulasView.xaml.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using Tango.MachineStudio.DB.CustomAttributes;
+using Tango.MachineStudio.DB.Managers;
+using Tango.SharedUI.Controls;
+
+namespace Tango.MachineStudio.DB.Views.DBViews
+{
+ /// <summary>
+ /// Interaction logic for MachinesView.xaml
+ /// </summary>
+ [DBView]
+ public partial class IdsPackFormulasView : UserControl
+ {
+ public IdsPackFormulasView() : base()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackView.xaml
index 537bdb9f7..75093aa77 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPackView.xaml
@@ -10,7 +10,7 @@
xmlns:vm="clr-namespace:Tango.MachineStudio.DB.ViewModels"
xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews"
mc:Ignorable="d"
- d:DesignHeight="400" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:IdsPacksViewVM, IsDesignTimeCreatable=False}">
+ d:DesignHeight="500" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:IdsPacksViewVM, IsDesignTimeCreatable=False}">
<UserControl.Resources>
<converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter>
@@ -68,6 +68,17 @@
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
+ <TextBlock Text="Index:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.PackIndex,Mode=TwoWay}"></mahapps:NumericUpDown>
+
+ <TextBlock Text="Calculation Formula:" FontWeight="Bold"></TextBlock>
+ <ComboBox ItemsSource="{Binding Adapter.IdsPackFormulas}" SelectedItem="{Binding EditEntity.IdsPackFormula,Mode=TwoWay}">
+ <ComboBox.ItemTemplate>
+ <DataTemplate>
+ <TextBlock><Run Text="{Binding Name}"></Run></TextBlock>
+ </DataTemplate>
+ </ComboBox.ItemTemplate>
+ </ComboBox>
</controls:TableGrid>
</Grid>
</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml
index 0837bbf9f..03ab1d7d4 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/IdsPacksView.xaml
@@ -12,6 +12,7 @@
<UserControl.Resources>
<converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter>
+ <converters:BooleanToYesNoConverter x:Key="BooleanToYesNoConverter" />
</UserControl.Resources>
<Grid>
@@ -57,6 +58,8 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
+ <DataGridTextColumn Header="Index" Binding="{Binding PackIndex}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Formula" Binding="{Binding IdsPackFormula.Name}"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</controls:DbTableView>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/ruler.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/ruler.png
new file mode 100644
index 000000000..173e4c204
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/ruler.png
Binary files differ
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/segment-single.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/segment-single.png
new file mode 100644
index 000000000..016666122
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/segment-single.png
Binary files differ
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/segment.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/segment.png
new file mode 100644
index 000000000..d0f85b83f
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Images/segment.png
Binary files 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 970556986..71527d1dc 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
@@ -188,5 +188,14 @@
<ItemGroup>
<Resource Include="Images\video-frame.png" />
</ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\segment.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\segment-single.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\ruler.png" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> \ 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 8f3d2a7e3..e77093eee 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
@@ -106,7 +106,22 @@ namespace Tango.MachineStudio.Developer.ViewModels
public Job SelectedJob
{
get { return _selectedJob; }
- set { _selectedJob = value; RaisePropertyChangedAuto(); }
+ set
+ {
+ _selectedJob = value;
+ RaisePropertyChangedAuto();
+ OnSelectedJobChanged();
+ }
+ }
+
+ private Segment _selectedSegment;
+ /// <summary>
+ /// Gets or sets the job selected segment.
+ /// </summary>
+ public Segment SelectedSegment
+ {
+ get { return _selectedSegment; }
+ set { _selectedSegment = value; RaisePropertyChangedAuto(); }
}
private Rml _selectedRML;
@@ -184,6 +199,26 @@ namespace Tango.MachineStudio.Developer.ViewModels
/// </summary>
public RelayCommand SaveLiquidFactorsCommand { get; set; }
+ /// <summary>
+ /// Gets or sets the add segment command.
+ /// </summary>
+ public RelayCommand AddSegmentCommand { get; set; }
+
+ /// <summary>
+ /// Gets or sets the remove segment command.
+ /// </summary>
+ public RelayCommand RemoveSegmentCommand { get; set; }
+
+ /// <summary>
+ /// Gets or sets the add job command.
+ /// </summary>
+ public RelayCommand AddJobCommand { get; set; }
+
+ /// <summary>
+ /// Gets or sets the remove job command.
+ /// </summary>
+ 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
@@ -240,6 +279,17 @@ namespace Tango.MachineStudio.Developer.ViewModels
#region Virtual Methods
/// <summary>
+ /// Called when the selected job has been changed.
+ /// </summary>
+ private void OnSelectedJobChanged()
+ {
+ if (SelectedJob != null)
+ {
+ SelectedSegment = SelectedJob.Segments.FirstOrDefault();
+ }
+ }
+
+ /// <summary>
/// Called when the selected group history has been changed
/// </summary>
protected virtual void OnSelectedGroupHistoryChanged()
@@ -358,6 +408,58 @@ namespace Tango.MachineStudio.Developer.ViewModels
}
}
+ /// <summary>
+ /// Removes the selected segment.
+ /// </summary>
+ private void RemoveSegment()
+ {
+ if (SelectedJob != null && SelectedSegment != null)
+ {
+ SelectedSegment.DefferedDelete();
+ SelectedJob.Segments.Remove(SelectedSegment);
+ }
+ }
+
+ /// <summary>
+ /// Adds a new segment.
+ /// </summary>
+ private void AddSegment()
+ {
+ if (SelectedJob != null)
+ {
+ Segment seg = new Segment();
+ seg.Name = "New Seg";
+ SelectedJob.Segments.Add(seg);
+ }
+ }
+
+ /// <summary>
+ /// Removes the selected job.
+ /// </summary>
+ private void RemoveJob()
+ {
+ if (SelectedMachine != null && SelectedJob != null)
+ {
+ SelectedJob.Delete();
+ SelectedMachine.Jobs.Remove(SelectedJob);
+ }
+ }
+
+ /// <summary>
+ /// Adds a new job to the selected machine.
+ /// </summary>
+ 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 @@
<Rectangle VerticalAlignment="Bottom" StrokeDashArray="7" StrokeThickness="1" Stroke="Silver" Margin="0 8 0 0"></Rectangle>
</StackPanel>
+ <StackPanel Orientation="Horizontal" DockPanel.Dock="Bottom" HorizontalAlignment="Right">
+ <Button Command="{Binding RemoveJobCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Remove Segment">
+ <materialDesign:PackIcon Kind="Minus" Width="24" Height="24"></materialDesign:PackIcon>
+ </Button>
+ <Button Command="{Binding AddJobCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Add Segment">
+ <materialDesign:PackIcon Kind="Plus" Width="24" Height="24"></materialDesign:PackIcon>
+ </Button>
+ </StackPanel>
<ListBox ItemsSource="{Binding SelectedMachine.Jobs}" SelectedItem="{Binding SelectedJob}" Margin="0 10 0 0">
<ListBox.ItemTemplate>
<DataTemplate>
@@ -425,6 +433,10 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="1*"/>
+ </Grid.RowDefinitions>
<StackPanel>
<Grid>
<StackPanel Orientation="Horizontal" Margin="0 5 0 0">
@@ -494,7 +506,81 @@
<Border BorderThickness="1" BorderBrush="Silver" CornerRadius="5" Margin="0 0 5 5">
<TextBox Style="{x:Null}" BorderThickness="0" Margin="5" Height="80" Text="{Binding SelectedJob.Description}" VerticalAlignment="Stretch" materialDesign:HintAssist.Hint="Enter description" AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"></TextBox>
</Border>
+
+
</StackPanel>
+
+ <Grid Grid.Row="1" Margin="0 10 0 0">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="200"/>
+ <ColumnDefinition Width="1*"/>
+ </Grid.ColumnDefinitions>
+
+ <DockPanel>
+ <StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
+ <Image Source="../Images/segment.png" Width="42"></Image>
+ <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="DimGray" FontSize="16" FontWeight="SemiBold">SEGMENTS</TextBlock>
+ </StackPanel>
+
+ <StackPanel Orientation="Horizontal" DockPanel.Dock="Bottom" HorizontalAlignment="Right">
+ <Button Command="{Binding RemoveSegmentCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Remove Segment">
+ <materialDesign:PackIcon Kind="Minus" Width="24" Height="24"></materialDesign:PackIcon>
+ </Button>
+ <Button Command="{Binding AddSegmentCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Add Segment">
+ <materialDesign:PackIcon Kind="Plus" Width="24" Height="24"></materialDesign:PackIcon>
+ </Button>
+ </StackPanel>
+
+ <ListBox ItemsSource="{Binding SelectedJob.Segments}" SelectedItem="{Binding SelectedSegment}">
+ <ListBox.ItemTemplate>
+ <DataTemplate>
+ <StackPanel Orientation="Horizontal" Margin="0 5 0 0">
+ <Image Source="../Images/segment-single.png" Width="24"></Image>
+ <TextBlock Margin="5 0 0 0" Text="{Binding Name}" FontSize="12" FontWeight="SemiBold" VerticalAlignment="Center"></TextBlock>
+ </StackPanel>
+ </DataTemplate>
+ </ListBox.ItemTemplate>
+ </ListBox>
+ </DockPanel>
+
+ <Grid Grid.Column="1" Margin="10 5 0 0">
+ <DockPanel>
+ <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
+ <Image Source="../Images/segment-single.png" Width="24"></Image>
+ <TextBlock Margin="5 0 0 0" Text="{Binding SelectedSegment.Name,FallbackValue=''}" FontSize="16" FontWeight="SemiBold" VerticalAlignment="Center"></TextBlock>
+ </StackPanel>
+
+ <Grid Margin="0 10 0 0">
+ <DockPanel>
+ <StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
+ <Border Style="{StaticResource JobFieldBorder}">
+ <StackPanel Margin="5" Width="140">
+ <StackPanel Orientation="Horizontal">
+ <Image Source="../Images/name.png" Width="32"></Image>
+ <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Name</TextBlock>
+ </StackPanel>
+ <TextBox Margin="0 3 0 0" Text="{Binding SelectedSegment.Name,UpdateSourceTrigger=PropertyChanged}"></TextBox>
+ </StackPanel>
+ </Border>
+ <Border Style="{StaticResource JobFieldBorder}">
+ <StackPanel Margin="5" Width="140">
+ <StackPanel Orientation="Horizontal">
+ <Image Source="../Images/ruler.png" Width="32"></Image>
+ <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Length</TextBlock>
+ </StackPanel>
+ <mahapps:NumericUpDown IsEnabled="{Binding SelectedJob.EnableInterSegment}" Margin="0 2 0 0" Minimum="1" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedSegment.Length,Mode=TwoWay}"></mahapps:NumericUpDown>
+ </StackPanel>
+ </Border>
+ </StackPanel>
+
+ <Grid>
+
+ </Grid>
+ </DockPanel>
+ </Grid>
+ </DockPanel>
+ </Grid>
+ </Grid>
</Grid>
<Grid Grid.Column="1" Margin="10 0 0 0" Width="340">
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
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/formula.png
Binary files 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 @@
<ItemGroup>
<Resource Include="Images\machine-designer-module.jpg" />
</ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\formula.png" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> \ 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;
}
+ /// <summary>
+ /// Drops the ids formula.
+ /// </summary>
+ /// <param name="idsPackFormula">The ids pack formula.</param>
+ /// <param name="idsPack">The ids pack.</param>
+ /// <exception cref="NotImplementedException"></exception>
+ 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 @@
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
+
+ <TextBlock Text="{Binding IdsPackFormula.Name}" TextWrapping="Wrap" Height="30" IsHitTestVisible="False" Width="50" Margin="-20 15 0 0" FontSize="7" TextAlignment="Center" RenderTransformOrigin="0.5,0.5" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center">
+ <TextBlock.LayoutTransform>
+ <RotateTransform Angle="90" />
+ </TextBlock.LayoutTransform>
+ </TextBlock>
</Grid>
</UniformGrid>
@@ -417,6 +423,10 @@
<Image RenderOptions.BitmapScalingMode="Fant" Source="../Images/liquid.png" Width="12" VerticalAlignment="Center"></Image>
<TextBlock Margin="5 0 0 0" VerticalAlignment="Center"><Run FontWeight="Bold">Liquid:</Run> <Run FontStyle="Italic" Text="{Binding LiquidType.Name}"></Run></TextBlock>
</StackPanel>
+ <StackPanel Orientation="Horizontal" Margin="0 3 0 3">
+ <Image RenderOptions.BitmapScalingMode="Fant" Source="../Images/formula.png" Width="12" VerticalAlignment="Center"></Image>
+ <TextBlock Margin="5 0 0 0" VerticalAlignment="Center"><Run FontWeight="Bold">Formula:</Run> <Run FontStyle="Italic" Text="{Binding IdsPackFormula.Name}"></Run></TextBlock>
+ </StackPanel>
</StackPanel>
</StackPanel>
</DataTemplate>
@@ -618,6 +628,32 @@
</ListBox>
</Expander>
<Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" />
+ <Expander HorizontalAlignment="Stretch" Header="Formulas">
+ <ListBox ItemsSource="{Binding Adapter.IdsPackFormulasViewSource}" HorizontalContentAlignment="Stretch">
+ <ListBox.ItemContainerStyle>
+ <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
+ <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
+ <Setter Property="VerticalContentAlignment" Value="Stretch"></Setter>
+ <Setter Property="Padding" Value="1"></Setter>
+ </Style>
+ </ListBox.ItemContainerStyle>
+ <ListBox.ItemTemplate>
+ <DataTemplate>
+ <Grid Background="Transparent" IsHitTestVisible="True" dragAndDrop:DragAndDropService.DraggableBorderBrush="{StaticResource AccentColorBrush}" dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}">
+ <StackPanel Orientation="Horizontal" Margin="2 8">
+ <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/formula.png" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"></Image>
+ <StackPanel Margin="5 0 0 0" IsHitTestVisible="False">
+ <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run Text="{Binding Name}"></Run></TextBlock>
+ </StackPanel>
+ </StackPanel>
+
+ <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle>
+ </Grid>
+ </DataTemplate>
+ </ListBox.ItemTemplate>
+ </ListBox>
+ </Expander>
+ <Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" />
<Expander HorizontalAlignment="Stretch" Header="Touch Panels">
<ListBox ItemsSource="{Binding Adapter.ApplicationDisplayPanelVersionsViewSource}" HorizontalContentAlignment="Stretch">
<ListBox.ItemContainerStyle>
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<ActionType>
{
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<Address>
{
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<ApplicationDisplayPanelVersion>
{
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<ApplicationFirmwareVersion>
{
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<ApplicationOsVersion>
{
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<ApplicationVersion>
{
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<BrushStop>
{
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<CartridgeType>
{
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<Cat>
{
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<Cct>
{
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<ColorSpace>
{
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<Configuration>
{
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<Contact>
{
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<DispenserType>
{
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<EmbeddedFirmwareVersion>
{
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<EmbeddedSoftwareVersion>
{
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<EventType>
{
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<EventTypesAction>
{
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<FiberShape>
{
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<FiberSynth>
{
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<HardwareVersion>
{
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<IdsPack>
{
private String _configurationguid;
@@ -152,6 +152,26 @@ namespace Tango.DAL.Observables
}
+ private String _idspackformulaguid;
+ /// <summary>
+ /// Gets or sets the idspack ids pack formula guid.
+ /// </summary>
+ [Column("IDS_PACK_FORMULA_GUID")]
+ [ForeignKey("IdsPackFormula")]
+ public String IdsPackFormulaGuid
+ {
+ get
+ {
+ return _idspackformulaguid;
+ }
+
+ set
+ {
+ _idspackformulaguid = value; RaisePropertyChanged(nameof(IdsPackFormulaGuid));
+ }
+
+ }
+
private CartridgeType _cartridgetype;
/// <summary>
/// Gets or sets the idspack cartridge types.
@@ -209,6 +229,25 @@ namespace Tango.DAL.Observables
}
+ private IdsPackFormula _idspackformula;
+ /// <summary>
+ /// Gets or sets the idspack ids pack formulas.
+ /// </summary>
+
+ public virtual IdsPackFormula IdsPackFormula
+ {
+ get
+ {
+ return _idspackformula;
+ }
+
+ set
+ {
+ _idspackformula = value; RaisePropertyChanged(nameof(IdsPackFormula));
+ }
+
+ }
+
private LiquidType _liquidtype;
/// <summary>
/// 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<IdsPackFormula>
+ {
+
+ private Int32 _code;
+ /// <summary>
+ /// Gets or sets the idspackformula code.
+ /// </summary>
+ [Column("CODE")]
+
+ public Int32 Code
+ {
+ get
+ {
+ return _code;
+ }
+
+ set
+ {
+ _code = value; RaisePropertyChanged(nameof(Code));
+ }
+
+ }
+
+ private String _name;
+ /// <summary>
+ /// Gets or sets the idspackformula name.
+ /// </summary>
+ [Column("NAME")]
+
+ public String Name
+ {
+ get
+ {
+ return _name;
+ }
+
+ set
+ {
+ _name = value; RaisePropertyChanged(nameof(Name));
+ }
+
+ }
+
+ private String _description;
+ /// <summary>
+ /// Gets or sets the idspackformula description.
+ /// </summary>
+ [Column("DESCRIPTION")]
+
+ public String Description
+ {
+ get
+ {
+ return _description;
+ }
+
+ set
+ {
+ _description = value; RaisePropertyChanged(nameof(Description));
+ }
+
+ }
+
+ private Boolean _autocalculated;
+ /// <summary>
+ /// Gets or sets the idspackformula auto calculated.
+ /// </summary>
+ [Column("AUTO_CALCULATED")]
+
+ public Boolean AutoCalculated
+ {
+ get
+ {
+ return _autocalculated;
+ }
+
+ set
+ {
+ _autocalculated = value; RaisePropertyChanged(nameof(AutoCalculated));
+ }
+
+ }
+
+ private ObservableCollection<IdsPack> _idspacks;
+ /// <summary>
+ /// Gets or sets the idspackformula ids packs.
+ /// </summary>
+
+ public virtual ObservableCollection<IdsPack> IdsPacks
+ {
+ get
+ {
+ return _idspacks;
+ }
+
+ set
+ {
+ _idspacks = value; RaisePropertyChanged(nameof(IdsPacks));
+ }
+
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="IdsPackFormula" /> class.
+ /// </summary>
+ public IdsPackFormula() : base()
+ {
+
+ IdsPacks = new ObservableCollection<IdsPack>();
+
+ }
+ }
+}
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<Job>
{
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<JobRun>
{
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<LinearMassDensityUnit>
{
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<LiquidType>
{
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<LiquidTypesRml>
{
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<Machine>
{
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<MachineVersion>
{
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<MachinesConfiguration>
{
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<MachinesEvent>
{
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<MediaColor>
{
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<MediaCondition>
{
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<MediaMaterial>
{
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<MediaPurpos>
{
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<MidTankType>
{
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<Organization>
{
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<Permission>
{
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<ProcessParametersTable>
{
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<ProcessParametersTablesGroup>
{
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<Rml>
{
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<Role>
{
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<RolesPermission>
{
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<Segment>
{
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<Sensor>
{
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<SyncConfiguration>
{
/// <summary>
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<User>
{
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<UsersRole>
{
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<WindingMethod>
{
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)
/// </summary>
[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
+ {
+
+ /// <summary>
+ /// (Standard Color IDS Pack Formula)
+ /// </summary>
+ [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
@@ -45,6 +45,16 @@ namespace Tango.DAL.Observables
void Save();
/// <summary>
+ /// Attaches this observable to the proper DbSet.
+ /// </summary>
+ void Attach();
+
+ /// <summary>
+ /// Detaches this observable from the proper DbSet.
+ /// </summary>
+ void Detach();
+
+ /// <summary>
/// Saves the changes on this entity to database asynchronously.
/// </summary>
/// <returns></returns>
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
/// <typeparam name="T"></typeparam>
/// <seealso cref="Tango.Core.ExtendedObject" />
/// <seealso cref="Tango.DAL.Observables.IObservableEntity" />
- public abstract class ObservableEntity : ExtendedObject, IObservableEntity
+ public abstract class ObservableEntity<T> : ExtendedObject, IObservableEntity where T : class, IObservableEntity
{
private Regex regExDAL;
@@ -93,6 +94,22 @@ namespace Tango.DAL.Observables
}
/// <summary>
+ /// Attaches this entity to the proper DbSet.
+ /// </summary>
+ public virtual void Attach()
+ {
+ GetDbSet().Add(this as T);
+ }
+
+ /// <summary>
+ /// Detaches this observable from the proper DbSet.
+ /// </summary>
+ public virtual void Detach()
+ {
+ GetDbSet().Remove(this as T);
+ }
+
+ /// <summary>
/// Saves the changes on this entity to database asynchronously.
/// </summary>
/// <returns></returns>
@@ -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
/// </summary>
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);
}
/// <summary>
@@ -151,23 +160,30 @@ namespace Tango.DAL.Observables
}
/// <summary>
- /// Converts the specified database conventional name to the observables conventional name.
+ /// Gets the observable database set.
/// </summary>
- /// <param name="dalName">DAL name.</param>
/// <returns></returns>
- public static String DalNameToStandardName(String dalName)
+ public DbSet<T> 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<T>;
+ 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<T>;
+ return set2;
+ }
+ }
- /// <summary>
- /// Converts the specified text to title case.
- /// </summary>
- /// <param name="text">The text.</param>
- /// <returns></returns>
- 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
@@ -216,6 +216,14 @@ namespace Tango.DAL.Observables
}
/// <summary>
+ /// Gets or sets the IdsPackFormulas.
+ /// </summary>
+ public DbSet<IdsPackFormula> IdsPackFormulas
+ {
+ get; set;
+ }
+
+ /// <summary>
/// Gets or sets the IdsPacks.
/// </summary>
public DbSet<IdsPack> 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<IdsPackFormula> _idspackformulas;
+ /// <summary>
+ /// Gets or sets the IdsPackFormulas.
+ /// </summary>
+ public ObservableCollection<IdsPackFormula> IdsPackFormulas
+ {
+ get
+ {
+ return _idspackformulas;
+ }
+
+ set
+ {
+ _idspackformulas = value; RaisePropertyChanged(nameof(IdsPackFormulas));
+ }
+
+ }
+
+ private ICollectionView _idspackformulasViewSource;
+ /// <summary>
+ /// Gets or sets the IdsPackFormulas View Source.
+ ///</summary>
+ public ICollectionView IdsPackFormulasViewSource
+ {
+ get
+ {
+ return _idspackformulasViewSource;
+ }
+
+ set
+ {
+ _idspackformulasViewSource = value; RaisePropertyChanged(nameof(IdsPackFormulasViewSource));
+ }
+
+ }
+
private ObservableCollection<IdsPack> _idspacks;
/// <summary>
/// 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 @@
<Compile Include="Entities\EventType.cs" />
<Compile Include="Entities\EventTypesAction.cs" />
<Compile Include="Entities\FiberSynth.cs" />
+ <Compile Include="Entities\IdsPackFormula.cs" />
<Compile Include="Entities\Job.cs" />
<Compile Include="Entities\JobRun.cs" />
<Compile Include="Entities\LiquidType.cs" />
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 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// 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.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+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<IDS_PACKS>();
+ }
+
+ 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> 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> FIBER_SHAPES { get; set; }
public virtual DbSet<FIBER_SYNTHS> FIBER_SYNTHS { get; set; }
public virtual DbSet<HARDWARE_VERSIONS> HARDWARE_VERSIONS { get; set; }
+ public virtual DbSet<IDS_PACK_FORMULAS> IDS_PACK_FORMULAS { get; set; }
public virtual DbSet<IDS_PACKS> IDS_PACKS { get; set; }
public virtual DbSet<JOB_RUNS> JOB_RUNS { get; set; }
public virtual DbSet<JOB> 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 @@
<Property Name="VERSION" Type="float" Nullable="false" />
<Property Name="NAME" Type="nvarchar" MaxLength="50" Nullable="false" />
</EntityType>
+ <EntityType Name="IDS_PACK_FORMULAS">
+ <Key>
+ <PropertyRef Name="GUID" />
+ </Key>
+ <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
+ <Property Name="GUID" Type="varchar" MaxLength="36" Nullable="false" />
+ <Property Name="LAST_UPDATED" Type="datetime2" Precision="3" Nullable="false" />
+ <Property Name="CODE" Type="int" Nullable="false" />
+ <Property Name="NAME" Type="nvarchar" MaxLength="50" Nullable="false" />
+ <Property Name="DESCRIPTION" Type="nvarchar" MaxLength="100" Nullable="false" />
+ <Property Name="AUTO_CALCULATED" Type="bit" Nullable="false" />
+ </EntityType>
<EntityType Name="IDS_PACKS">
<Key>
<PropertyRef Name="GUID" />
@@ -272,6 +284,7 @@
<Property Name="MID_TANK_TYPE_GUID" Type="varchar" MaxLength="36" Nullable="false" />
<Property Name="NAME" Type="nvarchar" MaxLength="50" Nullable="false" />
<Property Name="PACK_INDEX" Type="int" Nullable="false" />
+ <Property Name="IDS_PACK_FORMULA_GUID" Type="varchar" MaxLength="36" Nullable="false" />
</EntityType>
<EntityType Name="JOB_RUNS">
<Key>
@@ -834,6 +847,18 @@
</Dependent>
</ReferentialConstraint>
</Association>
+ <Association Name="FK_IDS_PACKS_IDS_PACK_FORMULAS">
+ <End Role="IDS_PACK_FORMULAS" Type="Self.IDS_PACK_FORMULAS" Multiplicity="1" />
+ <End Role="IDS_PACKS" Type="Self.IDS_PACKS" Multiplicity="*" />
+ <ReferentialConstraint>
+ <Principal Role="IDS_PACK_FORMULAS">
+ <PropertyRef Name="GUID" />
+ </Principal>
+ <Dependent Role="IDS_PACKS">
+ <PropertyRef Name="IDS_PACK_FORMULA_GUID" />
+ </Dependent>
+ </ReferentialConstraint>
+ </Association>
<Association Name="FK_IDS_PACKS_MID_TANK_TYPES">
<End Role="MID_TANK_TYPES" Type="Self.MID_TANK_TYPES" Multiplicity="1" />
<End Role="IDS_PACKS" Type="Self.IDS_PACKS" Multiplicity="*" />
@@ -1300,6 +1325,7 @@
<EntitySet Name="FIBER_SHAPES" EntityType="Self.FIBER_SHAPES" Schema="dbo" store:Type="Tables" />
<EntitySet Name="FIBER_SYNTHS" EntityType="Self.FIBER_SYNTHS" Schema="dbo" store:Type="Tables" />
<EntitySet Name="HARDWARE_VERSIONS" EntityType="Self.HARDWARE_VERSIONS" Schema="dbo" store:Type="Tables" />
+ <EntitySet Name="IDS_PACK_FORMULAS" EntityType="Self.IDS_PACK_FORMULAS" Schema="dbo" store:Type="Tables" />
<EntitySet Name="IDS_PACKS" EntityType="Self.IDS_PACKS" Schema="dbo" store:Type="Tables" />
<EntitySet Name="JOB_RUNS" EntityType="Self.JOB_RUNS" Schema="dbo" store:Type="Tables" />
<EntitySet Name="JOBS" EntityType="Self.JOBS" Schema="dbo" store:Type="Tables" />
@@ -1400,6 +1426,10 @@
<End Role="DISPENSER_TYPES" EntitySet="DISPENSER_TYPES" />
<End Role="IDS_PACKS" EntitySet="IDS_PACKS" />
</AssociationSet>
+ <AssociationSet Name="FK_IDS_PACKS_IDS_PACK_FORMULAS" Association="Self.FK_IDS_PACKS_IDS_PACK_FORMULAS">
+ <End Role="IDS_PACK_FORMULAS" EntitySet="IDS_PACK_FORMULAS" />
+ <End Role="IDS_PACKS" EntitySet="IDS_PACKS" />
+ </AssociationSet>
<AssociationSet Name="FK_IDS_PACKS_MID_TANK_TYPES" Association="Self.FK_IDS_PACKS_MID_TANK_TYPES">
<End Role="MID_TANK_TYPES" EntitySet="MID_TANK_TYPES" />
<End Role="IDS_PACKS" EntitySet="IDS_PACKS" />
@@ -1567,6 +1597,7 @@
<EntitySet Name="FIBER_SHAPES" EntityType="RemoteModel.FIBER_SHAPES" />
<EntitySet Name="FIBER_SYNTHS" EntityType="RemoteModel.FIBER_SYNTHS" />
<EntitySet Name="HARDWARE_VERSIONS" EntityType="RemoteModel.HARDWARE_VERSIONS" />
+ <EntitySet Name="IDS_PACK_FORMULAS" EntityType="RemoteModel.IDS_PACK_FORMULAS" />
<EntitySet Name="IDS_PACKS" EntityType="RemoteModel.IDS_PACKS" />
<EntitySet Name="JOB_RUNS" EntityType="RemoteModel.JOB_RUNS" />
<EntitySet Name="JOBS" EntityType="RemoteModel.JOB" />
@@ -1703,6 +1734,10 @@
<End Role="FIBER_SYNTHS" EntitySet="FIBER_SYNTHS" />
<End Role="RML" EntitySet="RMLS" />
</AssociationSet>
+ <AssociationSet Name="FK_IDS_PACKS_IDS_PACK_FORMULAS" Association="RemoteModel.FK_IDS_PACKS_IDS_PACK_FORMULAS">
+ <End Role="IDS_PACK_FORMULAS" EntitySet="IDS_PACK_FORMULAS" />
+ <End Role="IDS_PACKS" EntitySet="IDS_PACKS" />
+ </AssociationSet>
<AssociationSet Name="FK_CONFIGURATIONS_DISPENSERS_LIQUIDS" Association="RemoteModel.FK_CONFIGURATIONS_DISPENSERS_LIQUIDS">
<End Role="LIQUID_TYPES" EntitySet="LIQUID_TYPES" />
<End Role="IDS_PACKS" EntitySet="IDS_PACKS" />
@@ -2098,6 +2133,19 @@
<Property Name="NAME" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
<NavigationProperty Name="CONFIGURATIONS" Relationship="RemoteModel.FK_CONFIGURATIONS_HARDWARE_VERSIONS" FromRole="HARDWARE_VERSIONS" ToRole="CONFIGURATION" />
</EntityType>
+ <EntityType Name="IDS_PACK_FORMULAS">
+ <Key>
+ <PropertyRef Name="GUID" />
+ </Key>
+ <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+ <Property Name="GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" />
+ <Property Name="LAST_UPDATED" Type="DateTime" Nullable="false" Precision="3" />
+ <Property Name="CODE" Type="Int32" Nullable="false" />
+ <Property Name="NAME" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
+ <Property Name="DESCRIPTION" Type="String" Nullable="false" MaxLength="100" FixedLength="false" Unicode="true" />
+ <Property Name="AUTO_CALCULATED" Type="Boolean" Nullable="false" />
+ <NavigationProperty Name="IDS_PACKS" Relationship="RemoteModel.FK_IDS_PACKS_IDS_PACK_FORMULAS" FromRole="IDS_PACK_FORMULAS" ToRole="IDS_PACKS" />
+ </EntityType>
<EntityType Name="IDS_PACKS">
<Key>
<PropertyRef Name="GUID" />
@@ -2112,9 +2160,11 @@
<Property Name="MID_TANK_TYPE_GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" />
<Property Name="NAME" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="PACK_INDEX" Type="Int32" Nullable="false" />
+ <Property Name="IDS_PACK_FORMULA_GUID" Type="String" Nullable="false" MaxLength="36" FixedLength="false" Unicode="false" />
<NavigationProperty Name="CARTRIDGE_TYPES" Relationship="RemoteModel.FK_IDS_PACKS_CARTRIDGE_TYPES" FromRole="IDS_PACKS" ToRole="CARTRIDGE_TYPES" />
<NavigationProperty Name="CONFIGURATION" Relationship="RemoteModel.FK_IDS_PACKS_CONFIGURATIONS" FromRole="IDS_PACKS" ToRole="CONFIGURATION" />
<NavigationProperty Name="DISPENSER_TYPES" Relationship="RemoteModel.FK_IDS_PACKS_DISPENSER_TYPES" FromRole="IDS_PACKS" ToRole="DISPENSER_TYPES" />
+ <NavigationProperty Name="IDS_PACK_FORMULAS" Relationship="RemoteModel.FK_IDS_PACKS_IDS_PACK_FORMULAS" FromRole="IDS_PACKS" ToRole="IDS_PACK_FORMULAS" />
<NavigationProperty Name="LIQUID_TYPES" Relationship="RemoteModel.FK_CONFIGURATIONS_DISPENSERS_LIQUIDS" FromRole="IDS_PACKS" ToRole="LIQUID_TYPES" />
<NavigationProperty Name="MID_TANK_TYPES" Relationship="RemoteModel.FK_IDS_PACKS_MID_TANK_TYPES" FromRole="IDS_PACKS" ToRole="MID_TANK_TYPES" />
</EntityType>
@@ -2855,6 +2905,18 @@
</Dependent>
</ReferentialConstraint>
</Association>
+ <Association Name="FK_IDS_PACKS_IDS_PACK_FORMULAS">
+ <End Type="RemoteModel.IDS_PACK_FORMULAS" Role="IDS_PACK_FORMULAS" Multiplicity="1" />
+ <End Type="RemoteModel.IDS_PACKS" Role="IDS_PACKS" Multiplicity="*" />
+ <ReferentialConstraint>
+ <Principal Role="IDS_PACK_FORMULAS">
+ <PropertyRef Name="GUID" />
+ </Principal>
+ <Dependent Role="IDS_PACKS">
+ <PropertyRef Name="IDS_PACK_FORMULA_GUID" />
+ </Dependent>
+ </ReferentialConstraint>
+ </Association>
<Association Name="FK_CONFIGURATIONS_DISPENSERS_LIQUIDS">
<End Type="RemoteModel.LIQUID_TYPES" Role="LIQUID_TYPES" Multiplicity="1" />
<End Type="RemoteModel.IDS_PACKS" Role="IDS_PACKS" Multiplicity="*" />
@@ -3467,9 +3529,23 @@
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
+ <EntitySetMapping Name="IDS_PACK_FORMULAS">
+ <EntityTypeMapping TypeName="RemoteModel.IDS_PACK_FORMULAS">
+ <MappingFragment StoreEntitySet="IDS_PACK_FORMULAS">
+ <ScalarProperty Name="AUTO_CALCULATED" ColumnName="AUTO_CALCULATED" />
+ <ScalarProperty Name="DESCRIPTION" ColumnName="DESCRIPTION" />
+ <ScalarProperty Name="NAME" ColumnName="NAME" />
+ <ScalarProperty Name="CODE" ColumnName="CODE" />
+ <ScalarProperty Name="LAST_UPDATED" ColumnName="LAST_UPDATED" />
+ <ScalarProperty Name="GUID" ColumnName="GUID" />
+ <ScalarProperty Name="ID" ColumnName="ID" />
+ </MappingFragment>
+ </EntityTypeMapping>
+ </EntitySetMapping>
<EntitySetMapping Name="IDS_PACKS">
<EntityTypeMapping TypeName="RemoteModel.IDS_PACKS">
<MappingFragment StoreEntitySet="IDS_PACKS">
+ <ScalarProperty Name="IDS_PACK_FORMULA_GUID" ColumnName="IDS_PACK_FORMULA_GUID" />
<ScalarProperty Name="PACK_INDEX" ColumnName="PACK_INDEX" />
<ScalarProperty Name="NAME" ColumnName="NAME" />
<ScalarProperty Name="MID_TANK_TYPE_GUID" ColumnName="MID_TANK_TYPE_GUID" />
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 @@
<!-- Diagram content (shape and connector positions) -->
<edmx:Diagrams>
<Diagram DiagramId="f9ae01d708754bbd997add25a4bacc79" Name="Diagram1">
- <EntityTypeShape EntityType="RemoteModel.ACTION_TYPES" Width="1.5" PointX="11" PointY="43.25" />
- <EntityTypeShape EntityType="RemoteModel.ADDRESS" Width="1.5" PointX="3.5" PointY="57.5" />
- <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="3.5" PointY="40" />
- <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="3.5" PointY="37" />
- <EntityTypeShape EntityType="RemoteModel.APPLICATION_OS_VERSIONS" Width="1.5" PointX="3.5" PointY="48.75" />
- <EntityTypeShape EntityType="RemoteModel.APPLICATION_VERSIONS" Width="1.5" PointX="3.5" PointY="54.625" />
- <EntityTypeShape EntityType="RemoteModel.BRUSH_STOPS" Width="1.5" PointX="14.75" PointY="11.875" />
- <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="5.75" PointY="41" />
- <EntityTypeShape EntityType="RemoteModel.CAT" Width="1.5" PointX="5.25" PointY="15.125" />
- <EntityTypeShape EntityType="RemoteModel.CCT" Width="1.5" PointX="5.25" PointY="29.25" />
- <EntityTypeShape EntityType="RemoteModel.COLOR_SPACES" Width="1.5" PointX="12.5" PointY="17" />
- <EntityTypeShape EntityType="RemoteModel.CONFIGURATION" Width="1.5" PointX="5.75" PointY="44.125" />
- <EntityTypeShape EntityType="RemoteModel.CONTACT" Width="1.5" PointX="3.5" PointY="61.75" />
- <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="5.75" PointY="25.5" />
- <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="3.5" PointY="45.75" />
- <EntityTypeShape EntityType="RemoteModel.EMBEDDED_SOFTWARE_VERSIONS" Width="1.5" PointX="3.5" PointY="51.625" />
- <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES" Width="1.5" PointX="8" PointY="52.125" />
- <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES_ACTIONS" Width="1.5" PointX="13.25" PointY="52.25" />
- <EntityTypeShape EntityType="RemoteModel.FIBER_SHAPES" Width="1.5" PointX="0.75" PointY="13.375" />
- <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHS" Width="1.5" PointX="0.75" PointY="22.75" />
- <EntityTypeShape EntityType="RemoteModel.HARDWARE_VERSIONS" Width="1.5" PointX="3.5" PointY="42.875" />
- <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="8" PointY="32.875" />
- <EntityTypeShape EntityType="RemoteModel.JOB_RUNS" Width="1.5" PointX="12.5" PointY="9.625" />
- <EntityTypeShape EntityType="RemoteModel.JOB" Width="1.5" PointX="10.25" PointY="10.375" />
- <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="0.75" PointY="8.875" />
- <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES" Width="1.5" PointX="3" PointY="20" />
- <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES_RMLS" Width="1.5" PointX="8.25" PointY="16.25" />
- <EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS" Width="1.5" PointX="5.75" PointY="33.75" />
- <EntityTypeShape EntityType="RemoteModel.MACHINE" Width="1.5" PointX="8" PointY="47.5" />
- <EntityTypeShape EntityType="RemoteModel.MACHINES_CONFIGURATIONS" Width="1.5" PointX="10.25" PointY="46.625" />
- <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="10.25" PointY="49.875" />
- <EntityTypeShape EntityType="RemoteModel.MEDIA_COLORS" Width="1.5" PointX="0.75" PointY="6.25" />
- <EntityTypeShape EntityType="RemoteModel.MEDIA_CONDITIONS" Width="1.5" PointX="0.75" PointY="25.625" />
- <EntityTypeShape EntityType="RemoteModel.MEDIA_MATERIALS" Width="1.5" PointX="0.75" PointY="19.75" />
- <EntityTypeShape EntityType="RemoteModel.MEDIA_PURPOSES" Width="1.5" PointX="0.75" PointY="16.875" />
- <EntityTypeShape EntityType="RemoteModel.MID_TANK_TYPES" Width="1.5" PointX="5.75" PointY="37.875" />
- <EntityTypeShape EntityType="RemoteModel.ORGANIZATION" Width="1.5" PointX="5.75" PointY="59.875" />
- <EntityTypeShape EntityType="RemoteModel.PERMISSION" Width="1.5" PointX="8" PointY="64.125" />
- <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES" Width="1.5" PointX="7.5" PointY="9.875" />
- <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES_GROUPS" Width="1.5" PointX="5.25" PointY="11.125" />
- <EntityTypeShape EntityType="RemoteModel.RML" Width="1.5" PointX="3" PointY="10.625" />
- <EntityTypeShape EntityType="RemoteModel.ROLE" Width="1.5" PointX="8" PointY="56" />
- <EntityTypeShape EntityType="RemoteModel.ROLES_PERMISSIONS" Width="1.5" PointX="10.25" PointY="56.125" />
- <EntityTypeShape EntityType="RemoteModel.SEGMENT" Width="1.5" PointX="12.5" PointY="12.875" />
- <EntityTypeShape EntityType="RemoteModel.SENSOR" Width="1.5" PointX="0.75" PointY="0.75" />
- <EntityTypeShape EntityType="RemoteModel.SYNC_CONFIGURATIONS" Width="1.5" PointX="2.75" PointY="0.75" />
- <EntityTypeShape EntityType="RemoteModel.USER" Width="1.5" PointX="8" PointY="59.375" />
- <EntityTypeShape EntityType="RemoteModel.USERS_ROLES" Width="1.5" PointX="10.25" PointY="60" />
- <EntityTypeShape EntityType="RemoteModel.WINDING_METHODS" Width="1.5" PointX="8" PointY="19.625" />
+ <EntityTypeShape EntityType="RemoteModel.ACTION_TYPES" Width="1.5" PointX="3" PointY="87.375" />
+ <EntityTypeShape EntityType="RemoteModel.ADDRESS" Width="1.5" PointX="1.5" PointY="75.75" />
+ <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="1.5" PointY="53" />
+ <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="37.125" />
+ <EntityTypeShape EntityType="RemoteModel.APPLICATION_OS_VERSIONS" Width="1.5" PointX="1.5" PointY="50" />
+ <EntityTypeShape EntityType="RemoteModel.APPLICATION_VERSIONS" Width="1.5" PointX="1.5" PointY="58.875" />
+ <EntityTypeShape EntityType="RemoteModel.BRUSH_STOPS" Width="1.5" PointX="9.75" PointY="9.625" />
+ <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="3" PointY="0.75" />
+ <EntityTypeShape EntityType="RemoteModel.CAT" Width="1.5" PointX="5.25" PointY="14.875" />
+ <EntityTypeShape EntityType="RemoteModel.CCT" Width="1.5" PointX="5.25" PointY="31" />
+ <EntityTypeShape EntityType="RemoteModel.COLOR_SPACES" Width="1.5" PointX="7.5" PointY="4.75" />
+ <EntityTypeShape EntityType="RemoteModel.CONFIGURATION" Width="1.5" PointX="0.75" PointY="41.375" />
+ <EntityTypeShape EntityType="RemoteModel.CONTACT" Width="1.5" PointX="1.5" PointY="71.625" />
+ <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="3" PointY="64.625" />
+ <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="55.875" />
+ <EntityTypeShape EntityType="RemoteModel.EMBEDDED_SOFTWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="34.25" />
+ <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES" Width="1.5" PointX="3" PointY="80.25" />
+ <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES_ACTIONS" Width="1.5" PointX="5.25" PointY="80.375" />
+ <EntityTypeShape EntityType="RemoteModel.FIBER_SHAPES" Width="1.5" PointX="0.75" PointY="15.125" />
+ <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHS" Width="1.5" PointX="0.75" PointY="18.75" />
+ <EntityTypeShape EntityType="RemoteModel.HARDWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="61.75" />
+ <EntityTypeShape EntityType="RemoteModel.IDS_PACK_FORMULAS" Width="1.5" PointX="3" PointY="4.5" />
+ <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="5.25" PointY="21.125" />
+ <EntityTypeShape EntityType="RemoteModel.JOB_RUNS" Width="1.5" PointX="7.5" PointY="8.375" />
+ <EntityTypeShape EntityType="RemoteModel.JOB" Width="1.5" PointX="5.25" PointY="9.125" />
+ <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="0.75" PointY="10.875" />
+ <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES" Width="1.5" PointX="3" PointY="7.75" />
+ <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES_RMLS" Width="1.5" PointX="8.25" PointY="15" />
+ <EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS" Width="1.5" PointX="0.75" PointY="30.875" />
+ <EntityTypeShape EntityType="RemoteModel.MACHINE" Width="1.5" PointX="3" PointY="44.625" />
+ <EntityTypeShape EntityType="RemoteModel.MACHINES_CONFIGURATIONS" Width="1.5" PointX="5.25" PointY="43.75" />
+ <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="5.25" PointY="47" />
+ <EntityTypeShape EntityType="RemoteModel.MEDIA_COLORS" Width="1.5" PointX="0.75" PointY="21.75" />
+ <EntityTypeShape EntityType="RemoteModel.MEDIA_CONDITIONS" Width="1.5" PointX="0.75" PointY="24.5" />
+ <EntityTypeShape EntityType="RemoteModel.MEDIA_MATERIALS" Width="1.5" PointX="0.75" PointY="27.375" />
+ <EntityTypeShape EntityType="RemoteModel.MEDIA_PURPOSES" Width="1.5" PointX="0.75" PointY="8" />
+ <EntityTypeShape EntityType="RemoteModel.MID_TANK_TYPES" Width="1.5" PointX="3" PointY="21.375" />
+ <EntityTypeShape EntityType="RemoteModel.ORGANIZATION" Width="1.5" PointX="0.75" PointY="67" />
+ <EntityTypeShape EntityType="RemoteModel.PERMISSION" Width="1.5" PointX="3.75" PointY="84" />
+ <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES" Width="1.5" PointX="7.5" PointY="25" />
+ <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES_GROUPS" Width="1.5" PointX="5.25" PointY="26.25" />
+ <EntityTypeShape EntityType="RemoteModel.RML" Width="1.5" PointX="3" PointY="12.375" />
+ <EntityTypeShape EntityType="RemoteModel.ROLE" Width="1.5" PointX="3.75" PointY="75.875" />
+ <EntityTypeShape EntityType="RemoteModel.ROLES_PERMISSIONS" Width="1.5" PointX="6" PointY="76" />
+ <EntityTypeShape EntityType="RemoteModel.SEGMENT" Width="1.5" PointX="7.5" PointY="11.625" />
+ <EntityTypeShape EntityType="RemoteModel.SENSOR" Width="1.5" PointX="9.75" PointY="2.5" />
+ <EntityTypeShape EntityType="RemoteModel.SYNC_CONFIGURATIONS" Width="1.5" PointX="11.75" PointY="2.5" />
+ <EntityTypeShape EntityType="RemoteModel.USER" Width="1.5" PointX="3.75" PointY="71.25" />
+ <EntityTypeShape EntityType="RemoteModel.USERS_ROLES" Width="1.5" PointX="6" PointY="71.875" />
+ <EntityTypeShape EntityType="RemoteModel.WINDING_METHODS" Width="1.5" PointX="3" PointY="41" />
<AssociationConnector Association="RemoteModel.FK_EVENTS_ACTIONS_ACTIONS" />
<AssociationConnector Association="RemoteModel.FK_ORGANIZATIONS_ADDRESSES" />
<AssociationConnector Association="RemoteModel.FK_USERS_ADDRESSES" />
@@ -81,6 +82,7 @@
<AssociationConnector Association="RemoteModel.FK_MACHINES_EVENTS_EVENTS" />
<AssociationConnector Association="RemoteModel.FK_RML_FIBER_SHAPES" />
<AssociationConnector Association="RemoteModel.FK_RML_FIBER_SYNTHESIS" />
+ <AssociationConnector Association="RemoteModel.FK_IDS_PACKS_IDS_PACK_FORMULAS" />
<AssociationConnector Association="RemoteModel.FK_CONFIGURATIONS_DISPENSERS_LIQUIDS" />
<AssociationConnector Association="RemoteModel.FK_IDS_PACKS_MID_TANK_TYPES" />
<AssociationConnector Association="RemoteModel.FK_JOB_RUNS_JOBS" />
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 @@
<Compile Include="DB\IDS_PACKS.cs">
<DependentUpon>RemoteADO.tt</DependentUpon>
</Compile>
+ <Compile Include="DB\IDS_PACK_FORMULAS.cs">
+ <DependentUpon>RemoteADO.tt</DependentUpon>
+ </Compile>
<Compile Include="DB\JOB.cs">
<DependentUpon>RemoteADO.tt</DependentUpon>
</Compile>
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<String> 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<String> 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);
}
+
+ /// <summary>
+ /// Converts the specified database conventional name to the observables conventional name.
+ /// </summary>
+ /// <param name="dalName">DAL name.</param>
+ /// <returns></returns>
+ private static String DalNameToStandardName(String dalName)
+ {
+ return String.Join("", dalName.Split('_').Select(x => ToTitleCase(x)));
+ }
+
+ /// <summary>
+ /// Converts the specified text to title case.
+ /// </summary>
+ /// <param name="text">The text.</param>
+ /// <returns></returns>
+ 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 @@
<Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project>
<Name>Tango.Core</Name>
</ProjectReference>
- <ProjectReference Include="..\..\Tango.DAL.Observables\Tango.DAL.Observables.csproj">
- <Project>{0ecd6da8-7aa6-48d9-8b65-279d176ad9af}</Project>
- <Name>Tango.DAL.Observables</Name>
- </ProjectReference>
<ProjectReference Include="..\..\Tango.DAL.Remote\Tango.DAL.Remote.csproj">
<Project>{38197109-8610-4d3f-92b9-16d48df94d7c}</Project>
<Name>Tango.DAL.Remote</Name>