aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2023-08-28 18:50:50 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2023-08-28 18:50:50 +0300
commit35a6803034f699d6e2a7f4c7650d87c45e04e9be (patch)
tree48c2816a21c2c15257c92e67c415df8d2e7eecac /Software/Visual_Studio/PPC/Modules
parentdbd01e3213d88f39bb0659c42fffb84e9e96b39e (diff)
downloadTango-35a6803034f699d6e2a7f4c7650d87c45e04e9be.tar.gz
Tango-35a6803034f699d6e2a7f4c7650d87c45e04e9be.zip
Allow setting the VFT length from within the VFT window
Related Work Items: #8717
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml7
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs32
2 files changed, 35 insertions, 4 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml
index 99b78d7ec..bd1183dea 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialog.xaml
@@ -231,7 +231,7 @@
<Run Text="{Binding TrialNumber, Mode=OneWay}" Foreground="{StaticResource TangoGrayTextBrush}"></Run>
</TextBlock>
</StackPanel>
-
+ <Grid Grid.Row="1" HorizontalAlignment="Stretch" Grid.RowSpan="2" >
<touch:TouchNavigationLinks Grid.Row="1" BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 0 0 3" x:Name="navigationCSTLinks" SelectionChanged="TouchNavigationLinks_SelectionChanged" HorizontalContentAlignment="Center"
SelectedIndex="{Binding SelectedTabIndex,Mode=TwoWay}" VerticalAlignment="Bottom" Margin="0,0,0,30" Padding="40 0 40 0"
FontSize="{StaticResource TangoNavigationLinksFontSize}" Grid.RowSpan="2" PreviewMouseDown="NavigationCSTLinks_PreviewMouseDown" PreviewTouchDown="NavigationCSTLinks_PreviewTouchDown" >
@@ -262,6 +262,11 @@
</touch:TouchNavigationLinks.Style>
</touch:TouchNavigationLinks>
+ <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 0 20 20" >
+ <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="{StaticResource TangoButtonFontSize}">Length:</TextBlock>
+ <touch:TouchNumericTextBox Margin="20 0 20 5" Width="80" Height="40" HorizontalAlignment="Stretch" BorderThickness="0.8" Minimum="20" Maximum="999" Value="{Binding FineTuningTrialLengthMeters, Mode=TwoWay}" FontSize="{StaticResource TangoButtonFontSize}" FontWeight="Normal" BorderBrush="{StaticResource TangoDividerBrush}" HideUnderline="True" HasDecimalPoint="False" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
+ </StackPanel>
+ </Grid>
<Grid Grid.Row="3" Margin="40 0 20 0">
<Grid Visibility="{Binding IsManualFineTuning, Converter={StaticResource BooleanToVisibilityInverseConverter}}" Margin="0 0 24 0" x:Name="Automatic">
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs
index 3914a8b1b..e6094d0d7 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/VectorFineTuningDialogVM.cs
@@ -716,7 +716,20 @@ namespace Tango.PPC.Jobs.Dialogs
}
}
}
-
+
+ private int _fineTuningTrialLengthMeters;
+
+ public int FineTuningTrialLengthMeters
+ {
+ get { return _fineTuningTrialLengthMeters; }
+ set
+ {
+ _fineTuningTrialLengthMeters = value;
+ RaisePropertyChangedAuto();
+ OnUpdateSettingineTuningTrialLengthMeters();
+ }
+ }
+
#endregion
#region Commands
@@ -757,6 +770,9 @@ namespace Tango.PPC.Jobs.Dialogs
IsManualFineTuning = false;
IsOnlyManual = false;
VisualCorrectionModel = new VisualOffsetModel();
+
+ var settings = SettingsManager.Default.GetOrCreate<PPCSettings>();
+ FineTuningTrialLengthMeters = settings.FineTuningTrialLengthMeters;
}
/// <summary>
@@ -1375,6 +1391,16 @@ namespace Tango.PPC.Jobs.Dialogs
}
+ private void OnUpdateSettingineTuningTrialLengthMeters()
+ {
+ if (FineTuningTrialLengthMeters != 0)
+ {
+ var settings = SettingsManager.Default.GetOrCreate<PPCSettings>();
+ settings.FineTuningTrialLengthMeters = FineTuningTrialLengthMeters;
+ settings.Save();
+ }
+ }
+
#endregion
#region Job
@@ -1444,7 +1470,7 @@ namespace Tango.PPC.Jobs.Dialogs
}
BrushStopModel.ColorSpace = ColorSpaces.LAB;
}
- var settings = SettingsManager.Default.GetOrCreate<PPCSettings>();
+ // var settings = SettingsManager.Default.GetOrCreate<PPCSettings>();
using (ObservablesContext db = ObservablesContext.CreateDefault())
{
@@ -1464,7 +1490,7 @@ namespace Tango.PPC.Jobs.Dialogs
Segment segment = new Segment();
segment.Name = "VFT Segment";
- segment.Length = settings.FineTuningTrialLengthMeters;
+ segment.Length = FineTuningTrialLengthMeters;//settings.FineTuningTrialLengthMeters;
segment.Job = job;
segment.JobGuid = job.Guid;