-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDSSCallBackStructDef.h
59 lines (52 loc) · 3.49 KB
/
DSSCallBackStructDef.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef DSSCALLBACKSTRUCTDEFH
#define DSSCALLBACKSTRUCTDEFH
#include "System.h"
#include "d2c_structures.h"
struct TDSSCallBacks {
void (*MsgCallBack)(pUTF8Char S, unsignedint maxlen); /*Make use of DSS Message handling*/
/*Routines for using DSS Parser. This allows you to write models that accept
syntax like other DSS scripts.*/
void (*GetIntValue)(int& i); /*Get next param as an integer*/
void (*GetDblValue)(double& x); /*Get next param as a double*/
void (*GetStrValue)(pUTF8Char S, unsignedint maxlen);
/*Get next param as a string <= maxlen characters (Cardinal = 32-bit unsigned)*/
/*caller must allocate space for s (Maxlen chars)*/
void (*LoadParser)(pUTF8Char S, unsignedint maxlen); // Copies a string into a special instance of the DSS parser
int (*NextParam)(pUTF8Char ParamName, unsignedint maxlen);
/*Advance to the next parameter and
Get name of the param just retrieved, if one was given.
Returns length of parameter found. If 0, then end of string.
This is to handle the syntax "paramname=paramvalue" commonly used in DSS scripts
Copies the string to the location specified by s up to maxlen characters.
Caller must allocate space (Maxlen chars)*/
void (*DoDSSCommand)(pUTF8Char S, unsignedint maxlen);
void (*GetActiveElementBusNames)(pUTF8Char Name1, unsignedint Len1, pUTF8Char Name2, unsignedint Len2);
void (*GetActiveElementVoltages)(int& NumVoltages, pComplexArray V);
void (*GetActiveElementCurrents)(int& NumCurrents, pComplexArray Curr, int ActorID);
void (*GetActiveElementLosses)(complex& TotalLosses, complex& LoadLosses, complex& NoLoadLosses, int ActorID);
void (*GetActiveElementPower)(int Terminal, complex& TotalPower);
void (*GetActiveElementNumCust)(int& Numcust, int& TotalCust);
void (*GetActiveElementNodeRef)(int Maxsize, pIntegerArray NodeReferenceArray);// calling program must allocate
int (*GetActiveElementBusRef)(int Terminal);
void (*GetActiveElementTerminalInfo)(int& NumTerminals, int& NumConds, int& NumPhases);
void (*GetPtrToSystemVarray)(void*& V, int& iNumNodes); // Returns pointer to Solution.V and size
int (*GetActiveElementIndex)();
bool (*IsActiveElementEnabled)();
bool (*IsBusCoordinateDefined)(int BusRef, int ActorID);
void (*GetBusCoordinate)(int BusRef, double& x, double& y, int ActorID);
double (*GetBuskVBase)(int BusRef, int ActorID);
double (*GetBusDistFromMeter)(int BusRef, int ActorID);
void (*GetDynamicsStruct)(void*& pDynamicsStruct, int ActorID); // Returns pointer to dynamics variables structure
double (*GetStepSize)(int ActorID); // Return just 'h' from dynamics record
double (*GetTimeSec)(int ActorID); // returns t in sec from top of hour
double (*GetTimeHr)(int ActorID); // returns time as a double in hours
void (*GetPublicDataPtr)(void*& pPublicData, int& PublicDataBytes, int ActorID);
int (*GetActiveElementName)(pUTF8Char FullName, unsignedint MaxNameLen, int ActorID);
void* (*GetActiveElementPtr)(int ActorID); // Returns pointer to active circuit element
int (*ControlQueuePush)(const int Hour, const double Sec, const int Code, const int ProxyHdl, void* Owner, int ActorID);
void (*GetResultStr)(pUTF8Char S, unsignedint maxlen);
};
/*NOTE: Maxlen argument is to better accommodate Fortran strings. VB also*/
/* Caller must allocate space for pchar values */
typedef TDSSCallBacks* pDSSCallBacks; /*Pointer to callback structure*/
#endif // DSSCALLBACKSTRUCTDEFH