Skip to content

Commit 20e8f85

Browse files
committed
Disables breakpoints when running
1 parent 3db4c44 commit 20e8f85

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

.github/workflows/run_tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: Run Unit Tests
32

43
on:

RATapi/examples/normal_reflectivity/DSPC_custom_layers.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,5 @@ def DSPC_custom_layers():
127127

128128

129129
if __name__ == "__main__":
130-
import RATapi
131-
132-
RATapi.wrappers.get_matlab_engine().editFile((pathlib.Path(__file__).parent / "customBilayerDSPC.m").as_posix())
133-
134-
import time
135-
136-
time.sleep(20)
137130
problem, results = DSPC_custom_layers()
138-
139131
RAT.plotting.plot_ref_sld(problem, results, True)

cpp/rat.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ class MatlabLoader
143143

144144
void close() {
145145
if (matlabPtr) {
146+
engEvalString(matlabPtr, "closeNoPrompt(matlab.desktop.editor.getAll);");
146147
engEvalString(matlabPtr, "fclose all");
147148
engEvalString(matlabPtr, "clear all");
148149
engClose(matlabPtr);
@@ -193,6 +194,7 @@ class MatlabEngine
193194
void editFile(std::string path)
194195
{
195196
loader->open();
197+
loader->engEvalString(loader->matlabPtr, "dbclear all");
196198
loader->engEvalString(loader->matlabPtr, ("edit " + path).c_str());
197199
};
198200

@@ -212,8 +214,10 @@ class MatlabEngine
212214
if (nOutput != expOutputCount)
213215
{
214216
throw std::runtime_error("The custom function " + functionName + " is expected to have " +
215-
std::to_string(expOutputCount) + " output but has " + std::to_string(nOutput) + " instead.");
216-
}
217+
std::to_string(expOutputCount) + " output but has " + std::to_string(nOutput) + " instead.");
218+
}
219+
loader->engEvalString(loader->matlabPtr, "closeNoPrompt(matlab.desktop.editor.getAll);");
220+
loader->engEvalString(loader->matlabPtr, "dbclear all");
217221
funChanged = false;
218222
}
219223
}

0 commit comments

Comments
 (0)