diff options
author | root <root@avtech.domain.avtechpulse.com> | 1999-12-31 20:35:46 -0500 |
---|---|---|
committer | root <root@avtech.domain.avtechpulse.com> | 1999-12-31 20:35:46 -0500 |
commit | fc5c34aab51ad93a6867fd224353aca0cee46fc2 (patch) | |
tree | 5c4d7e50c6843a3722a5069ec2b2f670ab4ef47a /instr-daemon.c | |
parent | 02231cd9177ae12053b3dc2248fb6a8bfeb4bdfd (diff) |
re-add auto-off timer function
Diffstat (limited to 'instr-daemon.c')
-rw-r--r-- | instr-daemon.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/instr-daemon.c b/instr-daemon.c index 52ebf6a..3b24548 100644 --- a/instr-daemon.c +++ b/instr-daemon.c @@ -265,8 +265,6 @@ int main(int argc, char **argv) // FIXME - self-cal here - or in thread beside user sessions? - // FIXME - need auto-timer output-off somewhere - launch event from set_output? - //register stdin channel stdinChannel = g_io_channel_unix_new(0); if(stdinChannel == NULL) { @@ -349,15 +347,27 @@ static gboolean periodic_poll (void) system ("/usr/bin/systemctl poweroff -f"); } + int i, output_on_time_so_far; + for (i=0; i<(globals.Flash.ChanKey_output_state?globals.Flash.channels:1); ++i) { + output_on_time_so_far = (int) (sec_timer()-globals.Timers.last_activity_at[i]); + if ((globals.Flash.output_timer[i]>0) && (globals.Timers.last_activity_at[i]>0) && (output_on_time_so_far > globals.Flash.output_timer[i])) { + Set_Output_State(i,output_off); + Show_Main_Menu(); + } + } + + Update_Main_Menu_If_Visible(); + Menu_Check_Buttons (); - int i; for (i=0; i<max_channels; i++) { if (globals.Flash.monitor_enabled[i]) { I2C_Check_Monitors(); } } + Update_Main_Menu_If_Visible(); + GPIB_check_for_device_clear_signal(); if (GPIB_check_for_messages(globals.Registers.gpib_buffer)) { if (GPIB_handle_new_input(globals.Registers.gpib_buffer)) { |