Skip to content

Commit 04ccf95

Browse files
committed
calllib: migrate most to include ctx_
1 parent 73d8c32 commit 04ccf95

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1380
-1385
lines changed

+DSS_MATLAB/IActiveClass.m

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,61 +43,61 @@
4343
options = 0;
4444
end
4545

46-
result = calllib(obj.libname, 'ActiveClass_ToJSON', options);
46+
result = calllib(obj.libname, 'ctx_ActiveClass_ToJSON', obj.dssctx, options);
4747
obj.CheckForError();
4848
end
4949
end
5050
methods
5151

5252
function result = get.ActiveClassName(obj)
5353
% (read-only) Returns name of active class.
54-
result = calllib(obj.libname, 'ActiveClass_Get_ActiveClassName');
54+
result = calllib(obj.libname, 'ctx_ActiveClass_Get_ActiveClassName', obj.dssctx);
5555
obj.CheckForError();
5656
end
5757

5858
function result = get.AllNames(obj)
5959
% (read-only) Array of strings consisting of all element names in the active class.
60-
result = obj.apiutil.get_string_array('ActiveClass_Get_AllNames');
60+
result = obj.apiutil.get_string_array('ctx_ActiveClass_Get_AllNames', obj.dssctx);
6161
obj.CheckForError();
6262
end
6363

6464
function result = get.Count(obj)
6565
% (read-only) Number of elements in Active Class. Same as NumElements Property.
66-
result = calllib(obj.libname, 'ActiveClass_Get_Count');
66+
result = calllib(obj.libname, 'ctx_ActiveClass_Get_Count', obj.dssctx);
6767
obj.CheckForError();
6868
end
6969

7070
function result = get.First(obj)
7171
% (read-only) Sets first element in the active class to be the active DSS object. If object is a CktElement, ActiveCktELment also points to this element. Returns 0 if none.
72-
result = calllib(obj.libname, 'ActiveClass_Get_First');
72+
result = calllib(obj.libname, 'ctx_ActiveClass_Get_First', obj.dssctx);
7373
obj.CheckForError();
7474
end
7575

7676
function result = get.Name(obj)
7777
% Name of the Active Element of the Active Class
78-
result = calllib(obj.libname, 'ActiveClass_Get_Name');
78+
result = calllib(obj.libname, 'ctx_ActiveClass_Get_Name', obj.dssctx);
7979
obj.CheckForError();
8080
end
8181
function obj = set.Name(obj, Value)
82-
calllib(obj.libname, 'ActiveClass_Set_Name', Value);
82+
calllib(obj.libname, 'ctx_ActiveClass_Set_Name', obj.dssctx, Value);
8383
obj.CheckForError();
8484
end
8585

8686
function result = get.Next(obj)
8787
% (read-only) Sets next element in active class to be the active DSS object. If object is a CktElement, ActiveCktElement also points to this element. Returns 0 if no more.
88-
result = calllib(obj.libname, 'ActiveClass_Get_Next');
88+
result = calllib(obj.libname, 'ctx_ActiveClass_Get_Next', obj.dssctx);
8989
obj.CheckForError();
9090
end
9191

9292
function result = get.NumElements(obj)
9393
% (read-only) Number of elements in this class. Same as Count property.
94-
result = calllib(obj.libname, 'ActiveClass_Get_NumElements');
94+
result = calllib(obj.libname, 'ctx_ActiveClass_Get_NumElements', obj.dssctx);
9595
obj.CheckForError();
9696
end
9797

9898
function result = get.ActiveClassParent(obj)
9999
% Get the name of the parent class of the active class
100-
result = calllib(obj.libname, 'ActiveClass_Get_ActiveClassParent');
100+
result = calllib(obj.libname, 'ctx_ActiveClass_Get_ActiveClassParent', obj.dssctx);
101101
obj.CheckForError();
102102
end
103103
end

+DSS_MATLAB/IBus.m

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@
8484
end
8585

8686
function result = GetUniqueNodeNumber(obj, StartNumber)
87-
result = calllib(obj.libname, 'Bus_GetUniqueNodeNumber', StartNumber);
87+
result = calllib(obj.libname, 'ctx_Bus_GetUniqueNodeNumber', obj.dssctx, StartNumber);
8888
obj.CheckForError();
8989
end
9090

9191
function result = ZscRefresh(obj)
92-
result = (calllib(obj.libname, 'Bus_ZscRefresh') ~= 0);
92+
result = (calllib(obj.libname, 'ctx_Bus_ZscRefresh', obj.dssctx) ~= 0);
9393
obj.CheckForError();
9494
end
9595

@@ -98,222 +98,222 @@
9898

9999
function result = get.Coorddefined(obj)
100100
% (read-only) False=0 else True. Indicates whether a coordinate has been defined for this bus
101-
result = (calllib(obj.libname, 'Bus_Get_Coorddefined') ~= 0);
101+
result = (calllib(obj.libname, 'ctx_Bus_Get_Coorddefined', obj.dssctx) ~= 0);
102102
obj.CheckForError();
103103
end
104104

105105
function result = get.CplxSeqVoltages(obj)
106106
% (read-only) Complex Double array of Sequence Voltages (0, 1, 2) at this Bus.
107-
calllib(obj.libname, 'Bus_Get_CplxSeqVoltages_GR');
107+
calllib(obj.libname, 'ctx_Bus_Get_CplxSeqVoltages_GR', obj.dssctx);
108108
obj.CheckForError();
109109
result = obj.apiutil.get_float64_gr_array();
110110
end
111111

112112
function result = get.Cust_Duration(obj)
113113
% (read-only) Accumulated customer outage durations
114-
result = calllib(obj.libname, 'Bus_Get_Cust_Duration');
114+
result = calllib(obj.libname, 'ctx_Bus_Get_Cust_Duration', obj.dssctx);
115115
obj.CheckForError();
116116
end
117117

118118
function result = get.Cust_Interrupts(obj)
119119
% (read-only) Annual number of customer-interruptions from this bus
120-
result = calllib(obj.libname, 'Bus_Get_Cust_Interrupts');
120+
result = calllib(obj.libname, 'ctx_Bus_Get_Cust_Interrupts', obj.dssctx);
121121
obj.CheckForError();
122122
end
123123

124124
function result = get.Distance(obj)
125125
% (read-only) Distance from energymeter (if non-zero)
126-
result = calllib(obj.libname, 'Bus_Get_Distance');
126+
result = calllib(obj.libname, 'ctx_Bus_Get_Distance', obj.dssctx);
127127
obj.CheckForError();
128128
end
129129

130130
function result = get.Int_Duration(obj)
131131
% (read-only) Average interruption duration, hr.
132-
result = calllib(obj.libname, 'Bus_Get_Int_Duration');
132+
result = calllib(obj.libname, 'ctx_Bus_Get_Int_Duration', obj.dssctx);
133133
obj.CheckForError();
134134
end
135135

136136
function result = get.Isc(obj)
137137
% (read-only) Short circuit currents at bus; Complex Array.
138-
calllib(obj.libname, 'Bus_Get_Isc_GR');
138+
calllib(obj.libname, 'ctx_Bus_Get_Isc_GR', obj.dssctx);
139139
obj.CheckForError();
140140
result = obj.apiutil.get_float64_gr_array();
141141
end
142142

143143
function result = get.Lambda(obj)
144144
% (read-only) Accumulated failure rate downstream from this bus; faults per year
145-
result = calllib(obj.libname, 'Bus_Get_Lambda');
145+
result = calllib(obj.libname, 'ctx_Bus_Get_Lambda', obj.dssctx);
146146
obj.CheckForError();
147147
end
148148

149149
function result = get.N_Customers(obj)
150150
% (read-only) Total numbers of customers served downline from this bus
151-
result = calllib(obj.libname, 'Bus_Get_N_Customers');
151+
result = calllib(obj.libname, 'ctx_Bus_Get_N_Customers', obj.dssctx);
152152
obj.CheckForError();
153153
end
154154

155155
function result = get.N_interrupts(obj)
156156
% (read-only) Number of interruptions this bus per year
157-
result = calllib(obj.libname, 'Bus_Get_N_interrupts');
157+
result = calllib(obj.libname, 'ctx_Bus_Get_N_interrupts', obj.dssctx);
158158
obj.CheckForError();
159159
end
160160

161161
function result = get.Name(obj)
162162
% (read-only) Name of Bus
163-
result = calllib(obj.libname, 'Bus_Get_Name');
163+
result = calllib(obj.libname, 'ctx_Bus_Get_Name', obj.dssctx);
164164
obj.CheckForError();
165165
end
166166

167167
function result = get.Nodes(obj)
168168
% (read-only) Integer Array of Node Numbers defined at the bus in same order as the voltages.
169-
calllib(obj.libname, 'Bus_Get_Nodes_GR');
169+
calllib(obj.libname, 'ctx_Bus_Get_Nodes_GR', obj.dssctx);
170170
obj.CheckForError();
171171
result = obj.apiutil.get_int32_gr_array();
172172
end
173173

174174
function result = get.NumNodes(obj)
175175
% (read-only) Number of Nodes this bus.
176-
result = calllib(obj.libname, 'Bus_Get_NumNodes');
176+
result = calllib(obj.libname, 'ctx_Bus_Get_NumNodes', obj.dssctx);
177177
obj.CheckForError();
178178
end
179179

180180
function result = get.SectionID(obj)
181181
% (read-only) Integer ID of the feeder section in which this bus is located.
182-
result = calllib(obj.libname, 'Bus_Get_SectionID');
182+
result = calllib(obj.libname, 'ctx_Bus_Get_SectionID', obj.dssctx);
183183
obj.CheckForError();
184184
end
185185

186186
function result = get.SeqVoltages(obj)
187187
% (read-only) Double Array of sequence voltages at this bus.
188-
calllib(obj.libname, 'Bus_Get_SeqVoltages_GR');
188+
calllib(obj.libname, 'ctx_Bus_Get_SeqVoltages_GR', obj.dssctx);
189189
obj.CheckForError();
190190
result = obj.apiutil.get_float64_gr_array();
191191
end
192192

193193
function result = get.TotalMiles(obj)
194194
% (read-only) Total length of line downline from this bus, in miles. For recloser siting algorithm.
195-
result = calllib(obj.libname, 'Bus_Get_TotalMiles');
195+
result = calllib(obj.libname, 'ctx_Bus_Get_TotalMiles', obj.dssctx);
196196
obj.CheckForError();
197197
end
198198

199199
function result = get.VLL(obj)
200200
% (read-only) For 2- and 3-phase buses, returns array of complex numbers represetin L-L voltages in volts. Returns -1.0 for 1-phase bus. If more than 3 phases, returns only first 3.
201-
calllib(obj.libname, 'Bus_Get_VLL_GR');
201+
calllib(obj.libname, 'ctx_Bus_Get_VLL_GR', obj.dssctx);
202202
obj.CheckForError();
203203
result = obj.apiutil.get_float64_gr_array();
204204
end
205205

206206
function result = get.VMagAngle(obj)
207207
% (read-only) Array of doubles containing voltages in Magnitude (VLN), angle (deg)
208-
calllib(obj.libname, 'Bus_Get_VMagAngle_GR');
208+
calllib(obj.libname, 'ctx_Bus_Get_VMagAngle_GR', obj.dssctx);
209209
obj.CheckForError();
210210
result = obj.apiutil.get_float64_gr_array();
211211
end
212212

213213
function result = get.Voc(obj)
214214
% (read-only) Open circuit voltage; Complex array.
215-
calllib(obj.libname, 'Bus_Get_Voc_GR');
215+
calllib(obj.libname, 'ctx_Bus_Get_Voc_GR', obj.dssctx);
216216
obj.CheckForError();
217217
result = obj.apiutil.get_float64_gr_array();
218218
end
219219

220220
function result = get.Voltages(obj)
221221
% (read-only) Complex array of voltages at this bus.
222-
calllib(obj.libname, 'Bus_Get_Voltages_GR');
222+
calllib(obj.libname, 'ctx_Bus_Get_Voltages_GR', obj.dssctx);
223223
obj.CheckForError();
224224
result = obj.apiutil.get_float64_gr_array();
225225
end
226226

227227
function result = get.YscMatrix(obj)
228228
% (read-only) Complex array of Ysc matrix at bus. Column by column.
229-
calllib(obj.libname, 'Bus_Get_YscMatrix_GR');
229+
calllib(obj.libname, 'ctx_Bus_Get_YscMatrix_GR', obj.dssctx);
230230
obj.CheckForError();
231231
result = obj.apiutil.get_float64_gr_array();
232232
end
233233

234234
function result = get.Zsc0(obj)
235235
% (read-only) Complex Zero-Sequence short circuit impedance at bus.
236-
calllib(obj.libname, 'Bus_Get_Zsc0_GR');
236+
calllib(obj.libname, 'ctx_Bus_Get_Zsc0_GR', obj.dssctx);
237237
obj.CheckForError();
238238
result = obj.apiutil.get_float64_gr_array();
239239
end
240240

241241
function result = get.Zsc1(obj)
242242
% (read-only) Complex Positive-Sequence short circuit impedance at bus..
243-
calllib(obj.libname, 'Bus_Get_Zsc1_GR');
243+
calllib(obj.libname, 'ctx_Bus_Get_Zsc1_GR', obj.dssctx);
244244
obj.CheckForError();
245245
result = obj.apiutil.get_float64_gr_array();
246246
end
247247

248248
function result = get.ZscMatrix(obj)
249249
% (read-only) Complex array of Zsc matrix at bus. Column by column.
250-
calllib(obj.libname, 'Bus_Get_ZscMatrix_GR');
250+
calllib(obj.libname, 'ctx_Bus_Get_ZscMatrix_GR', obj.dssctx);
251251
obj.CheckForError();
252252
result = obj.apiutil.get_float64_gr_array();
253253
end
254254

255255
function result = get.kVBase(obj)
256256
% (read-only) Base voltage at bus in kV
257-
result = calllib(obj.libname, 'Bus_Get_kVBase');
257+
result = calllib(obj.libname, 'ctx_Bus_Get_kVBase', obj.dssctx);
258258
obj.CheckForError();
259259
end
260260

261261
function result = get.puVLL(obj)
262262
% (read-only) Returns Complex array of pu L-L voltages for 2- and 3-phase buses. Returns -1.0 for 1-phase bus. If more than 3 phases, returns only 3 phases.
263-
calllib(obj.libname, 'Bus_Get_puVLL_GR');
263+
calllib(obj.libname, 'ctx_Bus_Get_puVLL_GR', obj.dssctx);
264264
obj.CheckForError();
265265
result = obj.apiutil.get_float64_gr_array();
266266
end
267267

268268
function result = get.puVmagAngle(obj)
269269
% (read-only) Array of doubles containig voltage magnitude, angle pairs in per unit
270-
calllib(obj.libname, 'Bus_Get_puVmagAngle_GR');
270+
calllib(obj.libname, 'ctx_Bus_Get_puVmagAngle_GR', obj.dssctx);
271271
obj.CheckForError();
272272
result = obj.apiutil.get_float64_gr_array();
273273
end
274274

275275
function result = get.puVoltages(obj)
276276
% (read-only) Complex Array of pu voltages at the bus.
277-
calllib(obj.libname, 'Bus_Get_puVoltages_GR');
277+
calllib(obj.libname, 'ctx_Bus_Get_puVoltages_GR', obj.dssctx);
278278
obj.CheckForError();
279279
result = obj.apiutil.get_float64_gr_array();
280280
end
281281

282282
function result = get.x(obj)
283283
% X Coordinate for bus (double)
284-
result = calllib(obj.libname, 'Bus_Get_x');
284+
result = calllib(obj.libname, 'ctx_Bus_Get_x', obj.dssctx);
285285
obj.CheckForError();
286286
end
287287
function obj = set.x(obj, Value)
288-
calllib(obj.libname, 'Bus_Set_x', Value);
288+
calllib(obj.libname, 'ctx_Bus_Set_x', obj.dssctx, Value);
289289
obj.CheckForError();
290290
end
291291

292292
function result = get.y(obj)
293293
% Y coordinate for bus(double)
294-
result = calllib(obj.libname, 'Bus_Get_y');
294+
result = calllib(obj.libname, 'ctx_Bus_Get_y', obj.dssctx);
295295
obj.CheckForError();
296296
end
297297
function obj = set.y(obj, Value)
298-
calllib(obj.libname, 'Bus_Set_y', Value);
298+
calllib(obj.libname, 'ctx_Bus_Set_y', obj.dssctx, Value);
299299
obj.CheckForError();
300300
end
301301

302302
function result = get.LoadList(obj)
303303
% List of strings: Full Names of LOAD elements connected to the active bus.
304-
result = obj.apiutil.get_string_array('Bus_Get_LoadList');
304+
result = obj.apiutil.get_string_array('ctx_Bus_Get_LoadList', obj.dssctx);
305305
obj.CheckForError();
306306
end
307307

308308
function result = get.LineList(obj)
309309
% List of strings: Full Names of LINE elements connected to the active bus.
310-
result = obj.apiutil.get_string_array('Bus_Get_LineList');
310+
result = obj.apiutil.get_string_array('ctx_Bus_Get_LineList', obj.dssctx);
311311
obj.CheckForError();
312312
end
313313

314314
function result = get.AllPCEatBus(obj)
315315
% Returns an array with the names of all PCE connected to the active bus
316-
result = obj.apiutil.get_string_array('Bus_Get_AllPCEatBus');
316+
result = obj.apiutil.get_string_array('ctx_Bus_Get_AllPCEatBus', obj.dssctx);
317317
obj.CheckForError();
318318
if (~isempty(result))
319319
result{end + 1} = '';
@@ -324,7 +324,7 @@
324324

325325
function result = get.AllPDEatBus(obj)
326326
% Returns an array with the names of all PDE connected to the active bus
327-
result = obj.apiutil.get_string_array('Bus_Get_AllPDEatBus');
327+
result = obj.apiutil.get_string_array('ctx_Bus_Get_AllPDEatBus', obj.dssctx);
328328
obj.CheckForError();
329329
if (~isempty(result))
330330
result{end + 1} = '';

0 commit comments

Comments
 (0)