aboutsummaryrefslogtreecommitdiffstats
path: root/Software
diff options
context:
space:
mode:
authorRoy <Roy.mail.net@gmail.com>2023-04-26 20:28:29 +0300
committerRoy <Roy.mail.net@gmail.com>2023-04-26 20:28:29 +0300
commit75768cc3f278db5683db93a65f45b25f3cc80dbb (patch)
treecc2a29c3b5612beae180faf15adc1de729345d22 /Software
parent5ac600493a16d7f8aa37260b5ccacbfa62b13d4d (diff)
downloadTango-75768cc3f278db5683db93a65f45b25f3cc80dbb.tar.gz
Tango-75768cc3f278db5683db93a65f45b25f3cc80dbb.zip
Machine Designer Creates With Machine Version !
Diffstat (limited to 'Software')
-rw-r--r--Software/DB/Tango.mdfbin75497472 -> 75497472 bytes
-rw-r--r--Software/DB/Tango_log.ldfbin22675456 -> 22675456 bytes
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MachineCreationDialogVM.cs28
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs5
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineCreationDialog.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml2
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs10
-rw-r--r--Software/Visual_Studio/Tango.BL/Tango.BL.csproj2
8 files changed, 40 insertions, 9 deletions
diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf
index ea4f30a8f..7dd4615d5 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 700663293..2799c5cba 100644
--- a/Software/DB/Tango_log.ldf
+++ b/Software/DB/Tango_log.ldf
Binary files differ
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MachineCreationDialogVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MachineCreationDialogVM.cs
index c7c7267a4..9d203b76d 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MachineCreationDialogVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MachineCreationDialogVM.cs
@@ -15,9 +15,24 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
public List<HardwareVersion> HardwareVersions { get; set; }
- public HardwareVersion SelectedHardwareVersion { get; set; }
+ public List<HardwareVersion> HardwareVersionsFiltered
+ {
+ get { return HardwareVersions.Where(x => x.MachineType == (int)MachineType).ToList(); }
+ }
- public MachinePrototype SelectedPrototype { get; set; }
+ private HardwareVersion _selectedHardwareVersion;
+ public HardwareVersion SelectedHardwareVersion
+ {
+ get { return _selectedHardwareVersion; }
+ set { _selectedHardwareVersion = value; RaisePropertyChangedAuto(); }
+ }
+
+ private MachinePrototype _selectedProtoType;
+ public MachinePrototype SelectedPrototype
+ {
+ get { return _selectedProtoType; }
+ set { _selectedProtoType = value; MachineType = (MachineTypes)value.MachineType; }
+ }
private bool _isNewMachine;
public bool IsNewMachine
@@ -33,7 +48,12 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
set { _serialNumber = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
}
- public MachineTypes MachineType { get; set; }
+ private MachineTypes _machineType;
+ public MachineTypes MachineType
+ {
+ get { return _machineType; }
+ set { _machineType = value; RaisePropertyChanged(nameof(HardwareVersionsFiltered)); SelectedHardwareVersion = HardwareVersionsFiltered.FirstOrDefault(); }
+ }
private String _name;
public String Name
@@ -44,7 +64,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
protected override bool CanOK()
{
- return base.CanOK() && !String.IsNullOrWhiteSpace(SerialNumber) && !String.IsNullOrWhiteSpace(Name);
+ return base.CanOK() && !String.IsNullOrWhiteSpace(SerialNumber) && !String.IsNullOrWhiteSpace(Name) && SelectedHardwareVersion != null;
}
}
}
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 855f063fc..cad54c848 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
@@ -541,6 +541,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
ActiveMachine.SerialNumber = machineCreationDialogVM.SerialNumber;
ActiveMachine.Name = machineCreationDialogVM.Name;
ActiveMachine.Type = machineCreationDialogVM.MachineType;
+ ActiveMachine.MachineVersion = ActiveMachineAdapter.MachineVersions.First(x => x.MachineType == machineCreationDialogVM.MachineType);
ActiveMachineAdapter.Context.Machines.Add(ActiveMachine);
}
else
@@ -549,7 +550,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
{
initHwConfig = false;
ActiveMachine = machineCreationDialogVM.SelectedPrototype.CreateMachine(machineCreationDialogVM.SerialNumber, machineCreationDialogVM.Name);
- ActiveMachine.MachineVersion = ActiveMachineAdapter.MachineVersions.FirstOrDefault(x => x.Guid == ActiveMachine.MachineVersionGuid);
+ ActiveMachine.MachineVersion = ActiveMachineAdapter.MachineVersions.First(x => x.MachineType == machineCreationDialogVM.MachineType);
if (machineCreationDialogVM.SelectedHardwareVersion != null)
{
@@ -862,7 +863,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels
vm.IsNewMachine = true;
vm.Prototypes = prototypes.ToList();
vm.HardwareVersions = hardwareVersions.OrderByDescending(x => x.Version).ToList();
- vm.SelectedHardwareVersion = vm.HardwareVersions.FirstOrDefault();
+ vm.SelectedHardwareVersion = vm.HardwareVersions.Where(x => x.ForMachineType == MachineTypes.TS1800).FirstOrDefault();
_notification.ShowModalDialog<MachineCreationDialogVM, Views.MachineCreationDialog>(vm, (x) =>
{
using (ObservablesContext db = ObservablesContext.CreateDefault())
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineCreationDialog.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineCreationDialog.xaml
index b1a393875..8a4a9161b 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineCreationDialog.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineCreationDialog.xaml
@@ -73,7 +73,7 @@
<StackPanel Margin="0 20 0 0" Visibility="{Binding IsNewMachine,Converter={StaticResource BooleanToVisibilityConverter}}">
<TextBlock FontSize="10">Hardware Version</TextBlock>
- <ComboBox Margin="0 2 0 0" ItemsSource="{Binding HardwareVersions}" SelectedItem="{Binding SelectedHardwareVersion}" DisplayMemberPath="FullName"></ComboBox>
+ <ComboBox Margin="0 2 0 0" ItemsSource="{Binding HardwareVersionsFiltered}" SelectedItem="{Binding SelectedHardwareVersion}" DisplayMemberPath="FullName"></ComboBox>
</StackPanel>
</StackPanel>
</Grid>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml
index 4ba79d3f5..852e60d0f 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml
@@ -54,7 +54,7 @@
<ComboBox ItemsSource="{Binding Source={x:Type enumerations:HeadTypes},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValue="{Binding ActiveMachine.MachineHeadType}" SelectedValuePath="Value" DisplayMemberPath="DisplayName" Style="{StaticResource TransparentComboBoxStyle}"></ComboBox>
<TextBlock FontWeight="SemiBold">Machine Version</TextBlock>
- <ComboBox Background="Transparent" ItemsSource="{Binding ActiveMachineAdapter.MachineVersions}" SelectedItem="{Binding ActiveMachine.MachineVersion}" DisplayMemberPath="Name" Style="{StaticResource TransparentComboBoxStyle}" ></ComboBox>
+ <ComboBox IsEnabled="False" Background="Transparent" ItemsSource="{Binding ActiveMachineAdapter.MachineVersions}" SelectedItem="{Binding ActiveMachine.MachineVersion}" DisplayMemberPath="Name" Style="{StaticResource TransparentComboBoxStyle}" ></ComboBox>
<TextBlock FontWeight="SemiBold">Version Tag</TextBlock>
<ComboBox Background="Transparent" ItemsSource="{Binding Tags}" SelectedItem="{Binding ActiveMachine.VersionTag}" Style="{StaticResource TransparentComboBoxStyle}" ></ComboBox>
diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs b/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs
index 5832e8a74..694ee1f37 100644
--- a/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs
+++ b/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs
@@ -1,10 +1,13 @@
+using Newtonsoft.Json;
using System;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Builders;
+using Tango.BL.Enumerations;
using Tango.BL.Serialization;
namespace Tango.BL.Entities
@@ -18,5 +21,12 @@ namespace Tango.BL.Entities
{
}
+
+ [NotMapped]
+ [JsonIgnore]
+ public MachineTypes MachineType
+ {
+ get { return Version == 1 ? MachineTypes.TS1800 : MachineTypes.Eureka; }
+ }
}
}
diff --git a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj
index 659565224..83e4bf3ea 100644
--- a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj
+++ b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj
@@ -833,7 +833,7 @@
</Target>
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
+ <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file