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 18-02-2013, 16:15   #106
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,996
Images: 2
Re: WeatherFax...

Ok, will download and change that file and cmake.

Was having trouble with coord set and latlon set with both wav and gif files.
Hit OK then message "Image Edit Result in zero size."

Will download the file and cmake and build again.

Thanks!!!
rgleason is offline   Reply With Quote
Old 18-02-2013, 17:10   #107
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,449
Re: WeatherFax...

Quote:
Originally Posted by ChuckSK View Post
Try these fixes.

Code:
diff --git a/src/WeatherFaxDialog.cpp b/src/WeatherFaxDialog.cpp
index a922211..dbc68ab 100644
--- a/src/WeatherFaxDialog.cpp
+++ b/src/WeatherFaxDialog.cpp
@@ -241,7 +241,7 @@ EditFaxDialog::EditFaxDialog( WeatherFaxImage &img, wxString name,
     : EditFaxDialogBase( &parent ), m_parent(parent),
       m_img(img), m_curCoords(img.m_Coords),
       m_name(name), m_splits(0),
-      m_EditState(COORD), m_Coords(coords)
+      m_EditState(COORD1), m_Coords(coords)
 {
     m_swFaxArea->SetScrollbars(1, 1, m_img.GetWidth(), m_img.GetHeight()-1);
 
@@ -297,8 +297,8 @@ EditFaxDialog::~EditFaxDialog()
         sel = m_SelectedIndex;
 
     if(sel == 0 &&
-       (m_newCoords.lat1 || m_newCoords.lat2 ||
-        m_newCoords.lon1 || m_newCoords.lon2)) {
+       (m_newCoords->lat1 || m_newCoords->lat2 ||
+        m_newCoords->lon1 || m_newCoords->lon2)) {
         int cc = m_Coords.GetCount();
         wxString newname = m_newCoords->name, newnumberedname;
         for(int n=0, i=-1; i != cc; n++) {
@@ -321,7 +321,7 @@ EditFaxDialog::~EditFaxDialog()
 void EditFaxDialog::OnBitmapClick( wxMouseEvent& event )
 {
     switch(m_EditState) {
-        case COORD:
+        case COORD1:
         {
             wxPoint p = m_swFaxArea->CalcUnscrolledPosition(event.GetPosition());
 
@@ -374,7 +374,7 @@ void EditFaxDialog::OnBitmapClick( wxMouseEvent& event )
             wxRect r2(0, 0, m_img.GetWidth(), split.y);
             m_img = m_img.GetSubImage(r2);
             Refresh();
-            m_EditState = COORD;
+            m_EditState = COORD1;
         } break;
     }
 }
@@ -418,7 +418,7 @@ void EditFaxDialog::OnSplitImage( wxCommandEvent& event )
     if(w.ShowModal() == wxID_OK)
         m_EditState = SPLITIMAGE;
     else
-        m_EditState = COORD;
+        m_EditState = COORD1;
 }
 
 void EditFaxDialog::OnPhasing( wxScrollEvent& event )
diff --git a/src/WeatherFaxDialog.h b/src/WeatherFaxDialog.h
index 6d7d29a..81a1afb 100644
--- a/src/WeatherFaxDialog.h
+++ b/src/WeatherFaxDialog.h
@@ -72,7 +72,7 @@ protected:
     weatherfax_pi &m_weatherfax_pi;
 };
 
-enum EditState {COORD, SPLITIMAGE};
+enum EditState {COORD1, SPLITIMAGE};
 class EditFaxDialog : public EditFaxDialogBase
 {
 public:
diff --git a/src/libaudiofile/modules/PCM.cpp b/src/libaudiofile/modules/PCM.cpp
index 832f0e8..010dd70 100644
--- a/src/libaudiofile/modules/PCM.cpp
+++ b/src/libaudiofile/modules/PCM.cpp
@@ -39,10 +39,10 @@
 
 bool _af_pcm_format_ok (AudioFormat *f)
 {
-    assert(!isnan(f->pcm.slope));
-    assert(!isnan(f->pcm.intercept));
-    assert(!isnan(f->pcm.minClip));
-    assert(!isnan(f->pcm.maxClip));
+    assert(!_isnan(f->pcm.slope));
+    assert(!_isnan(f->pcm.intercept));
+    assert(!_isnan(f->pcm.minClip));
+    assert(!_isnan(f->pcm.maxClip));
 
     return true;
 }
Works much better now.
Chuck

Oops.. my fault on the . instead of -> thing. I thought I had recompiled before pushing apparently not. The COORDS thing is apparently a windows namespace collision issue I fixed as well. For png files.. I overlooked that one.. so all of these things should be _ok_ now in git.

As far as the isnan thing is concerned.. It seems on some systems you need _isnan, normally you need isnan. On my system _isnan is not defined, but both isnan and __isnan are. It is best not to use underscore preceeded names unless you really have to or are writing a system library as these are often functions built into the compiler and calling them directly can be very unportable.

Is this windows specific? can someone confirm? Then we can guard it with #ifdef __MSVC__ #else #endif to fix it once and for all.

It's good to have testers who can quickly hack around these errors, and still get on with testing.

As far as the next revision goes.. I have planned:
-- Direct audio capture with spectrum analyzer (make tuning frequency and bfo really easy)
-- skew correction
-- polar->mercator conversion. What different formats are most common? This is really not that difficult to do it just requires a little math. Should it be selected with a pole position and curvature coefficient (visually adjust until lines are flat) or some other way?
-- warp button to center of selected current fax (if possible for an opencpn plugin to do this, if not.. another patch to opencpn core will be needed)
-- save fax list images between sessions (note the last update saves the coordinate sets but not the image list)
-- More advanced filters for removing noise from an image and at least making the noise transparent not black

I still need to find a suitable library for direct audio capture on all platforms.

Then for the next revision (after that) there are mostly questions to be answered:

Is there any need to display multiple fax images at once?

Would it be useful to align coordinate sets with image sets? By this I mean.. normally you get a bunch of images in a 6-12 hour period and the order and location of each image is pretty much known. This way you could have a coordinate set defined for each radio frequency and (assuming phasing is detected and there are not skew problems) you could with one action grab all the weather fax images at once and have them all placed correctly and aligned. Then pre-defined coordinate sets for each station could be included (people would have to send them in to add them to the main distribution somehow), and the user interaction minimized. So opening an audio file captured from the radio would be much like opening a grib file, only you would select the radio frequency you used and the time you started receiving from a list.

Software radio.. Does anyone know of a suitable software radio (that can go low enough) for weather fax? It would be great to support this hardware since the cost is low.. so far the ones I have found go down to 22mhz which is still too high.
seandepagnier is offline   Reply With Quote
Old 18-02-2013, 17:33   #108
Registered User

Join Date: Apr 2009
Location: Marina Del Rey
Boat: Hylas 44
Posts: 387
Re: WeatherFax...

Quote:
Originally Posted by boat_alexandra View Post
As far as the isnan thing is concerned.. It seems on some systems you need _isnan, normally you need isnan. On my system _isnan is not defined, but both isnan and __isnan are. It is best not to use underscore preceeded names unless you really have to or are writing a system library as these are often functions built into the compiler and calling them directly can be very unportable.

Is this windows specific? can someone confirm? Then we can guard it with #ifdef __MSVC__ #else #endif to fix it once and for all.

Microsoft Visual C++ 2010 recognizes only _isnan. Not isnan nor __isnan
ChuckSK is offline   Reply With Quote
Old 18-02-2013, 17:34   #109
Registered User
 
LeaseOnLife's Avatar

Join Date: Apr 2008
Location: out cruising again, currently in Fiji
Boat: Sailboat
Posts: 1,479
Re: WeatherFax...

Quote:
Originally Posted by boat_alexandra View Post
Oops.. my fault on the . instead of -> thing. I thought I had recompiled before pushing apparently not. The COORDS thing is apparently a windows namespace collision issue I fixed as well. For png files.. I overlooked that one.. so all of these things should be _ok_ now in git.
latest git compiled and I can display png images
Quote:
As far as the next revision goes.. I have planned:
-- Direct audio capture with spectrum analyzer (make tuning frequency and bfo really easy)
-- skew correction
-- polar->mercator conversion. What different formats are most common? This is really not that difficult to do it just requires a little math. Should it be selected with a pole position and curvature coefficient (visually adjust until lines are flat) or some other way?
I will post images of what I can find...
Quote:
-- warp button to center of selected current fax (if possible for an opencpn plugin to do this, if not.. another patch to opencpn core will be needed)
probably not in the current release candidate cycle... I would hold off and wait for the next beta cycle
Quote:
-- save fax list images between sessions (note the last update saves the coordinate sets but not the image list)
I would like this very much!
Quote:
Is there any need to display multiple fax images at once?

Would it be useful to align coordinate sets with image sets? By this I mean.. normally you get a bunch of images in a 6-12 hour period and the order and location of each image is pretty much known. This way you could have a coordinate set defined for each radio frequency and (assuming phasing is detected and there are not skew problems) you could with one action grab all the weather fax images at once and have them all placed correctly and aligned. Then pre-defined coordinate sets for each station could be included (people would have to send them in to add them to the main distribution somehow), and the user interaction minimized. So opening an audio file captured from the radio would be much like opening a grib file, only you would select the radio frequency you used and the time you started receiving from a list.
this would be very useful, not just for faxes received via audio. There are other means to get images for weatherfaxes (SSB+PACTOR+email, SAT-phone, even WIFI/Internet while waiting for the next weather-window to set sail).

Great work!

Dirk
LeaseOnLife is offline   Reply With Quote
Old 18-02-2013, 17:49   #110
Registered User
 
LeaseOnLife's Avatar

Join Date: Apr 2008
Location: out cruising again, currently in Fiji
Boat: Sailboat
Posts: 1,479
Re: WeatherFax...

A variety of polar projections:
  1. South Africa: http://metzone.weathersa.co.za/image...les/ma_sy.gif?
  2. Japan: Japan Meteorological Agency | Weather Maps
  3. Australia: Latest Colour Mean Sea-Level Pressure Analysis
  4. UK: http://www2.wetter3.de/Fax/00_UKMet_Boden+00.gif
Attached Thumbnails
Click image for larger version

Name:	ma_sy.jpg
Views:	425
Size:	429.5 KB
ID:	55162   Click image for larger version

Name:	13021903.png
Views:	320
Size:	60.4 KB
ID:	55163  

Click image for larger version

Name:	IDY00030.201302181800.png
Views:	399
Size:	61.9 KB
ID:	55164   Click image for larger version

Name:	00_UKMet_Boden+00.gif
Views:	252
Size:	82.0 KB
ID:	55165  

LeaseOnLife is offline   Reply With Quote
Old 18-02-2013, 18:08   #111
Registered User

Join Date: Mar 2010
Location: Normandy, France
Boat: Flush Poker, 8.25m (Point Barre)
Posts: 340
Re: WeatherFax...

Quote:
Originally Posted by boat_alexandra View Post
As far as the isnan thing is concerned.. It seems on some systems you need _isnan, normally you need isnan. On my system _isnan is not defined, but both isnan and __isnan are. It is best not to use underscore preceeded names unless you really have to or are writing a system library as these are often functions built into the compiler and calling them directly can be very unportable.

Is this windows specific? can someone confirm? Then we can guard it with #ifdef __MSVC__ #else #endif to fix it once and for all.
Please read second answer in:
Checking if a double (or float) is nan in C++ - Stack Overflow

I guess you'll have to work around with some #ifdef or a macro on your own...
SethDart is offline   Reply With Quote
Old 19-02-2013, 01:15   #112
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,449
Re: WeatherFax...

I put an ifdef in to handle the msvc case. I wonder if anyone compiles opencpn with gcc on windows.
seandepagnier is offline   Reply With Quote
Old 19-02-2013, 03:27   #113
Registered User

Join Date: Apr 2012
Location: Port Steven, NSW, Australia
Boat: Van der Stadt Samoa 48
Posts: 142
Re: WeatherFax...

Has anyone thought of a way to use satellite images? The use of satellite images seems to cause similar problem as different projections.

Lars
Taarnskov is offline   Reply With Quote
Old 19-02-2013, 04:49   #114
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,996
Images: 2
Re: WeatherFax...

The user interface for setting coords and lat long is improved. Thankyou.
I have some ideas to make it more intuitive I think.

1. Have the weatherfax image or wav open with the coords (0,0) marked with a "0" at the upper left corner, and an "X" at the (500, 800 -for example) corner. I am pretty sure the program can determine the image size or has that available.

2. Then have a note to drag the "0" and "X" markers to nearest Long Lat and then to complete the respective fields. (Drag and release left button to located the "X" or "O"

3. For Coord Set 1 show an "O" identifier.
4. For Coord Set 2 show an "X" identifier.

These are great plans Sean. Incredible. Will next test the Lease on Life's 3rd file then git clone again. Thanks.
rgleason is offline   Reply With Quote
Old 19-02-2013, 05:13   #115
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,996
Images: 2
Re: WeatherFax...

copied downloaded pcm.cpp to plugins/weatherfax_pi/src and then folllowed readme with cmake.

Got these two cmd window clips, now only 5 warnings and 4 errors.
Attached Thumbnails
Click image for larger version

Name:	weatherfax-cmake-build-after-revised-pcm-cpp-top.png
Views:	837
Size:	95.6 KB
ID:	55204   Click image for larger version

Name:	weatherfax-cmake-build-after-revised-pcm-cpp-bottom.png
Views:	247
Size:	132.7 KB
ID:	55205  

rgleason is offline   Reply With Quote
Old 19-02-2013, 05:29   #116
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,996
Images: 2
Re: WeatherFax...

After running MS VC++2010 Express Debug Build it did not seem to create a new weatherfax_pi.dll in C:\..\Navigation\opencpn-git\build\plugins\weatherfax_pi\Release it is still dated the 18th and it is Feb 19th. Puzzled why it compiled without failure.

Code:
1>------ Build started: Project: ZERO_CHECK, Configuration: Release Win32 ------
2>------ Build started: Project: NMEA0183, Configuration: Release Win32 ------
3>------ Build started: Project: i18n, Configuration: Release Win32 ------
4>------ Build started: Project: dashboard-i18n, Configuration: Release Win32 ------
5>------ Build started: Project: weatherfax-i18n, Configuration: Release Win32 ------
6>------ Build started: Project: grib-i18n, Configuration: Release Win32 ------
3>  i18n: Done.
7>------ Skipped Build: Project: dashboard-pot-update, Configuration: Release Win32 ------
7>Project not selected to build for this solution configuration 
8>------ Skipped Build: Project: grib-po-update, Configuration: Release Win32 ------
8>Project not selected to build for this solution configuration 
9>------ Skipped Build: Project: po-update, Configuration: Release Win32 ------
9>Project not selected to build for this solution configuration 
10>------ Skipped Build: Project: pot-update, Configuration: Release Win32 ------
10>Project not selected to build for this solution configuration 
11>------ Skipped Build: Project: weatherfax-po-update, Configuration: Release Win32 ------
11>Project not selected to build for this solution configuration 
12>------ Skipped Build: Project: weatherfax-pot-update, Configuration: Release Win32 ------
12>Project not selected to build for this solution configuration 
13>------ Skipped Build: Project: dashboard-po-update, Configuration: Release Win32 ------
13>Project not selected to build for this solution configuration 
14>------ Skipped Build: Project: grib-pot-update, Configuration: Release Win32 ------
14>Project not selected to build for this solution configuration 
2>  NMEA0183.vcxproj -> C:\Data-Dart\Up-Soft\Navigation\opencpn-git\build\Release\NMEA0183.lib
4>  dashboard-i18n: Done.
5>  weatherfax-i18n: Done.
6>  grib-i18n: Done.
15>------ Skipped Build: Project: dummy, Configuration: Release Win32 ------
15>Project not selected to build for this solution configuration 
16>------ Build started: Project: grib_pi, Configuration: Release Win32 ------
16>  grib_pi.vcxproj -> C:\Data-Dart\Up-Soft\Navigation\opencpn-git\build\plugins\grib_pi\Release\grib_pi.dll
17>------ Build started: Project: ALL_BUILD, Configuration: Release Win32 ------
17>  Build all projects
18>------ Skipped Build: Project: PACKAGE, Configuration: Release Win32 ------
18>Project not selected to build for this solution configuration 
19>------ Skipped Build: Project: INSTALL, Configuration: Release Win32 ------
19>Project not selected to build for this solution configuration 
========== Build: 8 succeeded, 0 failed, 6 up-to-date, 11 skipped ==========
I tried it anyway, copied release dll of the same date and time to Opencpn 3.1.1405 plugins and got this image!! Hurrah.
Attached Thumbnails
Click image for larger version

Name:	weatherfax-msvc++-copy-rel-dll-wav-works.jpg
Views:	325
Size:	425.5 KB
ID:	55206  
rgleason is offline   Reply With Quote
Old 19-02-2013, 05:50   #117
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,996
Images: 2
Re: WeatherFax...

Tried a gif file and it works too! Great. Thanks.
Attached Thumbnails
Click image for larger version

Name:	weatherfax-msvc++-copy-rel-dll-gif-works.jpg
Views:	351
Size:	413.4 KB
ID:	55207  
rgleason is offline   Reply With Quote
Old 19-02-2013, 06:09   #118
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,996
Images: 2
Re: WeatherFax...

Deleted weatherfax_pi directory under opencpn-git/plugins directory.
Run Cmd
git clone git://github.com/seandepagnier/weatherfax_pi.git
Build as normally:
cd ..
cd build
cmake ..
cmake --build .

253 warnings
0 errors.

Below are images of the whole file, if needed for the errors.
Attached Thumbnails
Click image for larger version

Name:	weatherfax-cmake-1.png
Views:	346
Size:	143.4 KB
ID:	55208   Click image for larger version

Name:	weatherfax-cmake-2.png
Views:	285
Size:	113.2 KB
ID:	55209  

Click image for larger version

Name:	weatherfax-cmake-3.png
Views:	370
Size:	107.9 KB
ID:	55210   Click image for larger version

Name:	weatherfax-cmake-4.png
Views:	425
Size:	104.4 KB
ID:	55211  

Click image for larger version

Name:	weatherfax-cmake-5.png
Views:	385
Size:	104.1 KB
ID:	55212  
rgleason is offline   Reply With Quote
Old 19-02-2013, 06:29   #119
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,996
Images: 2
Re: WeatherFax...

Okay. It made a new weatherfax_pi.dll and I copied that from build/release/plugin directory to Opencpn3.1.1405 plugin directory. Then tried it.
It worked with wav and gif files. decoded wav files (wav files that are not 16 bit it does not decode) I can give some examples later.

I find it hard to get the lat long of the wav files, hard to discern these in the fax.

The double slider is nice one for contrast line heaviness and the other for white opacity I think.

Did not have time right now to mess around with the plugin, will do later.

Have attached the output file as doc.

Thanks.
Attached Thumbnails
Click image for larger version

Name:	Weatherfax-afterMSVC-worksforwavgif.jpg
Views:	347
Size:	368.9 KB
ID:	55213  
Attached Files
File Type: doc Output-from-MSVC++2010-Debug-Build-2.doc (42.2 KB, 140 views)
rgleason is offline   Reply With Quote
Old 19-02-2013, 07:49   #120
Registered User
 
LeaseOnLife's Avatar

Join Date: Apr 2008
Location: out cruising again, currently in Fiji
Boat: Sailboat
Posts: 1,479
Re: WeatherFax...

Quote:
Originally Posted by Taarnskov View Post
Has anyone thought of a way to use satellite images? The use of satellite images seems to cause similar problem as different projections.

Lars
Calibration and re-projecting sat images would be great. And imagine, overlaying a synaptic chart over a sat image:
Attached Thumbnails
Click image for larger version

Name:	100_20010820.1531.gms-5.IR.MODEL_cuaviet.jpg
Views:	493
Size:	100.4 KB
ID:	55215  
LeaseOnLife is offline   Reply With Quote
Reply

Tags
paracelle

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
For Sale: SSB, Tuner, Amp, WeatherFax Palarran Classifieds Archive 7 19-03-2011 08:22
Help with WeatherFax and SeaTTY desierto Navigation 2 12-12-2008 21:36
Basic Weatherfax reception Tnflakbait Marine Electronics 3 23-09-2008 22:55
How do I set myself up with weatherfax? tracker_46 Marine Electronics 4 12-10-2006 15:51
Weatherfax Recommendations Please Salacia Marine Electronics 3 03-07-2005 14:28

Advertise Here


All times are GMT -7. The time now is 21:38.


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.