diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer')
4 files changed, 54 insertions, 58 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 b7a254a03..0bb9033a8 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 @@ -300,18 +300,6 @@ <Project>{cb0b0aa2-bb24-4bca-a720-45e397684e12}</Project> <Name>Tango.MachineStudio.Common</Name> </ProjectReference> - <ProjectReference Include="..\Tango.MachineStudio.DataCapture\Tango.MachineStudio.DataCapture.csproj"> - <Project>{fc337a7f-1214-41d8-9992-78092a3b961e}</Project> - <Name>Tango.MachineStudio.DataCapture</Name> - </ProjectReference> - <ProjectReference Include="..\Tango.MachineStudio.Logging\Tango.MachineStudio.Logging.csproj"> - <Project>{1674f726-0e66-414f-b9fd-c6f20d7f07c7}</Project> - <Name>Tango.MachineStudio.Logging</Name> - </ProjectReference> - <ProjectReference Include="..\Tango.MachineStudio.MachineDesigner\Tango.MachineStudio.MachineDesigner.csproj"> - <Project>{d0ce8122-077d-42a2-9490-028ae4769b52}</Project> - <Name>Tango.MachineStudio.MachineDesigner</Name> - </ProjectReference> </ItemGroup> <ItemGroup> <Resource Include="Images\rgb.png" /> @@ -393,7 +381,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index ab74433a6..36beab19a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -38,8 +38,6 @@ using System.Threading; using Tango.SharedUI.Helpers; using Tango.Core.DI; using Tango.MachineStudio.Common; -using Tango.MachineStudio.Logging.ViewModels; -using Tango.MachineStudio.Logging.Views; using Tango.AutoComplete.Editors; using System.Data.Entity; using System.Runtime.ExceptionServices; @@ -53,6 +51,7 @@ using Microsoft.WindowsAPICodePack.Dialogs; using Tango.BL.Enumerations; using Tango.BL.DTO; using Tango.BL.ActionLogs; +using Tango.MachineStudio.Common.Buid; namespace Tango.MachineStudio.Developer.ViewModels { @@ -68,6 +67,7 @@ namespace Tango.MachineStudio.Developer.ViewModels private const string EMB_FORMATS_IMPORT = "Embroidery Files|*.pes;*.hus;*.dst"; private INotificationProvider _notification; + private IBuildProvider _buildProvider; private TimeSpan _runningJobEstimatedDuration; private DeveloperNavigationManager _navigation; private INavigationManager _msNavigation; @@ -76,7 +76,6 @@ namespace Tango.MachineStudio.Developer.ViewModels private ObservablesContext _activeJobDbContext; private IEventLogger _eventLogger; private ISpeechProvider _speech; - private DataCapture.ViewModels.MainViewVM _dataCaptureVM; private bool _isRecording; private DeveloperModuleSettings _settings; private Thread _colorConversionThread; @@ -769,7 +768,7 @@ namespace Tango.MachineStudio.Developer.ViewModels /// </summary> /// <param name="applicationManager">The application manager.</param> /// <param name="notificationProvider">The notification provider.</param> - public MainViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider, IDiagnosticsFrameProvider diagnosticsFrameProvider, IVideoCaptureProvider videoCaptureProvider, DeveloperNavigationManager navigation, INavigationManager navigationManager, IAuthenticationProvider authentication, IEventLogger eventLogger, ISpeechProvider speech, IActionLogManager actionLogManager) + public MainViewVM(IBuildProvider buildProvider, IStudioApplicationManager applicationManager, INotificationProvider notificationProvider, IDiagnosticsFrameProvider diagnosticsFrameProvider, IVideoCaptureProvider videoCaptureProvider, DeveloperNavigationManager navigation, INavigationManager navigationManager, IAuthenticationProvider authentication, IEventLogger eventLogger, ISpeechProvider speech, IActionLogManager actionLogManager) { _converter = new DefaultColorConverter(); @@ -781,6 +780,7 @@ namespace Tango.MachineStudio.Developer.ViewModels AuthenticationProvider = authentication; _actionLogManager = actionLogManager; + _buildProvider = buildProvider; _notification = notificationProvider; _speech = speech; _navigation = navigation; @@ -791,11 +791,11 @@ namespace Tango.MachineStudio.Developer.ViewModels LogManager.Log("Initializing relay commands..."); - TangoIOC.Default.GetInstanceWhenAvailable<DataCapture.ViewModels.MainViewVM>((vm) => - { - _dataCaptureVM = vm; - _dataCaptureVM.RelayCommandsInvalidated += (_, __) => StartJobAndRecordCommand.RaiseCanExecuteChanged(); - }); + //TangoIOC.Default.GetInstanceWhenAvailable<DataCapture.ViewModels.MainViewVM>((vm) => + //{ + // _dataCaptureVM = vm; + // _dataCaptureVM.RelayCommandsInvalidated += (_, __) => StartJobAndRecordCommand.RaiseCanExecuteChanged(); + //}); //Initialize Commands... EditMachineCommand = new RelayCommand(EditMachine, () => SelectedMachine != null && CanWork); @@ -811,7 +811,7 @@ namespace Tango.MachineStudio.Developer.ViewModels SaveJobCommand = new RelayCommand(SaveActiveJob, () => SelectedMachine != null && CanWork); DiscardJobCommand = new RelayCommand(BackToJobs, () => SelectedMachine != null && CanWork); StartJobCommand = new RelayCommand(() => StartJob(), () => ActiveJob != null && CanWork && !IsJobRunning && MachineOperator != null); - StartJobAndRecordCommand = new RelayCommand(StartJobAndRecord, () => _dataCaptureVM != null && !_dataCaptureVM.Recorder.IsRecording && !_dataCaptureVM.Player.IsPlaying && ActiveJob != null && !IsJobRunning && MachineOperator != null && CanWork); + //StartJobAndRecordCommand = new RelayCommand(StartJobAndRecord, () => _dataCaptureVM != null && !_dataCaptureVM.Recorder.IsRecording && !_dataCaptureVM.Player.IsPlaying && ActiveJob != null && !IsJobRunning && MachineOperator != null && CanWork); StopJobCommand = new RelayCommand(StopJob, () => IsJobRunning && CanWork); CloseJobCompletionStatusCommand = new RelayCommand(CloseJobCompletionStatusBar); LoadJobCommand = new RelayCommand(() => LoadSelectedJob(), () => SelectedMachineJob != null && CanWork); @@ -856,7 +856,7 @@ namespace Tango.MachineStudio.Developer.ViewModels { Settings = SettingsManager.Default.GetOrCreate<DeveloperModuleSettings>(); - Settings.PropertyChanged += (x, e) => + Settings.PropertyChanged += (x, e) => { if (e.PropertyName == nameof(Settings.UsePreferredLiquidVolumeIndex)) { @@ -872,10 +872,17 @@ namespace Tango.MachineStudio.Developer.ViewModels LogManager.Log("Initializing machine Db context..."); _machineDbContext = ObservablesContext.CreateDefault(); - if (_settings.LastSelectedMachineGuid != null) + if (_buildProvider.BuildType == MSBuildType.Lite) { - LogManager.Log("Setting last selected machine from settings..."); - SelectedMachine = _machineDbContext.Machines.SingleOrDefault(x => x.Guid == _settings.LastSelectedMachineGuid); + SelectedMachine = _machineDbContext.Machines.SingleOrDefault(x => x.Guid == AuthenticationProvider.Machine.Guid); + } + else + { + if (_settings.LastSelectedMachineGuid != null) + { + LogManager.Log("Setting last selected machine from settings..."); + SelectedMachine = _machineDbContext.Machines.SingleOrDefault(x => x.Guid == _settings.LastSelectedMachineGuid); + } } if (_settings.LastSelectedJobGuid != null && SelectedMachine != null) @@ -1352,17 +1359,17 @@ namespace Tango.MachineStudio.Developer.ViewModels private void OnSelectedJobEventChanged() { - if (SelectedJobEvent != null && SelectedJobEvent.Type != BL.Enumerations.EventTypes.APPLICATION_STARTED && !_dialog_shown) - { - _dialog_shown = true; - _notification.ShowModalDialog<EventDetailsViewVM, EventDetailsView>(new EventDetailsViewVM(SelectedJobEvent), (x) => - { + //if (SelectedJobEvent != null && SelectedJobEvent.Type != BL.Enumerations.EventTypes.APPLICATION_STARTED && !_dialog_shown) + //{ + // _dialog_shown = true; + // _notification.ShowModalDialog<EventDetailsViewVM, EventDetailsView>(new EventDetailsViewVM(SelectedJobEvent), (x) => + // { - }, () => - { - _dialog_shown = false; - }); - } + // }, () => + // { + // _dialog_shown = false; + // }); + //} } /// <summary> @@ -1588,9 +1595,9 @@ namespace Tango.MachineStudio.Developer.ViewModels /// </summary> private void StartJobAndRecord() { - _isRecording = true; - _dataCaptureVM.StartDiagnosticsRecording(); - StartJob(); + //_isRecording = true; + //_dataCaptureVM.StartDiagnosticsRecording(); + //StartJob(); } /// <summary> @@ -1598,11 +1605,11 @@ namespace Tango.MachineStudio.Developer.ViewModels /// </summary> private void StopRecordingIfInProgress() { - if (_isRecording) - { - _isRecording = false; - InvokeUI(() => _dataCaptureVM.StopRecorderOrPlayer()); - } + //if (_isRecording) + //{ + // _isRecording = false; + // InvokeUI(() => _dataCaptureVM.StopRecorderOrPlayer()); + //} } private void BackToJob() @@ -1901,9 +1908,9 @@ namespace Tango.MachineStudio.Developer.ViewModels //var processParamsGroups = _activeJobDbContext.ProcessParametersTablesGroups.ToList(); //var processParams = _activeJobDbContext.ProcessParametersTables.ToList(); - ColorSpaces = _activeJobDbContext.ColorSpaces.ToObservableCollection(); + ColorSpaces = _activeJobDbContext.ColorSpaces.ToList().Where(x => x.Space == BL.Enumerations.ColorSpaces.Volume || x.Space == BL.Enumerations.ColorSpaces.LAB || x.Space == BL.Enumerations.ColorSpaces.RGB).ToObservableCollection(); - Rmls = _activeJobDbContext.Rmls.Where(x => x.MachineType == SelectedMachine.MachineType || x.MachineType == null).ToList().OrderBy(i => i.FinalName).ToObservableCollection(); + Rmls = _activeJobDbContext.Rmls.Where(x => x.CreatedByOrganizationGuid == AuthenticationProvider.CurrentUser.Organization.Guid || _buildProvider.BuildType == MSBuildType.Default).Where(x => x.MachineType == SelectedMachine.MachineType || x.MachineType == null).ToList().OrderBy(i => i.FinalName).ToObservableCollection(); WindingMethods = _activeJobDbContext.WindingMethods.ToObservableCollection(); SpoolTypes = _activeJobDbContext.SpoolTypes.ToObservableCollection(); 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 45c2d54cb..c326e5be2 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 @@ -16,7 +16,6 @@ xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:commonControls="clr-namespace:Tango.MachineStudio.Common.Controls;assembly=Tango.MachineStudio.Common" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" - 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" @@ -692,7 +691,7 @@ </StackPanel> </Border> - <Border Style="{StaticResource JobFieldBorder}" Height="82" Width="200" Visibility="{Binding IsSideBarOpened,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> + <!--<Border Style="{StaticResource JobFieldBorder}" Height="82" Width="200" Visibility="{Binding IsSideBarOpened,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <StackPanel Width="200"> <StackPanel Orientation="Horizontal" Margin="10 0 0 0"> <Image Source="../Images/description.png" Width="32"></Image> @@ -703,7 +702,7 @@ <TextBox Padding="5 0 0 0" FontStyle="Italic" Background="Transparent" Style="{x:Null}" BorderThickness="0" Margin="5" Height="40" Text="{Binding ActiveJob.Description}" VerticalAlignment="Stretch" materialDesign:HintAssist.Hint="Enter description" AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"></TextBox> </Border> </StackPanel> - </Border> + </Border>--> </StackPanel> @@ -1312,9 +1311,9 @@ <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="18" Foreground="{StaticResource WhiteTextBrush}">START JOB</TextBlock> </StackPanel> </Button> - <Button Height="60" Width="60" Margin="-60 0 0 0" Padding="0" Command="{Binding StartJobAndRecordCommand}" Click="OnJobStartClick" ToolTip="Start Job and Record"> + <!--<Button Height="60" Width="60" Margin="-60 0 0 0" Padding="0" Command="{Binding StartJobAndRecordCommand}" Click="OnJobStartClick" ToolTip="Start Job and Record"> <materialDesign:PackIcon VerticalAlignment="Center" Width="38" Height="38" Kind="Record" Foreground="{StaticResource RedBrush200}" /> - </Button> + </Button>--> </StackPanel> <Button Command="{Binding ToRunningJobCommand}" Width="280" Height="60" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityConverter}}"> <StackPanel Orientation="Horizontal"> 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 ce632539e..ae2bc5cd7 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 @@ -4,7 +4,6 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:global="clr-namespace:Tango.MachineStudio.Developer" - xmlns:designer="clr-namespace:Tango.MachineStudio.MachineDesigner.Views;assembly=Tango.MachineStudio.MachineDesigner" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" xmlns:automation="clr-namespace:Tango.MachineStudio.Common.Automation;assembly=Tango.MachineStudio.Common" @@ -15,6 +14,7 @@ xmlns:observables="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:commonControls="clr-namespace:Tango.MachineStudio.Common.Controls;assembly=Tango.MachineStudio.Common" + xmlns:commonConverters="clr-namespace:Tango.MachineStudio.Common.Converters;assembly=Tango.MachineStudio.Common" xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views" mc:Ignorable="d" x:Name="control" d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> @@ -26,6 +26,8 @@ <converters:GreaterThanToBooleanConverter x:Key="GreaterThanToBooleanConverter" /> <converters:MathOperatorConverter x:Key="MathOperatorConverter" /> <converters:BooleanInverseConverter x:Key="BooleanInverseConverter" /> + <commonConverters:IsLiteToVisibilityInverseConverter x:Key="IsLiteToVisibilityInverseConverter" /> + <commonConverters:IsLiteToVisibilityConverter x:Key="IsLiteToVisibilityConverter" /> </UserControl.Resources> <Grid IsEnabled="{Binding IsFree}"> @@ -37,13 +39,13 @@ <Grid Background="{StaticResource TransparentBackgroundBrush400}"> <StackPanel> - <TextBlock Margin="40 20" FontSize="30" FontWeight="SemiBold" FontStyle="Italic">TARGET MACHINE</TextBlock> + <TextBlock Visibility="{Binding Converter={StaticResource IsLiteToVisibilityInverseConverter}}" Margin="40 20" FontSize="30" FontWeight="SemiBold" FontStyle="Italic">TARGET MACHINE</TextBlock> <DockPanel Margin="40 0 40 0" IsEnabled="{Binding CanWork}"> - <Button Command="{Binding ReloadMachinesCommand}" DockPanel.Dock="Right" ToolTip="Reload" Foreground="{StaticResource GrayBrush280}" Margin="20 0 0 0" Padding="0" Width="40" Height="Auto" Style="{StaticResource MaterialDesignFlatButton}"> + <Button Visibility="{Binding Converter={StaticResource IsLiteToVisibilityInverseConverter}}" Command="{Binding ReloadMachinesCommand}" DockPanel.Dock="Right" ToolTip="Reload" Foreground="{StaticResource GrayBrush280}" Margin="20 0 0 0" Padding="0" Width="40" Height="Auto" Style="{StaticResource MaterialDesignFlatButton}"> <materialDesign:PackIcon Kind="Refresh" Width="24" Height="24" /> </Button> - <autoComplete:AutoCompleteTextBox Provider="{Binding MachinesProvider}" LoadingContent="Loading..." FontSize="20" SelectedItem="{Binding SelectedMachine,Mode=TwoWay}" materialDesign:HintAssist.Hint="Serial Number" DisplayMember="SerialNumber"> + <autoComplete:AutoCompleteTextBox Visibility="{Binding Converter={StaticResource IsLiteToVisibilityInverseConverter}}" Provider="{Binding MachinesProvider}" LoadingContent="Loading..." FontSize="20" SelectedItem="{Binding SelectedMachine,Mode=TwoWay}" materialDesign:HintAssist.Hint="Serial Number" DisplayMember="SerialNumber"> <autoComplete:AutoCompleteTextBox.ItemTemplate> <DataTemplate> <StackPanel> @@ -54,7 +56,7 @@ </autoComplete:AutoCompleteTextBox.ItemTemplate> </autoComplete:AutoCompleteTextBox> </DockPanel> - <designer:MachineView Width="600" IsHitTestVisible="False" Margin="0 40 0 0" DataContext="{Binding SelectedMachine}" /> + <commonControls:MachineView Width="600" IsHitTestVisible="False" Margin="0 40 0 0" DataContext="{Binding SelectedMachine}" /> </StackPanel> </Grid> @@ -260,7 +262,7 @@ </Grid> </DockPanel> - <StackPanel Margin="20 0 0 -100" VerticalAlignment="Bottom" HorizontalAlignment="Left" Orientation="Horizontal"> + <StackPanel Visibility="{Binding Converter={StaticResource IsLiteToVisibilityInverseConverter}}" Margin="20 0 0 -100" VerticalAlignment="Bottom" HorizontalAlignment="Left" Orientation="Horizontal"> <Button Command="{Binding ImportJobFileCommand}" Foreground="{StaticResource BlackForegroundBrush}" FontSize="16" Style="{StaticResource emptyButton}" Cursor="Hand"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="FileImport" VerticalAlignment="Center" Width="30" Height="30" /> |
