diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-04-18 23:57:06 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-04-18 23:57:06 (GMT) |
commit | 82624d4be02ab67c3e35c801ce875b1bb446f8aa (patch) | |
tree | 2ccce661a614690543d976894ac8e8ff2faaa515 /src/rhctl/audio_switch.go | |
parent | b9975f025a7dd3ba4fcfde03be9176618ef9aa5b (diff) |
seperate changed times for switch parts
Diffstat (limited to 'src/rhctl/audio_switch.go')
-rw-r--r-- | src/rhctl/audio_switch.go | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/rhctl/audio_switch.go b/src/rhctl/audio_switch.go index dd61f46..f3cb5df 100644 --- a/src/rhctl/audio_switch.go +++ b/src/rhctl/audio_switch.go @@ -85,10 +85,14 @@ type SwitchState struct { Inputs [SwitchInputNumMax]bool Silence bool } - GPI [SwitchGPINumMax]bool - Relay [SwitchRelayNumMax]bool - OC [SwitchOCNumMax]bool - Changed time.Time + AudioInputsChanged time.Time + AudioSilenceChanged time.Time + GPI [SwitchGPINumMax]bool + GPIChanged time.Time + Relay [SwitchRelayNumMax]bool + RelayChanged time.Time + OC [SwitchOCNumMax]bool + OCChanged time.Time } type AudioSwitch struct { @@ -128,7 +132,7 @@ func (sw *AudioSwitch) updateStateAudio(data string) { rhl.Printf("Audioswitch: invalid audio status update (state must be either '1' or '0' but is '%s')", ins[i]) } } - sw.state.Changed = time.Now() + sw.state.AudioInputsChanged = time.Now() sw.StateChanges <- sw.state } @@ -154,7 +158,7 @@ func (sw *AudioSwitch) updateStateGPI(data string) { rhl.Printf("Audioswitch: invalid gpi status update (state must be either '1' or '0' but is '%s')", data[7:8]) return } - sw.state.Changed = time.Now() + sw.state.GPIChanged = time.Now() sw.StateChanges <- sw.state return } @@ -180,7 +184,7 @@ func (sw *AudioSwitch) updateStateGPI(data string) { rhl.Printf("Audioswitch: invalid gpi status update (state must be either '1' or '0' but is '%s')", ins[i]) } } - sw.state.Changed = time.Now() + sw.state.GPIChanged = time.Now() sw.StateChanges <- sw.state } @@ -205,7 +209,7 @@ func (sw *AudioSwitch) updateStateRelay(data string) { rhl.Printf("Audioswitch: invalid relay status update (state must be either '1' or '0' but is '%s')", outs[i]) } } - sw.state.Changed = time.Now() + sw.state.RelayChanged = time.Now() sw.StateChanges <- sw.state } @@ -230,7 +234,7 @@ func (sw *AudioSwitch) updateStateOC(data string) { rhl.Printf("Audioswitch: invalid oc status update (state must be either '1' or '0' but is '%s')", outs[i]) } } - sw.state.Changed = time.Now() + sw.state.OCChanged = time.Now() sw.StateChanges <- sw.state } @@ -255,7 +259,7 @@ func (sw *AudioSwitch) updateStateSilence(data string) { rhl.Printf("Audioswitch: invalid silence status update (state must be either '1' or '0' but is '%s')", outs[i]) } } - sw.state.Changed = time.Now() + sw.state.AudioSilenceChanged = time.Now() sw.StateChanges <- sw.state } |