aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-08-02 10:24:54 +0300
committerShlomo Hecht <shlomo@twine-s.com>2018-08-02 10:24:54 +0300
commit66aa9beeec79e5f828fc13ce7a5e41c15227ec9a (patch)
treea74f7e1b4da57063046177139a5e2db188b13f48 /Software/Visual_Studio/MachineStudio/Modules
parentad93ce8b0f13540aafe55bc3ba9d7d72aa1fc7e2 (diff)
parent9e979a9b18727fdc9f128da5a7d2347dff2d0705 (diff)
downloadTango-66aa9beeec79e5f828fc13ce7a5e41c15227ec9a.tar.gz
Tango-66aa9beeec79e5f828fc13ce7a5e41c15227ec9a.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Properties/AssemblyInfo.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs22
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Properties/AssemblyInfo.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs27
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml26
5 files changed, 61 insertions, 18 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Properties/AssemblyInfo.cs
index 17c753cc1..205323af0 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Properties/AssemblyInfo.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Properties/AssemblyInfo.cs
@@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
using System.Windows;
[assembly: AssemblyTitle("Tango - Machine Studio Color Lab Module")]
-[assembly: AssemblyVersion("2.0.6.1407")]
+[assembly: AssemblyVersion("2.0.7.1657")]
[assembly: ComVisible(false)]
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs
index 688f90817..5b317e6d2 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs
@@ -425,6 +425,26 @@ namespace Tango.MachineStudio.ColorLab.ViewModels
}).ToObservableCollection();
LiquidVolumes.ToList().ForEach(x => x.VolumeChanged += (s, e) => OnLiquidVolumeChanged());
+
+ InvalidateLiquidFactorsCalibrationData();
+
+ SelectedMachine.Modified -= SelectedMachine_Modified;
+ SelectedMachine.Modified += SelectedMachine_Modified;
+ }
+ }
+
+ private void SelectedMachine_Modified(object sender, ObservableModifiedEventArgs e)
+ {
+ if (e.IsOtherContext)
+ {
+ InvokeUI(async () =>
+ {
+ if (SelectedMachine != null)
+ {
+ await SelectedMachine.Reload(_dbContext);
+ OnSelectedMachineChanged();
+ }
+ });
}
}
@@ -433,7 +453,7 @@ namespace Tango.MachineStudio.ColorLab.ViewModels
try
{
if (LiquidsCalibrationData == null || _prevent_inverse_conversion) return;
-
+
//TODO: This is temporary because of out of range volumes.
if (LiquidVolumes.Where(x => x.IdsPack.IdsPackFormula.Code == IdsPackFormulas.StandardColor.ToInt32()).Sum(x => x.Volume) > 200)
{
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Properties/AssemblyInfo.cs
index 81868f7a8..da66a79d8 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Properties/AssemblyInfo.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Properties/AssemblyInfo.cs
@@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
using System.Windows;
[assembly: AssemblyTitle("Tango - Machine Studio Developer Module")]
-[assembly: AssemblyVersion("2.0.8.1304")]
+[assembly: AssemblyVersion("2.0.10.1828")]
[assembly: ComVisible(false)]
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 a58757633..569359066 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
@@ -180,8 +180,8 @@ namespace Tango.MachineStudio.Developer.ViewModels
if (_selectedMachine != null)
{
- _selectedMachine.Saved -= SelectedMachine_Saved;
- _selectedMachine.Saved += SelectedMachine_Saved;
+ _selectedMachine.Modified -= SelectedMachine_Modified;
+ _selectedMachine.Modified += SelectedMachine_Modified;
}
}
}
@@ -627,6 +627,11 @@ namespace Tango.MachineStudio.Developer.ViewModels
/// Gets or sets the display job embroidery file command.
/// </summary>
public RelayCommand<Job> DisplayJobEmbroideryFileCommand { get; set; }
+
+ /// <summary>
+ /// Gets or sets the reload machines command.
+ /// </summary>
+ public RelayCommand ReloadMachinesCommand { get; set; }
#endregion
#region Constructors
@@ -703,6 +708,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
PushProcessParametersCommand = new RelayCommand(PushProcessParameters, () => SelectedRML != null && SelectedRML.ProcessParametersTablesGroups.Count > 0 && SelectedProcessParametersTable != null && MachineOperator != null);
ImportEmbroideryFileCommand = new RelayCommand(ImportEmbroideryFile, () => SelectedMachine != null);
DisplayJobEmbroideryFileCommand = new RelayCommand<Job>(DisplayJobEmbroideryFile);
+ ReloadMachinesCommand = new RelayCommand(ReloadMachine);
ApplicationManager.ConnectedMachineChanged += ApplicationManager_ConnectedMachineChanged;
@@ -850,10 +856,21 @@ namespace Tango.MachineStudio.Developer.ViewModels
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
- private void SelectedMachine_Saved(object sender, EventArgs e)
+ private void SelectedMachine_Modified(object sender, ObservableModifiedEventArgs e)
{
- InvalidateLiquidFactorsAndProcessTables();
- SelectedMachine.Reload(_machineDbContext);
+ if (e.IsOtherContext)
+ {
+ InvokeUI(() =>
+ {
+ SelectedMachine.Reload(_machineDbContext);
+ InvalidateLiquidFactorsAndProcessTables();
+
+ if (SelectedSegment != null)
+ {
+ OnSelectedSegmentChanged();
+ }
+ });
+ }
}
/// <summary>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml
index 4593ef259..c151b62bc 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml
@@ -35,16 +35,22 @@
<Grid Background="#B1FFFFFF">
<StackPanel>
<TextBlock Margin="40 20" FontSize="30" FontWeight="SemiBold" FontStyle="Italic">TARGET MACHINE</TextBlock>
- <ComboBox ItemsSource="{Binding Machines}" FontSize="20" SelectedItem="{Binding SelectedMachine}" materialDesign:HintAssist.Hint="Serial Number" Margin="40 0 40 0">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <StackPanel>
- <TextBlock Text="{Binding SerialNumber}" FontWeight="Bold" FontStyle="Italic"></TextBlock>
- <TextBlock FontSize="11" Text="{Binding Name}" Foreground="Gray"></TextBlock>
- </StackPanel>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
+
+ <DockPanel Margin="40 0 40 0">
+ <Button Command="{Binding ReloadMachinesCommand}" DockPanel.Dock="Right" ToolTip="Reload" Foreground="#404040" Margin="20 0 0 0" Padding="0" Width="40" Height="Auto" Style="{StaticResource MaterialDesignFlatButton}">
+ <materialDesign:PackIcon Kind="Refresh" Width="24" Height="24" />
+ </Button>
+ <ComboBox ItemsSource="{Binding Machines}" FontSize="20" SelectedItem="{Binding SelectedMachine}" materialDesign:HintAssist.Hint="Serial Number">
+ <ComboBox.ItemTemplate>
+ <DataTemplate>
+ <StackPanel>
+ <TextBlock Text="{Binding SerialNumber}" FontWeight="Bold" FontStyle="Italic"></TextBlock>
+ <TextBlock FontSize="11" Text="{Binding Name}" Foreground="Gray"></TextBlock>
+ </StackPanel>
+ </DataTemplate>
+ </ComboBox.ItemTemplate>
+ </ComboBox>
+ </DockPanel>
<designer:MachineView Width="600" IsHitTestVisible="False" Margin="0 40 0 0" DataContext="{Binding SelectedMachine}" />
<Button Command="{Binding EditMachineCommand}" HorizontalAlignment="Right" Margin="0 10 20 20" Style="{StaticResource MaterialDesignFlatButton}">
<StackPanel Orientation="Horizontal">