int main() { int nodesQuantity = 0; float pressure = 0; int i; long t, tstep; char *name; name = new char [30]; ENopen("../test/Net3.inp","resume.txt",""); ENgetcount(EN_NODECOUNT, &nodesQuantity); for (i = 1; i < nodesQuantity; i++) { ENgetnodeid(i, name); } ENopenH(); ENinitH(0); do { ENrunH(&t); if (t%3600 == 0) { for (i = 1; i < nodesQuantity; i++) { ENgetnodevalue(i,EN_PRESSURE, &pressure); } } ENnextH(&tstep); } while (tstep > 0); ENcloseH(); ENclose(); }
void writeNodeTable(int j, int tableType) { int k, m, hrs, mins; char s[MAXLINE+1]; float c; for (k=0; k<MSX.Nperiods; k++) { if ( tableType == SERIES_TABLE ) { getHrsMins(k, &hrs, &mins); sprintf(Line, "%4d:%02d", hrs, mins); } if ( tableType == STATS_TABLE ) { ENgetnodeid(j, IDname); sprintf(Line, "%-16s", IDname); } for (m=1; m<=MSX.Nobjects[SPECIES]; m++) { if ( !MSX.Species[m].rpt ) continue; if ( MSX.Species[m].type == WALL ) continue; c = MSXout_getNodeQual(k, j, m); sprintf(s, " %10.*f", MSX.Species[m].precision, c); strcat(Line, s); } writeLine(Line); } }
string ONNode::id(void) const { char* idc = new char[15]; int errcode; errcode = ENgetnodeid(epanetIndex(), idc); if(errcode) checkError(errcode, "ONNode::id()"); string id(idc); return id; }
void createSeriesTables() { int j; // --- report on all requested nodes for (j=1; j<=MSX.Nobjects[NODE]; j++) { if ( !MSX.Node[j].rpt ) continue; ENgetnodeid(j, IDname); createTableHdr(NODE, SERIES_TABLE); writeNodeTable(j, SERIES_TABLE); } // --- report on all requested links for (j=1; j<=MSX.Nobjects[LINK]; j++) { if ( !MSX.Link[j].rpt ) continue; ENgetlinkid(j, IDname); createTableHdr(LINK, SERIES_TABLE); writeLinkTable(j, SERIES_TABLE); } }