Commit graph

1797 commits

Author SHA1 Message Date
Johannes Mockenhaupt
5f43f0f147
* Fix stale data in Combo tab after error
* Add info about last command ran to the Combo tab
* Don't refresh data more than once a minute.
* Specify not only error, but also command that raised the error in
  alert notification
2017-07-18 21:20:40 +02:00
Johannes Mockenhaupt
4dc38e447a
Add first ruffyscripter test (needs ruffy to be available during test somehow). 2017-07-18 21:20:40 +02:00
Johannes Mockenhaupt
ac10bdc01c
First stab at dynamic timeout. 2017-07-18 21:20:40 +02:00
Johannes Mockenhaupt
44ae79bd50
Move command argument checking out of ctor into a dedicated method and check prior to execution. 2017-07-18 21:20:40 +02:00
Johannes Mockenhaupt
6faa1614ac
ComboFragment: rename Update Button to Refresh. 2017-07-18 21:20:40 +02:00
Johannes Mockenhaupt
5fad9b3a85
Cleanups. 2017-07-18 21:20:40 +02:00
Johannes Mockenhaupt
20a8350c67
Robustness for RuffyScripter. 2017-07-18 21:20:40 +02:00
Johannes Mockenhaupt
aa98864d65
... this should have gone into earlier commit, the UI one? 2017-07-18 21:20:40 +02:00
Johannes Mockenhaupt
ecf3866b43
Improve alerter. 2017-07-18 21:20:40 +02:00
Johannes Mockenhaupt
c131280e91
RuffyScripter.verifyMenuIsDisplayed: don't call waitForMenuUpdate, menu should already be displayed. If not, wait up to 1 second. 2017-07-18 21:20:40 +02:00
Johannes Mockenhaupt
ccffa3bfca
Add alerter thread to ComboPlugin that raises an alarm every 6 minutes (Android will by default silence alarms that go off within less than 5 minutes) when the pump state shows an error condition. 2017-07-18 21:20:40 +02:00
Johannes Mockenhaupt
362c3681d5
Clean up commands package. 2017-07-18 21:20:40 +02:00
Johannes Mockenhaupt
c63c86f98a
RuffyScripter improvements:
* Keep track of connection status rather than relying in IRuffyService.isConnected
* Abort running command if pump stops sending menu updates
* Fail if ruffy goes away (binding becomes invalid), currently only if this happens during disconnect attempts
2017-07-18 21:20:40 +02:00
Johannes Mockenhaupt
52b9621e29
Paranoia: check we're in the expected menu before each and every button press. 2017-07-18 21:20:40 +02:00
Johannes Mockenhaupt
d619796019
Improving pump status in the UI (combo tab) 2017-07-18 21:20:40 +02:00
Johannes Mockenhaupt
f7586268c7
Dead code be gone. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
93c0147b23
RuffyScripter: take over connection management. Disconnect after 5s of inactivity. Plus some fixes. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
b954ddaa84
Clean up ComoPlugin a bit. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
ccd81c67fd
UI for pump state. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
2ddccd3c31
RuffyScripter.runCommand: Next shot at understanding threading better. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
83e9ec743e
Properly accessing volatile field pumpState. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
69e560baee
Cleanup. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
4c0944b9f8
Optimize cancelling TBR. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
3aecf0f58b
Be more cautious handling command failures. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
8dd714b390
UI crimes 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
8ecf6922f7
Misc improvements:
* Make command execution (RuffyScripter/ComoboPlugin.runCommand) more robust (I still suck at threading).
* Return all possible states in PumpState
* Add absolute TBR to PumpState
* Add NoOpCommand to fetch state data from pump
* Display returned pump state in Combo fragment/tab.
2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
f251427d1b
Remove ReadStateCommand, all state will be return through the PumpState field on CommandResult, so it's passed back after every command. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
ec6491fcb7
Return absolute TBR rate in PumpState. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
69b98c54c6
Polish. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
9653af5501
RuffyScripter.navigateToMenu: detect if we're wrapping around not finding a menu (likely because it's hidden) 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
7e538cbcf6
Update PumpState s/errorCode/errorMsg/g 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
99830b05b6
Fix detecting error state on connection and fix cancelling TBR.
When there's an error, timing is crucial. Waiting for the blinking error code
to be readable hangs the thread running the command.
2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
f6c8f3638b
Reflect reject TBR change in comment. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
4ff81e885c
Simplify reading alerts (message doesn't blink) 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
e01e85c54f
On connect, check if pump is in an error state. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
364123c261
Fix carb only treatment. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
d0dabf34da
Fix handling TBR CANCELLED alert, remove ill-advised attempts to fake a command queue and have all commands return a state object. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
952aa0e8a2
RuffyScripter.waitForMenuToBeLeft: add timeout. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
77711b2174
ComboPlugin.runCommand: wait if pump is busy with a command. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
d8011aeaa4
Make cancelling TBR more robust to dismiss TBR cancelled alert specifially and only if it is raised.
Cancelling a TBR with a runtime < 60s (0:01 in the display) does NOT raise a TBR cancelled alert.
2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
2c706e7c22
Remove status logging in Ruffy, now done by command. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
8bc4cd255a
Don't close connection when other cmds are about to be run. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
f5ef666061
Add timestamp to State and rename to PumpState. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
f28a27a93f
Read pump state. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
9d8d12fcb9
Cleanups. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
eab9d8dcd7
Fix reducing duration of OpenAPS TBRs 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
e76524a539
Include state in CommandResult.toString. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
375eb46695
ReadStateCommand: properly read TBR %. 2017-07-18 21:20:39 +02:00
Johannes Mockenhaupt
fa039e6961
Note on cancelling TBRs that don't trigger a pump alert. 2017-07-18 21:20:18 +02:00
Johannes Mockenhaupt
0345a01fc1
Make CancelTbrCommand more robust. 2017-07-18 20:59:56 +02:00