diff --git a/Packages/MIES/MIES_Configuration.ipf b/Packages/MIES/MIES_Configuration.ipf index fa214639f1..20c96117e6 100644 --- a/Packages/MIES/MIES_Configuration.ipf +++ b/Packages/MIES/MIES_Configuration.ipf @@ -255,7 +255,7 @@ static Function CONF_DefaultSettings() JSON_AddString(jsonID, EXPCONFIG_JSON_POSITION_MCC, NONE) JSON_AddString(jsonID, EXPCONFIG_JSON_STIMSET_NAME, "") - JSON_AddString(jsonID, EXPCONFIG_JSON_SAVE_PATH, "C:MiesSave") + JSON_AddString(jsonID, EXPCONFIG_JSON_SAVE_PATH, CONF_DEFAULT_SAVE_LOCATION) JSON_AddBoolean(jsonID, EXPCONFIG_JSON_LOGFILE_UPLOAD, EXPCONFIG_JSON_LOGFILE_UPLOAD_DEFAULT) jsonpath = "/" + EXPCONFIG_JSON_GLOBALPACKAGESETTINGBLOCK + "/" + PACKAGE_SETTINGS_USERPING diff --git a/Packages/MIES/MIES_Constants.ipf b/Packages/MIES/MIES_Constants.ipf index 89af55f03e..e5bc93d018 100644 --- a/Packages/MIES/MIES_Constants.ipf +++ b/Packages/MIES/MIES_Constants.ipf @@ -2388,3 +2388,5 @@ Constant ABORTCODE_ABORT = -3 Constant ABORTCODE_STACKOVERFLOW = -2 Constant ABORTCODE_USERABORT = -1 ///@} + +StrConstant CONF_DEFAULT_SAVE_LOCATION = "C:MiesSave" diff --git a/Packages/tests/HardwareBasic/UTF_ConfigurationHardware.ipf b/Packages/tests/HardwareBasic/UTF_ConfigurationHardware.ipf index 398448ef4f..68aced78d6 100644 --- a/Packages/tests/HardwareBasic/UTF_ConfigurationHardware.ipf +++ b/Packages/tests/HardwareBasic/UTF_ConfigurationHardware.ipf @@ -155,14 +155,16 @@ End /// IUTF_TD_GENERATOR s1:DeviceNameGenerator static Function TCONF_CheckTypedPanelRestore([STRUCT IUTF_mData &md]) - string win, winRestored - string fName = GetFolder(FunctionPath("")) + "CheckTypedPanelRestore.json" + string win, winRestored, rewrittenConfig, device + variable jsonID, needsFixup + string fName = PrependExperimentFolder_IGNORE("CheckTypedPanelRestore.json") Execute/Q md.s0 + "()" win = WinName(0, -1) if(!CmpStr(win, BASE_WINDOW_NAME)) // special handling for DAEphys KillWindow $win + device = md.s1 CreateLockedDAEphys(md.s1) win = WinName(0, -1) PGC_SetAndActivateControl(win, "check_Settings_RequireAmpConn", val = 0) @@ -171,12 +173,20 @@ static Function TCONF_CheckTypedPanelRestore([STRUCT IUTF_mData &md]) PGC_SetAndActivateControl(win, "setvar_Settings_VC_DAgain", val = 20) PGC_SetAndActivateControl(win, "Gain_AD_00", val = 0.0025) PGC_SetAndActivateControl(win, "setvar_Settings_VC_ADgain", val = 0.0025) + needsFixup = 1 endif + CONF_SaveWindow(fName) KillWindow $win + + if(needsFixup) + [jsonID, rewrittenConfig] = FixupJSONConfig_IGNORE(fName, device) + JSON_Release(jsonID) + fName = rewrittenConfig + endif + CONF_RestoreWindow(fName) winRestored = WinName(0, -1) - DeleteFile fName CHECK_EQUAL_STR(win, winRestored) End diff --git a/Packages/tests/UTF_HelperFunctions.ipf b/Packages/tests/UTF_HelperFunctions.ipf index 4cfaef94a8..192f62a19c 100644 --- a/Packages/tests/UTF_HelperFunctions.ipf +++ b/Packages/tests/UTF_HelperFunctions.ipf @@ -908,6 +908,9 @@ Function TestCaseEndCommon(string testcase, [variable restartAsyncFramework]) ASYNC_Start(ThreadProcessorCount, disableTask = 1) endif endif + + INFO("The default save location for MIES json configuration \"%s\" must not exist for the tests.", s0 = CONF_DEFAULT_SAVE_LOCATION) + REQUIRE(!FolderExists(CONF_DEFAULT_SAVE_LOCATION)) End Function SetAsyncChannelProperties(string device, WAVE asyncChannels, variable minValue, variable maxValue)