aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj6
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs28
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml6
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs5
4 files changed, 28 insertions, 17 deletions
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 cd00557b1..6e55b6d14 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
@@ -208,6 +208,10 @@
<Project>{40085232-aced-4cbe-945b-90ba8153c151}</Project>
<Name>Tango.BrushPicker</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\..\Tango.ColorConversion\Tango.ColorConversion.csproj">
+ <Project>{b4fe6485-4161-4b36-bc08-67e0b53d01b7}</Project>
+ <Name>Tango.ColorConversion</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\..\Tango.ColorPicker\Tango.ColorPicker.csproj">
<Project>{a2f5af44-29ff-45d6-9d25-ecda5cce88b5}</Project>
<Name>Tango.ColorPicker</Name>
@@ -357,7 +361,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<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
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 3f28c2cff..a865cdc8f 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
@@ -38,7 +38,6 @@ using System.Threading;
using Tango.SharedUI.Helpers;
using Tango.Core.DI;
using Tango.MachineStudio.Common;
-using Tango.BL.ColorConversion;
using Tango.MachineStudio.Logging.ViewModels;
using Tango.MachineStudio.Logging.Views;
using Tango.AutoComplete.Editors;
@@ -47,6 +46,8 @@ using System.Runtime.ExceptionServices;
using Tango.BL.Builders;
using Tango.MachineStudio.Common.Navigation;
using System.Diagnostics;
+using Tango.Core.ExtensionMethods;
+using Tango.ColorConversion;
namespace Tango.MachineStudio.Developer.ViewModels
{
@@ -80,6 +81,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
private bool _disable_gamut_check;
private bool _rml_has_no_cct;
private TaskItem _preparingTaskItem;
+ private IColorConverter _converter;
#region Properties
@@ -713,6 +715,8 @@ namespace Tango.MachineStudio.Developer.ViewModels
/// <param name="notificationProvider">The notification provider.</param>
public MainViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider, IDiagnosticsFrameProvider diagnosticsFrameProvider, IVideoCaptureProvider videoCaptureProvider, DeveloperNavigationManager navigation, INavigationManager navigationManager, IAuthenticationProvider authentication, IEventLogger eventLogger, ISpeechProvider speech)
{
+ _converter = new DefaultColorConverter();
+
CanWork = true;
EnableColorConversion = true;
@@ -835,7 +839,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
{
try
{
- var output = TangoColorConverter.GetSuggestions(stop);
+ var output = _converter.Convert(stop);
stop.Red = output.SingleCoordinates.Red;
stop.Green = output.SingleCoordinates.Green;
@@ -849,7 +853,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
{
try
{
- stop.IsOutOfGamut = TangoColorConverter.IsOutOfGamut(stop);
+ stop.IsOutOfGamut = _converter.IsOutOfGamut(stop);
stop.OutOfGamutChecked = true;
}
catch { }
@@ -870,7 +874,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
_hiveOpened = true;
try
{
- HiveSuggestions = TangoColorConverter.CreateHiveSuggestions(TangoColorConverter.GetSuggestions(SelectedBrushStop));
+ HiveSuggestions = _converter.Convert(SelectedBrushStop).CreateHiveSuggestions();
}
catch (Exception ex)
{
@@ -911,7 +915,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
if (!_color_changed_from_hive && _hiveOpened)
{
SelectedBrushStop.Corrected = false;
- HiveSuggestions = TangoColorConverter.CreateHiveSuggestions(TangoColorConverter.GetSuggestions(SelectedBrushStop));
+ HiveSuggestions = _converter.Convert(SelectedBrushStop).CreateHiveSuggestions();
}
}
@@ -1233,8 +1237,8 @@ namespace Tango.MachineStudio.Developer.ViewModels
{
LogManager.Log(String.Format("BrushStop {0} Dropped on BrushStop {1}", dragged.StopIndex, dropped.StopIndex));
- dragged.SetStopIndex(dropped.StopIndex);
- dropped.SetStopIndex(dropped.StopIndex + 1);
+ dragged.SetStopIndexNoRaise(dropped.StopIndex);
+ dropped.SetStopIndexNoRaise(dropped.StopIndex + 1);
ArrangeBrushStopsIndices();
}
@@ -1988,7 +1992,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
foreach (var stop in SelectedSegment.BrushStops.OrderBy(x => x.StopIndex))
{
- stop.SetStopIndex(index++);
+ stop.SetStopIndexNoRaise(index++);
}
if (SelectedSegment.BrushStops.Count > 1)
@@ -2024,8 +2028,8 @@ namespace Tango.MachineStudio.Developer.ViewModels
_notification.ShowInfo("A job must contain at least one segment.");
return;
}
- ActiveJob.Segments.Remove(x);
- x.DefferedDelete(_activeJobDbContext);
+
+ x.Delete(_activeJobDbContext);
});
ArrangeSegmentsIndices();
@@ -2075,8 +2079,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
LogManager.Log(String.Format("Removing {0} jobs...", SelectedJobs.Count));
SelectedJobs.ToList().ForEach(x =>
{
- SelectedMachine.Jobs.Remove(x);
- x.DefferedDelete(_machineDbContext);
+ x.Delete(_machineDbContext);
});
using (_notification.PushTaskItem("Removing selected jobs..."))
@@ -2163,7 +2166,6 @@ namespace Tango.MachineStudio.Developer.ViewModels
return;
}
SelectedSegment.BrushStops.Remove(x);
- x.DefferedDelete(_activeJobDbContext);
});
ArrangeBrushStopsIndices();
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml
index 95f88d1ea..ad1648642 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml
@@ -7,7 +7,7 @@
xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop"
xmlns:brushPicker="clr-namespace:Tango.BrushPicker;assembly=Tango.BrushPicker"
xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
- xmlns:colorConversion="clr-namespace:Tango.BL.ColorConversion;assembly=Tango.BL"
+ xmlns:colorConversion="clr-namespace:Tango.ColorConversion;assembly=Tango.ColorConversion"
xmlns:hive="clr-namespace:Tango.Hive;assembly=Tango.Hive"
xmlns:automation="clr-namespace:Tango.MachineStudio.Common.Automation;assembly=Tango.MachineStudio.Common"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
@@ -901,10 +901,10 @@
</DockPanel>
</Grid>
<Grid Margin="0 10 10 0">
- <controls:MultiSelectListBox AutomationProperties.AutomationId="{x:Static automation:Developer.BrushStopsListBox}" SelectionMode="Extended" Style="{x:Null}" Background="Transparent" ScrollViewer.CanContentScroll="False" BorderThickness="0" ItemsSource="{Binding BrushStopsCollectionView}" SelectedItem="{Binding SelectedBrushStop}" SelectedItemsList="{Binding SelectedBrushStops,Mode=TwoWay}" HorizontalContentAlignment="Stretch">
+ <controls:MultiSelectListBox x:Name="listStops" AutomationProperties.AutomationId="{x:Static automation:Developer.BrushStopsListBox}" SelectionMode="Extended" Style="{x:Null}" Background="Transparent" ScrollViewer.CanContentScroll="False" BorderThickness="0" ItemsSource="{Binding BrushStopsCollectionView}" SelectedItem="{Binding SelectedBrushStop}" SelectedItemsList="{Binding SelectedBrushStops,Mode=TwoWay}" HorizontalContentAlignment="Stretch">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem" BasedOn="{StaticResource basicListBoxItem}">
-
+ <EventSetter Event="PreviewMouseDown" Handler="OnBrushStopMouseDown"></EventSetter>
</Style>
</ListBox.ItemContainerStyle>
<ItemsControl.ItemTemplate>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs
index f3af53352..18dc795bd 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs
@@ -312,5 +312,10 @@ namespace Tango.MachineStudio.Developer.Views
_vm.OnBrushStopFieldValueChanged(stop);
}
}
+
+ private void OnBrushStopMouseDown(object sender, MouseButtonEventArgs e)
+ {
+ listStops.SelectedItem = (sender as ListBoxItem).DataContext;
+ }
}
}