need custom PDE help

Share you PDE file with our community

Posts: 329
Joined: Fri May 17, 2013 1:35 pm
PostPosted: Tue Jun 11, 2013 7:51 am
I want to keep the DP AP part of the params and delete the rest. is it easy to change the name from DP to say WP40L and AP to say WP40R?


Image
Image
User avatar
Posts: 5361
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Tue Jun 11, 2013 8:29 am
Yes it's all very easy.

You will take out the block of code that is drawing the rest of the parameters and add something like this:

Code: Select all
DrawText(DPColor,DefaultBGColor,x+60,y+10,"DP:");
DrawSingleMonitor(ReefAngel.PWM.GetDaylightValue(), DPColor, x+78, y+10,1);
DrawText(APColor,DefaultBGColor,x+60,y+20,"AP:");
DrawSingleMonitor(ReefAngel.PWM.GetActinicValue(), APColor, x+78, y+20,1);


you will need to play with the x and y and change the DP and AP to what you want

The DrawText function prints your label and the DrawSingleMonitor draws the values.

Posts: 329
Joined: Fri May 17, 2013 1:35 pm
PostPosted: Tue Jun 11, 2013 10:43 am
easy for someone who knows what there doing maybe but is it easy for someone like me lol. ok so whats the x+60 mean, is that where its placing it on the screen? I tried plugging it in and get error not defined in scope?
Image

Posts: 329
Joined: Fri May 17, 2013 1:35 pm
PostPosted: Tue Jun 11, 2013 11:03 am
is this what you mean by changing the DP and AP?

Code: Select all
DrawText(WP40LColor,DefaultBGColor,x+60,y+10,"WP40L:");
DrawSingleMonitor(ReefAngel.PWM.GetDaylightValue(), WP40LColor, x+78, y+10,1);
DrawText(WP40RColor,DefaultBGColor,x+60,y+20,"WP40R:");
DrawSingleMonitor(ReefAngel.PWM.GetActinicValue(),WP40RPColor, x+78, y+20,1);
Image
User avatar
Posts: 5361
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Tue Jun 11, 2013 11:33 am
yes but don't change it for the colors... since WP40LColor and WP40RPColor are not defined... :)

Posts: 329
Joined: Fri May 17, 2013 1:35 pm
PostPosted: Tue Jun 11, 2013 11:46 am
so like this? now where do i put this exactly? in the bottom section or in the section between the global variable? I tried both but got the error saying not declared in this scope.

DrawText(DPColor,DefaultBGColor,x+60,y+10,"WP40L:");
DrawSingleMonitor(ReefAngel.PWM.GetDaylightValue(), DPColor, x+78, y+10,1);
DrawText(APColor,DefaultBGColor,x+60,y+20,"WP40R:");
DrawSingleMonitor(ReefAngel.PWM.GetActinicValue(),APColor, x+78, y+20,1);
Image
User avatar
Posts: 5361
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Tue Jun 11, 2013 11:50 am
This would all go inside your DrawCustomMain() function like you did with DrawStatus() and DrawParams(),

I see what the error is. I copied the code directly from the library function that does DrawMonitor...

so to use it in your code, you need to change DrawText to ReefAngel.LCD.DrawText and change DrawSingleMonitor to ReefAngel.LCD.DrawSingleMonitor.

Sorry about that.

Posts: 329
Joined: Fri May 17, 2013 1:35 pm
PostPosted: Tue Jun 11, 2013 11:56 am
so i changed it like this

Code: Select all
ReefAngel.LCD.DrawText(DPColor,DefaultBGColor,x+60,y+10,"WP40L:");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetDaylightValue(), DPColor, x+78, y+10,1);
ReefAngel.LCD.DrawText(APColor,DefaultBGColor,x+60,y+20,"WP40R:");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetActinicValue(),APColor, x+78, y+20,1);


and put it in here

Code: Select all
{
// the graph is drawn/updated when we exit the main menu &
// when the parameters are saved
ReefAngel.LCD.DrawDate(6, 112);
ReefAngel.LCD.DrawText(COLOR_INDIGO, COLOR_WHITE,25,5, "Jeremy's Reef");
pingSerial();
ReefAngel.LCD.DrawText(DPColor,DefaultBGColor,x+60,y+10,"WP40L:");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetDaylightValue(), DPColor, x+78, y+10,1);
ReefAngel.LCD.DrawText(APColor,DefaultBGColor,x+60,y+20,"WP40R:");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetActinicValue(),APColor, x+78, y+20,1);
DrawStatus (20,80);
DrawParams (5,60);
pingSerial();
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox(12, 93, TempRelay);
}

and got error the x and y are not declaired in this scope
Image

Posts: 329
Joined: Fri May 17, 2013 1:35 pm
PostPosted: Tue Jun 11, 2013 12:00 pm
ok i moved it into the bottom portion with the custom params section and it loaded. just got to figure out the placement.
Image

Posts: 329
Joined: Fri May 17, 2013 1:35 pm
PostPosted: Tue Jun 11, 2013 12:02 pm
thats not working all my params i.e. temp ph and pwm readings are all ontop of eachother.
ok did some more playing and created a new paramsa section to put the pwm files in so i can place them in there own area. :D
Last edited by jjdezek on Tue Jun 11, 2013 12:12 pm, edited 1 time in total.
Image
PreviousNext

Return to My PDE/INO file

Who is online

Users browsing this forum: No registered users and 2 guests