From 37c8e0b467673f992e686faf3c7f356f3626907f Mon Sep 17 00:00:00 2001 From: Houtan Bastani <houtan@dynare.org> Date: Thu, 11 Apr 2019 15:03:58 +0200 Subject: [PATCH] small changes --- src/+gui_tools/save_project.m | 2 +- src/gui_calib_smoother.m | 3 ++- src/gui_cond_forecast.m | 3 ++- src/gui_create_model_settings.m | 2 +- src/gui_define_model_settings.m | 2 +- src/gui_determ_simulation.m | 3 ++- src/gui_estim_params.m | 2 +- src/gui_estimation.m | 3 ++- src/gui_forecast.m | 5 +++-- src/gui_load_mod_file.m | 2 +- src/gui_observed_vars.m | 5 +++-- src/gui_open_project.m | 2 +- src/gui_realtime_shock_decomposition.m | 4 ++-- src/gui_sensitivity_analysis.m | 5 +++-- src/gui_set_project_info.m | 10 +++++++++- src/gui_shock_decomposition.m | 3 ++- src/gui_stoch_simulation.m | 3 ++- 17 files changed, 38 insertions(+), 21 deletions(-) diff --git a/src/+gui_tools/save_project.m b/src/+gui_tools/save_project.m index 8acd387..3da24fa 100644 --- a/src/+gui_tools/save_project.m +++ b/src/+gui_tools/save_project.m @@ -37,7 +37,7 @@ if ~exist(project_info.project_folder, 'dir') end fullFileName = [ project_info.project_folder, filesep, project_info.project_name,'.dproj']; -project_info.modified = 0; +project_info.modified = false; save(fullFileName, 'project_info'); % If project folder has been changed diff --git a/src/gui_calib_smoother.m b/src/gui_calib_smoother.m index a03326d..31cff0c 100644 --- a/src/gui_calib_smoother.m +++ b/src/gui_calib_smoother.m @@ -332,8 +332,9 @@ handles.pushbuttonCloseAll = uicontrol( ... jObj.stop; jObj.setBusyText('All done!'); handles.pushbuttonResults.Enable = 'on'; - project_info.modified = 1; + project_info.modified = true; project_info.mod_file_already_run = true; + project_info.calibrated_smoother_run = true; gui_set_menus(true); catch ME jObj.stop; diff --git a/src/gui_cond_forecast.m b/src/gui_cond_forecast.m index 993b7eb..5be7132 100644 --- a/src/gui_cond_forecast.m +++ b/src/gui_cond_forecast.m @@ -203,7 +203,8 @@ handles.pushbuttonCommandDefinition = uicontrol( ... jObj.stop; jObj.setBusyText('All done!'); - project_info.modified = 1; + project_info.modified = true; + project_info.conditional_forecast_run = true; catch ME jObj.stop; jObj.setBusyText('Done with errors'); diff --git a/src/gui_create_model_settings.m b/src/gui_create_model_settings.m index 973571e..b22c187 100644 --- a/src/gui_create_model_settings.m +++ b/src/gui_create_model_settings.m @@ -40,7 +40,7 @@ try create_shocks_cell_array(); model_settings.shocks_corr = M_.Correlation_matrix; gui_tools.project_log_entry('Creating model settings', '...'); - project_info.modified = 1; + project_info.modified = true; jsonfile = [M_.fname filesep() 'model' filesep() 'json' filesep() 'modfile.json']; if exist(jsonfile, 'file') ~= 2 error('Could not find %s. Please rerun the .mod file with the json=compute commandline argument', jsonfile); diff --git a/src/gui_define_model_settings.m b/src/gui_define_model_settings.m index d104f6a..78bf453 100644 --- a/src/gui_define_model_settings.m +++ b/src/gui_define_model_settings.m @@ -113,7 +113,7 @@ uicontrol(tabId, 'Style','pushbutton','String','Close this tab','Units','normali oo_.steady_state = cell2mat(model_settings.variables(:, 8)); gui_tools.project_log_entry('Saving model settings', '...'); - project_info.modified = 1; + project_info.modified = true; catch ME gui_tools.show_error('Error saving model settings', ME, 'basic'); end diff --git a/src/gui_determ_simulation.m b/src/gui_determ_simulation.m index d70fe6a..deb7035 100644 --- a/src/gui_determ_simulation.m +++ b/src/gui_determ_simulation.m @@ -342,7 +342,8 @@ handles.pushbuttonCommandDefinition = uicontrol( ... jObj.stop; jObj.setBusyText('Done'); - project_info.modified = 1; + project_info.modified = true; + project_info.deterministic_simulation_run = true; catch ME jObj.stop; jObj.setBusyText('Done with errors'); diff --git a/src/gui_estim_params.m b/src/gui_estim_params.m index dfe8e59..34e3ff9 100644 --- a/src/gui_estim_params.m +++ b/src/gui_estim_params.m @@ -106,7 +106,7 @@ uicontrol(tabId, 'Style','pushbutton','String','Close this tab','Units','normali msgbox('Changes saved successfully', 'Dynare_GUI'); gui_tools.project_log_entry('Saving estim_params','...'); - project_info.modified = 1; + project_info.modified = true; end catch ME gui_tools.show_error('Error while saving estimated parameters & shocks', ME, 'extended'); diff --git a/src/gui_estimation.m b/src/gui_estimation.m index 7081392..b80fff5 100644 --- a/src/gui_estimation.m +++ b/src/gui_estimation.m @@ -378,7 +378,8 @@ handles.pushbuttonCommandDefinition = uicontrol( ... gui_tools.menu_options('output','On'); handles.pushbuttonResults.Enable = 'on'; - project_info.modified = 1; + project_info.modified = true; + project_info.estimation_run = true; gui_set_menus(true); catch ME jObj.stop; diff --git a/src/gui_forecast.m b/src/gui_forecast.m index 03f5d30..9d106cf 100644 --- a/src/gui_forecast.m +++ b/src/gui_forecast.m @@ -109,8 +109,9 @@ handles.pushbuttonForecast = uicontrol( ... jObj.stop; jObj.setBusyText('All done!'); - set(handles.pushbuttonResults, 'Enable', 'on'); - project_info.modified = 1; + handles.pushbuttonResults.Enable = on; + project_info.modified = true; + project_info.forecast_run = true; catch ME jObj.stop; jObj.setBusyText('Done with errors'); diff --git a/src/gui_load_mod_file.m b/src/gui_load_mod_file.m index 7319f0d..126ce98 100644 --- a/src/gui_load_mod_file.m +++ b/src/gui_load_mod_file.m @@ -197,7 +197,7 @@ end evalin('base', 'global dynare_gui_ project_info model_settings'); dynare_gui_ = glob_dynare_gui_; project_info = glob_project_info; - project_info.modified = 1; + project_info.modified = true; project_info.mod_file_already_run = true; % recreate model_settings diff --git a/src/gui_observed_vars.m b/src/gui_observed_vars.m index 6cce1d1..a3039a0 100644 --- a/src/gui_observed_vars.m +++ b/src/gui_observed_vars.m @@ -33,7 +33,7 @@ global project_info model_settings options_ if ~isfield(model_settings, 'varobs') try model_settings.varobs = create_varobs_cell_array(evalin('base','options_.varobs'), evalin('base','M_.endo_names_tex'), evalin('base','M_.endo_names_long'), evalin('base','options_.varobs_id')); - project_info.modified = 1; + project_info.modified = true; catch ME model_settings.varobs = []; end @@ -89,7 +89,7 @@ uicontrol(tabId, 'Style','pushbutton','String','Close this tab','Units','normali project_info.freq = handles.frequency.Value; project_info.nobs = handles.num_obs.String; project_info.data_file = handles.data_file.String; - project_info.modified = 1; + project_info.modified = true; if project_info.new_data_format %new data interface options_.dataset.file = handles.data_file.String; @@ -105,6 +105,7 @@ uicontrol(tabId, 'Style','pushbutton','String','Close this tab','Units','normali if ~isempty(varobs) options_.varobs = varobs(:, 1); end + project_info.observed_variables_set = true; end catch ME gui_tools.show_error('Error saving observed variables and data file information', ME, 'extended'); diff --git a/src/gui_open_project.m b/src/gui_open_project.m index b89ecac..7f75bc9 100644 --- a/src/gui_open_project.m +++ b/src/gui_open_project.m @@ -73,7 +73,7 @@ try gui_set_menus(true); end end - project_info.modified = 0; + project_info.modified = false; gui_tools.project_log_entry('Project Open', ... ['project_name=' project_info.project_name '; project_folder=' project_info.project_folder]); end diff --git a/src/gui_realtime_shock_decomposition.m b/src/gui_realtime_shock_decomposition.m index 3ea3e49..66505b5 100644 --- a/src/gui_realtime_shock_decomposition.m +++ b/src/gui_realtime_shock_decomposition.m @@ -346,8 +346,8 @@ handles.pushbuttonClose = uicontrol( ... jObj.stop; jObj.setBusyText('All done!'); uiwait(msgbox('Realtime shock decomposition command executed successfully!', 'DynareGUI','modal')); - project_info.modified = 1; - + project_info.modified = true; + project_info.realtime_shock_decomposition_run = true; catch ME jObj.stop; jObj.setBusyText('Done with errors!'); diff --git a/src/gui_sensitivity_analysis.m b/src/gui_sensitivity_analysis.m index cd020b4..3eb53da 100644 --- a/src/gui_sensitivity_analysis.m +++ b/src/gui_sensitivity_analysis.m @@ -28,7 +28,7 @@ function gui_sensitivity_analysis(tabId) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. -global project_info model_settings options_ dynare_gui_ oo_ M_ +global project_info model_settings options_ dynare_gui_ oo_ bg_color = char(getappdata(0, 'bg_color')); @@ -91,7 +91,8 @@ handles.pushbuttonSensitivity = uicontrol( ... jObj.setBusyText('Done'); gui_tools.menu_options('output','On'); handles.pushbuttonResults.Enable = 'on'; - project_info.modified = 1; + project_info.modified = true; + project_info.sensitivity_analysis_run = true; catch ME jObj.stop; jObj.setBusyText('Done with errors'); diff --git a/src/gui_set_project_info.m b/src/gui_set_project_info.m index 2342adb..216a987 100644 --- a/src/gui_set_project_info.m +++ b/src/gui_set_project_info.m @@ -38,7 +38,7 @@ project_info.project_folder = ''; project_info.project_model_stochastic = 1; project_info.project_description = ''; project_info.default_forecast_periods = 20; -project_info.modified = 1; +project_info.modified = true; project_info.mod_file_already_run = false; project_info.first_obs = ''; @@ -48,6 +48,14 @@ project_info.data_file = ''; project_info.new_data_format = 0; +project_info.shock_decomposition_run = false; +project_info.realtime_shock_decomposition_run = false; +project_info.conditional_forecast_run = false; +project_info.stochastic_simulation_run = false; +project_info.deterministic_simulation_run = false; +project_info.estimation_run = false; +project_info.observed_variables_set = false; + gui_auxiliary.create_dynare_gui_structure; end diff --git a/src/gui_shock_decomposition.m b/src/gui_shock_decomposition.m index 6844541..6f8ca05 100644 --- a/src/gui_shock_decomposition.m +++ b/src/gui_shock_decomposition.m @@ -305,7 +305,8 @@ handles.pushbuttonClose = uicontrol( ... end jObj.stop; jObj.setBusyText('All done!'); - project_info.modified = 1; + project_info.modified = true; + project_info.shock_decomposition_run = true; catch ME jObj.stop; jObj.setBusyText('Done with errors!'); diff --git a/src/gui_stoch_simulation.m b/src/gui_stoch_simulation.m index acd84c3..e12eedd 100644 --- a/src/gui_stoch_simulation.m +++ b/src/gui_stoch_simulation.m @@ -200,7 +200,8 @@ handles.pushbuttonCommandDefinition = uicontrol( ... %enable menu options gui_tools.menu_options('output','On'); set(handles.pushbuttonResults, 'Enable', 'on'); - project_info.modified = 1; + project_info.modified = true; + project_info.stochastic_simulation_run = true; catch ME jObj.stop; jObj.setBusyText('Done with errors'); -- GitLab