Status display

Alows to show status of current channels and users
This commit is contained in:
Andreas Eversberg
2017-05-25 18:43:54 +02:00
parent bb64c6b3ba
commit 6adfcf7466
16 changed files with 354 additions and 12 deletions

View File

@@ -272,12 +272,29 @@ const char *amps_state_name(enum amps_state state)
return invalid;
}
void amps_display_status(void)
{
sender_t *sender;
amps_t *amps;
transaction_t *trans;
display_status_start();
for (sender = sender_head; sender; sender = sender->next) {
amps = (amps_t *) sender;
display_status_channel(amps->sender.kanal, chan_type_short_name(amps->chan_type), amps_state_name(amps->state));
for (trans = amps->trans_list; trans; trans = trans->next)
display_status_subscriber(amps_min2number(trans->min1, trans->min2), trans_short_state_name(trans->state));
}
display_status_end();
}
static void amps_new_state(amps_t *amps, enum amps_state new_state)
{
if (amps->state == new_state)
return;
PDEBUG_CHAN(DAMPS, DEBUG_DEBUG, "State change: %s -> %s\n", amps_state_name(amps->state), amps_state_name(new_state));
amps->state = new_state;
amps_display_status();
}
static struct amps_channels {