Skip to content

Commit 923c47b

Browse files
committed
ctx: adapt Monitors and YMatrix
1 parent 0b68b63 commit 923c47b

File tree

2 files changed

+46
-46
lines changed

2 files changed

+46
-46
lines changed

+DSS_MATLAB/IMonitors.m

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -83,39 +83,39 @@
8383
end
8484

8585
function obj = Process(obj)
86-
calllib(obj.libname, 'Monitors_Process');
86+
calllib(obj.libname, 'ctx_Monitors_Process', obj.dssctx);
8787
end
8888

8989
function obj = ProcessAll(obj)
90-
calllib(obj.libname, 'Monitors_ProcessAll');
90+
calllib(obj.libname, 'ctx_Monitors_ProcessAll', obj.dssctx);
9191
end
9292

9393
function obj = Reset(obj)
94-
calllib(obj.libname, 'Monitors_Reset');
94+
calllib(obj.libname, 'ctx_Monitors_Reset', obj.dssctx);
9595
end
9696

9797
function obj = ResetAll(obj)
98-
calllib(obj.libname, 'Monitors_ResetAll');
98+
calllib(obj.libname, 'ctx_Monitors_ResetAll', obj.dssctx);
9999
end
100100

101101
function obj = Sample(obj)
102-
calllib(obj.libname, 'Monitors_Sample');
102+
calllib(obj.libname, 'ctx_Monitors_Sample', obj.dssctx);
103103
end
104104

105105
function obj = SampleAll(obj)
106-
calllib(obj.libname, 'Monitors_SampleAll');
106+
calllib(obj.libname, 'ctx_Monitors_SampleAll', obj.dssctx);
107107
end
108108

109109
function obj = Save(obj)
110-
calllib(obj.libname, 'Monitors_Save');
110+
calllib(obj.libname, 'ctx_Monitors_Save', obj.dssctx);
111111
end
112112

113113
function obj = SaveAll(obj)
114-
calllib(obj.libname, 'Monitors_SaveAll');
114+
calllib(obj.libname, 'ctx_Monitors_SaveAll', obj.dssctx);
115115
end
116116

117117
function obj = Show(obj)
118-
calllib(obj.libname, 'Monitors_Show');
118+
calllib(obj.libname, 'ctx_Monitors_Show', obj.dssctx);
119119
end
120120

121121
end
@@ -125,39 +125,39 @@
125125
end
126126
function result = get.AllNames(obj)
127127
% Array of strings with all Monitor names
128-
result = obj.apiutil.get_string_array('Monitors_Get_AllNames');
128+
result = obj.apiutil.get_string_array('ctx_Monitors_Get_AllNames', obj.dssctx);
129129
end
130130

131131
function result = get.Count(obj)
132132
% Number of Monitor objects
133-
result = calllib(obj.libname, 'Monitors_Get_Count');
133+
result = calllib(obj.libname, 'ctx_Monitors_Get_Count', obj.dssctx);
134134
end
135135

136136
function result = get.First(obj)
137137
% Set first object of Monitor; returns 0 if none.
138-
result = calllib(obj.libname, 'Monitors_Get_First');
138+
result = calllib(obj.libname, 'ctx_Monitors_Get_First', obj.dssctx);
139139
end
140140

141141
function result = get.Name(obj)
142142
% Get/sets the name of the current active Monitor
143-
result = calllib(obj.libname, 'Monitors_Get_Name');
143+
result = calllib(obj.libname, 'ctx_Monitors_Get_Name', obj.dssctx);
144144
end
145145
function obj = set.Name(obj, Value)
146-
calllib(obj.libname, 'Monitors_Set_Name', Value);
146+
calllib(obj.libname, 'ctx_Monitors_Set_Name', obj.dssctx, Value);
147147
obj.CheckForError();
148148
end
149149

150150
function result = get.Next(obj)
151151
% Sets next Monitor active; returns 0 if no more.
152-
result = calllib(obj.libname, 'Monitors_Get_Next');
152+
result = calllib(obj.libname, 'ctx_Monitors_Get_Next', obj.dssctx);
153153
end
154154

155155
function result = get.idx(obj)
156156
% Get/set active Monitor by index; 1..Count
157-
result = calllib(obj.libname, 'Monitors_Get_idx');
157+
result = calllib(obj.libname, 'ctx_Monitors_Get_idx', obj.dssctx);
158158
end
159159
function obj = set.idx(obj, Value)
160-
calllib(obj.libname, 'Monitors_Set_idx', Value);
160+
calllib(obj.libname, 'ctx_Monitors_Set_idx', obj.dssctx, Value);
161161
obj.CheckForError();
162162
end
163163

@@ -169,66 +169,66 @@
169169

170170
function result = get.Element(obj)
171171
% Full object name of element being monitored.
172-
result = calllib(obj.libname, 'Monitors_Get_Element');
172+
result = calllib(obj.libname, 'ctx_Monitors_Get_Element', obj.dssctx);
173173
end
174174
function obj = set.Element(obj, Value)
175-
calllib(obj.libname, 'Monitors_Set_Element', Value);
175+
calllib(obj.libname, 'ctx_Monitors_Set_Element', obj.dssctx, Value);
176176
end
177177

178178
function result = get.FileName(obj)
179179
% (read-only) Name of CSV file associated with active Monitor.
180-
result = calllib(obj.libname, 'Monitors_Get_FileName');
180+
result = calllib(obj.libname, 'ctx_Monitors_Get_FileName', obj.dssctx);
181181
end
182182

183183
function result = get.FileVersion(obj)
184184
% (read-only) Monitor File Version (integer)
185-
result = calllib(obj.libname, 'Monitors_Get_FileVersion');
185+
result = calllib(obj.libname, 'ctx_Monitors_Get_FileVersion', obj.dssctx);
186186
end
187187

188188
function result = get.Header(obj)
189189
% (read-only) Header string; Array of strings containing Channel names
190-
result = obj.apiutil.get_string_array('Monitors_Get_Header');
190+
result = obj.apiutil.get_string_array('ctx_Monitors_Get_Header', obj.dssctx);
191191
end
192192

193193
function result = get.Mode(obj)
194194
% Set Monitor mode (bitmask integer - see DSS Help)
195-
result = calllib(obj.libname, 'Monitors_Get_Mode');
195+
result = calllib(obj.libname, 'ctx_Monitors_Get_Mode', obj.dssctx);
196196
end
197197
function obj = set.Mode(obj, Value)
198-
calllib(obj.libname, 'Monitors_Set_Mode', Value);
198+
calllib(obj.libname, 'ctx_Monitors_Set_Mode', obj.dssctx, Value);
199199
end
200200

201201
function result = get.NumChannels(obj)
202202
% (read-only) Number of Channels in the active Monitor
203-
result = calllib(obj.libname, 'Monitors_Get_NumChannels');
203+
result = calllib(obj.libname, 'ctx_Monitors_Get_NumChannels', obj.dssctx);
204204
end
205205

206206
function result = get.RecordSize(obj)
207207
% (read-only) Size of each record in ByteStream (Integer). Same as NumChannels.
208-
result = calllib(obj.libname, 'Monitors_Get_RecordSize');
208+
result = calllib(obj.libname, 'ctx_Monitors_Get_RecordSize', obj.dssctx);
209209
end
210210

211211
function result = get.SampleCount(obj)
212212
% (read-only) Number of Samples in Monitor at Present
213-
result = calllib(obj.libname, 'Monitors_Get_SampleCount');
213+
result = calllib(obj.libname, 'ctx_Monitors_Get_SampleCount', obj.dssctx);
214214
end
215215

216216
function result = get.Terminal(obj)
217217
% Terminal number of element being monitored.
218-
result = calllib(obj.libname, 'Monitors_Get_Terminal');
218+
result = calllib(obj.libname, 'ctx_Monitors_Get_Terminal', obj.dssctx);
219219
end
220220
function obj = set.Terminal(obj, Value)
221-
calllib(obj.libname, 'Monitors_Set_Terminal', Value);
221+
calllib(obj.libname, 'ctx_Monitors_Set_Terminal', obj.dssctx, Value);
222222
end
223223

224224
function result = get.dblFreq(obj)
225225
% (read-only) Array of doubles containing frequency values for harmonics mode solutions; Empty for time mode solutions (use dblHour)
226-
result = obj.apiutil.get_float64_array('Monitors_Get_dblFreq');
226+
result = obj.apiutil.get_float64_array('ctx_Monitors_Get_dblFreq', obj.dssctx);
227227
end
228228

229229
function result = get.dblHour(obj)
230230
% (read-only) Array of doubles containgin time value in hours for time-sampled monitor values; Empty if frequency-sampled values for harmonics solution (see dblFreq)
231-
result = obj.apiutil.get_float64_array('Monitors_Get_dblHour');
231+
result = obj.apiutil.get_float64_array('ctx_Monitors_Get_dblHour', obj.dssctx);
232232
end
233233
end
234234
end

+DSS_MATLAB/IYMatrix.m

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
ColPtr = libpointer('int32PtrPtr');
4040
RowIdxPtr = libpointer('int32PtrPtr');
4141
cValsPtr = libpointer('doublePtrPtr');
42-
calllib(obj.libname, 'YMatrix_GetCompressedYMatrix', factor, nBus, nNz, ColPtr, RowIdxPtr, cValsPtr);
42+
calllib(obj.libname, 'ctx_YMatrix_GetCompressedYMatrix', obj.dssctx, factor, nBus, nNz, ColPtr, RowIdxPtr, cValsPtr);
4343
obj.CheckForError;
4444
if ((~nBus.Value(1) || ~nNz.Value(1)))
4545
result = 0;
@@ -65,45 +65,45 @@
6565
end
6666

6767
function obj = ZeroInjCurr(obj)
68-
calllib(obj.libname, 'YMatrix_ZeroInjCurr');
68+
calllib(obj.libname, 'ctx_YMatrix_ZeroInjCurr', obj.dssctx);
6969
end
7070

7171
function obj = GetSourceInjCurrents(obj)
72-
calllib(obj.libname, 'YMatrix_GetSourceInjCurrents');
72+
calllib(obj.libname, 'ctx_YMatrix_GetSourceInjCurrents', obj.dssctx);
7373
end
7474

7575
function obj = GetPCInjCurr(obj)
76-
calllib(obj.libname, 'YMatrix_GetPCInjCurr');
76+
calllib(obj.libname, 'ctx_YMatrix_GetPCInjCurr', obj.dssctx);
7777
end
7878

7979
function obj = BuildYMatrixD(obj, BuildOps, AllocateVI)
80-
calllib(obj.libname, 'YMatrix_BuildYMatrixD', BuildOps, AllocateVI);
80+
calllib(obj.libname, 'ctx_YMatrix_BuildYMatrixD', obj.dssctx, BuildOps, AllocateVI);
8181
end
8282

8383
function obj = AddInAuxCurrents(obj, SType)
84-
calllib(obj.libname, 'YMatrix_AddInAuxCurrents', SType);
84+
calllib(obj.libname, 'ctx_YMatrix_AddInAuxCurrents', obj.dssctx, SType);
8585
end
8686

8787
function result = GetIPointer(obj)
8888
% Get access to the internal Current pointer
8989
IvectorPtr = libpointer('doublePtrPtr');
90-
numNodes = (calllib(obj.libname, 'Circuit_Get_NumNodes') + 1) * 2;
91-
calllib(obj.libname, 'YMatrix_getIpointer', IvectorPtr);
90+
numNodes = (calllib(obj.libname, 'ctx_Circuit_Get_NumNodes', obj.dssctx) + 1) * 2;
91+
calllib(obj.libname, 'ctx_YMatrix_getIpointer', obj.dssctx, IvectorPtr);
9292
setdatatype(IvectorPtr.Value, 'doublePtr', 1, numNodes);
9393
result = IvectorPtr;
9494
end
9595

9696
function result = GetVPointer(obj)
9797
% Get access to the internal Voltage pointer
9898
VvectorPtr = libpointer('doublePtrPtr');
99-
numNodes = (calllib(obj.libname, 'Circuit_Get_NumNodes') + 1) * 2;
100-
calllib(obj.libname, 'YMatrix_getVpointer', VvectorPtr);
99+
numNodes = (calllib(obj.libname, 'ctx_Circuit_Get_NumNodes', obj.dssctx) + 1) * 2;
100+
calllib(obj.libname, 'ctx_YMatrix_getVpointer', obj.dssctx, VvectorPtr);
101101
setdatatype(VvectorPtr.Value, 'doublePtr', 1, numNodes);
102102
result = VvectorPtr;
103103
end
104104

105105
function result = SolveSystem(obj, NodeV)
106-
result = calllib(obj.libname, 'YMatrix_SolveSystem', NodeV);
106+
result = calllib(obj.libname, 'ctx_YMatrix_SolveSystem', obj.dssctx, NodeV);
107107
obj.CheckForError();
108108
end
109109

@@ -125,18 +125,18 @@
125125
methods
126126

127127
function result = get.SystemYChanged(obj)
128-
result = calllib(obj.libname, 'YMatrix_Get_SystemYChanged') ~= 0;
128+
result = calllib(obj.libname, 'ctx_YMatrix_Get_SystemYChanged', obj.dssctx) ~= 0;
129129
end
130130
function obj = set.SystemYChanged(obj, value)
131-
calllib(obj.libname, 'YMatrix_Set_SystemYChanged', value);
131+
calllib(obj.libname, 'ctx_YMatrix_Set_SystemYChanged', obj.dssctx, value);
132132
obj.CheckForError();
133133
end
134134

135135
function result = get.UseAuxCurrents(obj)
136-
result = calllib(obj.libname, 'YMatrix_Get_UseAuxCurrents') ~= 0;
136+
result = calllib(obj.libname, 'ctx_YMatrix_Get_UseAuxCurrents', obj.dssctx) ~= 0;
137137
end
138138
function obj = set.UseAuxCurrents(obj, value)
139-
calllib(obj.libname, 'YMatrix_Set_UseAuxCurrents', value);
139+
calllib(obj.libname, 'ctx_YMatrix_Set_UseAuxCurrents', obj.dssctx, value);
140140
obj.CheckForError();
141141
end
142142

0 commit comments

Comments
 (0)