diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-02-19 17:52:10 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-02-19 17:52:10 +0200 |
| commit | a794a5d088b425d7b41f87d7c3a43b904249e11e (patch) | |
| tree | 65c99c623ceec3699bdd6fb7fdbf24c6d3057721 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer | |
| parent | 8feeef663f8984c609cb3aa530d09ffcffda5709 (diff) | |
| download | Tango-a794a5d088b425d7b41f87d7c3a43b904249e11e.tar.gz Tango-a794a5d088b425d7b41f87d7c3a43b904249e11e.zip | |
Working on developer module...
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer')
8 files changed, 46 insertions, 2636 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 eae234a8b..f986219e2 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 @@ -136,9 +136,6 @@ <Compile Include="Views\MachineJobSelectionView.xaml.cs"> <DependentUpon>MachineJobSelectionView.xaml</DependentUpon> </Compile> - <Compile Include="Views\MainView.xaml.cs"> - <DependentUpon>MainView.xaml</DependentUpon> - </Compile> <Compile Include="..\..\..\Versioning\GlobalVersionInfo.cs"> <Link>GlobalVersionInfo.cs</Link> </Compile> @@ -165,10 +162,6 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> - <Page Include="Views\MainView.xaml"> - <SubType>Designer</SubType> - <Generator>MSBuild:Compile</Generator> - </Page> <Page Include="Views\RunningJobView.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModelLocator.cs index 415643e3f..b397f1912 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModelLocator.cs @@ -20,7 +20,7 @@ namespace Tango.MachineStudio.Developer { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); - SimpleIoc.Default.Register<IMainView>(() => MainView.Self); + //SimpleIoc.Default.Register<IMainView>(() => MainView.Self); SimpleIoc.Default.Register<MainViewVM>(); SimpleIoc.Default.Register<DeveloperNavigationManager, DeveloperNavigationManager>(); } 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 c8a6aa89f..199183c12 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 @@ -45,14 +45,12 @@ namespace Tango.MachineStudio.Developer.ViewModels /// Represents the developer module main view, view model. /// </summary> /// <seealso cref="Tango.SharedUI.ViewModel" /> - public class MainViewVM : ViewModel<IMainView>, IShutdownRequestBlocker + public class MainViewVM : ViewModel, IShutdownRequestBlocker { private static object _syncLock = new object(); private INotificationProvider _notification; private TimeSpan _runningJobEstimatedDuration; - private Dictionary<String, GraphControllerBase> _controllers; - private int _fullScreenGraphIndex; private JobHandler _jobHandler; private DeveloperNavigationManager _navigation; private ObservablesContext _dbJobContext; @@ -62,6 +60,16 @@ namespace Tango.MachineStudio.Developer.ViewModels #region Properties + private ObservableCollection<Machine> _machines; + /// <summary> + /// Gets or sets the machines. + /// </summary> + public ObservableCollection<Machine> Machines + { + get { return _machines; } + set { _machines = value; RaisePropertyChangedAuto(); } + } + private ObservableCollection<ColorSpace> _colorSpaces; /// <summary> /// Gets or sets the color spaces. @@ -82,6 +90,15 @@ namespace Tango.MachineStudio.Developer.ViewModels set { _rmls = value; RaisePropertyChangedAuto(); } } + private ObservableCollection<WindingMethod> _windingMethods; + + public ObservableCollection<WindingMethod> WindingMethods + { + get { return _windingMethods; } + set { _windingMethods = value; RaisePropertyChangedAuto(); } + } + + /// <summary> /// Gets or sets the application manager. /// </summary> @@ -92,11 +109,6 @@ namespace Tango.MachineStudio.Developer.ViewModels /// </summary> public IVideoCaptureProvider VideoCaptureProvider { get; set; } - /// <summary> - /// Gets or sets observable entites database the adapter. - /// </summary> - public ObservablesEntitiesAdapter Adapter { get; set; } - protected Machine _selectedMachine; /// <summary> /// Gets or sets the selected machine. @@ -286,26 +298,6 @@ namespace Tango.MachineStudio.Developer.ViewModels set { _isSideBarOpened = value; RaisePropertyChangedAuto(); } } - private ObservableCollection<TechMonitor> _availableGraphs; - /// <summary> - /// Gets or sets the available sensors. - /// </summary> - public ObservableCollection<TechMonitor> AvailableGraphs - { - get { return _availableGraphs; } - set { _availableGraphs = value; RaisePropertyChangedAuto(); } - } - - private ObservableCollection<IRealTimeGraph> _graphs; - /// <summary> - /// Gets or sets the collection of displayed graph controls. - /// </summary> - public ObservableCollection<IRealTimeGraph> Graphs - { - get { return _graphs; } - set { _graphs = value; RaisePropertyChangedAuto(); } - } - private TimeSpan _estimatedDuration; /// <summary> /// Gets or sets the estimated duration for the selected job. @@ -557,16 +549,6 @@ namespace Tango.MachineStudio.Developer.ViewModels public RelayCommand CloseJobCompletionStatusCommand { get; set; } /// <summary> - /// Gets or sets the toggle camera command. - /// </summary> - public RelayCommand<CaptureDevice> ToggleCameraCommand { get; set; } - - /// <summary> - /// Gets or sets the exit full screen command. - /// </summary> - public RelayCommand ExitFullScreenCommand { get; set; } - - /// <summary> /// Gets or sets the load job command. /// </summary> public RelayCommand LoadJobCommand { get; set; } @@ -593,16 +575,9 @@ namespace Tango.MachineStudio.Developer.ViewModels /// <summary> /// Initializes a new instance of the <see cref="MainViewVM"/> class. /// </summary> - public MainViewVM(IMainView view) : base(view, true) + public MainViewVM() : base() { - if (!this.DesignMode) - { - Adapter = ObservablesEntitiesAdapter.Instance; - AvailableGraphs = Adapter.TechMonitors.ToObservableCollection(); - } - Graphs = new ObservableCollection<IRealTimeGraph>(); - _controllers = new Dictionary<String, GraphControllerBase>(); } /// <summary> @@ -611,8 +586,13 @@ namespace Tango.MachineStudio.Developer.ViewModels /// <param name="applicationManager">The application manager.</param> /// <param name="notificationProvider">The notification provider.</param> [PreferredConstructor] - public MainViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider, IMainView view, IDiagnosticsFrameProvider diagnosticsFrameProvider, IVideoCaptureProvider videoCaptureProvider, DeveloperNavigationManager navigation, IAuthenticationProvider authentication) : this(view) + public MainViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider, IDiagnosticsFrameProvider diagnosticsFrameProvider, IVideoCaptureProvider videoCaptureProvider, DeveloperNavigationManager navigation, IAuthenticationProvider authentication) : this() { + using (var db = ObservablesContext.CreateDefault()) + { + Machines = db.Machines.ToObservableCollection(); + } + _machineDBContext = ObservablesContext.CreateDefault(); SelectedJobs = new ObservableCollection<Job>(); @@ -623,7 +603,6 @@ namespace Tango.MachineStudio.Developer.ViewModels _navigation = navigation; ApplicationManager = applicationManager; VideoCaptureProvider = videoCaptureProvider; - diagnosticsFrameProvider.FrameReceived += DiagnosticsFrameProvider_FrameReceived; //Initialize Commands... EditMachineCommand = new RelayCommand(EditMachine, () => SelectedMachine != null); @@ -642,14 +621,11 @@ namespace Tango.MachineStudio.Developer.ViewModels StartJobCommand = new RelayCommand(StartJob, () => ActiveJob != null && !IsJobRunning); StopJobCommand = new RelayCommand(StopJob, () => IsJobRunning); CloseJobCompletionStatusCommand = new RelayCommand(CloseJobCompletionStatusBar); - ExitFullScreenCommand = new RelayCommand(ExitFullScreen); LoadJobCommand = new RelayCommand(LoadJob, () => SelectedMachineJob != null); DuplicateJobCommand = new RelayCommand(DuplicateSelectedJobs, () => SelectedMachineJob != null); DuplicateSegmentCommand = new RelayCommand(DuplicateSelectedSegments, () => SelectedSegment != null); DuplicateBrushStopCommand = new RelayCommand(DuplicateSelectedBrushStops, () => SelectedBrushStop != null); - ToggleCameraCommand = new RelayCommand<CaptureDevice>(ToggleCamera); - ApplicationManager.ConnectedMachineChanged += ApplicationManager_ConnectedMachineChanged; } @@ -658,16 +634,6 @@ namespace Tango.MachineStudio.Developer.ViewModels #region Event Handlers /// <summary> - /// Handles the diagnostics provider frame received event. - /// </summary> - /// <param name="sender">The sender.</param> - /// <param name="response">The response.</param> - private void DiagnosticsFrameProvider_FrameReceived(object sender, PushDiagnosticsResponse response) - { - PopulateDiagnosticsData(response); - } - - /// <summary> /// Handles the application manager connected machine changes event. /// </summary> /// <param name="sender">The sender.</param> @@ -835,6 +801,7 @@ namespace Tango.MachineStudio.Developer.ViewModels ColorSpaces = _dbJobContext.ColorSpaces.ToObservableCollection(); Rmls = _dbJobContext.Rmls.ToObservableCollection(); + WindingMethods = _dbJobContext.WindingMethods.ToObservableCollection(); _activeJob = _dbJobContext.Jobs.SingleOrDefault(x => x.Guid == SelectedMachineJob.Guid); @@ -896,59 +863,6 @@ namespace Tango.MachineStudio.Developer.ViewModels } } - private void ClearGraphs() - { - _controllers.ToList().ForEach(x => x.Value.Clear()); - } - - private void PopulateDiagnosticsData(PushDiagnosticsResponse data) - { - foreach (var prop in data.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) - { - GraphControllerBase controller = null; - - if (_controllers.TryGetValue(prop.Name, out controller)) - { - if (controller is GraphController) - { - double[] arr = Enumerable.ToArray(prop.GetValue(data) as IEnumerable<double>); - (controller as GraphController).PushData(arr); - } - else - { - DoubleArray[] arrayOfDoubles = Enumerable.ToArray(prop.GetValue(data) as IEnumerable<DoubleArray>); - (controller as GraphMultiController).PushData(arrayOfDoubles.Select(x => x.Data.ToList()).ToList()); - } - } - } - } - - private void ExitFullScreen() - { - if (FullScreenGraph != null) - { - FullScreenGraph.EnableToolBar = true; - Graphs.Insert(_fullScreenGraphIndex, FullScreenGraph); - FullScreenGraph = null; - } - } - - private void StartFullScreenGraph(IRealTimeGraph graph) - { - graph.EnableToolBar = false; - _fullScreenGraphIndex = Graphs.IndexOf(graph); - Graphs.Remove(graph); - FullScreenGraph = graph; - } - - private void ToggleCamera(CaptureDevice captureDevice) - { - if (captureDevice.Device != null) - { - captureDevice.IsStarted = !captureDevice.IsStarted; - } - } - private void CloseJobCompletionStatusBar() { _navigation.NavigateTo(DeveloperNavigationView.JobView); @@ -1138,15 +1052,9 @@ namespace Tango.MachineStudio.Developer.ViewModels g.Active = false; } - //String machineGuid = SelectedMachine.Guid; - //String rmlGuid = SelectedRML.Guid; - SelectedRML.ProcessParametersTablesGroups.Add(group); await SelectedRML.SaveAsync(); - //SelectedMachine = Adapter.Machines.SingleOrDefault(x => x.Guid == machineGuid); - //SelectedRML = Adapter.Rmls.SingleOrDefault(x => x.Guid == rmlGuid); - InvalidateLiquidFactorsAndProcessTables(); } } @@ -1329,8 +1237,8 @@ namespace Tango.MachineStudio.Developer.ViewModels newJob.Name = jobName; newJob.CreationDate = DateTime.UtcNow; newJob.User = _authentication.CurrentUser; - newJob.Rml = Adapter.Rmls.FirstOrDefault(); - newJob.WindingMethod = Adapter.WindingMethods.FirstOrDefault(); + newJob.Rml = _machineDBContext.Rmls.FirstOrDefault(); + newJob.WindingMethod = _machineDBContext.WindingMethods.FirstOrDefault(); newJob.Machine = SelectedMachine; SelectedMachine.Jobs.Add(newJob); @@ -1463,68 +1371,6 @@ namespace Tango.MachineStudio.Developer.ViewModels #region Public Methods /// <summary> - /// Add sensor graph from available sensors to displayed graphs. - /// </summary> - /// <param name="sensor">The sensor.</param> - public void OnDropAvailableGraph(TechMonitor sensor) - { - if (Graphs.Count < 8) - { - IRealTimeGraph graphControl = null; - GraphControllerBase controller = null; - - if (!sensor.MultiChannel) - { - graphControl = new RealTimeGraphControl(); - controller = new GraphController(); - graphControl.Controller = controller; - } - else - { - graphControl = new RealTimeGraphMultiControl(); - controller = new GraphMultiController(); - - for (int i = 0; i < sensor.ChannelCount; i++) - { - var randomColor = new SolidColorBrush(Core.Helpers.ColorHelper.GetRandomColor()); - - (controller as GraphMultiController).AddSeries(new DataYSeries() - { - Name = sensor.Description.First().ToString() + (i + 1), - UseFillAndStroke = true, - Stroke = randomColor - }); - } - - graphControl.Controller = controller; - } - - graphControl.Tag = sensor; - graphControl.SensorName = sensor.Description; - graphControl.SensorUnits = sensor.Units; - graphControl.InnerGraph.Minimum = sensor.Min; - graphControl.InnerGraph.Maximum = sensor.Max; - graphControl.InnerGraph.MaxPoints = Common.Helpers.GraphsHelper.GetMaxPoints(sensor.PointsPerFrame); - graphControl.GraphRemoveButtonPressed += (sender, _) => - { - RemoveGraph(sender as IRealTimeGraph); - }; - graphControl.GraphFullScreenButtonPressed += (sender, _) => - { - StartFullScreenGraph(sender as IRealTimeGraph); - }; - Graphs.Add(graphControl); - AvailableGraphs.Remove(sensor); - - _controllers.Add(sensor.Name, controller); - } - else - { - _notification.ShowInfo("The maximum number of real-time graphs is eight. Please remove a graph to add another."); - } - } - - /// <summary> /// Switch the brush stop position in the segment. /// </summary> /// <param name="draggedStop">The dragged stop.</param> @@ -1536,19 +1382,6 @@ namespace Tango.MachineStudio.Developer.ViewModels ArrangeBrushStopsIndices(); } - /// <summary> - /// Removes the graph. - /// </summary> - /// <param name="graph">The graph.</param> - public void RemoveGraph(IRealTimeGraph graph) - { - var sensor = graph.Tag as TechMonitor; - _controllers.Remove(sensor.Name); - graph.InnerGraph.Dispose(); - Graphs.Remove(graph); - AvailableGraphs.Insert(0, sensor); - } - #endregion #region IShutdownRequestBlocker @@ -1575,20 +1408,20 @@ namespace Tango.MachineStudio.Developer.ViewModels #region IMainView - protected override void OnViewAttached() - { - base.OnViewAttached(); + //protected override void OnViewAttached() + //{ + // base.OnViewAttached(); - if (SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedMachineGuid != null) - { - SelectedMachine = Adapter.Machines.SingleOrDefault(x => x.Guid == SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedMachineGuid); - } + // //if (SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedMachineGuid != null) + // //{ + // // SelectedMachine = Adapter.Machines.SingleOrDefault(x => x.Guid == SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedMachineGuid); + // //} - if (SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedJobGuid != null && SelectedMachine != null) - { - ActiveJob = SelectedMachine.Jobs.SingleOrDefault(x => x.Guid == SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedJobGuid); - } - } + // //if (SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedJobGuid != null && SelectedMachine != null) + // //{ + // // ActiveJob = SelectedMachine.Jobs.SingleOrDefault(x => x.Guid == SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedJobGuid); + // //} + //} #endregion } 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 cf7af21d9..69f0fed5c 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 @@ -357,7 +357,7 @@ <Image Source="../Images/wind.png" Width="32"></Image> <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Winding Method</TextBlock> </StackPanel> - <ComboBox Width="90" HorizontalAlignment="Left" ItemsSource="{Binding Adapter.WindingMethods}" SelectedItem="{Binding ActiveJob.WindingMethod}" DisplayMemberPath="Name" ></ComboBox> + <ComboBox Width="90" HorizontalAlignment="Left" ItemsSource="{Binding WindingMethods}" SelectedItem="{Binding ActiveJob.WindingMethod}" DisplayMemberPath="Name" ></ComboBox> </StackPanel> </Border> 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 41886357b..27ea3cae8 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 @@ -82,14 +82,6 @@ namespace Tango.MachineStudio.Developer.Views } } - private void OnDropAvailableGraph(object sender, DropEventArgs e) - { - if (e.Draggable.DataContext is TechMonitor) - { - _vm.OnDropAvailableGraph(e.Draggable.DataContext as TechMonitor); - } - } - private void Offset_Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) { UpdateGradientBrushDisplay(); 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 8881e4f57..c07ddb95b 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 @@ -31,7 +31,7 @@ <Grid Background="#B1FFFFFF"> <StackPanel> <TextBlock Margin="40 20" FontSize="30" FontWeight="SemiBold" FontStyle="Italic">TARGET MACHINE</TextBlock> - <ComboBox ItemsSource="{Binding Adapter.Machines}" FontSize="20" SelectedItem="{Binding SelectedMachine}" materialDesign:HintAssist.Hint="Serial Number" Margin="40 0 40 0"> + <ComboBox ItemsSource="{Binding Machines}" FontSize="20" SelectedItem="{Binding SelectedMachine}" materialDesign:HintAssist.Hint="Serial Number" Margin="40 0 40 0"> <ComboBox.ItemTemplate> <DataTemplate> <StackPanel> @@ -84,7 +84,7 @@ </StackPanel> </Grid> - <Grid DockPanel.Dock="Bottom"> + <Grid DockPanel.Dock="Bottom" Margin="0 20 0 0"> <StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Left" Margin="20 0 0 0"> <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="#FF7575" BorderBrush="#FF7575" Command="{Binding RemoveJobCommand}"> <StackPanel Orientation="Horizontal"> 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 deleted file mode 100644 index 442385731..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ /dev/null @@ -1,2246 +0,0 @@ -<UserControl x:Class="Tango.MachineStudio.Developer.Views.MainView" - 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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" - xmlns:global="clr-namespace:Tango.MachineStudio.Developer" - xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" - xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" - xmlns:sys="clr-namespace:System;assembly=mscorlib" - xmlns:techViews="clr-namespace:Tango.MachineStudio.Technician.Views;assembly=Tango.MachineStudio.Technician" - xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker" - xmlns:printing="clr-namespace:Tango.Integration.Printing;assembly=Tango.Integration" - xmlns:dispensing="clr-namespace:Tango.Integration.Dispensing;assembly=Tango.Integration" - xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" - xmlns:db="clr-namespace:Tango.MachineStudio.DB.Views.DBViews;assembly=Tango.MachineStudio.DB" - xmlns:commonControls="clr-namespace:Tango.MachineStudio.Common.Controls;assembly=Tango.MachineStudio.Common" - xmlns:designer="clr-namespace:Tango.MachineStudio.MachineDesigner.Views;assembly=Tango.MachineStudio.MachineDesigner" - xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels" - xmlns:localConverters="clr-namespace:Tango.MachineStudio.Developer.Converters" - xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" - xmlns:observables="clr-namespace:Tango.Integration.Observables;assembly=Tango.Integration" - xmlns:editors="clr-namespace:Tango.SharedUI.Editors;assembly=Tango.SharedUI" - xmlns:video="clr-namespace:Tango.Video.DirectCapture;assembly=Tango.Video" - xmlns:shapes="clr-namespace:Tango.SharedUI.Shapes;assembly=Tango.SharedUI" - xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views" - mc:Ignorable="d" - d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> - - <UserControl.InputBindings> - <KeyBinding Key="Esc" Command="{Binding ExitFullScreenCommand}"></KeyBinding> - </UserControl.InputBindings> - - <UserControl.Resources> - <Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}"> - <Setter Property="mahapps:ControlsHelper.HeaderFontSize" Value="14" /> - <Setter Property="Margin" Value="2" /> - </Style> - - <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> - <converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter" /> - <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> - <converters:BooleanInverseConverter x:Key="BooleanInverseConverter" /> - <localConverters:DbRmlViewToEntityConverter x:Key="DbRmlViewToEntityConverter"></localConverters:DbRmlViewToEntityConverter> - <converters:NullObjectToBooleanConverter x:Key="NullObjectToBooleanConverter"></converters:NullObjectToBooleanConverter> - <converters:GreaterThanToBooleanConverter x:Key="GreaterThanToBooleanConverter"></converters:GreaterThanToBooleanConverter> - <converters:SmallerThanToBooleanConverter x:Key="SmallerThanToBooleanConverter"></converters:SmallerThanToBooleanConverter> - <localConverters:BrushStopToColorConverter x:Key="BrushStopToColorConverter" /> - <localConverters:BrushStopCMYKToColorConverter x:Key="BrushStopCMYKToColorConverter" /> - <localConverters:BrushStopLabToColorConverter x:Key="BrushStopLabToColorConverter" /> - <localConverters:SegmentToGradientStopsConverter x:Key="SegmentToGradientStopsConverter" /> - <localConverters:BrushStopToOffsetLimitConverter x:Key="BrushStopToOffsetLimitConverter" /> - <localConverters:JobToColumnDefinitionsConverter x:Key="JobToColumnDefinitionsConverter" /> - <localConverters:SegmentLengthToWidthConverter x:Key="SegmentLengthToWidthConverter" /> - <localConverters:SegmentToGradientStopsConverterMulti x:Key="SegmentToGradientStopsConverterMulti" /> - <localConverters:SegmentToBrushConverter x:Key="SegmentToBrushConverter" /> - <localConverters:SegmentToBrushConverterMulti x:Key="SegmentToBrushConverterMulti" /> - <localConverters:ObjectsNotEqualToBooleanConveter x:Key="ObjectsNotEqualToBooleanConveter" /> - <localConverters:JobProgressToPositionConverter x:Key="JobProgressToPositionConverter" /> - <localConverters:BrushStopToOffsetValueConverter x:Key="BrushStopToOffsetValueConverter" /> - <converters:StringEllipsisConverter x:Key="StringEllipsisConverter" /> - <converters:NumberToFileSizeConverter x:Key="NumberToFileSizeConverter"/> - <localConverters:OneToPercentConverter x:Key="OneToPercentConverter"/> - <converters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" /> - <converters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" /> - - - <ObjectDataProvider x:Key="dispenserDivisions" MethodName="GetValues" ObjectType="{x:Type sys:Enum}"> - <ObjectDataProvider.MethodParameters> - <x:Type TypeName="dispensing:DispenserStepDivisions"/> - </ObjectDataProvider.MethodParameters> - </ObjectDataProvider> - - - <SolidColorBrush x:Key="SideBarBackground" Color="White"> - - </SolidColorBrush> - - <Color x:Key="dummyColor">Transparent</Color> - - <Style x:Key="droppableGrid" TargetType="Grid"> - <Setter Property="RenderTransform"> - <Setter.Value> - <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform> - </Setter.Value> - </Setter> - <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter> - <Setter Property="Background" Value="Transparent"></Setter> - <Setter Property="dragAndDrop:DragAndDropService.Droppable" Value="True"></Setter> - <Setter Property="dragAndDrop:DragAndDropService.DraggingSurface" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"></Setter> - <Style.Triggers> - <Trigger Property="dragAndDrop:DragAndDropService.IsDraggableOver" Value="True"> - <Setter Property="Opacity" Value="0.5"></Setter> - <Trigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation> - <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation> - </Storyboard> - </BeginStoryboard> - </Trigger.EnterActions> - <Trigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation> - <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation> - </Storyboard> - </BeginStoryboard> - </Trigger.ExitActions> - </Trigger> - </Style.Triggers> - </Style> - - <Style x:Key="brushStopBorder" TargetType="Border"> - <Setter Property="RenderTransform"> - <Setter.Value> - <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform> - </Setter.Value> - </Setter> - <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter> - <Setter Property="Background" Value="Transparent"></Setter> - <Setter Property="dragAndDrop:DragAndDropService.Droppable" Value="True"></Setter> - <Setter Property="dragAndDrop:DragAndDropService.Draggable" Value="True"></Setter> - <Setter Property="dragAndDrop:DragAndDropService.DraggingSurface" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"></Setter> - <Style.Triggers> - <Trigger Property="dragAndDrop:DragAndDropService.IsDraggableOver" Value="True"> - <Setter Property="Opacity" Value="0.5"></Setter> - <Trigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation> - <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation> - </Storyboard> - </BeginStoryboard> - </Trigger.EnterActions> - <Trigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation> - <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation> - </Storyboard> - </BeginStoryboard> - </Trigger.ExitActions> - </Trigger> - </Style.Triggers> - </Style> - - <Style x:Key="draggableGrid" TargetType="Grid"> - <Setter Property="RenderTransform"> - <Setter.Value> - <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform> - </Setter.Value> - </Setter> - <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter> - <Setter Property="Background" Value="Transparent"></Setter> - <Setter Property="dragAndDrop:DragAndDropService.Draggable" Value="True"></Setter> - <Setter Property="dragAndDrop:DragAndDropService.DraggingSurface" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"></Setter> - </Style> - - <Style TargetType="Border" x:Key="JobFieldBorder"> - <Setter Property="BorderBrush" Value="{StaticResource SideBarBackground}"></Setter> - <Setter Property="BorderThickness" Value="0"></Setter> - <Setter Property="CornerRadius" Value="100 10 100 0"></Setter> - <Setter Property="Padding" Value="10 5"></Setter> - <Setter Property="Margin" Value="0 0 10 0"></Setter> - <Setter Property="Background"> - <Setter.Value> - <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5"> - <GradientStop Color="#73F4F4F4"/> - <GradientStop Color="White" Offset="1"/> - </LinearGradientBrush> - </Setter.Value> - </Setter> - </Style> - - <Style TargetType="ContentControl" x:Key="colorPicker"> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate> - <Grid> - <ToggleButton Cursor="Hand" x:Name="PopupButton" BorderThickness="0" Height="30" Background="Transparent" Foreground="{StaticResource AccentColorBrush}" VerticalAlignment="Center" Margin="30 0 0 0" IsChecked="{Binding ElementName=Popup, Path=IsOpen}"> - <ToggleButton.Style> - <Style TargetType="ToggleButton" BasedOn="{StaticResource emptyToggleButton}"> - <Style.Triggers> - <DataTrigger Binding="{Binding IsOpen, ElementName=Popup}" Value="True"> - <Setter Property="IsEnabled" Value="False" /> - </DataTrigger> - </Style.Triggers> - </Style> - </ToggleButton.Style> - - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon VerticalAlignment="Center" Kind="Pencil" Width="24" Height="24"> - <materialDesign:PackIcon.Foreground> - <SolidColorBrush Color="{Binding Color}"></SolidColorBrush> - </materialDesign:PackIcon.Foreground> - </materialDesign:PackIcon> - <TextBlock Margin="5 0 0 0" VerticalAlignment="Center">SELECT COLOR</TextBlock> - </StackPanel> - </ToggleButton> - <Popup x:Name="Popup" MouseDown="Popup_MouseDown" PopupAnimation="Fade" StaysOpen="False" PlacementTarget="{Binding ElementName=PopupButton}" Placement="Bottom" AllowsTransparency="True"> - <Border Background="#E6FFFFFF" Height="250" Width="500" CornerRadius="5" Margin="10"> - <Border.Effect> - <DropShadowEffect ShadowDepth="0" BlurRadius="10" /> - </Border.Effect> - <Grid> - <Grid Margin="10"> - <commonControls:HiveColorPickerControl SelectedColorChanged="HiveColorPickerControl_SelectedColorChanged" SelectedColor="{Binding Color,Mode=TwoWay}" DemoMode="True" /> - </Grid> - </Grid> - </Border> - </Popup> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - </UserControl.Resources> - - <Grid> - <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="Auto"/> - <RowDefinition Height="1*"/> - </Grid.RowDefinitions> - - <StackPanel> - <Grid Background="#202020" TextElement.Foreground="Silver"> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="LayoutTransform"> - <Setter.Value> - <ScaleTransform ScaleX="1" ScaleY="0" /> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding ShowJobStatus}" Value="True"> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - <Border BorderBrush="#404040" BorderThickness="0 0 0 1" Padding="20"> - <DockPanel> - <Grid DockPanel.Dock="Left" MinWidth="190" VerticalAlignment="Center" Margin="0 0 0 0"> - <StackPanel Orientation="Vertical" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityConverter}}"> - <ProgressBar Foreground="#FF6464" Width="50" Height="50" HorizontalAlignment="Center" VerticalAlignment="Center" IsIndeterminate="True" Style="{StaticResource MaterialDesignCircularProgressBar}" Value="0" /> - <TextBlock Margin="0 10 0 0" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14" FontStyle="Italic" FontWeight="DemiBold" Foreground="#FF6464" TextWrapping="Wrap"> - <Run Text="Running '"></Run> - <Run Text="{Binding RunningJob.Name}"></Run> - <Run Text="'..."></Run> - </TextBlock> - </StackPanel> - </Grid> - <StackPanel DockPanel.Dock="Right" VerticalAlignment="Center" Margin="0 20 0 0"> - <StackPanel Orientation="Horizontal"> - <TextBlock VerticalAlignment="Center" FontSize="30" FontFamily="{StaticResource digital-7}" Margin="0 0 40 0" Foreground="#FF6464" Width="100" Text="{Binding RunningJobRemainingTime,StringFormat=hh\\:mm\\:ss}"></TextBlock> - - <Button Height="40" Width="170" Command="{Binding StopJobCommand}" Background="#FF6464" BorderBrush="#FF6464"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="Stop" /> - <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">STOP</TextBlock> - </StackPanel> - </Button> - </StackPanel> - </StackPanel> - <Grid> - <Grid> - <Border Margin="0 10 0 0" VerticalAlignment="Bottom" Width="1200" BorderBrush="#404040" BorderThickness="0" ClipToBounds="False"> - <Grid ClipToBounds="False" > - - <ItemsControl ClipToBounds="False" x:Name="runningJobBrushList" ItemsSource="{Binding RunningJobSegments}"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> - <Grid ClipToBounds="False"> - <Grid.Width> - <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}"> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob.Length"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding> - <Binding Path="Length"></Binding> - </MultiBinding> - </Grid.Width> - - <StackPanel Margin="0 0 0 0" ClipToBounds="False"> - - <StackPanel Margin="0 0 0 0" HorizontalAlignment="Center" VerticalAlignment="Center"> - <TextBlock Margin="0 0 0 0" FontSize="14" HorizontalAlignment="Right"> - <Run Text="{Binding Length,Mode=OneWay}"></Run> - <Run FontSize="12" Text="m"></Run> - </TextBlock> - <materialDesign:PackIcon HorizontalAlignment="Center" RenderTransformOrigin="0.5,0.5" Kind="Triangle" Width="12" Height="12"> - <materialDesign:PackIcon.RenderTransform> - <RotateTransform Angle="180" /> - </materialDesign:PackIcon.RenderTransform> - </materialDesign:PackIcon> - </StackPanel> - - <Rectangle Height="30" Margin="0 10 0 0" VerticalAlignment="Center"> - <Rectangle.Fill> - <MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}"> - <Binding Path="."></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob.Length"></Binding> - </MultiBinding> - </Rectangle.Fill> - </Rectangle> - - <Canvas Height="30" HorizontalAlignment="Center" Width="80"> - <Label Padding="0" Margin="0"> - <Label.Style> - <Style TargetType="Label"> - <Setter Property="Content" Value="{x:Null}"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Started}" Value="True"> - <Setter Property="Content"> - <Setter.Value> - <TextBlock Text="{Binding RemainingTime,StringFormat=hh\\:mm\\:ss}" Foreground="#FF6464" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Margin="10" FontSize="20"></TextBlock> - </Setter.Value> - </Setter> - </DataTrigger> - <DataTrigger Binding="{Binding Completed}" Value="True"> - <Setter Property="Content"> - <Setter.Value> - <materialDesign:PackIcon Margin="30 10 0 0" HorizontalAlignment="Center" Width="24" Height="24" Kind="Check" Foreground="#47FF00" /> - </Setter.Value> - </Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </Label.Style> - </Label> - </Canvas> - </StackPanel> - - <Rectangle HorizontalAlignment="Right" Stroke="White" Margin="0 35 0 25"></Rectangle> - </Grid> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - - <StackPanel Margin="-40 -5 0 0" HorizontalAlignment="Left"> - <TextBlock FontSize="14"> - <Run Text="0"></Run> - <Run FontSize="13" Text="m"></Run> - </TextBlock> - <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="SubdirectoryArrowRight" Width="20" Height="20"> - - </materialDesign:PackIcon> - </StackPanel> - - <StackPanel Margin="0 -5 -40 0" HorizontalAlignment="Right"> - <TextBlock FontSize="14"> - <Run Text="{Binding RunningJob.Length,Mode=OneWay}"></Run> - <Run FontSize="13" Text="m"></Run> - </TextBlock> - <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="FlagCheckered" Width="20" Height="20"> - - </materialDesign:PackIcon> - </StackPanel> - - <Border BorderBrush="#404040" BorderThickness="1" VerticalAlignment="Center" Height="30" Margin="0 11 0 0"> - - </Border> - - <Canvas x:Name="jobProgressCanvas"> - <Grid Canvas.Top="0"> - <Canvas.Left> - <MultiBinding Converter="{StaticResource JobProgressToPositionConverter}"> - <Binding Path="RunningJob" /> - <Binding Path="RunningJobProgress" /> - <Binding ElementName="jobProgressCanvas" Path="ActualWidth" /> - </MultiBinding> - </Canvas.Left> - <materialDesign:PackIcon Kind="MapMarker" Foreground="#FF6464" Width="35" Height="35" Margin="-17 0 0 0" /> - <TextBlock Margin="-11 -23 0 0" FontSize="16" Foreground="#FF6464" VerticalAlignment="Top" Height="18" Text="{Binding RunningJobProgress,StringFormat=0.0}"></TextBlock> - </Grid> - </Canvas> - </Grid> - </Border> - </Grid> - </Grid> - </DockPanel> - </Border> - - <ProgressBar IsIndeterminate="True" VerticalAlignment="Bottom" Height="3" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityConverter}}"></ProgressBar> - </Grid> - - <Grid Background="#C1FFC7"> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="LayoutTransform"> - <Setter.Value> - <ScaleTransform ScaleX="1" ScaleY="0" /> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding IsJobCompleted}" Value="True"> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - - <Border BorderBrush="#404040" BorderThickness="0 1 0 1" Padding="5"> - <DockPanel> - <StackPanel Orientation="Horizontal" DockPanel.Dock="Left"> - <materialDesign:PackIcon Kind="Check" Width="32" Height="32" VerticalAlignment="Center" /> - <TextBlock VerticalAlignment="Center" FontSize="16" FontWeight="SemiBold" Margin="10 0 0 0" FontStyle="Italic">Job Completed Successfully</TextBlock> - </StackPanel> - - <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0"> - <Button Height="20" Padding="0" Command="{Binding CloseJobCompletionStatusCommand}" Style="{StaticResource MaterialDesignFlatButton}"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon Foreground="#202020" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" /> - </StackPanel> - </Button> - </StackPanel> - - <Grid> - - </Grid> - </DockPanel> - </Border> - </Grid> - - <Grid Background="#FF8888"> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="LayoutTransform"> - <Setter.Value> - <ScaleTransform ScaleX="1" ScaleY="0" /> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding IsJobFailed}" Value="True"> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - - <Border BorderBrush="#404040" BorderThickness="0 1 0 1" Padding="5"> - <DockPanel> - <StackPanel Orientation="Horizontal" DockPanel.Dock="Left"> - <materialDesign:PackIcon Kind="Alert" Width="32" Height="32" VerticalAlignment="Center" /> - <TextBlock VerticalAlignment="Center" FontSize="16" FontWeight="SemiBold" Margin="10 0 0 0" FontStyle="Italic">Job Failed To Complete</TextBlock> - </StackPanel> - - <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0"> - <!--<Button Height="40" Width="170" Command="{Binding ViewResultsCommand}" Background="#303030" BorderBrush="#202020"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="ChartLine" /> - <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">RESULTS</TextBlock> - </StackPanel> - </Button>--> - - <Button Padding="0" Height="20" Command="{Binding CloseJobCompletionStatusCommand}" Style="{StaticResource MaterialDesignFlatButton}"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon Foreground="#202020" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" /> - </StackPanel> - </Button> - </StackPanel> - - <Grid> - - </Grid> - </DockPanel> - </Border> - </Grid> - - <Grid Background="#FFE388"> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="LayoutTransform"> - <Setter.Value> - <ScaleTransform ScaleX="1" ScaleY="0" /> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding IsJobCanceled}" Value="True"> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - - <Border BorderBrush="#404040" BorderThickness="0 1 0 1" Padding="5"> - <DockPanel> - <StackPanel Orientation="Horizontal" DockPanel.Dock="Left"> - <materialDesign:PackIcon Kind="Alert" Width="32" Height="32" VerticalAlignment="Center" /> - <TextBlock VerticalAlignment="Center" FontSize="16" FontWeight="SemiBold" Margin="10 0 0 0" FontStyle="Italic">Job Aborted By User</TextBlock> - </StackPanel> - - <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0"> - <Button Padding="0" Height="20" Command="{Binding CloseJobCompletionStatusCommand}" Style="{StaticResource MaterialDesignFlatButton}"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon Foreground="#202020" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" /> - </StackPanel> - </Button> - </StackPanel> - - <Grid> - - </Grid> - </DockPanel> - </Border> - </Grid> - </StackPanel> - - <Grid Grid.Row="1"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="1*"/> - </Grid.ColumnDefinitions> - - <Grid Grid.Column="1"> - <Grid.RowDefinitions> - <RowDefinition Height="Auto"/> - <RowDefinition Height="1*"/> - </Grid.RowDefinitions> - - <Grid Background="{StaticResource SideBarBackground}" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="Height" Value="350"></Setter> - <Setter Property="LayoutTransform"> - <Setter.Value> - <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding IsSideBarOpened}" Value="True"> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.2"></DoubleAnimation> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.2"></DoubleAnimation> - </Storyboard> - </BeginStoryboard> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - - <ScrollViewer VerticalScrollBarVisibility="Auto"> - <StackPanel> - <Expander Header="PROCESS PARAMETERS" IsExpanded="True"> - <Grid> - <Grid Height="250"> - <StackPanel Orientation="Horizontal" Margin="25 0 0 0"> - - <Border Width="140" Margin="0 0 10 0" Padding="5" CornerRadius="5" BorderThickness="1" BorderBrush="Silver"> - <DockPanel> - <TextBlock DockPanel.Dock="Top" VerticalAlignment="Center" Padding="2">HISTORY</TextBlock> - <ListBox Margin="0 10 0 0" ItemsSource="{Binding GroupsHistory}" SelectedItem="{Binding SelectedGroupHistory}"> - <ListBox.ItemTemplate> - <DataTemplate> - <StackPanel> - <TextBlock Text="{Binding Name}" FontSize="11" FontWeight="Bold"> - <TextBlock.Style> - <Style TargetType="TextBlock"> - <Style.Triggers> - <DataTrigger Binding="{Binding Active}" Value="True"> - <Setter Property="Foreground" Value="#FF5F5F"></Setter> - <Setter Property="FontStyle" Value="Italic"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </TextBlock.Style> - </TextBlock> - <TextBlock Text="{Binding SaveDate}" FontStyle="Italic" Foreground="Gray" FontSize="10"></TextBlock> - </StackPanel> - </DataTemplate> - </ListBox.ItemTemplate> - </ListBox> - </DockPanel> - </Border> - <ListBox ScrollViewer.VerticalScrollBarVisibility="Disabled" Background="Transparent" BorderThickness="0" Style="{x:Null}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding RmlProcessParametersTableGroup.ProcessParametersTables}" SelectedItem="{Binding SelectedProcessParametersTable}" IsEnabled="{Binding RmlProcessParametersTableGroup.Active}"> - <ListBox.ItemContainerStyle> - <Style TargetType="ListBoxItem" BasedOn="{StaticResource basicListBoxItem}"> - - </Style> - </ListBox.ItemContainerStyle> - <ListBox.ItemsPanel> - <ItemsPanelTemplate> - <WrapPanel IsItemsHost="True"></WrapPanel> - </ItemsPanelTemplate> - </ListBox.ItemsPanel> - <ListBox.ItemTemplate> - <DataTemplate DataType="{x:Type observables:ProcessParametersTable}"> - <Border Padding="5" CornerRadius="5" BorderThickness="1" Height="245" Margin="0 0 10 0"> - <Border.Style> - <Style TargetType="Border" BasedOn="{StaticResource brushStopBorder}"> - <Setter Property="BorderBrush" Value="Silver"></Setter> - <Setter Property="Opacity" Value="0.5"></Setter> - <Setter Property="Background" Value="{StaticResource SideBarBackground}"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,FallbackValue=False}" Value="True"> - <Setter Property="BorderBrush" Value="{StaticResource AccentColorBrush}"></Setter> - <Setter Property="Background" Value="White"></Setter> - <Setter Property="Opacity" Value="1"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </Border.Style> - <Grid> - <DockPanel> - <TextBox materialDesign:HintAssist.Hint="Table Name" DockPanel.Dock="Top" Text="{Binding Name}"></TextBox> - <WrapPanel Orientation="Vertical" Margin="0 5 0 0"> - <WrapPanel.Resources> - <Style TargetType="TextBlock" BasedOn="{StaticResource {x:Type TextBlock}}"> - <Setter Property="FontSize" Value="10"></Setter> - <Setter Property="Foreground" Value="#7A7A7A"></Setter> - <Setter Property="Margin" Value="0 5 0 5"></Setter> - <Setter Property="MinWidth" Value="80"></Setter> - </Style> - - <Style TargetType="mahapps:NumericUpDown"> - <Setter Property="FontFamily" Value="{StaticResource digital-7}"></Setter> - </Style> - - <Style TargetType="ContentControl"> - <!--<Setter Property="FontFamily" Value="digital-7"></Setter>--> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="ContentControl"> - <Grid> - <Border> - <Border.Style> - <Style TargetType="Border"> - <Setter Property="BorderBrush" Value="Gainsboro"></Setter> - <Setter Property="BorderThickness" Value="1"></Setter> - <Setter Property="Padding" Value="2"></Setter> - <Setter Property="Margin" Value="5"></Setter> - <Setter Property="CornerRadius" Value="3"></Setter> - </Style> - </Border.Style> - <ContentPresenter Content="{TemplateBinding Content}"></ContentPresenter> - </Border> - - <materialDesign:PackIcon HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0 0 0 0" Width="12" Height="12" Kind="Settings"></materialDesign:PackIcon> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - - - </WrapPanel.Resources> - <editors:ParameterizedEditor ParameterizedObject="{Binding}"> - <editors:ParameterizedEditor.ItemsPanel> - <ItemsPanelTemplate> - <WrapPanel IsItemsHost="True" Orientation="Vertical" /> - </ItemsPanelTemplate> - </editors:ParameterizedEditor.ItemsPanel> - <editors:ParameterizedEditor.DoubleTemplate> - <DataTemplate> - <ContentControl> - <StackPanel> - <TextBlock Text="{Binding Name}" FontSize="10"></TextBlock> - <mahapps:NumericUpDown Minimum="0" Maximum="10000" StringFormat="0.0" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding Value,Mode=TwoWay}"></mahapps:NumericUpDown> - </StackPanel> - </ContentControl> - </DataTemplate> - </editors:ParameterizedEditor.DoubleTemplate> - </editors:ParameterizedEditor> - </WrapPanel> - </DockPanel> - - <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="5" Visibility="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,Converter={StaticResource BooleanToVisibilityConverter}}"> - <TextBlock Text="Active" FontWeight="Bold" FontStyle="Italic" FontSize="13" VerticalAlignment="Center"></TextBlock> - <materialDesign:PackIcon Foreground="#90E990" Kind="CheckboxBlankCircle" VerticalAlignment="Center" Margin="5 0 0 0"> - <materialDesign:PackIcon.Style> - <Style TargetType="materialDesign:PackIcon"> - <Setter Property="Opacity" Value="0"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,FallbackValue=False}" Value="True"> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Duration="00:00:01" RepeatBehavior="Forever"> - <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" /> - <DiscreteDoubleKeyFrame KeyTime="00:00:0.5" Value="0" /> - </DoubleAnimationUsingKeyFrames> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Duration="00:00:01"> - <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="0" /> - </DoubleAnimationUsingKeyFrames> - </Storyboard> - </BeginStoryboard> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </materialDesign:PackIcon.Style> - </materialDesign:PackIcon> - </StackPanel> - </Grid> - </Border> - </DataTemplate> - </ListBox.ItemTemplate> - </ListBox> - - <StackPanel Margin="5 0 0 10" VerticalAlignment="Bottom"> - <Button Command="{Binding PushProcessParametersCommand}" HorizontalAlignment="Left" Style="{StaticResource MaterialDesignFlatButton}"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon VerticalAlignment="Center" Kind="ArrowRightBold"></materialDesign:PackIcon> - <TextBlock Margin="10 0 0 0">PUSH PARAMETERS</TextBlock> - </StackPanel> - </Button> - <Button Margin="0 5 0 0" Command="{Binding SaveProcessParametersCommand}" HorizontalAlignment="Left" Style="{StaticResource MaterialDesignFlatButton}"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon VerticalAlignment="Center" Kind="ContentSave"></materialDesign:PackIcon> - <TextBlock Margin="10 0 0 0">SAVE PARAMETERS</TextBlock> - </StackPanel> - </Button> - </StackPanel> - </StackPanel> - </Grid> - - <Grid Background="White"> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="Visibility" Value="Visible"></Setter> - <Style.Triggers> - <MultiDataTrigger> - <MultiDataTrigger.Conditions> - <Condition Binding="{Binding SelectedMachine,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"></Condition> - <Condition Binding="{Binding SelectedRML,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"></Condition> - </MultiDataTrigger.Conditions> - <Setter Property="Visibility" Value="Collapsed"></Setter> - </MultiDataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - <TextBlock Foreground="#FA9292" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24">SELECT MACHINE & MEDIA</TextBlock> - </Grid> - </Grid> - </Expander> - <Expander Header="CONTROL PARAMETERS" IsExpanded="False"> - - </Expander> - </StackPanel> - </ScrollViewer> - - <Rectangle VerticalAlignment="Bottom" Stroke="#CECECE" StrokeThickness="1"></Rectangle> - </Grid> - - - <!--Main Grid--> - <Grid Grid.Row="1"> - <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="234*"/> - <RowDefinition x:Name="graphRowDefinition" Height="80"/> - </Grid.RowDefinitions> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="350"/> - <ColumnDefinition Width="1*"/> - </Grid.ColumnDefinitions> - - <Grid Grid.ColumnSpan="3"> - <Grid.Background> - <ImageBrush Opacity="0.4" ImageSource="../Images/White-Background.jpg" Stretch="Fill"></ImageBrush> - </Grid.Background> - </Grid> - - - <Grid> - <Rectangle HorizontalAlignment="Right" StrokeThickness="1" Width="3" Margin="0 40 0 40"> - <Rectangle.Fill> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Offset="0" Color="Transparent" /> - <GradientStop Offset="0.5" Color="Black" /> - <GradientStop Offset="1.1" Color="Transparent" /> - </LinearGradientBrush> - </Rectangle.Fill> - <Rectangle.Stroke> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Offset="0" Color="Transparent" /> - <GradientStop Offset="0.5" Color="White" /> - <GradientStop Offset="1" Color="Transparent" /> - </LinearGradientBrush> - </Rectangle.Stroke> - </Rectangle> - <DockPanel Margin="10"> - <StackPanel DockPanel.Dock="Top" > - <StackPanel Orientation="Horizontal"> - <Image Source="../Images/machine-trans.png" RenderOptions.BitmapScalingMode="Fant" Width="70"></Image> - <TextBlock VerticalAlignment="Center" FontWeight="SemiBold" Margin="10 0 0 0" FontSize="30">MACHINE JOBS</TextBlock> - </StackPanel> - - - </StackPanel> - <Border DockPanel.Dock="Bottom" CornerRadius="5" BorderThickness="1" BorderBrush="Gainsboro" Background="#7BFFFFFF"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> - <Button Command="{Binding RemoveJobCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Remove Job"> - <materialDesign:PackIcon Kind="MinusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon> - </Button> - <Button Command="{Binding AddJobCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Add Job"> - <materialDesign:PackIcon Kind="PlusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon> - </Button> - </StackPanel> - </Border> - <ListBox ItemsSource="{Binding SelectedMachine.Jobs}" SelectedItem="{Binding SelectedJob}" Margin="0 10 0 0" HorizontalContentAlignment="Stretch"> - <ListBox.ItemTemplate> - <DataTemplate> - <DockPanel> - <StackPanel Orientation="Horizontal" DockPanel.Dock="Left"> - <Image Source="../Images/rgb.png" Width="32"></Image> - - <StackPanel VerticalAlignment="Center" Margin="10 0 0 0"> - <TextBlock FontWeight="Bold" Text="{Binding Name}"></TextBlock> - <TextBlock Foreground="Gray" FontStyle="Italic" FontSize="10" Text="{Binding CreationDate}"></TextBlock> - </StackPanel> - </StackPanel> - - <ItemsControl HorizontalAlignment="Right" ItemsSource="{Binding Segments}"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> - - </StackPanel> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> - <Border Width="25" Height="25" Margin="10 0 0 0" BorderThickness="1" BorderBrush="DimGray" CornerRadius="3"> - <Border.Background> - <MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}"> - <Binding Path="."></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob.Length"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedBrushStop.Color"></Binding> - </MultiBinding> - </Border.Background> - </Border> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - </DockPanel> - </DataTemplate> - </ListBox.ItemTemplate> - </ListBox> - </DockPanel> - </Grid> - - <Grid Grid.Column="1" Margin="10 10 10 0"> - <Grid.ColumnDefinitions> - <ColumnDefinition/> - <ColumnDefinition Width="Auto"/> - </Grid.ColumnDefinitions> - <Grid> - <Grid.IsEnabled> - <MultiBinding Converter="{StaticResource ObjectsNotEqualToBooleanConveter}"> - <Binding Path="SelectedJob" /> - <Binding Path="RunningJob" /> - </MultiBinding> - </Grid.IsEnabled> - <Grid.RowDefinitions> - <RowDefinition Height="Auto"/> - <RowDefinition Height="1*"/> - </Grid.RowDefinitions> - <StackPanel> - <Grid> - <StackPanel Orientation="Horizontal" Margin="0 5 0 0"> - <Image Source="../Images/rgb.png" Width="24"></Image> - <TextBlock Margin="5 0 0 0" Text="{Binding SelectedJob.Name,FallbackValue='UNSET'}" FontSize="16" FontWeight="SemiBold" VerticalAlignment="Center"></TextBlock> - </StackPanel> - - <StackPanel Orientation="Horizontal" Margin="0 5 0 0" HorizontalAlignment="Right"> - <TextBlock Margin="0 0 5 0" Text="{Binding SelectedJob.CreationDate,FallbackValue='UNSET'}" FontSize="12" Foreground="Gray" FontStyle="Italic" VerticalAlignment="Center"></TextBlock> - <Image Source="../Images/calendar.png" Width="16"></Image> - </StackPanel> - </Grid> - - <StackPanel Orientation="Horizontal" Margin="0 20 0 0" MaxWidth="940" HorizontalAlignment="Left"> - <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 SelectedJob.Name,UpdateSourceTrigger=PropertyChanged}"></TextBox> - </StackPanel> - </Border> - - <Border Style="{StaticResource JobFieldBorder}"> - <StackPanel Margin="10 5 5 5" Width="140"> - <StackPanel Orientation="Horizontal"> - <Image Source="../Images/wind.png" Width="32"></Image> - <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Winding Method</TextBlock> - </StackPanel> - <ComboBox ItemsSource="{Binding Adapter.WindingMethods}" SelectedItem="{Binding SelectedJob.WindingMethod}" DisplayMemberPath="Name" ></ComboBox> - </StackPanel> - </Border> - - <Border Style="{StaticResource JobFieldBorder}"> - <StackPanel Margin="20 5 5 5" Width="140"> - <StackPanel Orientation="Horizontal"> - <Image Source="../Images/inter-segment.png" Width="32"></Image> - <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Inter Segment</TextBlock> - </StackPanel> - <DockPanel LastChildFill="True"> - <ToggleButton Margin="10 0 0 0" DockPanel.Dock="Right" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsChecked="{Binding SelectedJob.EnableInterSegment}"></ToggleButton> - <mahapps:NumericUpDown StringFormat="{}{0:N1} m" FontFamily="{StaticResource digital-7}" IsEnabled="{Binding SelectedJob.EnableInterSegment}" Margin="0 2 0 0" HideUpDownButtons="True" Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedJob.InterSegmentLength,Mode=TwoWay}"></mahapps:NumericUpDown> - </DockPanel> - </StackPanel> - </Border> - - <Border Style="{StaticResource JobFieldBorder}"> - <StackPanel Margin="20 5 5 5" Width="140"> - <StackPanel Orientation="Horizontal"> - <Image Source="../Images/lubrication.png" Width="32"></Image> - <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Lubrication</TextBlock> - </StackPanel> - <DockPanel LastChildFill="True" Margin="0 10 0 0"> - <ToggleButton DockPanel.Dock="Right" VerticalAlignment="Center" HorizontalAlignment="Center" IsChecked="{Binding SelectedJob.EnableLubrication}"></ToggleButton> - </DockPanel> - </StackPanel> - </Border> - - <Border Style="{StaticResource JobFieldBorder}" Height="90"> - <StackPanel Width="200"> - <StackPanel Orientation="Horizontal" Margin="10 0 0 0"> - <Image Source="../Images/description.png" Width="32"></Image> - <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Description</TextBlock> - </StackPanel> - - <Border BorderThickness="0" BorderBrush="Silver" CornerRadius="5" Margin="0 0 5 5"> - <TextBox Padding="5 0 0 0" FontStyle="Italic" Background="Transparent" Style="{x:Null}" BorderThickness="0" Margin="5" Height="40" Text="{Binding SelectedJob.Description}" VerticalAlignment="Stretch" materialDesign:HintAssist.Hint="Enter description" AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"></TextBox> - </Border> - </StackPanel> - </Border> - </StackPanel> - - - </StackPanel> - - <Grid HorizontalAlignment="Right"> - <Button Height="40" Width="170" Margin="0 40 40 5" Style="{StaticResource MaterialDesignFlatButton}" VerticalAlignment="Bottom" BorderBrush="Transparent" Command="{Binding SaveJobsCommand}"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="ContentSave" /> - <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">SAVE JOB</TextBlock> - </StackPanel> - </Button> - </Grid> - - <Grid Grid.Row="1" Margin="0 20 0 0"> - <Grid.RowDefinitions> - <RowDefinition Height="1*" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - <Grid> - <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> - - <Border DockPanel.Dock="Bottom" CornerRadius="5" BorderThickness="1" BorderBrush="Gainsboro" Background="#7BFFFFFF"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> - <Button Command="{Binding RemoveSegmentCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Remove Segment"> - <materialDesign:PackIcon Kind="MinusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon> - </Button> - <Button Command="{Binding AddSegmentCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Add Segment"> - <materialDesign:PackIcon Kind="PlusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon> - </Button> - </StackPanel> - </Border> - - <ListBox SelectionChanged="ListBox_SelectionChanged" ItemsSource="{Binding SelectedJob.Segments}" SelectedItem="{Binding SelectedSegment}" HorizontalContentAlignment="Stretch"> - <ListBox.ItemTemplate> - <DataTemplate> - <DockPanel> - <StackPanel Orientation="Horizontal" Margin="0 5 0 0" DockPanel.Dock="Left"> - <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> - - <ItemsControl ItemsSource="{Binding BrushStops}" HorizontalAlignment="Right" Margin="0 5 0 0"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel Orientation="Horizontal" VerticalAlignment="Center"></StackPanel> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> - <Ellipse Width="8" Height="8" Stroke="DimGray" Margin="5 0 0 0"> - <Ellipse.Fill> - <SolidColorBrush Color="{Binding Color}" /> - </Ellipse.Fill> - </Ellipse> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - </DockPanel> - </DataTemplate> - </ListBox.ItemTemplate> - </ListBox> - </DockPanel> - - <Rectangle HorizontalAlignment="Right" StrokeThickness="1" Width="3" Margin="0 40 0 40"> - <Rectangle.Fill> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Offset="0" Color="Transparent" /> - <GradientStop Offset="0.5" Color="Black" /> - <GradientStop Offset="1.1" Color="Transparent" /> - </LinearGradientBrush> - </Rectangle.Fill> - <Rectangle.Stroke> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Offset="0" Color="Transparent" /> - <GradientStop Offset="0.5" Color="White" /> - <GradientStop Offset="1" Color="Transparent" /> - </LinearGradientBrush> - </Rectangle.Stroke> - </Rectangle> - - <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> - <Grid DockPanel.Dock="Top"> - <Grid> - <StackPanel 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 FontFamily="{StaticResource digital-7}" StringFormat="{}{0:N1} m" 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 HorizontalAlignment="Right"> - <StackPanel Orientation="Horizontal"> - - </StackPanel> - </Grid> - </Grid> - </Grid> - - <Border DockPanel.Dock="Bottom" CornerRadius="5" BorderThickness="1" BorderBrush="Gainsboro" Background="#7BFFFFFF"> - <StackPanel Orientation="Horizontal" DockPanel.Dock="Bottom" HorizontalAlignment="Right"> - <Button Command="{Binding RemoveBrushStopCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Remove Color"> - <materialDesign:PackIcon Kind="MinusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon> - </Button> - <Button Command="{Binding AddBrushStopCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Add Color"> - <materialDesign:PackIcon Kind="PlusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon> - </Button> - </StackPanel> - </Border> - - <Grid Margin="0 20 0 0"> - <DockPanel> - <Grid DockPanel.Dock="Top"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image Source="../Images/color-palette.png" Width="42"></Image> - <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="DimGray" FontSize="16" FontWeight="SemiBold">SEGMENT BRUSH</TextBlock> - </StackPanel> - - <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Center" Height="8" Margin="200 0 80 0" StrokeThickness="1" Stroke="Gainsboro"> - <Rectangle.Fill> - <LinearGradientBrush StartPoint="0,0" EndPoint="1,0" x:Name="gradientBrush"></LinearGradientBrush> - </Rectangle.Fill> - </Rectangle> - </Grid> - <Grid Margin="0 10 0 0"> - <ListBox Style="{x:Null}" Background="Transparent" ScrollViewer.CanContentScroll="False" BorderThickness="0" ItemsSource="{Binding SelectedSegment.BrushStops}" SelectedItem="{Binding SelectedBrushStop}" HorizontalContentAlignment="Stretch"> - <ListBox.ItemContainerStyle> - <Style TargetType="ListBoxItem" BasedOn="{StaticResource basicListBoxItem}"> - - </Style> - </ListBox.ItemContainerStyle> - <ItemsControl.ItemTemplate> - <DataTemplate DataType="{x:Type observables:BrushStop}"> - - <StackPanel Margin="0 0 0 5"> - <Border BorderThickness="1" CornerRadius="5" Padding="10" dragAndDrop:DragAndDropService.Drop="OnBrushStopBorderDrop"> - <Border.Style> - <Style TargetType="Border" BasedOn="{StaticResource brushStopBorder}"> - <Setter Property="BorderBrush" Value="#B5B5B5"></Setter> - <Setter Property="Background" Value="#70FFFFFF"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,FallbackValue=False}" Value="True"> - <Setter Property="BorderBrush" Value="Gainsboro"></Setter> - <Setter Property="Background" Value="{StaticResource SideBarBackground}"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </Border.Style> - <Grid> - <DockPanel> - <ContentControl DockPanel.Dock="Left"> - <ContentControl.Style> - <Style TargetType="ContentControl"> - <Setter Property="Content"> - <Setter.Value> - <Rectangle/> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding ColorSpace.Name}" Value="Volume"> - <Setter Property="Content"> - <Setter.Value> - <StackPanel VerticalAlignment="Center"> - <ItemsControl ItemsSource="{Binding LiquidVolumes}" VerticalAlignment="Center"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> - <ContentControl Style="{StaticResource numberBorder}" Width="50" Height="50" Margin="10 0 0 0"> - <ContentControl.Foreground> - <SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> - </ContentControl.Foreground> - <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> - <mahapps:NumericUpDown.Resources> - <Style TargetType="TextBox"/> - </mahapps:NumericUpDown.Resources> - </mahapps:NumericUpDown> - </ContentControl> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - </StackPanel> - </Setter.Value> - </Setter> - </DataTrigger> - <DataTrigger Binding="{Binding ColorSpace.Name}" Value="RGB"> - <Setter Property="Content"> - <Setter.Value> - <StackPanel Orientation="Horizontal"> - <ContentControl Style="{StaticResource numberBorder}" Foreground="#FF6F6F" Width="50" Height="50" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Red, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center"> - <mahapps:NumericUpDown.Resources> - <Style TargetType="TextBox"/> - </mahapps:NumericUpDown.Resources> - </mahapps:NumericUpDown> - </ContentControl> - - <ContentControl Style="{StaticResource numberBorder}" Foreground="#92FF92" Width="50" Height="50" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Green, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center"> - <mahapps:NumericUpDown.Resources> - <Style TargetType="TextBox"/> - </mahapps:NumericUpDown.Resources> - </mahapps:NumericUpDown> - </ContentControl> - - <ContentControl Style="{StaticResource numberBorder}" Foreground="#3C7EF4" BorderThickness="1" Width="50" Height="50" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Blue, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center"> - <mahapps:NumericUpDown.Resources> - <Style TargetType="TextBox"/> - </mahapps:NumericUpDown.Resources> - </mahapps:NumericUpDown> - </ContentControl> - - <ContentControl Style="{StaticResource colorPicker}"></ContentControl> - </StackPanel> - </Setter.Value> - </Setter> - </DataTrigger> - <DataTrigger Binding="{Binding ColorSpace.Name}" Value="CMYK"> - <Setter Property="Content"> - <Setter.Value> - <StackPanel Orientation="Horizontal"> - <ContentControl Style="{StaticResource numberBorder}" Foreground="Cyan" Width="50" Height="50" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Cyan,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> - <mahapps:NumericUpDown.Resources> - <Style TargetType="TextBox"/> - </mahapps:NumericUpDown.Resources> - </mahapps:NumericUpDown> - </ContentControl> - - <ContentControl Style="{StaticResource numberBorder}" Foreground="Magenta" Width="50" Height="50" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Magenta,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> - <mahapps:NumericUpDown.Resources> - <Style TargetType="TextBox"/> - </mahapps:NumericUpDown.Resources> - </mahapps:NumericUpDown> - </ContentControl> - - <ContentControl Style="{StaticResource numberBorder}" Foreground="Yellow" Width="50" Height="50" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Yellow,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> - <mahapps:NumericUpDown.Resources> - <Style TargetType="TextBox"/> - </mahapps:NumericUpDown.Resources> - </mahapps:NumericUpDown> - </ContentControl> - - <ContentControl Style="{StaticResource numberBorder}" Foreground="Black" Width="50" Height="50" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Black,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> - <mahapps:NumericUpDown.Resources> - <Style TargetType="TextBox"/> - </mahapps:NumericUpDown.Resources> - </mahapps:NumericUpDown> - </ContentControl> - - <Rectangle Margin="30 0 0 0" Width="50" Height="50" StrokeThickness="1" Stroke="Gray"> - <Rectangle.Fill> - <SolidColorBrush Color="{Binding Color}"> - </SolidColorBrush> - </Rectangle.Fill> - </Rectangle> - </StackPanel> - </Setter.Value> - </Setter> - </DataTrigger> - <DataTrigger Binding="{Binding ColorSpace.Name}" Value="LAB"> - <Setter Property="Content"> - <Setter.Value> - <StackPanel Orientation="Horizontal"> - <ContentControl Style="{StaticResource numberBorder}" Foreground="Gray" Width="50" Height="50" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding L, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> - <mahapps:NumericUpDown.Resources> - <Style TargetType="TextBox"/> - </mahapps:NumericUpDown.Resources> - </mahapps:NumericUpDown> - </ContentControl> - - <ContentControl Style="{StaticResource numberBorder}" Foreground="#FF8A8A" Width="50" Height="50" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding A, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-128" Maximum="128" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> - <mahapps:NumericUpDown.Resources> - <Style TargetType="TextBox"/> - </mahapps:NumericUpDown.Resources> - </mahapps:NumericUpDown> - </ContentControl> - - <ContentControl Style="{StaticResource numberBorder}" Foreground="#92FF92" Width="50" Height="50" Margin="10 0 0 0"> - <mahapps:NumericUpDown FontSize="14" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding B, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-128" Maximum="128" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> - <mahapps:NumericUpDown.Resources> - <Style TargetType="TextBox"/> - </mahapps:NumericUpDown.Resources> - </mahapps:NumericUpDown> - </ContentControl> - - <Rectangle Margin="30 0 0 0" Width="50" Height="50" StrokeThickness="1" Stroke="Gray"> - <Rectangle.Fill> - <SolidColorBrush Color="{Binding Color}"> - </SolidColorBrush> - </Rectangle.Fill> - </Rectangle> - </StackPanel> - </Setter.Value> - </Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </ContentControl.Style> - </ContentControl> - - <Grid DockPanel.Dock="Right"> - <Border Style="{StaticResource JobFieldBorder}"> - <StackPanel Margin="5" Width="140"> - <StackPanel Orientation="Horizontal"> - <Image Source="../Images/colorspace.png" Width="24"></Image> - <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Color Space</TextBlock> - </StackPanel> - <ComboBox Background="#FCFCFC" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Adapter.ColorSpaces}" SelectedItem="{Binding ColorSpace}" DisplayMemberPath="Name"></ComboBox> - </StackPanel> - </Border> - </Grid> - <Grid> - <StackPanel VerticalAlignment="Center"> - <StackPanel.Style> - <Style TargetType="StackPanel"> - <Setter Property="Visibility" Value="Hidden"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedSegment.BrushStops.Count,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=1}" Value="True"> - <Setter Property="Visibility" Value="Visible"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </StackPanel.Style> - <TextBlock Width="150" TextAlignment="Center" HorizontalAlignment="Center"> - <Run FontWeight="Bold" FontStyle="Italic" Text="OFFSET:"></Run> - <Run FontFamily="{StaticResource digital-7}" Text="{Binding OffsetPercent,StringFormat={}{0:F1}%}"></Run> - <Run Foreground="Gray" FontSize="9" Text="{Binding OffsetMeters,Mode=OneWay,StringFormat={} ( {0:F1}m )}"></Run> - </TextBlock> - <Slider ValueChanged="Offset_Slider_ValueChanged" SmallChange="0.1" IsSnapToTickEnabled="True" TickFrequency="0.1" Margin="0 5 0 0" HorizontalAlignment="Center" Width="150" Value="{Binding OffsetPercent}" IsEnabled="{Binding IsMiddle}"> - <Slider.Minimum> - <MultiBinding Converter="{StaticResource BrushStopToOffsetLimitConverter}" ConverterParameter="min"> - <Binding Path="."></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl,Mode=FindAncestor}" Path="DataContext.SelectedSegment"></Binding> - <Binding Path="StopIndex"></Binding> - </MultiBinding> - </Slider.Minimum> - <Slider.Maximum> - <MultiBinding Converter="{StaticResource BrushStopToOffsetLimitConverter}" ConverterParameter="max"> - <Binding Path="." Delay="500"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl,Mode=FindAncestor}" Path="DataContext.SelectedSegment"></Binding> - <Binding Path="StopIndex"></Binding> - </MultiBinding> - </Slider.Maximum> - </Slider> - </StackPanel> - </Grid> - </DockPanel> - </Grid> - </Border> - - <StackPanel> - <Grid VerticalAlignment="Top"> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="LayoutTransform"> - <Setter.Value> - <ScaleTransform ScaleX="1" ScaleY="0" /> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding ElementName=toggleExpand, Path=IsChecked}" Value="True"> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.2" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.2" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - <Grid> - <DataGrid ItemsSource="{Binding LiquidVolumes}" AutoGenerateColumns="False" Background="Transparent" SelectionUnit="FullRow"> - <DataGrid.CellStyle> - <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> - <Setter Property="BorderThickness" Value="0"/> - <Setter Property="FocusVisualStyle" Value="{x:Null}"/> - </Style> - </DataGrid.CellStyle> - <DataGrid.Columns> - <DataGridTemplateColumn Header="IDS PACK"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <Grid x:Name="t0"> - <Polygon x:Name="t1" Points="0,0 15,0 0,15 0,0" Margin="-15 -11 0 0"> - <Polygon.Fill> - <SolidColorBrush x:Name="t2" Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter},FallbackValue={StaticResource dummyColor}}" /> - </Polygon.Fill> - </Polygon> - <TextBlock FontWeight="SemiBold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding IdsPack.LiquidType.Name}"></TextBlock> - </Grid> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTemplateColumn Header="D/F"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <TextBlock VerticalAlignment="Center"> - <Run Text="{Binding IdsPack.DispenserType.NlPerPulse,StringFormat='0.0'}"></Run> - <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run> - </TextBlock> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTemplateColumn Header="STEP"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <ComboBox ItemsSource="{Binding Source={StaticResource dispenserDivisions}}" SelectedItem="{Binding DispenserStepDivision,UpdateSourceTrigger=PropertyChanged}"> - <ComboBox.ItemContainerStyle> - <Style TargetType="ComboBoxItem" BasedOn="{StaticResource {x:Type ComboBoxItem}}"> - <Setter Property="Background" Value="#ECECEC"></Setter> - </Style> - </ComboBox.ItemContainerStyle> - <ComboBox.ItemTemplate> - <DataTemplate> - <TextBlock Text="{Binding Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock> - </DataTemplate> - </ComboBox.ItemTemplate> - </ComboBox> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTemplateColumn Header="MAX NL / CM"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <TextBlock VerticalAlignment="Center"> - <Run Text="{Binding LiquidMaxNanoliterPerCentimeter,Mode=OneWay,StringFormat='0.0'}"></Run> - <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run> - </TextBlock> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTemplateColumn Header="VOLUME"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <TextBlock VerticalAlignment="Center"> - <Run Text="{Binding Volume,StringFormat='0.0'}"></Run> - <Run Text="%" Foreground="Gray"></Run> - </TextBlock> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTemplateColumn Header="FORMULA"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <TextBlock VerticalAlignment="Center"> - <Run Text="{Binding IdsPack.IdsPackFormula.Name}"></Run> - </TextBlock> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTemplateColumn Header="NL / CM"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <TextBlock VerticalAlignment="Center"> - <Run Text="{Binding NanoliterPerCentimeter,Mode=OneWay,StringFormat='0.0'}"></Run> - <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run> - </TextBlock> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTemplateColumn Header="NL / SEC"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <TextBlock VerticalAlignment="Center"> - <Run Text="{Binding NanoliterPerSecond,Mode=OneWay,StringFormat='0.0'}"></Run> - <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run> - </TextBlock> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTemplateColumn Header="PULSE / SEC"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <Label VerticalAlignment="Center"> - <Label.Style> - <Style TargetType="Label"> - <Setter Property="Content"> - <Setter.Value> - <TextBlock> - <Run Text="{Binding PulsePerSecond,Mode=OneWay,StringFormat='0.0'}"></Run> - <Run Text="(pulse)" FontSize="9" Foreground="Gray"></Run> - </TextBlock> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding DispenserStepDivision}" Value="{x:Static dispensing:DispenserStepDivisions.Auto}"> - <Setter Property="Content" Value="Auto"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </Label.Style> - </Label> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - </DataGrid.Columns> - </DataGrid> - </Grid> - </Grid> - <ToggleButton Margin="5" x:Name="toggleExpand" Style="{StaticResource MaterialDesignFlatToggleButton}" ToolTip="View more" HorizontalAlignment="Right" Padding="0" Width="24" Height="24" VerticalContentAlignment="Center"> - <materialDesign:PackIcon VerticalAlignment="Center"> - <materialDesign:PackIcon.Style> - <Style TargetType="materialDesign:PackIcon"> - <Setter Property="Kind" Value="ArrowDown"></Setter> - <Setter Property="Margin" Value="0"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton},Path=IsChecked}" Value="True"> - <Setter Property="Kind" Value="ArrowUp"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </materialDesign:PackIcon.Style> - </materialDesign:PackIcon> - </ToggleButton> - </StackPanel> - </StackPanel> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ListBox> - </Grid> - </DockPanel> - </Grid> - </DockPanel> - </Grid> - </DockPanel> - </Grid> - </Grid> - - <Grid Height="60" Grid.Row="1"> - <DockPanel> - <Grid DockPanel.Dock="Left"> - <StackPanel HorizontalAlignment="Left" Margin="0 0 0 0"> - <TextBlock FontSize="14" Margin="0 20 0 0"> - <Run FontWeight="Bold">ESTIMATED DURATION:</Run> - <Run FontSize="18" FontStyle="Italic" FontFamily="{StaticResource digital-7}" Text="{Binding EstimatedDuration,StringFormat=hh\\:mm\\:ss,TargetNullValue='00:00:00'}"></Run> - </TextBlock> - </StackPanel> - </Grid> - - <Grid DockPanel.Dock="Right"> - <StackPanel Orientation="Horizontal"> - <Button Height="40" Width="170" Command="{Binding StartJobCommand}" Click="OnJobStartClick"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="ClockFast" /> - <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">START</TextBlock> - </StackPanel> - </Button> - </StackPanel> - </Grid> - - <Grid Margin="0 -18 0 0"> - <Border VerticalAlignment="Center" Height="35" Margin="30 0 40 0" ClipToBounds="False"> - <Grid ClipToBounds="False"> - <ItemsControl x:Name="jobBrushList" ClipToBounds="False"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> - <Grid> - <Grid.Width> - <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}"> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob.Length"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding> - <Binding Path="Length"></Binding> - </MultiBinding> - </Grid.Width> - <Rectangle VerticalAlignment="Bottom" Height="10"> - <Rectangle.Fill> - <MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}"> - <Binding Path="."></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob.Length"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedBrushStop.Color"></Binding> - </MultiBinding> - </Rectangle.Fill> - </Rectangle> - - <StackPanel Margin="0 0 0 0" HorizontalAlignment="Center"> - <TextBlock FontSize="9" HorizontalAlignment="Right"> - <Run Text="{Binding Length,Mode=OneWay}"></Run> - <Run Foreground="Gray" FontSize="8" Text="m"></Run> - </TextBlock> - <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="Triangle" Width="8" Height="8" Foreground="DimGray"> - <materialDesign:PackIcon.RenderTransform> - <RotateTransform Angle="180" /> - </materialDesign:PackIcon.RenderTransform> - </materialDesign:PackIcon> - </StackPanel> - </Grid> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - - <StackPanel Margin="-20 -5 0 0" HorizontalAlignment="Left"> - <TextBlock FontSize="9"> - <Run Text="0"></Run> - <Run Foreground="Gray" FontSize="8" Text="m"></Run> - </TextBlock> - <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="SubdirectoryArrowRight" Width="16" Height="16" Foreground="DimGray"> - - </materialDesign:PackIcon> - </StackPanel> - - <StackPanel Margin="0 -5 -20 0" HorizontalAlignment="Right"> - <TextBlock FontSize="9"> - <Run Text="{Binding SelectedJob.Length,Mode=OneWay}"></Run> - <Run Foreground="Gray" FontSize="8" Text="m"></Run> - </TextBlock> - <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="FlagCheckered" Width="16" Height="16" Foreground="DimGray"> - - </materialDesign:PackIcon> - </StackPanel> - - <Border BorderBrush="Gainsboro" BorderThickness="1" VerticalAlignment="Bottom" Height="10"> - - </Border> - </Grid> - </Border> - </Grid> - </DockPanel> - </Grid> - </Grid> - </Grid> - - <Grid Grid.Column="1" Margin="10 0 0 0" Width="340"> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="LayoutTransform"> - <Setter.Value> - <ScaleTransform ScaleY="1" ScaleX="1"></ScaleTransform> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding IsSideBarOpened}" Value="True"> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleX" To="0" Duration="00:00:0.2"></DoubleAnimation> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleX" To="1" Duration="00:00:0.2"></DoubleAnimation> - </Storyboard> - </BeginStoryboard> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - - <Grid Margin="5 0 0 0"> - <DockPanel x:Name="dockCameras"> - <StackPanel Orientation="Horizontal" DockPanel.Dock="Top"> - <Image Source="../Images/camera.png" Width="42"></Image> - <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="DimGray" FontSize="16" FontWeight="SemiBold">USB CAMERAS</TextBlock> - </StackPanel> - - - <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalAlignment="Top" VerticalScrollBarVisibility="Auto" Margin="0 0 0 10"> - <ItemsControl x:Name="listCameras" ItemsSource="{Binding VideoCaptureProvider.AvailableCaptureDevices}" Height="790" Width="320"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <UniformGrid Rows="3" /> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - - <ItemsControl.ItemTemplate> - <DataTemplate DataType="{x:Type video:CaptureDevice}"> - <Border RenderOptions.BitmapScalingMode="Fant"> - <Border.Background> - <ImageBrush ImageSource="../Images/video-frame.png" Stretch="Fill"></ImageBrush> - </Border.Background> - - <Grid> - <Border Margin="22 24 23 42"> - <Grid> - <Border IsHitTestVisible="False" VerticalAlignment="Center" Padding="10" HorizontalAlignment="Center" Background="#20808080" CornerRadius="5"> - <TextBlock FontSize="11" Text="{Binding Device.Name,Converter={StaticResource StringEllipsisConverter},ConverterParameter=30,FallbackValue='No Camera',TargetNullValue='No Camera'}"></TextBlock> - </Border> - - <Image Source="{Binding VideoSource,Mode=OneWay,IsAsync=True}" Stretch="Fill" Visibility="{Binding IsStarted,Converter={StaticResource BooleanToVisibilityConverter}}"></Image> - - <Grid Background="#83000000" Cursor="Hand"> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="Opacity" Value="0"></Setter> - <Style.Triggers> - <EventTrigger RoutedEvent="MouseEnter"> - <EventTrigger.Actions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:0.2"></DoubleAnimation> - </Storyboard> - </BeginStoryboard> - </EventTrigger.Actions> - </EventTrigger> - <EventTrigger RoutedEvent="MouseLeave"> - <EventTrigger.Actions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="Opacity" To="0" Duration="00:00:0.2"></DoubleAnimation> - </Storyboard> - </BeginStoryboard> - </EventTrigger.Actions> - </EventTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - - <Button Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ToggleCameraCommand}" CommandParameter="{Binding}" Style="{StaticResource MaterialDesignFloatingActionMiniButton}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Width="60" Height="60" Padding="0"> - <materialDesign:PackIcon Width="40" Height="40"> - <materialDesign:PackIcon.Style> - <Style TargetType="materialDesign:PackIcon"> - <Setter Property="Kind" Value="Play"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding IsStarted}" Value="True"> - <Setter Property="Kind" Value="Stop"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding IsStarted}" Value="False"> - <Setter Property="Kind" Value="Play"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </materialDesign:PackIcon.Style> - </materialDesign:PackIcon> - </Button> - </Grid> - </Grid> - </Border> - </Grid> - </Border> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - </ScrollViewer> - </DockPanel> - </Grid> - - </Grid> - - </Grid> - - <Grid Grid.Row="1" Grid.ColumnSpan="2" Background="{StaticResource SideBarBackground}"> - <Grid Margin="10 70 10 10"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="1*"/> - <ColumnDefinition Width="350"/> - </Grid.ColumnDefinitions> - - <Grid Grid.Column="1"> - <DockPanel> - <StackPanel Orientation="Horizontal" DockPanel.Dock="Top"> - <Image Source="../Images/graphs.png" Width="42"></Image> - <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="DimGray" FontSize="16" FontWeight="SemiBold">AVAILABLE GRAPHS</TextBlock> - </StackPanel> - <ScrollViewer Margin="0 5 0 0" VerticalScrollBarVisibility="Auto"> - <ItemsControl Margin="0 0 5 0" ItemsSource="{Binding AvailableGraphs}"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <UniformGrid Columns="2" IsItemsHost="True"></UniformGrid> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate DataType="{x:Type observables:TechMonitor}"> - <Border dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}" Margin="5" CornerRadius="3" Height="120" BorderThickness="1" BorderBrush="Silver" ClipToBounds="True"> - <Border.Background> - <ImageBrush ImageSource="../Images/line_graph.png" Stretch="Fill"></ImageBrush> - </Border.Background> - <Grid> - <Label HorizontalAlignment="Left" VerticalAlignment="Top" Style="{StaticResource graphLabel}"> - <TextBlock Foreground="DimGray" VerticalAlignment="Center" Text="{Binding Description}"></TextBlock> - </Label> - </Grid> - </Border> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - </ScrollViewer> - </DockPanel> - </Grid> - - <Grid> - <Grid Margin="0 0 10 0" Style="{StaticResource droppableGrid}" dragAndDrop:DragAndDropService.Drop="OnDropAvailableGraph"> - <Border> - <ItemsControl ItemsSource="{Binding Graphs}"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <UniformGrid IsItemsHost="True"> - <UniformGrid.Style> - <Style TargetType="UniformGrid"> - <Setter Property="Columns" Value="1"></Setter> - <Setter Property="Rows" Value="1"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Graphs.Count,Converter={StaticResource SmallerThanToBooleanConverter},ConverterParameter=3}" Value="True"> - <Setter Property="Columns" Value="{Binding Graphs.Count}"></Setter> - <Setter Property="Rows" Value="1"></Setter> - </DataTrigger> - <MultiDataTrigger> - <MultiDataTrigger.Conditions> - <Condition Binding="{Binding Graphs.Count,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=2}" Value="True"></Condition> - <Condition Binding="{Binding Graphs.Count,Converter={StaticResource SmallerThanToBooleanConverter},ConverterParameter=5}" Value="True"></Condition> - </MultiDataTrigger.Conditions> - <Setter Property="Columns" Value="2"></Setter> - <Setter Property="Rows" Value="2"></Setter> - </MultiDataTrigger> - <MultiDataTrigger> - <MultiDataTrigger.Conditions> - <Condition Binding="{Binding Graphs.Count,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=4}" Value="True"></Condition> - <Condition Binding="{Binding Graphs.Count,Converter={StaticResource SmallerThanToBooleanConverter},ConverterParameter=7}" Value="True"></Condition> - </MultiDataTrigger.Conditions> - <Setter Property="Columns" Value="3"></Setter> - <Setter Property="Rows" Value="2"></Setter> - </MultiDataTrigger> - <DataTrigger Binding="{Binding Graphs.Count,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=6}" Value="True"> - <Setter Property="Columns" Value="4"></Setter> - <Setter Property="Rows" Value="2"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </UniformGrid.Style> - </UniformGrid> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - </ItemsControl> - </Border> - <Grid> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="Visibility" Value="Collapsed"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Graphs.Count}" Value="0"> - <Setter Property="Visibility" Value="Visible"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - <TextBlock Foreground="Silver" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="30">DRAG & DROP GRAPHS</TextBlock> - </Grid> - </Grid> - </Grid> - </Grid> - - <Border VerticalAlignment="Top" Height="50" CornerRadius="0 0 50 50"> - <Border.Effect> - <DropShadowEffect BlurRadius="30" ShadowDepth="20" Opacity="0.2" /> - </Border.Effect> - <Border.Background> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Color="White" Offset="0" /> - <GradientStop Color="#FFE6E6E6" Offset="1"/> - - </LinearGradientBrush> - </Border.Background> - - <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 0 120 0"> - <ToggleButton x:Name="chkGraphs" IsChecked="False"></ToggleButton> - <TextBlock VerticalAlignment="Center" Margin="5 -1 0 0" Foreground="Gray">Display Graphs</TextBlock> - </StackPanel> - </Border> - </Grid> - - <!--JOB STATUS--> - <Grid Grid.RowSpan="1" Grid.ColumnSpan="2" Width="1570" HorizontalAlignment="Left"> - <Grid.Background> - <ImageBrush ImageSource="../Images/White-Background.jpg" Stretch="None" /> - </Grid.Background> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="RenderTransform"> - <Setter.Value> - <ScaleTransform ScaleY="0" ScaleX="1"></ScaleTransform> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding ShowJobStatus}" Value="True"> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.5"></DoubleAnimation> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="0" Duration="00:00:0.5"></DoubleAnimation> - </Storyboard> - </BeginStoryboard> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - - <DockPanel Margin="60 20 13 13"> - <StackPanel Margin="0 20 0 0" Orientation="Horizontal" DockPanel.Dock="Top"> - <materialDesign:PackIcon Kind="Settings" Width="60" Height="60" /> - <TextBlock FontSize="30" FontWeight="SemiBold" VerticalAlignment="Center" Margin="10 0 0 0">Job Status</TextBlock> - </StackPanel> - - <Grid DockPanel.Dock="Bottom" Height="40"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 0 30 0"> - <Button Command="{Binding ExportToExcelCommand}" Style="{StaticResource MaterialDesignFlatButton}"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon VerticalAlignment="Center" Kind="FileExcel"></materialDesign:PackIcon> - <TextBlock Margin="10 0 0 0">EXPORT TO EXCEL</TextBlock> - </StackPanel> - </Button> - </StackPanel> - </Grid> - - <Grid> - <DataGrid Background="Transparent" HorizontalAlignment="Left" Width="1450" Margin="0 20 0 10" BorderThickness="1" BorderBrush="Gainsboro"> - <DataGrid.Columns> - <DataGridTextColumn Width="Auto" Header="#"/> - <DataGridTextColumn Width="200" Header="TIME STAMP"/> - <DataGridTextColumn Width="100" Header="CODE"/> - <DataGridTextColumn Width="200" Header="NAME"/> - <DataGridTextColumn Width="1*" Header="DESCRIPTION"/> - </DataGrid.Columns> - </DataGrid> - </Grid> - </DockPanel> - </Grid> - - <!--MONITORING--> - <!--<Grid Grid.ColumnSpan="3" Background="White" Visibility="Visible"> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="RenderTransform"> - <Setter.Value> - <ScaleTransform ScaleY="1" ScaleX="0"></ScaleTransform> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding IsSideBarOpened}" Value="True"> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.5"></DoubleAnimation> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="0" Duration="00:00:0.5"></DoubleAnimation> - </Storyboard> - </BeginStoryboard> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - - <techViews:MachineTechView DataContext="{Binding MachineTechViewVM}" /> - </Grid>--> - </Grid> - </Grid> - </Grid> - - <Grid Background="{StaticResource SideBarBackground}" IsEnabled="{Binding IsJobRunning,Converter={StaticResource BooleanInverseConverter}}"> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="Width" Value="500"></Setter> - <Setter Property="LayoutTransform"> - <Setter.Value> - <ScaleTransform ScaleY="1" ScaleX="1"></ScaleTransform> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding IsSideBarOpened}" Value="True"> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleX" To="1" Duration="00:00:0.2"></DoubleAnimation> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleX" To="0" Duration="00:00:0.2"></DoubleAnimation> - </Storyboard> - </BeginStoryboard> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - - <ScrollViewer VerticalScrollBarVisibility="Auto" FlowDirection="RightToLeft"> - <materialDesign:Card Background="{StaticResource SideBarBackground}" FlowDirection="LeftToRight"> - <StackPanel> - <Expander Header="MACHINE" IsExpanded="True" Background="{StaticResource SideBarBackground}"> - <StackPanel Margin="0 0 0 0"> - <ComboBox ItemsSource="{Binding Adapter.Machines}" SelectedItem="{Binding SelectedMachine}" materialDesign:HintAssist.IsFloating="True" materialDesign:HintAssist.Hint="Selected Machine" 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> - <designer:MachineView Width="500" 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"> - <materialDesign:PackIcon VerticalAlignment="Center" Kind="Pencil"></materialDesign:PackIcon> - <TextBlock Margin="10 0 0 0">EDIT</TextBlock> - </StackPanel> - </Button> - </StackPanel> - </Expander> - - <Separator Foreground="{StaticResource MaterialDesignDivider}" Background="{StaticResource MaterialDesignDivider}" /> - - <Expander Header="MEDIA" Background="{StaticResource SideBarBackground}" IsExpanded="True"> - <StackPanel> - <ComboBox DockPanel.Dock="Top" ItemsSource="{Binding Adapter.Rmls}" SelectedItem="{Binding SelectedRML}" materialDesign:HintAssist.IsFloating="True" materialDesign:HintAssist.Hint="Selected Thread" Margin="40 0 40 0"> - <ComboBox.ItemTemplate> - <DataTemplate> - <StackPanel> - <TextBlock Text="{Binding Name}" FontWeight="Bold" FontStyle="Italic"></TextBlock> - <TextBlock FontSize="11" Text="{Binding Manufacturer}" Foreground="Gray"></TextBlock> - </StackPanel> - </DataTemplate> - </ComboBox.ItemTemplate> - </ComboBox> - - <Button DockPanel.Dock="Bottom" Command="{Binding EditRMLCommand}" HorizontalAlignment="Right" Margin="0 10 20 20" Style="{StaticResource MaterialDesignFlatButton}"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon VerticalAlignment="Center" Kind="Pencil"></materialDesign:PackIcon> - <TextBlock Margin="10 0 0 0">EDIT</TextBlock> - </StackPanel> - </Button> - </StackPanel> - </Expander> - - <Separator Foreground="{StaticResource MaterialDesignDivider}" Background="{StaticResource MaterialDesignDivider}" /> - - <Expander Background="{StaticResource SideBarBackground}" IsExpanded="True"> - <Expander.HeaderTemplate> - <DataTemplate> - <TextBlock><Run>LIQUID FACTORS</Run> <Run FontSize="10" Foreground="DimGray">( Max Nanolitter/CM )</Run></TextBlock> - </DataTemplate> - </Expander.HeaderTemplate> - - <Grid> - <StackPanel Margin="40 0 40 0"> - <ItemsControl ItemsSource="{Binding LiquidTypesRmls}"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <WrapPanel IsItemsHost="True"></WrapPanel> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate DataType="{x:Type observables:LiquidTypesRml}"> - <StackPanel Margin="0 0 10 20"> - <TextBlock HorizontalAlignment="Center" FontSize="10" Foreground="DimGray" Text="{Binding LiquidType.Name}"></TextBlock> - <Grid Width="58" Height="48" Margin="0 5 0 0"> - <shapes:Hexagon StrokeThickness="1" Stroke="Gray"> - <shapes:Hexagon.Fill> - <LinearGradientBrush Opacity="0.7" > - <GradientStop Color="{Binding LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"/> - <GradientStop Color="White" Offset="1"/> - </LinearGradientBrush> - </shapes:Hexagon.Fill> - </shapes:Hexagon> - - <TextBox Style="{x:Null}" Background="Transparent" Foreground="Black" BorderThickness="0" Text="{Binding MaxNlPerCm}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontWeight="Bold" FontStyle="Italic"></TextBox> - </Grid> - </StackPanel> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - - <Button Command="{Binding SaveLiquidFactorsCommand}" HorizontalAlignment="Right" Margin="0 10 -20 20" Style="{StaticResource MaterialDesignFlatButton}"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon VerticalAlignment="Center" Kind="Harddisk"></materialDesign:PackIcon> - <TextBlock Margin="10 0 0 0">SAVE</TextBlock> - </StackPanel> - </Button> - </StackPanel> - - <Grid Height="150" Background="{StaticResource SideBarBackground}"> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="Visibility" Value="Visible"></Setter> - <Style.Triggers> - <MultiDataTrigger> - <MultiDataTrigger.Conditions> - <Condition Binding="{Binding SelectedMachine,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"></Condition> - <Condition Binding="{Binding SelectedRML,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"></Condition> - </MultiDataTrigger.Conditions> - <Setter Property="Visibility" Value="Collapsed"></Setter> - </MultiDataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - <TextBlock Foreground="#FA9292" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24">SELECT MACHINE & MEDIA</TextBlock> - </Grid> - </Grid> - </Expander> - - - </StackPanel> - </materialDesign:Card> - </ScrollViewer> - - <Rectangle HorizontalAlignment="Right" Stroke="#CECECE" StrokeThickness="1"></Rectangle> - </Grid> - - <Button Background="Transparent" Command="{Binding ToggleSideBarCommand}" Padding="0" Style="{StaticResource MaterialDesignFlatButton}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalAlignment="Right" VerticalAlignment="Center" Height="200" Width="50" Margin="0 300 -50 0"> - <Border Background="#F6F6F6" CornerRadius="0 10 10 0" BorderThickness="0 1 1 1" BorderBrush="#C6C0C0"> - <Grid> - <TextBlock Foreground="#FF7272" Text="CONFIGURATION" FontSize="16" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" HorizontalAlignment="Center"> - <TextBlock.LayoutTransform> - <RotateTransform Angle="270"></RotateTransform> - </TextBlock.LayoutTransform> - </TextBlock> - </Grid> - </Border> - </Button> - </Grid> - </Grid> - - <Grid x:Name="gridFullScreen"> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="Opacity" Value="0"></Setter> - <Setter Property="Visibility" Value="Hidden"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding FullScreenGraph,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"> - <Setter Property="Visibility" Value="Visible"></Setter> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="Opacity"></DoubleAnimation> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation To="0" Duration="00:00:0.2" Storyboard.TargetProperty="Opacity"></DoubleAnimation> - </Storyboard> - </BeginStoryboard> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - <Grid.Background> - <SolidColorBrush Color="White" Opacity="0.8"></SolidColorBrush> - </Grid.Background> - <Grid.RowDefinitions> - <RowDefinition Height="218*"/> - <RowDefinition Height="289*"/> - <RowDefinition Height="213*"/> - </Grid.RowDefinitions> - - <Grid> - <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="40" Text="{Binding FullScreenGraph.SensorName}"></TextBlock> - <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 30" FontSize="16" Foreground="Gray"> - <i:Interaction.Triggers> - <i:EventTrigger EventName="MouseDown"> - <i:InvokeCommandAction Command="{Binding ExitFullScreenCommand}"></i:InvokeCommandAction> - </i:EventTrigger> - </i:Interaction.Triggers> - <Run> Press </Run> - <Run TextDecorations="Underline" Cursor="Hand">'Escape'</Run> - <Run> to exit full screen mode</Run> - </TextBlock> - </Grid> - - <Grid Grid.Row="1" Margin="10 0 10 0"> - <ContentControl Content="{Binding FullScreenGraph}"></ContentControl> - </Grid> - </Grid> - - <dragAndDrop:DraggingSurface x:Name="draggingSurface" /> - </Grid> -</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs deleted file mode 100644 index 2bd36e449..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs +++ /dev/null @@ -1,162 +0,0 @@ -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.Integration.Observables; -using Tango.DragAndDrop; -using Tango.MachineStudio.Developer.Converters; -using Tango.MachineStudio.Developer.ViewModels; -using System.Windows.Threading; -using Tango.SharedUI; - -namespace Tango.MachineStudio.Developer.Views -{ - /// <summary> - /// Interaction logic for MainView.xaml - /// </summary> - public partial class MainView : UserControl, IMainView - { - public static MainView Self { get; set; } - - private MainViewVM _vm; - private DispatcherTimer _jobBrushTimer; - - public DraggingSurface DraggingSurface - { - get { return (DraggingSurface)GetValue(DraggingSurfaceProperty); } - set { SetValue(DraggingSurfaceProperty, value); } - } - public static readonly DependencyProperty DraggingSurfaceProperty = - DependencyProperty.Register("DraggingSurface", typeof(DraggingSurface), typeof(MainView), new PropertyMetadata(null)); - - public event EventHandler<IView> ViewAttached; - - public MainView() - { - Self = this; - - InitializeComponent(); - - DraggingSurface = draggingSurface; - this.Loaded += (x, y) => - { - _vm = DataContext as MainViewVM; - ViewAttached?.Invoke(this, this); - }; - - chkGraphs.Checked += (x, y) => - { - graphRowDefinition.Height = new GridLength(440, GridUnitType.Pixel); - //listCameras.Width = 240; - //dockCameras.Width = 270; - //dockCameras.Height = 600; - }; - chkGraphs.Unchecked += (x, y) => - { - graphRowDefinition.Height = new GridLength(80, GridUnitType.Pixel); - //listCameras.Width = double.NaN; - //dockCameras.Width = 330; - //dockCameras.Height = 850; - }; - - _jobBrushTimer = new DispatcherTimer(); - _jobBrushTimer.Interval = TimeSpan.FromSeconds(1); - _jobBrushTimer.Tick += _jobBrushTimer_Tick; - _jobBrushTimer.Start(); - } - - private void _jobBrushTimer_Tick(object sender, EventArgs e) - { - if (_vm != null && _vm.ActiveJob != null) - { - List<Segment> segments = new List<Segment>(); - foreach (var s in _vm.ActiveJob.Segments) - { - segments.Add(s); - - if (_vm.ActiveJob.EnableInterSegment && _vm.ActiveJob.Segments.IndexOf(s) != _vm.ActiveJob.Segments.Count - 1) - { - segments.Add(new Segment() - { - Length = _vm.ActiveJob.InterSegmentLength, - BrushStops = new System.Collections.ObjectModel.ObservableCollection<BrushStop>() - { - new BrushStop() - { - Color = Colors.White, - } - }, - }); - } - } - - jobBrushList.ItemsSource = segments; - } - } - - private void OnDropAvailableGraph(object sender, DropEventArgs e) - { - if (e.Draggable.DataContext is TechMonitor) - { - _vm.OnDropAvailableGraph(e.Draggable.DataContext as TechMonitor); - } - } - - private void Offset_Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) - { - UpdateGradientBrushDisplay(); - } - - private void UpdateGradientBrushDisplay() - { - if (_vm.SelectedSegment != null) - { - SegmentToGradientStopsConverter converter = new SegmentToGradientStopsConverter(); - GradientStopCollection stops = converter.Convert(_vm.SelectedSegment, null, null, null) as GradientStopCollection; - gradientBrush.GradientStops = stops; - } - else - { - gradientBrush.GradientStops = new GradientStopCollection(); - } - } - - private void OnBrushStopBorderDrop(object sender, DropEventArgs e) - { - if (e.Draggable.DataContext is BrushStop) - { - _vm.OnDropBrushStop(e.Draggable.DataContext as BrushStop, e.Droppable.DataContext as BrushStop); - } - } - - private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) - { - UpdateGradientBrushDisplay(); - } - - private void OnJobStartClick(object sender, RoutedEventArgs e) - { - - } - - private void HiveColorPickerControl_SelectedColorChanged(object sender, Color e) - { - UpdateGradientBrushDisplay(); - } - - private void Popup_MouseDown(object sender, MouseButtonEventArgs e) - { - e.Handled = true; - } - } -} |
