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 20 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
6 changes: 3 additions & 3 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 @@ -463,15 +463,15 @@

<!--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"/>
Style="{StaticResource ImportantButtonStyle}" Margin="0,0,10,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"/>
Margin="0,0,211,0"/>

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

<!--The list of spectra files-->
<DataGrid Name="dataGridSpectraFiles" ItemsSource="{Binding}" Grid.Row="3" Style="{StaticResource x:DataGridStyle}"
Expand Down
18 changes: 14 additions & 4 deletions MetaMorpheus/GUI/TaskWindows/CalibrateTaskWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@
</Grid.RowDefinitions>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<DockPanel>
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
<Grid DockPanel.Dock="Top" Margin="5,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="Task Name" />
<TextBox x:Name="OutputFileNameTextBox" Width="150">
<TextBox x:Name="OutputFileNameTextBox" Width="150" Grid.Column="1">
<TextBox.Style>
<Style TargetType="TextBox" xmlns:sys="clr-namespace:System;assembly=mscorlib">
<Style.Resources>
Expand All @@ -44,7 +49,11 @@
</Style>
</TextBox.Style>
</TextBox>
</StackPanel>
<!-- save settings -->
<local:SaveSettingsControl x:Name="TaskSettingsCtrl" Grid.Column="2" HorizontalAlignment="Right"
DataContext="{Binding TaskSettingViewModel}" />
</Grid>

<GroupBox Header="Search Parameters" DockPanel.Dock="Top">
<Expander x:Name="SearchModeExpander">
<StackPanel>
Expand Down Expand Up @@ -422,7 +431,8 @@
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="1" Margin="5">
<Button x:Name="CancelButton" Content="Cancel" Click="CancelButton_Click" />
<Button x:Name="SaveButton" Content="Save Calibrate Task" Click="SaveButton_Click" FontSize="24" />
<Button x:Name="SetDefaultbutton" Click="SaveAsDefault_Click" Width="100" >
<Button x:Name="setDefaultbutton"
Command="{Binding SaveAsDefaultSettingsCommand}" Width="100" >
<TextBlock Text="Save As Default" TextWrapping="Wrap" TextAlignment="Center"/>
<ToolTipService.ToolTip>
<ToolTip Content="Save these parameters as the default. MetaMorpheus can return to original defaults by deleting the folder 'DefaultParameters'" ToolTipService.ShowDuration="999999" ToolTipService.InitialShowDelay="500" />
Expand Down
27 changes: 21 additions & 6 deletions MetaMorpheus/GUI/TaskWindows/CalibrateTaskWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ 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)
{
Expand All @@ -36,8 +37,12 @@ public CalibrateTaskWindow(CalibrationTask myCalibrateTask)

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


if (myCalibrateTask == null)
{
Expand Down Expand Up @@ -187,15 +192,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 +241,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 +311,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 +372,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
25 changes: 19 additions & 6 deletions MetaMorpheus/GUI/TaskWindows/GPTMDTaskWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@
</Grid.RowDefinitions>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<DockPanel>
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
<Grid DockPanel.Dock="Top" Margin="5,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="Task Name" />
kscdnw marked this conversation as resolved.
Show resolved Hide resolved
<TextBox x:Name="OutputFileNameTextBox" Width="150">
<TextBox x:Name="OutputFileNameTextBox" Width="150" Grid.Column="1">
<TextBox.Style>
<Style TargetType="TextBox" xmlns:sys="clr-namespace:System;assembly=mscorlib">
<Style TargetType="TextBox">
<Style.Resources>
<VisualBrush x:Key="CueBannerBrush" AlignmentX="Left" AlignmentY="Center" Stretch="None">
<VisualBrush x:Key="CueBannerBrush" AlignmentX="Left" AlignmentY="Center"
Stretch="None">
<VisualBrush.Visual>
<Label Content="GPTMDTask" Foreground="Gray" />
</VisualBrush.Visual>
Expand All @@ -44,7 +50,13 @@
</Style>
</TextBox.Style>
</TextBox>
</StackPanel>
<!-- save settings -->
<local:SaveSettingsControl x:Name="TaskSettingsCtrl" Grid.Column="2" HorizontalAlignment="Right"
DataContext="{Binding TaskSettingViewModel}" />

</Grid>


<GroupBox Header="File Loading Parameters" DockPanel.Dock="Top">
<Expander x:Name="FileLoadExpander" >
<StackPanel>
Expand Down Expand Up @@ -499,7 +511,8 @@
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="1" Margin="5">
<Button x:Name="cancelButton" Content="Cancel" Click="CancelButton_Click" />
<Button x:Name="saveButton" Content="Save GPTMD task" Click="SaveButton_Click" FontSize="24" />
<Button x:Name="setDefaultbutton" Click="SaveAsDefault_Click" Width="100" >
<Button x:Name="setDefaultbutton"
Command="{Binding SaveAsDefaultSettingsCommand}" Width="100" >
<TextBlock Text="Save As Default" TextWrapping="Wrap" TextAlignment="Center"/>
<ToolTipService.ToolTip>
<ToolTip Content="Save these parameters as the default. MetaMorpheus can return to original defaults by deleting the folder 'DefaultParameters'" ToolTipService.ShowDuration="999999" ToolTipService.InitialShowDelay="500" />
Expand Down
Loading