 |
25-03-2016, 17:59
|
#1
|
|
Registered User
Join Date: Mar 2016
Posts: 5
|
Rev Counter
Hello CF, I'm looking for a rev counter at the dashboard from opencpn, but I not found it. Then I loaded the source-code and wrote it self. It was many copy and paste and changes. the result is in the attatchment the changes in rsa.cpp are required for my test equipment (NMEA-Simulator from Kave Oy) . I have a question why is OCPN_DBP_STC_... a bitmap, over 31 instruments I get a compilerwarning, so i must comment out HEEL regards Gerald sorry for errors in the text, but English isn*t my native language
|
|
|
25-03-2016, 19:17
|
#2
|
|
Registered User
Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,326
|
Re: Rev Counter
Gerald...
Could you please attach the diff as text (if not sending it as a pull request on Github)?
Thanks
Pavel
|
|
|
26-03-2016, 02:18
|
#3
|
|
Registered User
Join Date: Mar 2016
Posts: 5
|
Re: Rev Counter
Quote:
Originally Posted by nohal
Gerald...
Could you please attach the diff as text
|
Have I tried, it's to big for txt, over 2000 kB
Quote:
(if not sending it as a pull request on Github)?
Thanks
Pavel
|
I don't know how,
can you help me
Gerald
|
|
|
26-03-2016, 04:04
|
#4
|
|
Senior Cruiser

Join Date: Mar 2003
Location: Thunder Bay, Ontario - 48-29N x 89-20W
Boat: (Cruiser Living On Dirt)
Posts: 53,721
|
Re: Rev Counter
Greetings and welcome aboard the CF, Gerald.
__________________
Gord May
"If you didn't have the time or money to do it right in the first place, when will you get the time/$ to fix it?"
|
|
|
26-03-2016, 05:12
|
#5
|
|
Registered User
Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,326
|
Re: Rev Counter
Quote:
Originally Posted by gsisvsts
Have I tried, it's to big for txt, over 2000 kB
|
If you simply change the extension of the file to .pdf or .doc, the 2kB limit does not apply
Quote:
I don't know how,
can you help me
|
https://help.github.com/articles/using-pull-requests/
Or if you don't know anything at all about Git and Github, maybe read even the rest of https://help.github.com/categories/c...pull-requests/
Pavel
|
|
|
26-03-2016, 07:02
|
#6
|
|
Registered User
Join Date: Mar 2016
Posts: 5
|
Re: Rev Counter
Quote:
Originally Posted by nohal
If you simply change the extension of the file to .pdf or .doc, the 2kB limit does not apply
|
It's a good idea, so I will do
and read
Quote:
Originally Posted by nohal
|
Gerald
|
|
|
26-03-2016, 08:15
|
#7
|
|
Registered User
Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,326
|
Re: Rev Counter
Gerald...
I don't think we want to sacrifice the already existing sentences and instruments for the new ones so a better solution for the 32bit limit of the enum would probably be something like
Code:
diff --git a/plugins/dashboard_pi/src/instrument.h b/plugins/dashboard_pi/src/instrument.h
index c10d24d..f165060 100644
--- a/plugins/dashboard_pi/src/instrument.h
+++ b/plugins/dashboard_pi/src/instrument.h
@@ -58,41 +58,41 @@ class DashboardInstrument_Single;
class DashboardInstrument_Position;
class DashboardInstrument_Sun;
-enum
-{
- OCPN_DBP_STC_LAT = 1 << 0,
- OCPN_DBP_STC_LON = 1 << 1,
- OCPN_DBP_STC_SOG = 1 << 2,
- OCPN_DBP_STC_COG = 1 << 3,
- OCPN_DBP_STC_STW = 1 << 4,
- OCPN_DBP_STC_HDM = 1 << 5,
- OCPN_DBP_STC_HDT = 1 << 6,
- OCPN_DBP_STC_HMV = 1 << 7, // Magnetic variation
- OCPN_DBP_STC_BRG = 1 << 8,
- OCPN_DBP_STC_AWA = 1 << 9,
- OCPN_DBP_STC_AWS = 1 << 10,
- OCPN_DBP_STC_TWA = 1 << 11,
- OCPN_DBP_STC_TWS = 1 << 12,
- OCPN_DBP_STC_DPT = 1 << 13,
- OCPN_DBP_STC_TMP = 1 << 14,
- OCPN_DBP_STC_VMG = 1 << 15,
- OCPN_DBP_STC_RSA = 1 << 16,
- OCPN_DBP_STC_SAT = 1 << 17,
- OCPN_DBP_STC_GPS = 1 << 18,
- OCPN_DBP_STC_PLA = 1 << 19, // Cursor latitude
- OCPN_DBP_STC_PLO = 1 << 20, // Cursor longitude
- OCPN_DBP_STC_CLK = 1 << 21,
- OCPN_DBP_STC_MON = 1 << 22,
- OCPN_DBP_STC_ATMP = 1 << 23, //AirTemp
- OCPN_DBP_STC_TWD = 1 << 24,
- OCPN_DBP_STC_TWS2 = 1 << 25,
- OCPN_DBP_STC_VLW1 = 1 << 26, // Trip Log
- OCPN_DBP_STC_VLW2 = 1 << 27, // Sum Log
- OCPN_DBP_STC_MDA = 1 << 28, // Bareometic pressure
- OCPN_DBP_STC_MCOG = 1 << 29, // Magnetic Course over Ground
- OCPN_DBP_STC_PITCH = 1 << 30, //Pitch
- OCPN_DBP_STC_HEEL = 1 << 31 //Heel
-};
+#define ONE (unsigned long)1
+const unsigned long OCPN_DBP_STC_LAT = ONE << 0;
+const unsigned long OCPN_DBP_STC_LON = ONE << 1;
+const unsigned long OCPN_DBP_STC_SOG = ONE << 2;
+const unsigned long OCPN_DBP_STC_COG = ONE << 3;
+const unsigned long OCPN_DBP_STC_STW = ONE << 4;
+const unsigned long OCPN_DBP_STC_HDM = ONE << 5;
+const unsigned long OCPN_DBP_STC_HDT = ONE << 6;
+const unsigned long OCPN_DBP_STC_HMV = ONE << 7; // Magnetic variation
+const unsigned long OCPN_DBP_STC_BRG = ONE << 8;
+const unsigned long OCPN_DBP_STC_AWA = ONE << 9;
+const unsigned long OCPN_DBP_STC_AWS = ONE << 10;
+const unsigned long OCPN_DBP_STC_TWA = ONE << 11;
+const unsigned long OCPN_DBP_STC_TWS = ONE << 12;
+const unsigned long OCPN_DBP_STC_DPT = ONE << 13;
+const unsigned long OCPN_DBP_STC_TMP = ONE << 14;
+const unsigned long OCPN_DBP_STC_VMG = ONE << 15;
+const unsigned long OCPN_DBP_STC_RSA = ONE << 16;
+const unsigned long OCPN_DBP_STC_SAT = ONE << 17;
+const unsigned long OCPN_DBP_STC_GPS = ONE << 18;
+const unsigned long OCPN_DBP_STC_PLA = ONE << 19; // Cursor latitude
+const unsigned long OCPN_DBP_STC_PLO = ONE << 20; // Cursor longitude
+const unsigned long OCPN_DBP_STC_CLK = ONE << 21;
+const unsigned long OCPN_DBP_STC_MON = ONE << 22;
+const unsigned long OCPN_DBP_STC_ATMP = ONE << 23; //AirTemp
+const unsigned long OCPN_DBP_STC_TWD = ONE << 24;
+const unsigned long OCPN_DBP_STC_TWS2 = ONE << 25;
+const unsigned long OCPN_DBP_STC_VLW1 = ONE << 26; // Trip Log
+const unsigned long OCPN_DBP_STC_VLW2 = ONE << 27; // Sum Log
+const unsigned long OCPN_DBP_STC_MDA = ONE << 28; // Bareometic pressure
+const unsigned long OCPN_DBP_STC_MCOG = ONE << 29; // Magnetic Course over Ground
+const unsigned long OCPN_DBP_STC_PITCH = ONE << 30; //Pitch
+const unsigned long OCPN_DBP_STC_HEEL = ONE << 31; //Heel
+const unsigned long OCPN_DBP_STC_RPM = ONE << 32;
+
class DashboardInstrument : public wxControl
{
Also, if I'm not missing something, the patch does not seem to handle the situation where you get the RPMs from more than one source (eg. on a catamaran or from an engine and a genset)
Pavel
|
|
|
26-03-2016, 13:21
|
#8
|
|
Registered User
Join Date: Mar 2016
Posts: 5
|
Re: Rev Counter
Pavel...
Thank you for the better solution for the 32bit limit of the enum.
Quote:
Originally Posted by nohal
Also, if I'm not missing something, the patch does not seem to handle the situation where you get the RPMs from more than one source (eg. on a catamaran or from an engine and a genset)
|
for me it's work fine, I have only one engine but I understand the problem.
The simplest way is ,I clone the Instrument, 2x or 3x or ...
a good way is an array with evaluate field 2 if you add a new instrument.
I hope , I have ideas and try burn it in code.
|
|
|
 |
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
Recent Discussions |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Vendor Spotlight |
|
No Threads to Display.
|
|