Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Enable saving of multiple settings for tasks #2319

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f8d02b1
Begin implementing GUI save preset settings
kscdnw Apr 17, 2023
4ebfdad
Change the Save button in the SaveSettingsWindow
kscdnw Apr 17, 2023
bc81a2f
Attached ViewModel to main task window
nbollis Apr 17, 2023
b8b97b8
Merge Conflict
nbollis Apr 17, 2023
0e49b6d
Added ability for view model to communicate selected item with gui an…
nbollis Apr 19, 2023
b24aafc
Default Settings updated.
kscdnw Apr 19, 2023
79a2a0f
Removed dead method
nbollis Apr 19, 2023
eea8177
Merge updated
kscdnw Apr 19, 2023
8d0c428
SaveAsDefautSettings and SaveSettings buttons updated.
kscdnw Apr 26, 2023
aa3ce6d
Some Gui bugs fixed.
kscdnw Apr 26, 2023
4d0e2cb
Developed ability to test with actions and methods
nbollis Apr 26, 2023
a60fb95
Merge branch 'FWSaveSettings' of https://github.com/kscdnw/MetaMorphe…
nbollis Apr 26, 2023
f421159
Added testing class for window operations
nbollis Apr 27, 2023
957185f
Got the other windows ready
nbollis Apr 27, 2023
87917e7
Merged Master into development branch
kscdnw Sep 12, 2023
ffacfc6
Replace added files with what's in the old hard drive.
kscdnw Sep 19, 2023
f7f8772
Add the TaskSettingViewModel to all task window except for Spectral A…
kscdnw Nov 28, 2023
c9c2a8c
Clean up codes and spaces that are not used. Reformatting the Guis th…
kscdnw Dec 5, 2023
798d5e3
Merge branch 'master' into FWSaveSettings
kscdnw Dec 5, 2023
a83a1b1
Binding SaveAsDefault button for all task windows and manually test t…
kscdnw Dec 5, 2023
43a7336
Change the columns of the labels in TaskWindows. Remove SaveAsDefault…
kscdnw Dec 12, 2023
fc5fc80
Merge branch 'master' into FWSaveSettings
kscdnw Dec 12, 2023
6af7af1
Merge branch 'master' into FWSaveSettings
nbollis Dec 13, 2023
419efe4
Merge branch 'master' into FWSaveSettings
nbollis Jan 29, 2024
3e7be9b
Merge branch 'master' into FWSaveSettings
nbollis Feb 6, 2024
8348513
removed extra solution file
nbollis Feb 6, 2024
8306c7a
Reverted changes to testscan management
nbollis Feb 6, 2024
1fb9361
Reverted changes to testscan management
nbollis Feb 6, 2024
d0dc6c0
merged
nbollis Feb 6, 2024
f930a39
reverted change to TestScanManagement
nbollis Feb 6, 2024
9c4ddce
Merge branch 'master' into FWSaveSettings
nbollis Feb 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 134 additions & 0 deletions MetaMorpheus.sln
kscdnw marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32228.430
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CMD", "CMD\CMD.csproj", "{FD20EBBA-F4C5-40D6-AD61-48A7EB255DAE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GUI", "GUI\GUI.csproj", "{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EngineLayer", "EngineLayer\EngineLayer.csproj", "{FFAE3A5E-B5AE-4CD0-ABF9-703C91F1C7D6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TaskLayer", "TaskLayer\TaskLayer.csproj", "{9CD3D75C-4E3C-40AC-A3D8-C32DD528DB7F}"
EndProject
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MetaMorpheusSetup", "MetaMorpheusSetup\MetaMorpheusSetup.wixproj", "{BE72541A-66A4-4958-9D19-56ACC7D3876B}"
ProjectSection(ProjectDependencies) = postProject
{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD} = {C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}
EndProjectSection
EndProject
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Bootstrapper1", "Bootstrapper1\Bootstrapper1.wixproj", "{FBA0315B-076D-4470-AFB0-64C8AB4A65A9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GuiFunctions", "GuiFunctions\GuiFunctions.csproj", "{653015B3-CC5A-4D1C-AAD3-1CE2A0C4D197}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test", "Test\Test.csproj", "{7EE028A9-75A2-450F-A9A7-76559ED15419}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FD20EBBA-F4C5-40D6-AD61-48A7EB255DAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FD20EBBA-F4C5-40D6-AD61-48A7EB255DAE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FD20EBBA-F4C5-40D6-AD61-48A7EB255DAE}.Debug|x64.ActiveCfg = Debug|Any CPU
{FD20EBBA-F4C5-40D6-AD61-48A7EB255DAE}.Debug|x64.Build.0 = Debug|Any CPU
{FD20EBBA-F4C5-40D6-AD61-48A7EB255DAE}.Debug|x86.ActiveCfg = Debug|Any CPU
{FD20EBBA-F4C5-40D6-AD61-48A7EB255DAE}.Debug|x86.Build.0 = Debug|Any CPU
{FD20EBBA-F4C5-40D6-AD61-48A7EB255DAE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FD20EBBA-F4C5-40D6-AD61-48A7EB255DAE}.Release|Any CPU.Build.0 = Release|Any CPU
{FD20EBBA-F4C5-40D6-AD61-48A7EB255DAE}.Release|x64.ActiveCfg = Release|Any CPU
{FD20EBBA-F4C5-40D6-AD61-48A7EB255DAE}.Release|x64.Build.0 = Release|Any CPU
{FD20EBBA-F4C5-40D6-AD61-48A7EB255DAE}.Release|x86.ActiveCfg = Release|Any CPU
{FD20EBBA-F4C5-40D6-AD61-48A7EB255DAE}.Release|x86.Build.0 = Release|Any CPU
{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}.Debug|x64.ActiveCfg = Debug|Any CPU
{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}.Debug|x64.Build.0 = Debug|Any CPU
{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}.Debug|x86.ActiveCfg = Debug|Any CPU
{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}.Debug|x86.Build.0 = Debug|Any CPU
{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}.Release|Any CPU.Build.0 = Release|Any CPU
{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}.Release|x64.ActiveCfg = Release|Any CPU
{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}.Release|x64.Build.0 = Release|Any CPU
{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}.Release|x86.ActiveCfg = Release|Any CPU
{C654FC97-FBD1-43D7-9F61-35FDD1A4E0AD}.Release|x86.Build.0 = Release|Any CPU
{FFAE3A5E-B5AE-4CD0-ABF9-703C91F1C7D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FFAE3A5E-B5AE-4CD0-ABF9-703C91F1C7D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FFAE3A5E-B5AE-4CD0-ABF9-703C91F1C7D6}.Debug|x64.ActiveCfg = Debug|Any CPU
{FFAE3A5E-B5AE-4CD0-ABF9-703C91F1C7D6}.Debug|x64.Build.0 = Debug|Any CPU
{FFAE3A5E-B5AE-4CD0-ABF9-703C91F1C7D6}.Debug|x86.ActiveCfg = Debug|Any CPU
{FFAE3A5E-B5AE-4CD0-ABF9-703C91F1C7D6}.Debug|x86.Build.0 = Debug|Any CPU
{FFAE3A5E-B5AE-4CD0-ABF9-703C91F1C7D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FFAE3A5E-B5AE-4CD0-ABF9-703C91F1C7D6}.Release|Any CPU.Build.0 = Release|Any CPU
{FFAE3A5E-B5AE-4CD0-ABF9-703C91F1C7D6}.Release|x64.ActiveCfg = Release|Any CPU
{FFAE3A5E-B5AE-4CD0-ABF9-703C91F1C7D6}.Release|x64.Build.0 = Release|Any CPU
{FFAE3A5E-B5AE-4CD0-ABF9-703C91F1C7D6}.Release|x86.ActiveCfg = Release|Any CPU
{FFAE3A5E-B5AE-4CD0-ABF9-703C91F1C7D6}.Release|x86.Build.0 = Release|Any CPU
{9CD3D75C-4E3C-40AC-A3D8-C32DD528DB7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9CD3D75C-4E3C-40AC-A3D8-C32DD528DB7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9CD3D75C-4E3C-40AC-A3D8-C32DD528DB7F}.Debug|x64.ActiveCfg = Debug|Any CPU
{9CD3D75C-4E3C-40AC-A3D8-C32DD528DB7F}.Debug|x64.Build.0 = Debug|Any CPU
{9CD3D75C-4E3C-40AC-A3D8-C32DD528DB7F}.Debug|x86.ActiveCfg = Debug|Any CPU
{9CD3D75C-4E3C-40AC-A3D8-C32DD528DB7F}.Debug|x86.Build.0 = Debug|Any CPU
{9CD3D75C-4E3C-40AC-A3D8-C32DD528DB7F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9CD3D75C-4E3C-40AC-A3D8-C32DD528DB7F}.Release|Any CPU.Build.0 = Release|Any CPU
{9CD3D75C-4E3C-40AC-A3D8-C32DD528DB7F}.Release|x64.ActiveCfg = Release|Any CPU
{9CD3D75C-4E3C-40AC-A3D8-C32DD528DB7F}.Release|x64.Build.0 = Release|Any CPU
{9CD3D75C-4E3C-40AC-A3D8-C32DD528DB7F}.Release|x86.ActiveCfg = Release|Any CPU
{9CD3D75C-4E3C-40AC-A3D8-C32DD528DB7F}.Release|x86.Build.0 = Release|Any CPU
{BE72541A-66A4-4958-9D19-56ACC7D3876B}.Debug|Any CPU.ActiveCfg = Debug|x64
{BE72541A-66A4-4958-9D19-56ACC7D3876B}.Debug|Any CPU.Build.0 = Debug|x64
{BE72541A-66A4-4958-9D19-56ACC7D3876B}.Debug|x64.ActiveCfg = Debug|x64
{BE72541A-66A4-4958-9D19-56ACC7D3876B}.Debug|x64.Build.0 = Debug|x64
{BE72541A-66A4-4958-9D19-56ACC7D3876B}.Debug|x86.ActiveCfg = Debug|x64
{BE72541A-66A4-4958-9D19-56ACC7D3876B}.Release|Any CPU.ActiveCfg = Release|x64
{BE72541A-66A4-4958-9D19-56ACC7D3876B}.Release|Any CPU.Build.0 = Release|x64
{BE72541A-66A4-4958-9D19-56ACC7D3876B}.Release|x64.ActiveCfg = Release|x64
{BE72541A-66A4-4958-9D19-56ACC7D3876B}.Release|x64.Build.0 = Release|x64
{BE72541A-66A4-4958-9D19-56ACC7D3876B}.Release|x86.ActiveCfg = Release|x64
{FBA0315B-076D-4470-AFB0-64C8AB4A65A9}.Debug|Any CPU.ActiveCfg = Debug|x86
{FBA0315B-076D-4470-AFB0-64C8AB4A65A9}.Debug|x64.ActiveCfg = Debug|x86
{FBA0315B-076D-4470-AFB0-64C8AB4A65A9}.Debug|x86.ActiveCfg = Debug|x86
{FBA0315B-076D-4470-AFB0-64C8AB4A65A9}.Debug|x86.Build.0 = Debug|x86
{FBA0315B-076D-4470-AFB0-64C8AB4A65A9}.Release|Any CPU.ActiveCfg = Release|x86
{FBA0315B-076D-4470-AFB0-64C8AB4A65A9}.Release|Any CPU.Build.0 = Release|x86
{FBA0315B-076D-4470-AFB0-64C8AB4A65A9}.Release|x64.ActiveCfg = Release|x86
{FBA0315B-076D-4470-AFB0-64C8AB4A65A9}.Release|x64.Build.0 = Release|x86
{FBA0315B-076D-4470-AFB0-64C8AB4A65A9}.Release|x86.ActiveCfg = Release|x86
{FBA0315B-076D-4470-AFB0-64C8AB4A65A9}.Release|x86.Build.0 = Release|x86
{653015B3-CC5A-4D1C-AAD3-1CE2A0C4D197}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{653015B3-CC5A-4D1C-AAD3-1CE2A0C4D197}.Debug|Any CPU.Build.0 = Debug|Any CPU
{653015B3-CC5A-4D1C-AAD3-1CE2A0C4D197}.Debug|x64.ActiveCfg = Debug|Any CPU
{653015B3-CC5A-4D1C-AAD3-1CE2A0C4D197}.Debug|x64.Build.0 = Debug|Any CPU
{653015B3-CC5A-4D1C-AAD3-1CE2A0C4D197}.Debug|x86.ActiveCfg = Debug|Any CPU
{653015B3-CC5A-4D1C-AAD3-1CE2A0C4D197}.Debug|x86.Build.0 = Debug|Any CPU
{653015B3-CC5A-4D1C-AAD3-1CE2A0C4D197}.Release|Any CPU.ActiveCfg = Release|Any CPU
{653015B3-CC5A-4D1C-AAD3-1CE2A0C4D197}.Release|Any CPU.Build.0 = Release|Any CPU
{653015B3-CC5A-4D1C-AAD3-1CE2A0C4D197}.Release|x64.ActiveCfg = Release|Any CPU
{653015B3-CC5A-4D1C-AAD3-1CE2A0C4D197}.Release|x64.Build.0 = Release|Any CPU
{653015B3-CC5A-4D1C-AAD3-1CE2A0C4D197}.Release|x86.ActiveCfg = Release|Any CPU
{653015B3-CC5A-4D1C-AAD3-1CE2A0C4D197}.Release|x86.Build.0 = Release|Any CPU
{7EE028A9-75A2-450F-A9A7-76559ED15419}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7EE028A9-75A2-450F-A9A7-76559ED15419}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7EE028A9-75A2-450F-A9A7-76559ED15419}.Debug|x64.ActiveCfg = Debug|Any CPU
{7EE028A9-75A2-450F-A9A7-76559ED15419}.Debug|x64.Build.0 = Debug|Any CPU
{7EE028A9-75A2-450F-A9A7-76559ED15419}.Debug|x86.ActiveCfg = Debug|Any CPU
{7EE028A9-75A2-450F-A9A7-76559ED15419}.Debug|x86.Build.0 = Debug|Any CPU
{7EE028A9-75A2-450F-A9A7-76559ED15419}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7EE028A9-75A2-450F-A9A7-76559ED15419}.Release|Any CPU.Build.0 = Release|Any CPU
{7EE028A9-75A2-450F-A9A7-76559ED15419}.Release|x64.ActiveCfg = Release|Any CPU
{7EE028A9-75A2-450F-A9A7-76559ED15419}.Release|x64.Build.0 = Release|Any CPU
{7EE028A9-75A2-450F-A9A7-76559ED15419}.Release|x86.ActiveCfg = Release|Any CPU
{7EE028A9-75A2-450F-A9A7-76559ED15419}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4735EA49-310B-4478-BF26-64F03519DB48}
EndGlobalSection
EndGlobal
21 changes: 11 additions & 10 deletions MetaMorpheus/GUI/MainWindow.xaml
kscdnw marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -450,32 +450,33 @@
<RowDefinition Height="50"/>
<RowDefinition Height="50"/>
<RowDefinition Height="25"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="41*"/>
<RowDefinition Height="153*"/>
</Grid.RowDefinitions>

<!--Header label-->
<Label Content="Spectra" Grid.Row="0" Style="{StaticResource HeaderLabelStyle}" />

<!--Detail text-->
<TextBlock Grid.Row="1" Style="{StaticResource TextBlockStyle}">
<TextBlock Grid.Row="1" Style="{StaticResource TextBlockStyle}" Margin="15,0,10,0">
Add spectra file(s) in .mzML, .mgf, or Thermo .raw format.
</TextBlock>

<!--Button to add spectra files-->
<Button Name="AddSpectraButton" Grid.Row="2" Content="+ADD SPECTRA" Click="AddSpectraFile_Click" HorizontalAlignment="Right"
Style="{StaticResource ImportantButtonStyle}" Margin="0,0,10,0"/>
<Button Name="AddSpectraButton" Grid.Row="2" Content="+ADD SPECTRA" Click="AddSpectraFile_Click" HorizontalAlignment="Left"
Style="{StaticResource ImportantButtonStyle}" Margin="634,0,0,0"/>

<Button Name="SetFileSpecificSettingsButton" Grid.Row="2" Content="SET FILE-SPECIFIC SETTINGS" Click="SetFileSpecificParameters_Click"
HorizontalAlignment="Right" Style="{StaticResource ImportantButtonStyle}"
Margin="0,0,211,0"/>
HorizontalAlignment="Left" Style="{StaticResource ImportantButtonStyle}"
Margin="433,0,0,0"/>

<Button Name="SetExperimentalDesignButton" Grid.Row="2" Content="SET EXPERIMENTAL DESIGN" Click="SetExperimentalDesign_Click"
HorizontalAlignment="Right" Style="{StaticResource ImportantButtonStyle}"
Margin="0,0,412,0"/>
HorizontalAlignment="Left" Style="{StaticResource ImportantButtonStyle}"
Margin="232,0,0,0"/>

<!--The list of spectra files-->
<DataGrid Name="dataGridSpectraFiles" ItemsSource="{Binding}" Grid.Row="3" Style="{StaticResource x:DataGridStyle}"
ColumnHeaderStyle="{StaticResource DataGridColumnHeaderStyle}" PreviewKeyDown="Window_PreviewKeyDown">
ColumnHeaderStyle="{StaticResource DataGridColumnHeaderStyle}" PreviewKeyDown="Window_PreviewKeyDown" Margin="10,0,10,10" Grid.RowSpan="2">
<DataGrid.RowStyle>
<Style TargetType="{x:Type DataGridRow}" BasedOn="{StaticResource SpectraFileDataGridItemStyle}" />
</DataGrid.RowStyle>
Expand All @@ -493,7 +494,7 @@
</TabItem>

<!--Workflow tab-->
<TabItem Name="TasksTab" Header="Tasks" TabIndex="0" Style="{StaticResource TabItemStyle}">
<TabItem Name="TasksTab" Header="Tasks" TabIndex="0" Style="{StaticResource TabItemStyle}" Height="35" Margin="0,0,2,0" VerticalAlignment="Bottom">
<Grid Style="{StaticResource PageGridStyle}">
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
Expand Down
7 changes: 7 additions & 0 deletions MetaMorpheus/GUI/TaskWindows/CalibrateTaskWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@
</TextBox.Style>
</TextBox>
</StackPanel>

<StackPanel DockPanel.Dock="Top" Margin="10">
<!-- save settings -->
<local:SaveSettingsControl x:Name="TaskSettingsCtrl"
DataContext="{Binding TaskSettingViewModel}"/>
</StackPanel>

<GroupBox Header="Search Parameters" DockPanel.Dock="Top">
<Expander x:Name="SearchModeExpander">
<StackPanel>
Expand Down
28 changes: 21 additions & 7 deletions MetaMorpheus/GUI/TaskWindows/CalibrateTaskWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ public partial class CalibrateTaskWindow : Window
private readonly ObservableCollection<ModTypeForLoc> LocalizeModTypeForTreeViewObservableCollection = new ObservableCollection<ModTypeForLoc>();
private bool AutomaticallyAskAndOrUpdateParametersBasedOnProtease = true;
private CustomFragmentationWindow CustomFragmentationWindow;
private TaskSettingViewModel TaskSettingViewModel;

public CalibrateTaskWindow(CalibrationTask myCalibrateTask)
{
InitializeComponent();
PopulateChoices();
kscdnw marked this conversation as resolved.
Show resolved Hide resolved
TheTask = myCalibrateTask ?? new CalibrationTask();

var updateFieldsFromNewTaskAction = (MetaMorpheusTask task) => UpdateFieldsFromTask(task as CalibrationTask);
TaskSettingViewModel = new(TheTask, updateFieldsFromNewTaskAction, GetTaskFromGui);
TaskSettingsCtrl.DataContext = TaskSettingViewModel;

AutomaticallyAskAndOrUpdateParametersBasedOnProtease = false;
PopulateChoices();
UpdateFieldsFromTask(TheTask);
AutomaticallyAskAndOrUpdateParametersBasedOnProtease = true;

if (myCalibrateTask == null)
Expand Down Expand Up @@ -187,15 +191,25 @@ private void CancelButton_Click(object sender, RoutedEventArgs e)
}

private void SaveButton_Click(object sender, RoutedEventArgs e)
{
CalibrationTask task = GetTaskFromGui();
if (task == null)
return;

TheTask = task;
DialogResult = true;
}

private CalibrationTask GetTaskFromGui()
{
string fieldNotUsed = "1";

if (!GlobalGuiSettings.CheckTaskSettingsValidity(PrecursorMassToleranceTextBox.Text, ProductMassToleranceTextBox.Text, MissedCleavagesTextBox.Text,
MaxModificationIsoformsTextBox.Text, MinPeptideLengthTextBox.Text, MaxPeptideLengthTextBox.Text, MaxThreadsTextBox.Text, MinScoreAllowed.Text,
fieldNotUsed, fieldNotUsed, fieldNotUsed, fieldNotUsed, fieldNotUsed, null, null, fieldNotUsed, MaxModsPerPeptideTextBox.Text, fieldNotUsed,
fieldNotUsed, fieldNotUsed, fieldNotUsed, fieldNotUsed, fieldNotUsed, null, null, fieldNotUsed, MaxModsPerPeptideTextBox.Text, fieldNotUsed,
null, null, null))
{
return;
return null;
}

Protease protease = (Protease)ProteaseComboBox.SelectedItem;
Expand Down Expand Up @@ -226,7 +240,7 @@ private void SaveButton_Click(object sender, RoutedEventArgs e)

if (!GlobalGuiSettings.VariableModCheck(listOfModsVariable))
{
return;
return null;
}

var listOfModsFixed = new List<(string, string)>();
Expand Down Expand Up @@ -296,7 +310,7 @@ private void SaveButton_Click(object sender, RoutedEventArgs e)
}

TheTask.CalibrationParameters.WriteIndexedMzml = writeIndexMzmlCheckbox.IsChecked.Value;
DialogResult = true;
return TheTask;
}

private void CheckIfNumber(object sender, TextCompositionEventArgs e)
Expand Down Expand Up @@ -357,7 +371,7 @@ private void OnClosing(object sender, CancelEventArgs e)
// remove event handler from timer
// keeping it will trigger an exception because the closed window stops existing

CustomFragmentationWindow.Close();
CustomFragmentationWindow?.Close();
}

private void SaveAsDefault_Click(object sender, RoutedEventArgs e)
Expand Down
8 changes: 8 additions & 0 deletions MetaMorpheus/GUI/TaskWindows/GPTMDTaskWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@
</TextBox.Style>
</TextBox>
</StackPanel>

<StackPanel DockPanel.Dock="Top" Margin="10">

<!-- save settings -->
<local:SaveSettingsControl x:Name="TaskSettingsCtrl"
DataContext="{Binding TaskSettingViewModel}"/>
</StackPanel>

<GroupBox Header="File Loading Parameters" DockPanel.Dock="Top">
<Expander x:Name="FileLoadExpander" >
<StackPanel>
Expand Down
Loading