From bdcde244bbc54cb3ad348da09e5c49fc08b44d74 Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Tue, 15 Oct 2024 14:17:16 +0200 Subject: [PATCH] MIES_SweepFormula.ipf: Remove emptieness check for graph parameters We never do that for parameters, and usually just let it fail. This is also here the best choice. Close #2271 --- Packages/MIES/MIES_SweepFormula.ipf | 37 ----------------------------- 1 file changed, 37 deletions(-) diff --git a/Packages/MIES/MIES_SweepFormula.ipf b/Packages/MIES/MIES_SweepFormula.ipf index 5d449f8f3b..83cd595d96 100644 --- a/Packages/MIES/MIES_SweepFormula.ipf +++ b/Packages/MIES/MIES_SweepFormula.ipf @@ -831,7 +831,6 @@ static Function/WAVE SF_FormulaExecutor(string graph, variable jsonID, [string j if(ParamIsDefault(jsonPath)) jsonPath = "" endif - SFH_ASSERT(!IsEmpty(graph), "Name of graph window must not be empty.") #ifdef DEBUGGING_ENABLED if(DP_DebuggingEnabledForCaller()) @@ -4426,7 +4425,6 @@ static Function/WAVE SF_OperationSelectChannels(variable jsonId, string jsonPath string channelName, channelNumber string regExp = "^(?i)(" + ReplaceString(";", XOP_CHANNEL_NAMES, "|") + ")([0-9]+)?$" - SFH_ASSERT(!IsEmpty(graph), "Graph not specified.") numArgs = SFH_GetNumberOfArguments(jsonId, jsonPath) WAVE channels = SF_NewChannelsWave(numArgs ? numArgs : 1) for(i = 0; i < numArgs; i += 1) @@ -4462,8 +4460,6 @@ static Function/WAVE SF_OperationSelectSweeps(variable jsonId, string jsonPath, variable i, numArgs - SFH_ASSERT(!IsEmpty(graph), "Graph not specified.") - numArgs = SFH_GetNumberOfArguments(jsonId, jsonPath) if(!numArgs) WAVE/D/Z sweeps = OVS_GetSelectedSweeps(graph, OVS_SWEEP_ALL_SWEEPNO) @@ -4730,8 +4726,6 @@ static Function/WAVE SF_OperationSelectVis(variable jsonId, string jsonPath, str string vis - SFH_ASSERT(!IsEmpty(graph), "Graph for extracting sweeps not specified.") - SFH_CheckArgumentCount(jsonId, jsonPath, SF_OP_SELECTVIS, 0, maxArgs = 1) vis = SFH_GetArgumentAsText(jsonId, jsonPath, graph, SF_OP_SELECTVIS, 0, allowedValues = {SF_OP_SELECTVIS_DISPLAYED, SF_OP_SELECTVIS_ALL}, defValue = SF_OP_SELECTVIS_DISPLAYED) @@ -4747,8 +4741,6 @@ static Function/WAVE SF_OperationSelectExperiment(variable jsonId, string jsonPa string expName - SFH_ASSERT(!IsEmpty(graph), "Graph for extracting sweeps not specified.") - SFH_CheckArgumentCount(jsonId, jsonPath, SF_OP_SELECTEXP, 1, maxArgs = 1) expName = SFH_GetArgumentAsText(jsonId, jsonPath, graph, SF_OP_SELECTEXP, 0) @@ -4762,8 +4754,6 @@ End /// returns a one element numeric wave static Function/WAVE SF_OperationSelectExpandSCI(variable jsonId, string jsonPath, string graph) - SFH_ASSERT(!IsEmpty(graph), "Graph for extracting sweeps not specified.") - SFH_CheckArgumentCount(jsonId, jsonPath, SF_OP_SELECTEXPANDSCI, 0, maxArgs = 0) Make/FREE/D output = {1} @@ -4776,8 +4766,6 @@ End /// returns a one element numeric wave static Function/WAVE SF_OperationSelectExpandRAC(variable jsonId, string jsonPath, string graph) - SFH_ASSERT(!IsEmpty(graph), "Graph for extracting sweeps not specified.") - SFH_CheckArgumentCount(jsonId, jsonPath, SF_OP_SELECTEXPANDRAC, 0, maxArgs = 0) Make/FREE/D output = {1} @@ -4792,8 +4780,6 @@ static Function/WAVE SF_OperationSelectSetCycleCount(variable jsonId, string jso variable value - SFH_ASSERT(!IsEmpty(graph), "Graph for extracting sweeps not specified.") - SFH_CheckArgumentCount(jsonId, jsonPath, SF_OP_SELECTSETCYCLECOUNT, 1, maxArgs = 1) value = SFH_GetArgumentAsNumeric(jsonId, jsonPath, graph, SF_OP_SELECTSETCYCLECOUNT, 0) @@ -4809,8 +4795,6 @@ static Function/WAVE SF_OperationSelectSetSweepCount(variable jsonId, string jso variable value - SFH_ASSERT(!IsEmpty(graph), "Graph for extracting sweeps not specified.") - SFH_CheckArgumentCount(jsonId, jsonPath, SF_OP_SELECTSETSWEEPCOUNT, 1, maxArgs = 1) value = SFH_GetArgumentAsNumeric(jsonId, jsonPath, graph, SF_OP_SELECTSETSWEEPCOUNT, 0) @@ -4826,8 +4810,6 @@ static Function/WAVE SF_OperationSelectSCIIndex(variable jsonId, string jsonPath variable value - SFH_ASSERT(!IsEmpty(graph), "Graph for extracting sweeps not specified.") - SFH_CheckArgumentCount(jsonId, jsonPath, SF_OP_SELECTSCIINDEX, 1, maxArgs = 1) value = SFH_GetArgumentAsNumeric(jsonId, jsonPath, graph, SF_OP_SELECTSCIINDEX, 0) @@ -4843,8 +4825,6 @@ static Function/WAVE SF_OperationSelectRACIndex(variable jsonId, string jsonPath variable value - SFH_ASSERT(!IsEmpty(graph), "Graph for extracting sweeps not specified.") - SFH_CheckArgumentCount(jsonId, jsonPath, SF_OP_SELECTRACINDEX, 1, maxArgs = 1) value = SFH_GetArgumentAsNumeric(jsonId, jsonPath, graph, SF_OP_SELECTRACINDEX, 0) @@ -4860,8 +4840,6 @@ static Function/WAVE SF_OperationSelectDevice(variable jsonId, string jsonPath, string expName - SFH_ASSERT(!IsEmpty(graph), "Graph for extracting sweeps not specified.") - SFH_CheckArgumentCount(jsonId, jsonPath, SF_OP_SELECTDEV, 1, maxArgs = 1) expName = SFH_GetArgumentAsText(jsonId, jsonPath, graph, SF_OP_SELECTDEV, 0) @@ -4879,8 +4857,6 @@ static Function/WAVE SF_OperationSelectCM(variable jsonId, string jsonPath, stri variable numArgs, i, mode string clampMode - SFH_ASSERT(!IsEmpty(graph), "Graph for extracting sweeps not specified.") - numArgs = SFH_CheckArgumentCount(jsonId, jsonPath, SF_OP_SELECTCM, 0) if(!numArgs) mode = SF_OP_SELECT_CLAMPCODE_ALL @@ -4922,8 +4898,6 @@ static Function/WAVE SF_OperationSelectStimset(variable jsonId, string jsonPath, variable numArgs, i - SFH_ASSERT(!IsEmpty(graph), "Graph for extracting sweeps not specified.") - numArgs = SFH_CheckArgumentCount(jsonId, jsonPath, SF_OP_SELECTSTIMSET, 0) if(!numArgs) @@ -4946,8 +4920,6 @@ static Function/WAVE SF_OperationSelectIVSCCSweepQC(variable jsonId, string json variable mode string arg - SFH_ASSERT(!IsEmpty(graph), "Graph for extracting sweeps not specified.") - SFH_CheckArgumentCount(jsonId, jsonPath, SF_OP_SELECTIVSCCSWEEPQC, 1, maxArgs = 1) arg = SFH_GetArgumentAsText(jsonId, jsonPath, graph, SF_OP_SELECTIVSCCSWEEPQC, 0, allowedValues = {SF_OP_SELECT_IVSCCQC_PASSED, SF_OP_SELECT_IVSCCQC_FAILED}) @@ -4966,8 +4938,6 @@ static Function/WAVE SF_OperationSelectIVSCCSetQC(variable jsonId, string jsonPa variable mode string arg - SFH_ASSERT(!IsEmpty(graph), "Graph for extracting sweeps not specified.") - SFH_CheckArgumentCount(jsonId, jsonPath, SF_OP_SELECTIVSCCSETQC, 1, maxArgs = 1) arg = SFH_GetArgumentAsText(jsonId, jsonPath, graph, SF_OP_SELECTIVSCCSETQC, 0, allowedValues = {SF_OP_SELECT_IVSCCQC_PASSED, SF_OP_SELECT_IVSCCQC_FAILED}) @@ -4985,8 +4955,6 @@ static Function/WAVE SF_OperationSelectRange(variable jsonId, string jsonPath, s variable numArgs - SFH_ASSERT(!IsEmpty(graph), "Graph for extracting sweeps not specified.") - numArgs = SFH_CheckArgumentCount(jsonId, jsonPath, SF_OP_SELECTRANGE, 0, maxArgs = 1) if(!numArgs) WAVE/WAVE range = SFH_AsDataSet(SFH_GetFullRange()) @@ -5030,7 +4998,6 @@ static Function/WAVE SF_OperationSelect(variable jsonId, string jsonPath, string string expName = "" string device = "" - SFH_ASSERT(!IsEmpty(graph), "Graph for extracting sweeps not specified.") SF_InitSelectFilterUninitalized(filter) numArgs = SFH_GetNumberOfArguments(jsonId, jsonPath) @@ -5679,8 +5646,6 @@ static Function/WAVE SF_OperationData(variable jsonId, string jsonPath, string g variable i, numArgs - SFH_ASSERT(!IsEmpty(graph), "Graph for extracting sweeps not specified.") - SFH_CheckArgumentCount(jsonId, jsonPath, SF_OP_DATA, 0, maxArgs = 1) WAVE/WAVE selectData = SFH_GetArgumentSelect(jsonID, jsonPath, graph, SF_OP_DATA, 0) @@ -5703,8 +5668,6 @@ static Function/WAVE SF_OperationLabnotebook(variable jsonId, string jsonPath, s variable numArgs, mode string lbnKey - SFH_ASSERT(!IsEmpty(graph), "Graph not specified.") - numArgs = SFH_GetNumberOfArguments(jsonID, jsonPath) SFH_ASSERT(numArgs <= 3, "Maximum number of three arguments exceeded.") SFH_ASSERT(numArgs >= 1, "At least one argument is required.")