Custom Menu
Re: Custom Menu
When the tutorial is ready?
tanks
Marcelo
tanks
Marcelo
Re: Custom Menu
There is no tutorial for creating a custom menu. The ability to create a custom menu does not exist yet. The only thing that you can do is utilize the simple menu.mbertalha wrote:When the tutorial is ready?
tanks
Marcelo
curt
Re: Custom Menu
Well, I must say that I have a preliminary working (yes, I did say working) version of the custom menu. It can be defined and all contained within the PDE file. You can create your own menu entries and have it perform all the tasks that you want. This will open up all sorts of possibilities and possibly some confusion as well with the menu events but that's just how it goes when you want lots of customizing opportunities.
Some stuff will have to be repeated unless I create custom functions for them (like displaying a setup menu and stuff like that). I haven't created those functions because they increase code size. However, at the expense of increasing the code size a little for simplicity of the menus I think it would be manageable.
In this working example I have so far, you cannot display any of the setup screens. I'm thinking that some people would want to have access to some specific setup screens, like maybe an ATO or Lights or something. Although this is not necessary now that we have the memory page on the Client Suite and also my Status application.
Another limitation is that you an only have 1 menu screen with a max of 9 entries. This should be more than adequate for everybody.
Anyways, here's a sample screenshot that I created of all 9 entries in use. I still have more testing to make sure things work as expected. If anybody would like to help me test out, keep an eye on my github account for the "custom_menu" branch.
Feedback (comments and suggestions) are always welcomed.
curt
Some stuff will have to be repeated unless I create custom functions for them (like displaying a setup menu and stuff like that). I haven't created those functions because they increase code size. However, at the expense of increasing the code size a little for simplicity of the menus I think it would be manageable.
In this working example I have so far, you cannot display any of the setup screens. I'm thinking that some people would want to have access to some specific setup screens, like maybe an ATO or Lights or something. Although this is not necessary now that we have the memory page on the Client Suite and also my Status application.
Another limitation is that you an only have 1 menu screen with a max of 9 entries. This should be more than adequate for everybody.
Anyways, here's a sample screenshot that I created of all 9 entries in use. I still have more testing to make sure things work as expected. If anybody would like to help me test out, keep an eye on my github account for the "custom_menu" branch.
Feedback (comments and suggestions) are always welcomed.
curt
Re: Custom Menu
Cool Thanks curt !
I will test it I guess for all stuff I need in my fresh Water
I will test it I guess for all stuff I need in my fresh Water
Fresh Water Aquarium 180*60*80
Salt Water Aquarium 60*60*60
Click Here to see the Video of my Fresh Water Aquarium
Salt Water Aquarium 60*60*60
Click Here to see the Video of my Fresh Water Aquarium
Re: Custom Menu
There is most likely some finishing touches that I need to add with it though. It will most likely require a guide on how to use it with examples, otherwise people would get confused. I'll be working on this through the week and into the weekend. We shall see what all I come up with.Xender wrote:Cool Thanks curt !
I will test it I guess for all stuff I need in my fresh Water
curt
Re: Custom Menu
Very cool, Curt.
Thanks for your contribution...
Marcelo
Thanks for your contribution...
Marcelo
Re: Custom Menu
I modified the simple menu to remove the ATO and add in an option to turn on my moon lights since I don't run them all the time. If I wake up early before the mains come on sometimes I would like to turn on the moon.
So far I can get them to turn on but can't figure out how to get them to turn back off. I either get everything to turn off/on.
So far I can get them to turn on but can't figure out how to get them to turn back off. I either get everything to turn off/on.
Re: Custom Menu
What code are you using to turn them on?wolfador wrote:I modified the simple menu to remove the ATO and add in an option to turn on my moon lights since I don't run them all the time. If I wake up early before the mains come on sometimes I would like to turn on the moon.
So far I can get them to turn on but can't figure out how to get them to turn back off. I either get everything to turn off/on.
curt
Re: Custom Menu
binder wrote: What code are you using to turn them on?
curt
Code: Select all
void ReefAngelClass::MoonLightStart()
{
// turn off ports
#ifdef SaveRelayState
// TODO Test SaveRelayState
byte CurrentRelayState = Relay.RelayData;
#endif // SaveRelayState
Relay.RelayMaskOn = MoonLightPorts;
Relay.Write();
LCD.DrawText(ModeScreenColor, DefaultBGColor, 30, 10, "Moon Mode");
}
In the .PDE file I have
Code: Select all
ReefAngel.MoonLightPorts = B10000000;
Code: Select all
case MOONLIGHT_MODE:
{
LastStart = now(); // Set the time normal mode is started
if ( Joystick.IsButtonPressed() )
{
// we're finished, so let's clear the screen and return
ClearScreen(DefaultBGColor);
Timer[LCD_TIMER].Start(); // start LCD shutoff timer
#ifdef SaveRelayState
Relay.RelayData = CurrentRelayState;
#endif // SaveRelayState
// turn on ports
Relay.RelayMaskOn = ~MoonLightPorts;
// Compare the delayed on ports with the previous port states
Relay.RelayData &= ~(MoonLightPorts & DelayedOnPorts);
Relay.Write();
// Draw main screen
SelectedMenuItem = DEFAULT_MENU_ITEM;
DisplayedMenu = DEFAULT_MENU;
Currently that switches the moon lights off and the all other ports on.
Re: Custom Menu
ill have a closer look at things when i get my setup up and running later this weekend. It most likely is something simple.
curt
curt
Re: Custom Menu
I think you really should avoid creating functions inside the library, but I do understand that this particular piece of the library is still not finalized.
The reason being is that whenever Curt releases updates, your code will be overwritten and you will have to keep updating your own set of libraries everytime, but I'm pretty sure you know how to merge them.
Anyway, on your code, I think you should release the RelayMaskOn to its running state, which is 0 and not invert it.
When you invert the mask, you are making the mask becode B01111111, which means turn all relays on except number 8.
So, that line should be
Or, if you want to just return the relay 8 to its original state:
Let me know if this works out.
The reason being is that whenever Curt releases updates, your code will be overwritten and you will have to keep updating your own set of libraries everytime, but I'm pretty sure you know how to merge them.
Anyway, on your code, I think you should release the RelayMaskOn to its running state, which is 0 and not invert it.
When you invert the mask, you are making the mask becode B01111111, which means turn all relays on except number 8.
So, that line should be
Code: Select all
Relay.RelayMaskOn =0;
Code: Select all
Relay.RelayMaskOn &= ~MoonLightPorts;
Roberto.
Re: Custom Menu
Used this and it works great. Thanks!rimai wrote:
Or, if you want to just return the relay 8 to its original state:Let me know if this works out.Code: Select all
Relay.RelayMaskOn &= ~MoonLightPorts;