OpenTails / CRUMPET-Android

The Brains For Your Tail Company Gear!
GNU General Public License v3.0
31 stars 7 forks source link

Get Alarm working #21

Closed MasterTailer closed 5 years ago

MasterTailer commented 5 years ago

.. Absolute and Relative time

So choose a move and set it to go at 4pm, or +3 hours

ildar-gilmanov commented 5 years ago

Please could you describe the task in more details?

It is my vision of the task:

  1. We are at the screen image

  2. User clicks to Alarm button and we should show him new Alarm view.

  3. At this view user should choose one of the moving actions, like this: image

  4. And he should set up a time when this action should be passed to device (in relative or absolute time)

  5. We store these actions in C++ backend, in persistent storage, like QSettings (it is all new classes and we should realize them from scratch)

  6. When timer is triggered we should transmit these commands to device

@MasterTailer, @leinir, please check it, am I right?

MasterTailer commented 5 years ago

That looks good to me!

⁣The Master Tailer​

On 5 Feb 2019, 11:15, at 11:15, Gilmanov Ildar notifications@github.com wrote:

Please could you describe the task in more details?

It is my vision of the task:

  1. We are at the screen image

  2. User clicks to Alarm button and we should show him new Alarm view.

  3. At this view user should choose on of the moving actions, like this: image

  4. And he should set up a time when this action should be passed to device (in relative or absolute time)

  5. We store these actions in C++ backend, in persistent storage, like QSettings (it is all new classes and we should realize them from scratch)

@MasterTailer, @leinir, please check it, am I right?

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/MasterTailer/DIGITAiL/issues/21#issuecomment-460600741

leinir commented 5 years ago

Much good thinking there, that sounds about right for the logic of it all, yes :) A couple of details that might make life easier:

Hope that's helpful :)

ildar-gilmanov commented 5 years ago

@MasterTailer or @leinir, could you please record a video how it works with a real device. For example, we open Tail Moves view, click to Slow Wag 1 and what is happen after? The video will help me a lot :)

leinir commented 5 years ago

Just pushed a change so BaseMovesPage only blocks input when the tail is moving when it is told to do so (and have told it to do so only on the TailMoves page). This will make it easier for you to do that picking thing i mentioned in my first point above :)

i don't have a real tail right now, but i am unsure how a video of that would really help you do this... though i can totally see why having a video of the thing in action would be cool anyway ;)

ildar-gilmanov commented 5 years ago

I offer to reuse MoveLists component for alarms. In this case we just need to add time settings to move lists and save them at persistent storage. And it is much better then do only one action on time.

@leinir, @MasterTailer, What do you think about that?

ildar-gilmanov commented 5 years ago

Hmm, but it seems we use Move Lists only as a library for complex actions, so it would be not nice to add a concrete time to that complex action. But later we can add that actions as sources to the Alarms.

ildar-gilmanov commented 5 years ago

Done:

  1. Extracted NamePicker component from MoveList
  2. Figured out how alarms views should look
  3. Created stubs for AlarmList.qml
  4. Created stubs for Alarm and AlarmList C++ classes

At the next week:

  1. Link QML view with model classes to showing, editing and adding alarms
  2. Load and store alarms to and from settings
leinir commented 5 years ago

Hmm, but it seems we use Move Lists only as a library for complex actions, so it would be not nice to add a concrete time to that complex action. But later we can add that actions as sources to the Alarms.

Indeed, it would not make a lot of sense to add specific times into Move Lists, however it certainly would be nice for the alarm function to be able to also accept a move list as well as a single command for the alarm action :)

ildar-gilmanov commented 5 years ago

image

image

image

image

image

  1. Extracted shared components from MoveLists.qml and MoveListEditor.qml
  2. Added MessageBox.qml component. Now we can easily show message boxes with the one command: showMessageBox(qsTr(""))
  3. Added DatePicker.qml and TimePicker.qml
  4. Load and store alarm list model
ildar-gilmanov commented 5 years ago

https://github.com/MasterTailer/DIGITAiL/pull/40

ildar-gilmanov commented 5 years ago

Now user can only setup absolute date and time for alarm, but I think you want to add periodic tasks (each day, for example). And now we do not send the commands from app to devices.

MasterTailer commented 5 years ago

We dont need periodic ones, nice idea though.