From e0ab74411908f641f3fce086fc039c22c92b604a Mon Sep 17 00:00:00 2001
From: giuliaghirardini <giulia.ghirardini@skywarder.eu>
Date: Sat, 8 Mar 2025 19:53:37 +0100
Subject: [PATCH] [fixes][utilities] Added IPT prefix choice

---
 functions/utilities/exportFigureGUI.m | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/functions/utilities/exportFigureGUI.m b/functions/utilities/exportFigureGUI.m
index 08609b8..a4ab753 100644
--- a/functions/utilities/exportFigureGUI.m
+++ b/functions/utilities/exportFigureGUI.m
@@ -43,6 +43,14 @@ uilabel(fig, 'Text', 'Figure Name:', 'Position', [50 550 100 30]);
 figNameField = uieditfield(fig, 'text', 'Position', [150 550 200 30], ...
     'ValueChangedFcn', @(src, event) emptyNameField(src,event));
 
+%%% Dropdown menu for departement name
+uilabel(fig, 'Text', 'IPT Name:', 'Position', [370 550 100 30]);
+prefixIPTName = {'[]', '[MSA]', '[AER]', '[PRF]', '[RCS]', '[GNC]', '[ARP]', ...
+    '[SWD]', '[ELC]', '[STR]', '[PRP]', '[LPS]', '[AFD]', '[MMC]', '[ROV]'};
+prefixIPTNameDropDown = uidropdown(fig, 'Items', prefixIPTName, ...
+    'Value', '[]', ...
+    'Position', [455 550 80 30]);
+
 % WHratio Input
 uilabel(fig, 'Text', 'Width/Height Ratio:', 'Position', [50 170 150 30]);
 WHratioField = uieditfield(fig, 'numeric', 'Value', 0, 'Position', [160 170 50 30]);
@@ -163,7 +171,7 @@ defaultButton = uibutton(fig, 'Text', 'Reset', ...
 
 % automatically generate a name
 autoNameButton = uibutton(fig, 'Text', 'Auto name', ...
-    'Position', [370, 550, 120, 30], ...
+    'Position', [640, 550, 120, 30], ...
     'BackgroundColor', [.7 .7 .7], ...
     'Tooltip', 'Generate a automatic name', ...
     'ButtonPushedFcn', @(src, event) autoNameGenerator());
@@ -171,7 +179,7 @@ autoNameButton = uibutton(fig, 'Text', 'Auto name', ...
 %% Functions
 % Function to update dropdown menu with new figures
     function autoNameGenerator()
-        figNameField.Value = "[]plot";
+        figNameField.Value = "plot";
     end
 
     function emptyNameField(src)
@@ -346,7 +354,7 @@ autoNameButton = uibutton(fig, 'Text', 'Auto name', ...
 % Callback Function for Button
     function exportFigureCallback()
         % Get values from the GUI components
-        figName = figNameField.Value;
+        figName = [prefixIPTNameDropDown.Value figNameField.Value];
         percTextwidth = percTextField.Value;
         addMarkers = addMarkersBox.Value;
         forcedMarkers = forcedMarkersField.Value;
-- 
GitLab