summaryrefslogtreecommitdiff
path: root/monitor/disp.c
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2014-01-04 13:09:05 +0100
committerAlex AUVOLAT <alex.auvolat@ens.fr>2014-01-04 13:09:05 +0100
commit906d9a5356fe7b90fc14a9c0d6a0d65abb7e80a8 (patch)
tree3bc66c64240ee0b2cda71c1879169ff01e5cfc58 /monitor/disp.c
parent39df9f197b987e0a2c564276d5b65a97f1fb2700 (diff)
downloadSystDigit-Projet-906d9a5356fe7b90fc14a9c0d6a0d65abb7e80a8.tar.gz
SystDigit-Projet-906d9a5356fe7b90fc14a9c0d6a0d65abb7e80a8.zip
Document programs ; better time support in monitor.
Diffstat (limited to 'monitor/disp.c')
-rw-r--r--monitor/disp.c35
1 files changed, 31 insertions, 4 deletions
diff --git a/monitor/disp.c b/monitor/disp.c
index 7eaedc0..96d994d 100644
--- a/monitor/disp.c
+++ b/monitor/disp.c
@@ -74,9 +74,12 @@ void disp_display(t_mon *mon) {
werase(wpstatus);
- wprintw(wpstatus, "Step:\t\t%d\t%s\t%s\n",
+ wprintw(wpstatus, "Step:\t\t%d\t%s",
mon->step,
- (mon->status == MS_AUTO ? "A" : "M"),
+ (mon->status == MS_AUTO ? "A" : (mon->status == MS_RUN ? "M" : "")));
+ if (mon->status == MS_FREQ) wprintw(wpstatus, "%dHz", mon->freq);
+ if (mon->status == MS_AUTO) wprintw(wpstatus, " %dHz", mon->max_freq);
+ wprintw(wpstatus, "\t%s\n",
(mon->ticker_mode == TM_SECOND ? "TS" : (mon->ticker_mode == TM_FAST ? "TF" : "TZ")));
wprintw(wpstatus, "\nInputs:\n");
@@ -98,9 +101,30 @@ void disp_display(t_mon *mon) {
}
if (mon->n_outputs == 0) wprintw(wpstatus, "\t(none)\n");
- wprintw(wpstatus, "\nSerial buffer:\n%s\n", mon->ser_buf);
+ if (mon->ser_in_in != -1) {
+ wprintw(wpstatus, "\nSerial buffer:\n%s\n", mon->ser_buf);
+ }
+
+ wprintw(wpstatus, "\n\n");
+ for (i = 0; i < 8; i++)
+ wprintw(wpstatus, " %s ", (mon->d7[i] != -1 && mon->outputs[mon->d7[i]].v_bin[0] == '1' ? "---" : " "));
+ wprintw(wpstatus, "\n");
+ for (i = 0; i < 8; i++)
+ wprintw(wpstatus, " %c %c",
+ (mon->d7[i] != -1 && mon->outputs[mon->d7[i]].v_bin[1] == '1' ? '|' : ' '),
+ (mon->d7[i] != -1 && mon->outputs[mon->d7[i]].v_bin[2] == '1' ? '|' : ' '));
+ wprintw(wpstatus, "\n");
+ for (i = 0; i < 8; i++)
+ wprintw(wpstatus, " %s ", (mon->d7[i] != -1 && mon->outputs[mon->d7[i]].v_bin[3] == '1' ? "---" : " "));
+ wprintw(wpstatus, "\n");
+ for (i = 0; i < 8; i++)
+ wprintw(wpstatus, " %c %c",
+ (mon->d7[i] != -1 && mon->outputs[mon->d7[i]].v_bin[4] == '1' ? '|' : ' '),
+ (mon->d7[i] != -1 && mon->outputs[mon->d7[i]].v_bin[5] == '1' ? '|' : ' '));
+ wprintw(wpstatus, "\n");
+ for (i = 0; i < 8; i++)
+ wprintw(wpstatus, " %s ", (mon->d7[i] != -1 && mon->outputs[mon->d7[i]].v_bin[6] == '1' ? "---" : " "));
- wmove(wcmdline, 0, cmd_pos + 2);
wrefresh(wpstatus);
if (mon->ser_out_buf != 0) {
@@ -108,6 +132,9 @@ void disp_display(t_mon *mon) {
wrefresh(wpoutput);
mon->ser_out_buf = 0;
}
+
+ wmove(wcmdline, 0, cmd_pos + 2);
+ wrefresh(wcmdline);
}