diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-11 16:12:53 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-11 16:12:53 +0300 |
| commit | 009a02d57e244e9a8ed5d70fc0743f10f68f5a33 (patch) | |
| tree | a4f5ad18650c735310a3d30126dcbcee06d4a02b | |
| parent | bd49bdcb109a227130d7db6856e659b435d16530 (diff) | |
| download | Tango-009a02d57e244e9a8ed5d70fc0743f10f68f5a33.tar.gz Tango-009a02d57e244e9a8ed5d70fc0743f10f68f5a33.zip | |
Done some work on PPC & Color Lab Module.
25 files changed, 378 insertions, 140 deletions
diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf Binary files differindex 66c3a8783..a94e39894 100644 --- a/Software/DB/Tango.mdf +++ b/Software/DB/Tango.mdf diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf Binary files differindex 45f9ba68b..e74145160 100644 --- a/Software/DB/Tango_log.ldf +++ b/Software/DB/Tango_log.ldf diff --git a/Software/Graphics/Mobile/sample-dye.png b/Software/Graphics/Mobile/sample-dye.png Binary files differnew file mode 100644 index 000000000..f8989e19a --- /dev/null +++ b/Software/Graphics/Mobile/sample-dye.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs index 48d16104a..0e9109b28 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs @@ -13,6 +13,7 @@ using System.Windows.Media; using Tango.BL; using Tango.BL.ColorConversion; using Tango.BL.Entities; +using Tango.BL.Enumerations; using Tango.Core.Commands; using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.Controls; @@ -32,6 +33,33 @@ namespace Tango.MachineStudio.ColorLab.ViewModels #region Properties + private bool _isVolumesOutOfRange; + /// <summary> + /// Gets or sets a value indicating whether the liquid volumes are out of range. + /// </summary> + public bool IsVolumesOutOfRange + { + get { return _isVolumesOutOfRange; } + set + { + if (_isVolumesOutOfRange != value) + { + _isVolumesOutOfRange = value; + RaisePropertyChangedAuto(); + } + } + } + + private bool _isOutOfGamut; + /// <summary> + /// Gets or sets a value indicating whether the source color is out of gamut. + /// </summary> + public bool IsOutOfGamut + { + get { return _isOutOfGamut; } + set { _isOutOfGamut = value; RaisePropertyChangedAuto(); } + } + private ObservableCollection<Machine> _machines; /// <summary> /// Gets or sets the machines. @@ -280,6 +308,8 @@ namespace Tango.MachineStudio.ColorLab.ViewModels var output = TangoColorConverter.GetSuggestions(input); + IsOutOfGamut = output.OutOfGamut; + HiveSuggestions = TangoColorConverter.CreateHiveSuggestions(output); }); } @@ -396,6 +426,17 @@ namespace Tango.MachineStudio.ColorLab.ViewModels try { if (LiquidsCalibrationData == null) return; + + //TODO: This is temporary because of out of range volumes. + if (LiquidVolumes.Where(x => x.IdsPack.IdsPackFormula.Code == IdsPackFormulas.StandardColor.ToInt32()).Sum(x => x.Volume) > 200) + { + IsVolumesOutOfRange = true; + return; + } + else + { + IsVolumesOutOfRange = false; + } ConversionInput input = new ConversionInput(); input.ColorSpace = PMR.ColorLab.ColorSpace.Volume; diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml index 8b62604d6..d8ef015be 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml @@ -26,6 +26,7 @@ <converters:ColorToComponentsConverter x:Key="ColorToComponentsConverter" /> <converters:NullObjectToBooleanConverter x:Key="NullObjectToBooleanConverter" /> <converters:ObjectToObjectTypeConverter x:Key="ObjectToObjectTypeConverter" /> + <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> </UserControl.Resources> <Grid> @@ -163,6 +164,12 @@ </Grid.RowDefinitions> <StackPanel VerticalAlignment="Center" Grid.Row="1"> + <StackPanel Height="20"> + <StackPanel Orientation="Horizontal" Margin="0 0 0 5" Visibility="{Binding IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter}}"> + <materialDesign:PackIcon Kind="Alert" Foreground="#FF6D6D" /> + <TextBlock Margin="5 0 0 0" Foreground="#FF6D6D">Color is out of gamut</TextBlock> + </StackPanel> + </StackPanel> <Border BorderThickness="1" BorderBrush="#545454" Margin="0" Padding="2 2 2 0"> <brushPicker:BrushPicker x:Name="picker" Color="{Binding SourceColor.Color,Mode=TwoWay}" Background="Transparent" BorderThickness="0" Height="150" BrushTypeVisibility="Collapsed"></brushPicker:BrushPicker> </Border> @@ -254,30 +261,39 @@ </Grid> - <ItemsControl ItemsSource="{Binding LiquidVolumes}" VerticalAlignment="Center" MinWidth="420" Grid.Column="4" Grid.Row="3"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> - <StackPanel> - <TextBlock HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Name}" FontSize="10" Margin="0 0 0 5"></TextBlock> - <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Width="60" Height="60" Margin="10 0 0 0"> - <ContentControl.Foreground> - <SolidColorBrush Color="{Binding Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> - </ContentControl.Foreground> - <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.00" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> - <!--<mahapps:NumericUpDown.Resources> + <StackPanel Grid.Column="4" Grid.Row="3"> + <StackPanel Height="25" Margin="25 0 0 0"> + <StackPanel Orientation="Horizontal" Margin="0 0 0 0" Visibility="{Binding IsVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}"> + <materialDesign:PackIcon Kind="Alert" Foreground="#FF6D6D" /> + <TextBlock Margin="5 0 0 0" Foreground="#FF6D6D">Liquid volumes exceeds the maximum range</TextBlock> + </StackPanel> + </StackPanel> + + <ItemsControl ItemsSource="{Binding LiquidVolumes}" VerticalAlignment="Center" MinWidth="420"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel> + <TextBlock HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Name}" FontSize="10" Margin="0 0 0 5"></TextBlock> + <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Width="60" Height="60" Margin="10 0 0 0"> + <ContentControl.Foreground> + <SolidColorBrush Color="{Binding Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </ContentControl.Foreground> + <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.00" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <!--<mahapps:NumericUpDown.Resources> <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource> </mahapps:NumericUpDown.Resources>--> - </mahapps:NumericUpDown> - </ContentControl> - </StackPanel> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> + </mahapps:NumericUpDown> + </ContentControl> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> <Image Source="../Images/arrow-long-Left.png" Grid.Column="2" Grid.Row="3" Width="140" Opacity="0.8"></Image> @@ -286,11 +302,14 @@ <Grid> <DockPanel Width="80" HorizontalAlignment="Left"> <TextBlock DockPanel.Dock="Top" FontSize="9" TextAlignment="Center">COMPOSITE</TextBlock> - <Ellipse Height="70" Margin="0 5 0 0" Stroke="#202020"> - <Ellipse.Fill> - <SolidColorBrush Color="{Binding TargetColor.Color}"></SolidColorBrush> - </Ellipse.Fill> - </Ellipse> + <Grid> + <Ellipse Height="70" Margin="0 5 0 0" Stroke="#202020"> + <Ellipse.Fill> + <SolidColorBrush Color="{Binding TargetColor.Color}"></SolidColorBrush> + </Ellipse.Fill> + </Ellipse> + <materialDesign:PackIcon Visibility="{Binding IsVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}" Kind="Alert" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" Width="24" Height="24" /> + </Grid> </DockPanel> <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Height="60"> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt index 0aa0af85a..60d433d99 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt @@ -1 +1 @@ -Wed 07/11/2018 11:23:32.16 +Wed 07/11/2018 16:02:40.40 diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/Utils/Interp.cpp b/Software/Visual_Studio/Native/Tango.ColorLib/Utils/Interp.cpp index 7346a9898..68b7e0c93 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/Utils/Interp.cpp +++ b/Software/Visual_Studio/Native/Tango.ColorLib/Utils/Interp.cpp @@ -5,6 +5,7 @@ #include <iostream> #include <stdio.h> +#define epsTol 0.05 Interp::Interp(void) { } @@ -26,6 +27,15 @@ void Interp::Eval(double InValue, double &OutValue) int errType = 0; ind = -1; + //Check Bounds + if((InValue<m_xValues[0] - epsTol) || (InValue >m_xValues[m_length - 1] + epsTol)) + throw std::exception("Value out of Bounds"); + if ((InValue > m_xValues[0] - epsTol) && (InValue < m_xValues[0])) + InValue = m_xValues[0]; + + if ((InValue > m_xValues[m_length - 1] ) && (InValue < m_xValues[m_length - 1]+ epsTol)) + InValue = m_xValues[m_length - 1]; + for (m = 0; m < m_length - 1; ++m) { if (m_xValues[m] <= InValue && m_xValues[m + 1] >= InValue) diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/sample-dye.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/sample-dye.png Binary files differnew file mode 100644 index 000000000..f8989e19a --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/sample-dye.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj index 0163b77c2..aaf9fb453 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj @@ -311,5 +311,8 @@ <ItemGroup> <Resource Include="Images\JobProgressView\clock.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\JobView\sample-dye.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs index a111d3be2..6039dafb8 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs @@ -10,9 +10,10 @@ using Tango.PPC.Common.Navigation; namespace Tango.PPC.Jobs.ViewModels { - public class JobProgressViewVM : PPCViewModel, INavigationResultProvider<Object, Job> + public class JobProgressViewVM : PPCViewModel { private Job _job; + public Job Job { get { return _job; } @@ -32,21 +33,21 @@ namespace Tango.PPC.Jobs.ViewModels } - public void OnNavigationObjectReceived(Job job) + public override void OnApplicationStarted() { - Job = job; - var jobHandler = ApplicationManager.ConnectedMachine.Print(Job, Adapter.ProcessParametersTables.First()); - jobHandler.StatusChanged += JobHandler_StatusChanged; + ApplicationManager.ConnectedMachineChanged += ApplicationManager_ConnectedMachineChanged; } - public object GetNavigationResult() + private void ApplicationManager_ConnectedMachineChanged(object sender, IMachineOperator e) { - return null; + e.PrintingStarted -= PrintingStarted; + e.PrintingStarted += PrintingStarted; } - public override void OnApplicationStarted() + private void PrintingStarted(object sender, JobHandler jobHandler) { - + Job = jobHandler.Job; + jobHandler.StatusChanged += JobHandler_StatusChanged; } private void JobHandler_StatusChanged(object sender, RunningJobStatus e) diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs index a59b0fe27..12f2c9642 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs @@ -47,7 +47,8 @@ namespace Tango.PPC.Jobs.ViewModels private void StartJob() { - var result = NavigationManager.NavigateForResult<JobsModule, JobProgressView, Object, Job>(Job); + ApplicationManager.ConnectedMachine.Print(Job, Adapter.ProcessParametersTables.First()); + NavigationManager.NavigateTo<JobsModule>(nameof(JobProgressView)); } public override void OnApplicationStarted() diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs index 6b25d323f..82cfc3456 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs @@ -39,7 +39,6 @@ namespace Tango.PPC.Jobs.ViewModels #region Properties private Job _job; - /// <summary> /// Gets or sets the selected job. /// </summary> @@ -172,6 +171,16 @@ namespace Tango.PPC.Jobs.ViewModels /// </summary> public RelayCommand<BrushStop> TwineCatalogFieldTapCommand { get; set; } + /// <summary> + /// Gets or sets the increase decrease samples to dye command. + /// </summary> + public RelayCommand<String> IncreaseDecreaseSamplesToDyeCommand { get; set; } + + /// <summary> + /// Gets or sets the start sample dye command. + /// </summary> + public RelayCommand StartSampleDyeCommand { get; set; } + #endregion #region Constructors @@ -205,9 +214,22 @@ namespace Tango.PPC.Jobs.ViewModels SaveJobCommand = new RelayCommand(SaveJob); ReplaceBrushStopCommand = new RelayCommand<BrushStop>(InvokeColorAdjustmentForBrushStop); TwineCatalogFieldTapCommand = new RelayCommand<BrushStop>(InvokeTwineCatalogForBrushStop); + IncreaseDecreaseSamplesToDyeCommand = new RelayCommand<string>((x) => + { + if (x == "+") + { + Job.SampleUnitsOrMeters++; + } + else + { + Job.SampleUnitsOrMeters--; + } + }); _check_gamut_thread = new Thread(CheckGamutThreadMethod); _check_gamut_thread.IsBackground = true; + + StartSampleDyeCommand = new RelayCommand(StartSampleDye); } #endregion @@ -390,6 +412,35 @@ namespace Tango.PPC.Jobs.ViewModels #endregion + #region Sample Dye + + /// <summary> + /// Starts a sample dye. + /// </summary> + private async void StartSampleDye() + { + Job sampleDyeJob = Job.Clone(); + sampleDyeJob.Name += " sample"; + + if (Job.JobType == BL.Enumerations.JobTypes.Embroidery) + { + sampleDyeJob.NumberOfUnits = Job.SampleUnitsOrMeters; + } + else + { + sampleDyeJob.NumberOfUnits = 1; + + foreach (var segment in sampleDyeJob.Segments) + { + segment.Length = Job.SampleUnitsOrMeters; + } + } + + await NavigationManager.NavigateForResult<JobsModule, JobProgressView, Object, Job>(sampleDyeJob); + } + + #endregion + #region Out Of Gamut Check Thread private void CheckGamutThreadMethod() diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml index ce7f7b528..43917fe55 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml @@ -538,7 +538,11 @@ </StackPanel> </Border> - <Border Style="{StaticResource TangoTouchBorder}" Margin="0 12 0 120" Padding="0 0 0 40"> + <StackPanel HorizontalAlignment="Center" Margin="20 40 0 40" Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> + <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Additional Tools</TextBlock> + </StackPanel> + + <!--<Border Style="{StaticResource TangoTouchBorder}" Margin="0 12 0 0" Padding="0 0 0 40"> <StackPanel> <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> <Image Source="../Images/JobView/additional-tools.png" Width="39" /> @@ -549,7 +553,7 @@ <DockPanel LastChildFill="False"> <TextBlock Text="Make a sample dye" VerticalAlignment="Center"></TextBlock> - <touch:TouchToggleSlider DockPanel.Dock="Right" Width="75" Style="{StaticResource TouchToggleButtonCheck}" Margin="30 0 0 0" Height="38" HorizontalAlignment="Left" /> + <touch:TouchToggleSlider x:Name="toggle_sample_dye" DockPanel.Dock="Right" Width="75" Style="{StaticResource TouchToggleButtonCheck}" Margin="30 0 0 0" Height="38" HorizontalAlignment="Left" /> </DockPanel> <DockPanel Margin="0 25 0 0" LastChildFill="False"> @@ -558,7 +562,38 @@ </DockPanel> </StackPanel> </StackPanel> - </Border> + </Border>--> + + <touch:TouchExpander Margin="0 0 0 120" Padding="20 15" IsExpanded="True"> + <touch:TouchExpander.Header> + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 20 0"> + <Image Source="../Images/JobView/sample-dye.png" Width="39" /> + <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Sample Dye</TextBlock> + </StackPanel> + </touch:TouchExpander.Header> + + <StackPanel Margin="60 20 0 0"> + <TextBlock> + <Run>Dye 1 or more units in order to get approval.</Run> + <LineBreak/> + <Run>Once approved, you can dye the entire job.</Run> + </TextBlock> + + <DockPanel Margin="0 50 0 0" LastChildFill="True" Width="450" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center">How many sample units?</TextBlock> + + <DockPanel Margin="50 0 0 0"> + <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="-" DockPanel.Dock="Left" Icon="Minus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" /> + <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="+" DockPanel.Dock="Right" Icon="Plus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" /> + <touch:TouchNumericTextBox Value="{Binding Job.SampleUnitsOrMeters}" Minimum="1" Maximum="100" HorizontalContentAlignment="Center" VerticalAlignment="Center" Margin="10 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoTitleFontSize}" DockPanel.Dock="Right" KeyboardContainer="{Binding ElementName=Container}" /> + </DockPanel> + </DockPanel> + + <touch:TouchButton Margin="0 50 0 15" DockPanel.Dock="Right" Height="54" Padding="0" Width="184" CornerRadius="30" BlurRadius="20" HorizontalAlignment="Right" Command="{Binding StartSampleDyeCommand}"> + START + </touch:TouchButton> + </StackPanel> + </touch:TouchExpander> </StackPanel> </StackPanel> </touch:LightTouchScrollViewer> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs index c67e83fc6..8c112ff7a 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs @@ -193,12 +193,12 @@ namespace Tango.PPC.UI.PPCApplication private async void ConnectToMachine() { - Transport.Discovery.UsbCommunicationScanner<ConnectRequest, ConnectResponse> scanner = new Transport.Discovery.UsbCommunicationScanner<ConnectRequest, ConnectResponse>(UsbSerialBaudRates.BR_9600); - var response = await scanner.Scan(new ConnectRequest() { Password = "1234" }, TimeSpan.FromSeconds(10)); + //Transport.Discovery.UsbCommunicationScanner<ConnectRequest, ConnectResponse> scanner = new Transport.Discovery.UsbCommunicationScanner<ConnectRequest, ConnectResponse>(UsbSerialBaudRates.BR_9600); + //var response = await scanner.Scan(new ConnectRequest() { Password = "1234" }, TimeSpan.FromSeconds(10)); - var machine = new MachineOperator(response.Adapter); - await machine.Connect(); - ConnectedMachine = machine; + //var machine = new MachineOperator(response.Adapter); + //await machine.Connect(); + //ConnectedMachine = machine; } } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareMotor.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareMotor.cs index 3104dfafd..cb7abbd64 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareMotor.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareMotor.cs @@ -23,7 +23,7 @@ namespace Tango.BL.Entities /// <summary> /// - ///</summary> + /// </summary> [Table("HARDWARE_MOTORS")] public partial class HardwareMotor : ObservableEntity<HardwareMotor> @@ -584,8 +584,8 @@ namespace Tango.BL.Entities protected Int32 _fsspd; /// <summary> - ///The speed in which the motor moves to full step operation. - ///</summary> + /// The speed in which the motor moves to full step operation. + /// </summary> [Column("FS_SPD")] diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs index 15ac3d199..0adfe0b23 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs @@ -23,7 +23,7 @@ namespace Tango.BL.Entities /// <summary> /// - ///</summary> + /// </summary> [Table("JOBS")] public partial class Job : ObservableEntity<Job> @@ -433,13 +433,13 @@ namespace Tango.BL.Entities protected Int32 _status; /// <summary> - ///0 = Draft - ///1 = PendingApproval - ///2 = Ready - ///3 = Approved - ///4 = Disrupted - ///5 = Completed - ///</summary> + /// 0 = Draft + /// 1 = PendingApproval + /// 2 = Ready + /// 3 = Approved + /// 4 = Disrupted + /// 5 = Completed + /// </summary> [Column("STATUS")] @@ -505,9 +505,9 @@ namespace Tango.BL.Entities protected Int32 _type; /// <summary> - ///0 = Sewing - ///1 = Embroidery - ///</summary> + /// 0 = Sewing + /// 1 = Embroidery + /// </summary> [Column("TYPE")] @@ -551,9 +551,9 @@ namespace Tango.BL.Entities protected Int32 _spoolsdistribution; /// <summary> - ///0 = All segments per spool - ///1 = One segments per spool - ///</summary> + /// 0 = All segments per spool + /// 1 = One segments per spool + /// </summary> [Column("SPOOLS_DISTRIBUTION")] @@ -593,6 +593,28 @@ namespace Tango.BL.Entities } + protected Int32 _sampleunitsormeters; + + /// <summary> + /// Gets or sets the job sample units or meters. + /// </summary> + + [Column("SAMPLE_UNITS_OR_METERS")] + + public Int32 SampleUnitsOrMeters + { + get + { + return _sampleunitsormeters; + } + + set + { + _sampleunitsormeters = value; RaisePropertyChanged(nameof(SampleUnitsOrMeters)); + } + + } + protected ColorSpace _colorspace; /// <summary> diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/IEnumerableExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/IEnumerableExtensions.cs index ffe164a53..0f15ad060 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/IEnumerableExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/IEnumerableExtensions.cs @@ -80,5 +80,17 @@ public static class IEnumerableExtensions { return String.Join(separator, source); } + + /// <summary> + /// Returns a distinct collection by the specified property. + /// </summary> + /// <typeparam name="T"></typeparam> + /// <param name="source">The source.</param> + /// <param name="property">The property.</param> + /// <returns></returns> + public static IEnumerable<T> DistinctBy<T, TKey>(this IEnumerable<T> source, Func<T, TKey> property) + { + return source.GroupBy(property).Select(g => g.First()); + } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs index 433dacee4..109e876b5 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB.cs @@ -49,6 +49,7 @@ namespace Tango.DAL.Remote.DB public string CUSTOMER_GUID { get; set; } public int SPOOLS_DISTRIBUTION { get; set; } public int NUMBER_OF_HEADS { get; set; } + public int SAMPLE_UNITS_OR_METERS { get; set; } public virtual COLOR_SPACES COLOR_SPACES { get; set; } public virtual CUSTOMER CUSTOMER { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx index 7f17f8940..9030a9f0b 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -582,6 +582,7 @@ <Property Name="CUSTOMER_GUID" Type="varchar" MaxLength="36" /> <Property Name="SPOOLS_DISTRIBUTION" Type="int" Nullable="false" /> <Property Name="NUMBER_OF_HEADS" Type="int" Nullable="false" /> + <Property Name="SAMPLE_UNITS_OR_METERS" Type="int" Nullable="false" /> </EntityType> <EntityType Name="LINEAR_MASS_DENSITY_UNITS"> <Key> @@ -3397,6 +3398,7 @@ <Property Name="CUSTOMER_GUID" Type="String" MaxLength="36" FixedLength="false" Unicode="false" /> <Property Name="SPOOLS_DISTRIBUTION" Type="Int32" Nullable="false" /> <Property Name="NUMBER_OF_HEADS" Type="Int32" Nullable="false" /> + <Property Name="SAMPLE_UNITS_OR_METERS" Type="Int32" Nullable="false" /> <NavigationProperty Name="COLOR_SPACES" Relationship="RemoteModel.FK_JOBS_COLOR_SPACES" FromRole="JOB" ToRole="COLOR_SPACES" /> <NavigationProperty Name="CUSTOMER" Relationship="RemoteModel.FK_JOBS_CUSTOMERS" FromRole="JOB" ToRole="CUSTOMER" /> <NavigationProperty Name="JOB_RUNS" Relationship="RemoteModel.FK_JOB_RUNS_JOBS" FromRole="JOB" ToRole="JOB_RUNS" /> @@ -5462,6 +5464,7 @@ <EntitySetMapping Name="JOBS"> <EntityTypeMapping TypeName="RemoteModel.JOB"> <MappingFragment StoreEntitySet="JOBS"> + <ScalarProperty Name="SAMPLE_UNITS_OR_METERS" ColumnName="SAMPLE_UNITS_OR_METERS" /> <ScalarProperty Name="NUMBER_OF_HEADS" ColumnName="NUMBER_OF_HEADS" /> <ScalarProperty Name="SPOOLS_DISTRIBUTION" ColumnName="SPOOLS_DISTRIBUTION" /> <ScalarProperty Name="CUSTOMER_GUID" ColumnName="CUSTOMER_GUID" /> diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram index 668abf151..305fe3ebd 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,78 +5,78 @@ <!-- Diagram content (shape and connector positions) --> <edmx:Diagrams> <Diagram DiagramId="f9ae01d708754bbd997add25a4bacc79" Name="Diagram1"> - <EntityTypeShape EntityType="RemoteModel.ACTION_TYPES" Width="1.5" PointX="6" PointY="75.5" /> - <EntityTypeShape EntityType="RemoteModel.ADDRESS" Width="1.5" PointX="1.5" PointY="37.625" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="1.5" PointY="76.625" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="73.625" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_OS_VERSIONS" Width="1.5" PointX="1.5" PointY="79.5" /> - <EntityTypeShape EntityType="RemoteModel.APPLICATION_VERSIONS" Width="1.5" PointX="1.5" PointY="70.75" /> - <EntityTypeShape EntityType="RemoteModel.BRUSH_STOPS" Width="1.5" PointX="12.75" PointY="11.125" /> - <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="3" PointY="4.5" /> - <EntityTypeShape EntityType="RemoteModel.CAT" Width="1.5" PointX="5.25" PointY="10.75" /> - <EntityTypeShape EntityType="RemoteModel.CCT" Width="1.5" PointX="5.25" PointY="34" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS" Width="1.5" PointX="10.5" PointY="5.5" /> - <EntityTypeShape EntityType="RemoteModel.COLOR_SPACES" Width="1.5" PointX="6" PointY="18.5" /> - <EntityTypeShape EntityType="RemoteModel.CONFIGURATION" Width="1.5" PointX="0.75" PointY="61.625" /> - <EntityTypeShape EntityType="RemoteModel.CONTACT" Width="1.5" PointX="1.5" PointY="50" /> - <EntityTypeShape EntityType="RemoteModel.CUSTOMER" Width="1.5" PointX="6" PointY="22" /> - <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="3" PointY="95.375" /> - <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="67.875" /> - <EntityTypeShape EntityType="RemoteModel.EMBEDDED_SOFTWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="57.875" /> - <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES" Width="1.5" PointX="6" PointY="70.625" /> - <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES_ACTIONS" Width="1.5" PointX="8.25" PointY="71.5" /> - <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES_CATEGORIES" Width="1.5" PointX="3.75" PointY="74.75" /> - <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES_GROUPS" Width="1.5" PointX="3.75" PointY="71.625" /> - <EntityTypeShape EntityType="RemoteModel.FIBER_SHAPES" Width="1.5" PointX="0.75" PointY="27.5" /> - <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHS" Width="1.5" PointX="0.75" PointY="21.625" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCER_TYPES" Width="1.5" PointX="4.5" PointY="64.375" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCERS" Width="1.5" PointX="6.75" PointY="53.5" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTOR_TYPES" Width="1.5" PointX="7.5" PointY="49.375" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTORS" Width="1.5" PointX="9.75" PointY="52.125" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROL_TYPES" Width="1.5" PointX="1.5" PointY="91.375" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROLS" Width="1.5" PointX="3.75" PointY="57.75" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSOR_TYPES" Width="1.5" PointX="1.5" PointY="87.375" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSORS" Width="1.5" PointX="3.75" PointY="54.25" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="54" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDER_TYPES" Width="1.5" PointX="1.5" PointY="83.375" /> - <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDERS" Width="1.5" PointX="3.75" PointY="50.375" /> - <EntityTypeShape EntityType="RemoteModel.HTML_PAGES" Width="1.5" PointX="3.75" PointY="68.25" /> - <EntityTypeShape EntityType="RemoteModel.IDS_PACK_FORMULAS" Width="1.5" PointX="3" PointY="8.25" /> - <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="5.25" PointY="43.75" /> - <EntityTypeShape EntityType="RemoteModel.JOB_RUNS" Width="1.5" PointX="10.5" PointY="16.75" /> - <EntityTypeShape EntityType="RemoteModel.JOB" Width="1.5" PointX="8.25" PointY="12.25" /> - <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="0.75" PointY="10.875" /> - <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES" Width="1.5" PointX="3" PointY="21" /> - <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES_RMLS" Width="1.5" PointX="5.25" PointY="15" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE_STUDIO_VERSIONS" Width="1.5" PointX="8.25" PointY="38" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS" Width="1.5" PointX="0.75" PointY="46.5" /> - <EntityTypeShape EntityType="RemoteModel.MACHINE" Width="1.5" PointX="3" PointY="44.625" /> - <EntityTypeShape EntityType="RemoteModel.MACHINES_CONFIGURATIONS" Width="1.5" PointX="6.25" PointY="58.625" /> - <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="8.25" PointY="42" /> + <EntityTypeShape EntityType="RemoteModel.ACTION_TYPES" Width="1.5" PointX="6" PointY="98.25" /> + <EntityTypeShape EntityType="RemoteModel.ADDRESS" Width="1.5" PointX="1.5" PointY="43.5" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_DISPLAY_PANEL_VERSIONS" Width="1.5" PointX="1.5" PointY="70.25" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="57.5" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_OS_VERSIONS" Width="1.5" PointX="1.5" PointY="60.5" /> + <EntityTypeShape EntityType="RemoteModel.APPLICATION_VERSIONS" Width="1.5" PointX="1.5" PointY="76" /> + <EntityTypeShape EntityType="RemoteModel.BRUSH_STOPS" Width="1.5" PointX="12.75" PointY="14.5" /> + <EntityTypeShape EntityType="RemoteModel.CARTRIDGE_TYPES" Width="1.5" PointX="6.75" PointY="84.75" /> + <EntityTypeShape EntityType="RemoteModel.CAT" Width="1.5" PointX="5.25" PointY="19.75" /> + <EntityTypeShape EntityType="RemoteModel.CCT" Width="1.5" PointX="5.25" PointY="11.375" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_CATALOGS" Width="1.5" PointX="10.5" PointY="20.875" /> + <EntityTypeShape EntityType="RemoteModel.COLOR_SPACES" Width="1.5" PointX="6" PointY="23.75" /> + <EntityTypeShape EntityType="RemoteModel.CONFIGURATION" Width="1.5" PointX="3.75" PointY="65.125" /> + <EntityTypeShape EntityType="RemoteModel.CONTACT" Width="1.5" PointX="1.5" PointY="47.75" /> + <EntityTypeShape EntityType="RemoteModel.CUSTOMER" Width="1.5" PointX="6" PointY="46.125" /> + <EntityTypeShape EntityType="RemoteModel.DISPENSER_TYPES" Width="1.5" PointX="6.75" PointY="81.375" /> + <EntityTypeShape EntityType="RemoteModel.EMBEDDED_FIRMWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="67.25" /> + <EntityTypeShape EntityType="RemoteModel.EMBEDDED_SOFTWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="73.125" /> + <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES" Width="1.5" PointX="6" PointY="93.375" /> + <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES_ACTIONS" Width="1.5" PointX="8.25" PointY="94.25" /> + <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES_CATEGORIES" Width="1.5" PointX="3.75" PointY="97.5" /> + <EntityTypeShape EntityType="RemoteModel.EVENT_TYPES_GROUPS" Width="1.5" PointX="3.75" PointY="94.375" /> + <EntityTypeShape EntityType="RemoteModel.FIBER_SHAPES" Width="1.5" PointX="0.75" PointY="18.75" /> + <EntityTypeShape EntityType="RemoteModel.FIBER_SYNTHS" Width="1.5" PointX="0.75" PointY="27.5" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCER_TYPES" Width="1.5" PointX="4.5" PointY="71.75" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_DANCERS" Width="1.5" PointX="6.75" PointY="55.875" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTOR_TYPES" Width="1.5" PointX="6.5" PointY="77.75" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_MOTORS" Width="1.5" PointX="8.75" PointY="61.5" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROL_TYPES" Width="1.5" PointX="1.5" PointY="53.75" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_PID_CONTROLS" Width="1.5" PointX="3.75" PointY="58.125" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSOR_TYPES" Width="1.5" PointX="4.5" PointY="81.75" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_SPEED_SENSORS" Width="1.5" PointX="6.75" PointY="69.625" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_VERSIONS" Width="1.5" PointX="1.5" PointY="63.375" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDER_TYPES" Width="1.5" PointX="7.5" PointY="73.75" /> + <EntityTypeShape EntityType="RemoteModel.HARDWARE_WINDERS" Width="1.5" PointX="9.75" PointY="57.75" /> + <EntityTypeShape EntityType="RemoteModel.HTML_PAGES" Width="1.5" PointX="3.75" PointY="91" /> + <EntityTypeShape EntityType="RemoteModel.IDS_PACK_FORMULAS" Width="1.5" PointX="6.75" PointY="87.625" /> + <EntityTypeShape EntityType="RemoteModel.IDS_PACKS" Width="1.5" PointX="9" PointY="44" /> + <EntityTypeShape EntityType="RemoteModel.JOB_RUNS" Width="1.5" PointX="10.5" PointY="13.25" /> + <EntityTypeShape EntityType="RemoteModel.JOB" Width="1.5" PointX="8.25" PointY="12.125" /> + <EntityTypeShape EntityType="RemoteModel.LINEAR_MASS_DENSITY_UNITS" Width="1.5" PointX="0.75" PointY="21.625" /> + <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES" Width="1.5" PointX="3" PointY="21.875" /> + <EntityTypeShape EntityType="RemoteModel.LIQUID_TYPES_RMLS" Width="1.5" PointX="5.25" PointY="16" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE_STUDIO_VERSIONS" Width="1.5" PointX="8.25" PointY="39.125" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE_VERSIONS" Width="1.5" PointX="3.75" PointY="54.25" /> + <EntityTypeShape EntityType="RemoteModel.MACHINE" Width="1.5" PointX="6" PointY="64" /> + <EntityTypeShape EntityType="RemoteModel.MACHINES_CONFIGURATIONS" Width="1.5" PointX="11.25" PointY="66.125" /> + <EntityTypeShape EntityType="RemoteModel.MACHINES_EVENTS" Width="1.5" PointX="8.25" PointY="51.75" /> <EntityTypeShape EntityType="RemoteModel.MEDIA_COLORS" Width="1.5" PointX="0.75" PointY="15" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_CONDITIONS" Width="1.5" PointX="0.75" PointY="18.75" /> - <EntityTypeShape EntityType="RemoteModel.MEDIA_MATERIALS" Width="1.5" PointX="0.75" PointY="7.875" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_CONDITIONS" Width="1.5" PointX="0.75" PointY="7.875" /> + <EntityTypeShape EntityType="RemoteModel.MEDIA_MATERIALS" Width="1.5" PointX="0.75" PointY="10.875" /> <EntityTypeShape EntityType="RemoteModel.MEDIA_PURPOSES" Width="1.5" PointX="0.75" PointY="24.625" /> - <EntityTypeShape EntityType="RemoteModel.MID_TANK_TYPES" Width="1.5" PointX="3" PointY="25.125" /> - <EntityTypeShape EntityType="RemoteModel.ORGANIZATION" Width="1.5" PointX="0.75" PointY="32.875" /> - <EntityTypeShape EntityType="RemoteModel.PERMISSION" Width="1.5" PointX="9" PointY="24.25" /> - <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES" Width="1.5" PointX="7.5" PointY="27.375" /> - <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES_GROUPS" Width="1.5" PointX="5.25" PointY="29" /> + <EntityTypeShape EntityType="RemoteModel.MID_TANK_TYPES" Width="1.5" PointX="6.75" PointY="7.25" /> + <EntityTypeShape EntityType="RemoteModel.ORGANIZATION" Width="1.5" PointX="3.75" PointY="45.625" /> + <EntityTypeShape EntityType="RemoteModel.PERMISSION" Width="1.5" PointX="9" PointY="8.375" /> + <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES" Width="1.5" PointX="7.5" PointY="31.75" /> + <EntityTypeShape EntityType="RemoteModel.PROCESS_PARAMETERS_TABLES_GROUPS" Width="1.5" PointX="5.25" PointY="33.25" /> <EntityTypeShape EntityType="RemoteModel.RML" Width="1.5" PointX="3" PointY="12.375" /> - <EntityTypeShape EntityType="RemoteModel.ROLE" Width="1.5" PointX="9" PointY="34.125" /> - <EntityTypeShape EntityType="RemoteModel.ROLES_PERMISSIONS" Width="1.5" PointX="11.25" PointY="34.25" /> - <EntityTypeShape EntityType="RemoteModel.SEGMENT" Width="1.5" PointX="10.5" PointY="13.25" /> - <EntityTypeShape EntityType="RemoteModel.SPOOL_TYPES" Width="1.5" PointX="6" PointY="6" /> + <EntityTypeShape EntityType="RemoteModel.ROLE" Width="1.5" PointX="9" PointY="28.25" /> + <EntityTypeShape EntityType="RemoteModel.ROLES_PERMISSIONS" Width="1.5" PointX="11.25" PointY="28.375" /> + <EntityTypeShape EntityType="RemoteModel.SEGMENT" Width="1.5" PointX="10.5" PointY="16.625" /> + <EntityTypeShape EntityType="RemoteModel.SPOOL_TYPES" Width="1.5" PointX="6" PointY="49.75" /> <EntityTypeShape EntityType="RemoteModel.SYNC_CONFIGURATIONS" Width="1.5" PointX="0.75" PointY="0.75" /> <EntityTypeShape EntityType="RemoteModel.sysdiagram" Width="1.5" PointX="2.75" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_CONTROLLERS" Width="1.5" PointX="8.75" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_DISPENSERS" Width="1.5" PointX="10.75" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_IOS" Width="1.5" PointX="12.75" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_MONITORS" Width="1.5" PointX="12.75" PointY="5.75" /> - <EntityTypeShape EntityType="RemoteModel.TECH_VALVES" Width="1.5" PointX="14.75" PointY="0.75" /> - <EntityTypeShape EntityType="RemoteModel.USER" Width="1.5" PointX="6" PointY="38.25" /> - <EntityTypeShape EntityType="RemoteModel.USERS_ROLES" Width="1.5" PointX="11.25" PointY="39.125" /> - <EntityTypeShape EntityType="RemoteModel.WINDING_METHODS" Width="1.5" PointX="6" PointY="2.125" /> + <EntityTypeShape EntityType="RemoteModel.TECH_CONTROLLERS" Width="1.5" PointX="0.75" PointY="3.75" /> + <EntityTypeShape EntityType="RemoteModel.TECH_DISPENSERS" Width="1.5" PointX="2.75" PointY="3.75" /> + <EntityTypeShape EntityType="RemoteModel.TECH_IOS" Width="1.5" PointX="4.75" PointY="0.75" /> + <EntityTypeShape EntityType="RemoteModel.TECH_MONITORS" Width="1.5" PointX="6.75" PointY="0.75" /> + <EntityTypeShape EntityType="RemoteModel.TECH_VALVES" Width="1.5" PointX="2.75" PointY="6.75" /> + <EntityTypeShape EntityType="RemoteModel.USER" Width="1.5" PointX="6" PointY="38.375" /> + <EntityTypeShape EntityType="RemoteModel.USERS_ROLES" Width="1.5" PointX="11.25" PointY="39.25" /> + <EntityTypeShape EntityType="RemoteModel.WINDING_METHODS" Width="1.5" PointX="6" PointY="27.25" /> <AssociationConnector Association="RemoteModel.FK_EVENTS_ACTIONS_ACTIONS" /> <AssociationConnector Association="RemoteModel.FK_ORGANIZATIONS_ADDRESSES" /> <AssociationConnector Association="RemoteModel.FK_USERS_ADDRESSES" /> diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs index c45701e99..aee5fae26 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs @@ -70,7 +70,7 @@ namespace Tango.Touch.Controls set { SetValue(MinimumProperty, value); } } public static readonly DependencyProperty MinimumProperty = - DependencyProperty.Register("Minimum", typeof(double), typeof(TouchNumericTextBox), new PropertyMetadata(.0)); + DependencyProperty.Register("Minimum", typeof(double), typeof(TouchNumericTextBox), new PropertyMetadata(0.0)); public double Maximum { @@ -108,6 +108,8 @@ namespace Tango.Touch.Controls _text_box.GotFocus += _text_box_GotFocus; _text_box.TextChanged += _text_box_TextChanged; + Value = Value; + OnValueChanged(); } diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchToggleButton.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchToggleButton.cs index 8187645ca..f24d716db 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchToggleButton.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchToggleButton.cs @@ -19,6 +19,8 @@ namespace Tango.Touch.Controls public class TouchToggleButton : ToggleButton, ITouchControl { private Object _uncheckedContent; + private bool _loaded; + private bool first_checked; #region ITouchControl @@ -91,8 +93,33 @@ namespace Tango.Touch.Controls public TouchToggleButton() { - Loaded += (_, __) => _uncheckedContent = Content; - Checked += (_, __) => Content = CheckedContent != null ? CheckedContent : Content; + Loaded += (_, __) => + { + if (!_loaded) + { + _uncheckedContent = Content; + _loaded = true; + } + }; + + Checked += (_, __) => + { + if (_loaded) + { + Content = CheckedContent != null ? CheckedContent : Content; + } + else + { + Loaded += (x, y) => + { + if (!first_checked) + { + Content = CheckedContent != null ? CheckedContent : Content; + first_checked = true; + } + }; + } + }; Unchecked += (_, __) => Content = _uncheckedContent; } } diff --git a/Software/Visual_Studio/Utilities/Tango.UITests/App.xaml b/Software/Visual_Studio/Utilities/Tango.UITests/App.xaml index 0ede32b42..43576481f 100644 --- a/Software/Visual_Studio/Utilities/Tango.UITests/App.xaml +++ b/Software/Visual_Studio/Utilities/Tango.UITests/App.xaml @@ -6,20 +6,20 @@ StartupUri="MainWindow.xaml"> <Application.Resources> <ResourceDictionary> - <ResourceDictionary.MergedDictionaries> - <!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! --> + <!--<ResourceDictionary.MergedDictionaries> + --><!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! --><!-- <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" /> - <!-- Accent and AppTheme setting --> + --><!-- Accent and AppTheme setting --><!-- <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/FlatButton.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/VS/Colors.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/VS/Styles.xaml" /> - </ResourceDictionary.MergedDictionaries> + </ResourceDictionary.MergedDictionaries>--> </ResourceDictionary> </Application.Resources> </Application> diff --git a/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml b/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml index 05bcad25c..6f821d30f 100644 --- a/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml +++ b/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml @@ -16,6 +16,6 @@ Title="MainWindow" Height="500" Width="800" Foreground="Red" DataContext="{Binding RelativeSource={RelativeSource Self}}"> <Grid> - <stubs:StubsView/> + <touch:TouchNumericTextBox Value="{Binding Value}" Minimum="1" Maximum="100" Margin="0 100 0 0" VerticalAlignment="Top" Width="100" /> </Grid> </Window> diff --git a/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml.cs b/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml.cs index 06613ee1e..c3eca4c76 100644 --- a/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml.cs +++ b/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml.cs @@ -110,6 +110,14 @@ namespace Tango.UITests public RelayCommand<DropEventArgs> DropCommand { get; set; } + public int Value + { + get { return (int)GetValue(ValueProperty); } + set { SetValue(ValueProperty, value); } + } + public static readonly DependencyProperty ValueProperty = + DependencyProperty.Register("Value", typeof(int), typeof(MainWindow), new PropertyMetadata(0)); + public MainWindow() { Persons = new ObservableCollection<Person>(); @@ -127,9 +135,11 @@ namespace Tango.UITests DropCommand = new RelayCommand<DropEventArgs>(OnDrop); + Value = 10; + InitializeComponent(); - DataContext = new VM(); + //DataContext = new VM(); } private void OnDrop(DropEventArgs e) |
