Wave Pattern - custom & portal
Wave Pattern - custom & portal
'Lo all.
What would be the correct way to use both in code wave settings and the portal (when I want to) ?
In other words, how would I code my own wave settings when I choose 'custom' in the portal?
What would be the correct way to use both in code wave settings and the portal (when I want to) ?
In other words, how would I code my own wave settings when I choose 'custom' in the portal?
Re: Wave Pattern - custom & portal
Like this:
Replace the stuff inside the {} with whatever you want to do when the portal is set to custom.
--Colin
Code: Select all
if (InternalMemory.DCPumpMode_read()==11) // Custom mode on Portal
{
ReefAngel.DCPump.UseMemory = false;
ReefAngel.DCPump.SetMode(Else,60,30);
if (hour()>=22 || hour()<9) ReefAngel.DCPump.SetMode(Gyre,70,10,31); // Gyre mode 31 to 60 over 10 minutes from 2200 to 0900
if (hour()>=9 && hour()<10) ReefAngel.DCPump.SetMode(Gyre,90,10,30); // Gyre mode 30 to 90 over 10 minutes from 0900 to 1000
if (hour()>=10 && hour()<11) ReefAngel.DCPump.SetMode(Else,50,20);
}
else ReefAngel.DCPump.UseMemory = true;
--Colin
Re: Wave Pattern - custom & portal
Awe man, this is absolutely perfect! Thank you.cosmith71 wrote:Like this:
Replace the stuff inside the {} with whatever you want to do when the portal is set to custom.Code: Select all
if (InternalMemory.DCPumpMode_read()==11) // Custom mode on Portal { ReefAngel.DCPump.UseMemory = false; ReefAngel.DCPump.SetMode(Else,60,30); if (hour()>=22 || hour()<9) ReefAngel.DCPump.SetMode(Gyre,70,10,31); // Gyre mode 31 to 60 over 10 minutes from 2200 to 0900 if (hour()>=9 && hour()<10) ReefAngel.DCPump.SetMode(Gyre,90,10,30); // Gyre mode 30 to 90 over 10 minutes from 0900 to 1000 if (hour()>=10 && hour()<11) ReefAngel.DCPump.SetMode(Else,50,20); } else ReefAngel.DCPump.UseMemory = true;
--Colin
Re: Wave Pattern - custom & portal
You're welcome!
--Colin
--Colin
Re: Wave Pattern - custom & portal
Does this nested 'if' look correct ? I am having a hard time switching using 'custom' on the portal. Seems unstable and sometimes doesn't work.
Code: Select all
if (InternalMemory.DCPumpMode_read()==11) // Custom mode on Portal
{
ReefAngel.DCPump.UseMemory = false;
//If 8am - 11am, Nutrient Transport
if (wpMode==4)
{
ReefAngel.PWM.SetDaylight( NutrientTransportMode(wpWavStr,wpWavOff,7000,true) );
ReefAngel.PWM.SetActinic ( NutrientTransportMode(wpWavStr,wpWavOff,7000,false) );
}
else
{
if (wpMode==5)
{
ReefAngel.PWM.SetDaylight(wpWavStr);
ReefAngel.PWM.SetActinic(wpWavStr); //// Right wavemaker under feeder
}
else
{
//Set the wave
ReefAngel.PWM.SetDaylight( ElseMode(wpWavStr,wpWavOff,true) );
ReefAngel.PWM.SetActinic( ElseMode(wpWavStr,wpWavOff,false) );
}
}
}
else ReefAngel.DCPump.UseMemory = true;
Re: Wave Pattern - custom & portal
Try something like this:
No need for all the elses. They just make things confusing.
--Colin
Code: Select all
ReefAngel.DCPump.UseMemory = true;
if (InternalMemory.DCPumpMode_read()==11) // Custom mode on Portal
{
ReefAngel.DCPump.UseMemory = false;
//If 8am - 11am, Nutrient Transport
if (wpMode==4)
{
ReefAngel.PWM.SetDaylight( NutrientTransportMode(wpWavStr,wpWavOff,7000,true) );
ReefAngel.PWM.SetActinic ( NutrientTransportMode(wpWavStr,wpWavOff,7000,false) );
}
if (wpMode==5)
{
ReefAngel.PWM.SetDaylight(wpWavStr);
ReefAngel.PWM.SetActinic(wpWavStr); //// Right wavemaker under feeder
}
if (wpMode!=4 && wpMode!=5)
{
//Set the wave
ReefAngel.PWM.SetDaylight( ElseMode(wpWavStr,wpWavOff,true) );
ReefAngel.PWM.SetActinic( ElseMode(wpWavStr,wpWavOff,false) );
}
}
--Colin
Re: Wave Pattern - custom & portal
cosmith71 wrote:Try something like this:
No need for all the elses. They just make things confusing.Code: Select all
ReefAngel.DCPump.UseMemory = true; if (InternalMemory.DCPumpMode_read()==11) // Custom mode on Portal { ReefAngel.DCPump.UseMemory = false; //If 8am - 11am, Nutrient Transport if (wpMode==4) { ReefAngel.PWM.SetDaylight( NutrientTransportMode(wpWavStr,wpWavOff,7000,true) ); ReefAngel.PWM.SetActinic ( NutrientTransportMode(wpWavStr,wpWavOff,7000,false) ); } if (wpMode==5) { ReefAngel.PWM.SetDaylight(wpWavStr); ReefAngel.PWM.SetActinic(wpWavStr); //// Right wavemaker under feeder } if (wpMode!=4 && wpMode!=5) { //Set the wave ReefAngel.PWM.SetDaylight( ElseMode(wpWavStr,wpWavOff,true) ); ReefAngel.PWM.SetActinic( ElseMode(wpWavStr,wpWavOff,false) ); } }
--Colin
Thanks bud. Definitely seems more elegant. Will try tonight!
Re: Wave Pattern - custom & portal
Can't seem to get this to work.
When I set 'custom mode' in the portal - my wave strength's are at 0. Works fine without the
Here's the full custom wave routine if anyone wants to help troubleshoot:
When I set 'custom mode' in the portal - my wave strength's are at 0. Works fine without the
Code: Select all
ReefAngel.DCPump.UseMemory = true;
if (InternalMemory.DCPumpMode_read()==11) ReefAngel.DCPump.UseMemory = false;
Code: Select all
// Custom Wave Routine
// set the wpMode based on what time it is
if ( (hour() >= 2) && (hour() < 5) ) wpMode=1; // from 2am - 5am
if ( (hour() >= 5) && (hour() < 8) ) wpMode=2; // from 5am - 8am
if ( (hour() >= 8) && (hour() < 11) ) wpMode=4; // from 8am - 11am Nutrient Transport
if ( (hour() >= 11) && (hour() < 14) ) wpMode=2; // from 11a - 2pm
if ( (hour() >= 14) && (hour() < 17) ) wpMode=1; // from 2pm - 5pm
if ( (hour() >= 17) && (hour() < 20) ) wpMode=2; // from 5pm - 8pm
if ( (hour() >= 20) && (hour() < 23) ) wpMode=3; // from 8pm - 11p
if (hour() >= 23) wpMode=2; // from 11pm - midnight
if (hour() < 2) wpMode=1; // from midnight - 2am
if (ReefAngel.DisplayedMenu==FEEDING_MODE) wpMode=5; // Feeding Mode
if (ReefAngel.DisplayedMenu==WATERCHANGE_MODE) wpMode=6; //Water Change Mode
switch (wpMode)
{
case 1: wpWavStr=30; wpWavOff=2; break;
case 2: wpWavStr=33; wpWavOff=4; break;
case 3: wpWavStr=35; wpWavOff=6; break;
case 4: wpWavStr=40; wpWavOff=50; break;
case 5: wpWavStr=29; wpWavOff=0; break; // Feeding mode
case 6: wpWavStr=0; wpWavOff=0; break; // Waterchange Mode
default: wpWavStr=30; wpWavOff=2;
}
ReefAngel.DCPump.UseMemory = true;
if (InternalMemory.DCPumpMode_read()==11) ReefAngel.DCPump.UseMemory = false;
//If 8am - 11am, Nutrient Transport
if (wpMode==4)
{
ReefAngel.PWM.SetDaylight( NutrientTransportMode(wpWavStr,wpWavOff,7000,true) );
ReefAngel.PWM.SetActinic ( NutrientTransportMode(wpWavStr,wpWavOff,7000,false) );
}
if (wpMode==5||wpMode==6)
{
ReefAngel.PWM.SetDaylight(wpWavStr);
ReefAngel.PWM.SetActinic(wpWavStr); //// Right wavemaker under feeder
}
if (wpMode!=4 && wpMode!=5)
{
//Set the wave
ReefAngel.PWM.SetDaylight( ElseMode(wpWavStr,wpWavOff,true) );
ReefAngel.PWM.SetActinic( ElseMode(wpWavStr,wpWavOff,false) );
}
//end Custom Wave Routine