mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
renamed some variable to ease understanding
This commit is contained in:
parent
1b9a1abffd
commit
e5b036e8ff
2 changed files with 12 additions and 12 deletions
|
@ -109,7 +109,7 @@ int file_open(struct node *n)
|
|||
else {
|
||||
struct msg m;
|
||||
/* Get current time */
|
||||
struct timespec now, tmp;
|
||||
struct timespec now, first, eta;
|
||||
clock_gettime(CLOCK_REALTIME, &now);
|
||||
|
||||
/* Get timestamp of first sample */
|
||||
|
@ -119,8 +119,8 @@ int file_open(struct node *n)
|
|||
/* Set offset depending on epoch_mode */
|
||||
switch (f->epoch_mode) {
|
||||
case EPOCH_NOW: /* read first value at f->now + f->epoch */
|
||||
tmp = time_diff(&f->start, &now);
|
||||
f->offset = time_add(&tmp, &f->epoch);
|
||||
first = time_diff(&f->start, &now);
|
||||
f->offset = time_add(&first, &f->epoch);
|
||||
break;
|
||||
case EPOCH_RELATIVE: /* read first value at f->start + f->epoch */
|
||||
f->offset = f->epoch;
|
||||
|
@ -130,14 +130,14 @@ int file_open(struct node *n)
|
|||
break;
|
||||
}
|
||||
|
||||
tmp = time_add(&f->start, &f->offset);
|
||||
tmp = time_diff(&now, &tmp);
|
||||
eta = time_add(&f->start, &f->offset);
|
||||
eta = time_diff(&now, &eta);
|
||||
|
||||
debug(5, "Opened file '%s' as input for node '%s': start=%.2f, offset=%.2f, eta=%.2f",
|
||||
debug(5, "Opened file '%s' as input for node '%s': start=%.2f, offset=%.2f, eta=%.2f sec",
|
||||
f->path_in, n->name,
|
||||
time_to_double(&f->start),
|
||||
time_to_double(&f->offset),
|
||||
time_to_double(&tmp)
|
||||
time_to_double(&eta)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -241,16 +241,16 @@ int socket_write(struct node *n, struct msg *pool, int poolsize, int first, int
|
|||
|
||||
struct iovec iov[cnt];
|
||||
for (int i = 0; i < cnt; i++) {
|
||||
struct msg *n = &pool[(first+i) % poolsize];
|
||||
|
||||
if (n->type == MSG_TYPE_EMPTY)
|
||||
struct msg *m = &pool[(first+i) % poolsize];
|
||||
|
||||
if (m->type == MSG_TYPE_EMPTY)
|
||||
continue;
|
||||
|
||||
/* Convert headers to network byte order */
|
||||
n->sequence = htons(n->sequence);
|
||||
|
||||
iov[sent].iov_base = n;
|
||||
iov[sent].iov_len = MSG_LEN(n);
|
||||
iov[sent].iov_base = m;
|
||||
iov[sent].iov_len = MSG_LEN(m);
|
||||
|
||||
sent++;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue