50 sprintf(srun,
"Run%4.4i", runn);
51 strncat(svpath, srun, 256);
52 printf(
"output with run file:%s-\n", svpath);
56 if ((fHandle = open(svpath, O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1)
59 if ((fHandle = open(svpath, O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1)
62 if ((fHandle = open(svpath, O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1)
66 _open(svpath, O_WRONLY | O_CREAT | O_TRUNC |
O_BINARY, S_IWRITE)) == -1)
69 printf(
"File %s cannot be created\n", svpath);
77 BOOL atleastone_active;
79 char str[80], path[256];
85 for (
int jj = 0; jj <
MAX_LINE; jj++) {
95 char cs[80], stt[80], spt[80], ex[80], rev[256], rev1[256];
101 strcpy(cs,
"Running");
103 strcpy(cs,
"Paused ");
105 strcpy(cs,
"Stopped");
126 assert(
sizeof(
str) >= 32);
127 ctime_r(&full_time,
str);
136 strcpy(rev, strstr(rev1,
"midas"));
137 xststr[
j++] =
msprintf(
"*- MIDAS Status Page -%s ----------------------------*",
str);
170 xststr[
j++] =
msprintf(
"Run time: %02d:%02d:%02d", difftime / 3600, difftime % 3600 / 60, difftime % 60);
172 xststr[
j++] =
msprintf(
"Run time: %02d:%02d:%02d", difftime / 3600, difftime % 3600 / 60, difftime % 60);
182 xststr[
j++] =
msprintf(
"Full Run time: %02d:%02d:%02d", difftime / 3600, difftime % 3600 / 60, difftime % 60);
184 xststr[
j++] =
msprintf(
"Full Run time: %02d:%02d:%02d", difftime / 3600, difftime % 3600 / 60, difftime % 60);
202 atleastone_active =
FALSE;
205 xststr[
j++] =
"FE Equip. Node Evts Taken Evt Rate[/s] Data Rate[Kb/s]";
212 ((strstr(
key.
name,
"ODB")) == NULL) &&
213 ((strstr(
key.
name,
"BOR")) == NULL) &&
214 ((strstr(
key.
name,
"EOR")) == NULL)) {
217 size =
sizeof(equclient);
218 sprintf(strtmp,
"/equipment/%s/common/Frontend name",
key.
name);
222 atleastone_active =
TRUE;
223 size =
sizeof(equenabled);
224 sprintf(strtmp,
"/equipment/%s/common/enabled",
key.
name);
227 size =
sizeof(equevtsend);
228 sprintf(strtmp,
"/equipment/%s/statistics/events sent",
key.
name);
231 size =
sizeof(equevtpsec);
232 sprintf(strtmp,
"/equipment/%s/statistics/events per sec.",
key.
name);
235 size =
sizeof(equkbpsec);
236 sprintf(strtmp,
"/equipment/%s/statistics/kBytes per sec.",
key.
name);
239 size =
sizeof(equnode);
240 sprintf(strtmp,
"/equipment/%s/common/Frontend host",
key.
name);
243 char *pp, sdummy[257];
244 memset(sdummy, 0, 64);
246 pp = strchr(equnode,
'.');
248 xststr[
j] +=
msprintf(
"%-18s", strncpy(sdummy, equnode, pp - equnode));
250 xststr[
j] +=
msprintf(
"%-18s", strncpy(sdummy, equnode,
sizeof(sdummy)-1));
252 if (equevtsend > 1E9)
254 else if (equevtsend > 1E6)
283 if (!atleastone_active) {
284 xststr[
j++] =
"... No Front-End currently running...";
302 size =
sizeof(datadir);
315 xststr[
j++] =
"Chan. Active Type Filename Events Taken KBytes Taken";
322 size =
sizeof(lactive);
323 sprintf(strtmp,
"/logger/channels/%s/settings/active",
key.
name);
325 sprintf(lstate,
"No");
327 sprintf(lstate,
"Yes");
328 size =
sizeof(lpath);
329 sprintf(strtmp,
"/logger/channels/%s/settings/Filename",
key.
name);
335 if (strchr(
str,
'%'))
336 sprintf(path,
str,
rn);
341 size =
sizeof(ltype);
342 sprintf(strtmp,
"/logger/channels/%s/settings/type",
key.
name);
346 sprintf(strtmp,
"/logger/channels/%s/statistics/Events written",
key.
name);
350 sprintf(strtmp,
"/logger/channels/%s/statistics/Bytes written",
key.
name);
402 char bn[128],
tl[128];
419 size =
sizeof(client_name);
423 sprintf(
str,
"/Lazy/%s", &client_name[5]);
429 sprintf(
tl,
"<empty>");
442 xststr[
j] =
msprintf(
"%s %15s %25s %45s %60s",
"Lazy Label",
"Progress",
"File name",
"#files",
"Total");
457 char clientn[256], clienth[256];
458 char *pp, sdummy[64];
461 for (
int i = 0;;
i++) {
467 memset(strtmp, 0,
sizeof(strtmp));
468 size =
sizeof(clientn);
469 sprintf(strtmp,
"name");
471 memset(strtmp, 0,
sizeof(strtmp));
472 size =
sizeof(clienth);
473 sprintf(strtmp,
"host");
475 memset(sdummy, 0, 64);
476 pp = strchr(clienth,
'.');
478 xststr[
j] +=
msprintf(
" %s/%s", clientn, strncpy(sdummy, clienth, pp - clienth));
486 xststr[
j++] =
msprintf(
"*- [!] to Exit ------- [R] to Refresh ---------------------- Delay:%2.i [sec]-*",
delta_time / 1000);
488 xststr[
j++] =
"*---------------------------------------------------------------------------*";