Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 25-03-2016, 16: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
Attached Files
File Type: pdf rpm.diff.pdf (95.2 KB, 47 views)
gsisvsts is offline   Reply With Quote
Old 25-03-2016, 18:17   #2
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,211
Re: Rev Counter

Gerald...
Could you please attach the diff as text (if not sending it as a pull request on Github)?

Thanks

Pavel
nohal is online now   Reply With Quote
Old 26-03-2016, 01:18   #3
Registered User

Join Date: Mar 2016
Posts: 5
Re: Rev Counter

Quote:
Originally Posted by nohal View Post
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
gsisvsts is offline   Reply With Quote
Old 26-03-2016, 03:04   #4
Senior Cruiser
 
GordMay's Avatar

Cruisers Forum Supporter

Join Date: Mar 2003
Location: Thunder Bay, Ontario - 48-29N x 89-20W
Boat: (Cruiser Living On Dirt)
Posts: 49,456
Images: 241
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?"



GordMay is online now   Reply With Quote
Old 26-03-2016, 04:12   #5
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,211
Re: Rev Counter

Quote:
Originally Posted by gsisvsts View Post
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
nohal is online now   Reply With Quote
Old 26-03-2016, 06:02   #6
Registered User

Join Date: Mar 2016
Posts: 5
Re: Rev Counter

Quote:
Originally Posted by nohal View Post
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 View Post
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
Gerald
Attached Files
File Type: doc rpm.doc (28.3 KB, 57 views)
gsisvsts is offline   Reply With Quote
Old 26-03-2016, 07:15   #7
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,211
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
nohal is online now   Reply With Quote
Old 26-03-2016, 12: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 View Post
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.
gsisvsts is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rev counter Marauder Engines and Propulsion Systems 10 09-08-2020 07:53
Rev Counter Fault ab27 Engines and Propulsion Systems 3 06-03-2012 05:39
Rev Counter Reads Intermittently timj Engines and Propulsion Systems 5 06-06-2011 21:49
Engine Won't Rev in Gear n8cal@hotmail.c Engines and Propulsion Systems 15 16-06-2009 09:44
REV counter pickup Alan Wheeler Electrical: Batteries, Generators & Solar 25 12-11-2006 13:27

Advertise Here


All times are GMT -7. The time now is 04:54.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.