Professional Documents
Culture Documents
Fault Report Codigo DPL
Fault Report Codigo DPL
object pObj,
pTmp;
int ierr,
faulttype,
iline,
iBus,
iTmp,
iCountShc,
iCountBus,
iLineLen;
string aShc;
iCountShc= 0;
iCountBus= 0;
iLineLen = 153;
pObj = NULL;
EchoOff();
! method
if (method=0) { ! iec
shc:iopt_mde=1;
aShc = 'IEC';
} else { ! complete
shc:iopt_mde=3;
aShc = 'complete';
}
! fault resistance
shc:Rf = Rf;
shc:Xf = Xf;
ierr=0;
faulttype = 0;
faulttype = -1;
while (faulttype<2) { ! 3-1 -> increased in loop !
iline=1;
for (iBus=iCountBus-1; iBus>=0; iBus=iBus-1) {
pTmp = aShcLocs.Obj(iBus);
iTmp = pTmp.IsNode();
if (iTmp) {
iTmp = pTmp.IsShortCircuited();
if (iTmp) {
pTmp:dpl1 = iline; ! line in matrix
iline = iline+1;
continue;
}
}
aShcLocs.Remove(pTmp);
}
iCountBus = aShcLocs.Count();
if (iCountBus) {
aShcLocs.SortToVar(0,'loc_name');
InitMatrix.Execute(Results,aShcLocs);
}
}
if (iCountBus=0) {
continue;
}
! store results in matrix
WriteMatrix.Execute(Results,aShcLocs,faulttype);
iCountShc = iCountShc + 1;
}
shc:shcobj = NULL;
! produce output
if (iExcel) {
ToExcel.Execute(aShcLocs,Results);
} else {
Output.Execute(iLineLen,aShcLocs,Results);
}
EchoOn();