mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-16 07:23:07 +01:00
Add #ifdef BOARD_NODEMCU32S_OBP60 in all *.cpp
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#ifdef BOARD_NODEMCU32S_OBP60
|
||||
|
||||
#include "Pagedata.h"
|
||||
#include "OBP60ExtensionPort.h"
|
||||
|
||||
@@ -83,18 +85,18 @@ public:
|
||||
//*******************************************************************************************
|
||||
|
||||
// Draw RudderPosition
|
||||
int rWindGraphic = 110; // Radius of RudderPosition
|
||||
int rInstrument = 110; // Radius of RudderPosition
|
||||
float pi = 3.141592;
|
||||
|
||||
display.fillCircle(200, 150, rWindGraphic + 10, pixelcolor); // Outer circle
|
||||
display.fillCircle(200, 150, rWindGraphic + 7, bgcolor); // Outer circle
|
||||
display.fillCircle(200, 150, rInstrument + 10, pixelcolor); // Outer circle
|
||||
display.fillCircle(200, 150, rInstrument + 7, bgcolor); // Outer circle
|
||||
display.fillRect(0, 30, 400, 122, bgcolor); // Delete half top circle
|
||||
|
||||
for(int i=90; i<=270; i=i+10)
|
||||
{
|
||||
// Scaling values
|
||||
float x = 200 + (rWindGraphic-30)*sin(i/180.0*pi); // x-coordinate dots
|
||||
float y = 150 - (rWindGraphic-30)*cos(i/180.0*pi); // y-coordinate cots
|
||||
float x = 200 + (rInstrument-30)*sin(i/180.0*pi); // x-coordinate dots
|
||||
float y = 150 - (rInstrument-30)*cos(i/180.0*pi); // y-coordinate cots
|
||||
const char *ii = " ";
|
||||
switch (i)
|
||||
{
|
||||
@@ -124,8 +126,8 @@ public:
|
||||
}
|
||||
|
||||
// Draw sub scale with dots
|
||||
float x1c = 200 + rWindGraphic*sin(i/180.0*pi);
|
||||
float y1c = 150 - rWindGraphic*cos(i/180.0*pi);
|
||||
float x1c = 200 + rInstrument*sin(i/180.0*pi);
|
||||
float y1c = 150 - rInstrument*cos(i/180.0*pi);
|
||||
display.fillCircle((int)x1c, (int)y1c, 2, pixelcolor);
|
||||
float sinx=sin(i/180.0*pi);
|
||||
float cosx=cos(i/180.0*pi);
|
||||
@@ -135,8 +137,8 @@ public:
|
||||
float dx=2; // Line thickness = 2*dx+1
|
||||
float xx1 = -dx;
|
||||
float xx2 = +dx;
|
||||
float yy1 = -(rWindGraphic-10);
|
||||
float yy2 = -(rWindGraphic+10);
|
||||
float yy1 = -(rInstrument-10);
|
||||
float yy2 = -(rInstrument+10);
|
||||
display.fillTriangle(200+(int)(cosx*xx1-sinx*yy1),150+(int)(sinx*xx1+cosx*yy1),
|
||||
200+(int)(cosx*xx2-sinx*yy1),150+(int)(sinx*xx2+cosx*yy1),
|
||||
200+(int)(cosx*xx1-sinx*yy2),150+(int)(sinx*xx1+cosx*yy2),pixelcolor);
|
||||
@@ -184,7 +186,7 @@ public:
|
||||
float xx1 = -startwidth;
|
||||
float xx2 = startwidth;
|
||||
float yy1 = -startwidth;
|
||||
float yy2 = -(rWindGraphic * 0.5);
|
||||
float yy2 = -(rInstrument * 0.5);
|
||||
display.fillTriangle(200+(int)(cosx*xx1-sinx*yy1),150+(int)(sinx*xx1+cosx*yy1),
|
||||
200+(int)(cosx*xx2-sinx*yy1),150+(int)(sinx*xx2+cosx*yy1),
|
||||
200+(int)(cosx*0-sinx*yy2),150+(int)(sinx*0+cosx*yy2),pixelcolor);
|
||||
@@ -193,7 +195,7 @@ public:
|
||||
float endwidth = 2; // End width of pointer
|
||||
float ix1 = endwidth;
|
||||
float ix2 = -endwidth;
|
||||
float iy1 = -(rWindGraphic * 0.5);
|
||||
float iy1 = -(rInstrument * 0.5);
|
||||
float iy2 = -endwidth;
|
||||
display.fillTriangle(200+(int)(cosx*ix1-sinx*iy1),150+(int)(sinx*ix1+cosx*iy1),
|
||||
200+(int)(cosx*ix2-sinx*iy1),150+(int)(sinx*ix2+cosx*iy1),
|
||||
@@ -242,4 +244,6 @@ PageDescription registerPageRudderPosition(
|
||||
0, // Number of bus values depends on selection in Web configuration
|
||||
{"RPOS"}, // Bus values we need in the page
|
||||
true // Show display header on/off
|
||||
);
|
||||
);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user