Re: Custom Main Screens
Posted: Sat Dec 31, 2011 6:37 pm
Code: Select all
//*********************************************************************************************************************************
//Custom Main, Graph & Menu
void DrawCustomMain()
{
Wire.requestFrom(8,8);
for (int a=0;a<8;a++)
{
if (Wire.available()) SeasonsVar[a]=Wire.receive();
}
byte x = 6;
byte y = 2;
byte t;
char text[7];
ReefAngel.LCD.DrawDate(6, 2);
ReefAngel.LCD.Clear(COLOR_BLACK, 1, 11, 132, 11);
pingSerial();
ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 6, 90, "--------------------");
ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 6, 126, "--------------------");
ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 93, "|");
ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 103, "|");
ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 113, "|");
ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 123, "|");
ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 93, "|");
ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 103, "|");
ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 113, "|");
ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 123, "|");
ReefAngel.LCD.DrawText(0,255,18,12,"EcoSmart Vortech");
if (vtechmode == 0) ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN,255,35,22,"Constant");
else if(vtechmode == 1) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,42,21,"Lagoon");
else if (vtechmode == 2) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,25,21,"Reef Crest");
else if (vtechmode == 3) ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE,255,22,21,"Short Pulse");
else if (vtechmode == 4) ReefAngel.LCD.DrawLargeText(COLOR_PINK,255,25,21,"Long Pulse");
else if (vtechmode == 5) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,8,21,"Nutrient Trnsp.");
else if (vtechmode == 6) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,23,21,"Tidal Swell");
else if (vtechmode == 9) ReefAngel.LCD.DrawLargeText(COLOR_WHITE,0,45,21,"Night");
ReefAngel.LCD.DrawText(0,255,10,30,"Display");
ConvertNumToString(text, ReefAngel.Params.Temp1, 10);
ReefAngel.LCD.DrawLargeText(COLOR_INDIANRED, 255, 10, 40, text, Num8x8);
pingSerial();
ReefAngel.LCD.DrawText(0,255,100,30,"pH");
ConvertNumToString(text, ReefAngel.Params.PH, 100);
ReefAngel.LCD.DrawLargeText(COLOR_PLUM, 255, 85, 40, text, Num8x8);
pingSerial();
ReefAngel.LCD.DrawText(0,255,43,48,"Salinity");
ConvertNumToString(text, ReefAngel.Params.Salinity, 100);
ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN, 255, 49, 58, text, Num8x8);
pingSerial();
pingSerial();
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox(12, 77, TempRelay);
ReefAngel.LCD.DrawText(0,255,8,68,"Sump");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp3, COLOR_CORNFLOWERBLUE, 40, 68, 10);
ReefAngel.LCD.DrawText(0,255,70,68,"Room");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp2, COLOR_CORNFLOWERBLUE, 99, 68, 10);
ReefAngel.LCD.DrawText(0,255,8,97,"Moon");
DayAge = MoonAge(day(), month(), year());
MoonState(DayAge);
if (ThisPhase == 0) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"New");
else if (ThisPhase == 1) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Waxing Crescent");
else if (ThisPhase == 2) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"First Quarter");
else if (ThisPhase == 3) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Waxing Gibbous");
else if (ThisPhase == 4) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Full");
else if (ThisPhase == 5) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Waning Gibbous");
else if (ThisPhase == 6) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Last Quarter");
else if (ThisPhase == 7) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Waning Crescent");
// ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetActinicValue(),COLOR_CORNFLOWERBLUE, 105, 109, 1);
ReefAngel.LCD.DrawText(0,255,8,109, "Sunrise");
ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,15,119, SeasonsVar[1]);
ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,20,119, ":");
ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,25,119, SeasonsVar[2]);
ReefAngel.LCD.DrawText(0,255,75,109,"%");
ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255, 60, 109, SeasonsVar[0]);
ReefAngel.LCD.DrawText(0,255,88,109, "Sunset");
ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,90,119, SeasonsVar[3]);
ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,102,119, ":");
ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,107,119, SeasonsVar[4]);
}
void DrawCustomGraph()
{
}