Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Seamanship, Navigation & Boat Handling > OpenCPN
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

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 30-03-2013, 16:45   #31
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Re: Calculator_pi New Finished Plugin for OpenCPN

Salty, I've used wxformbuilder and found it very useful. I've changed the plugin to show as attached in the first screenshot (which no longer has a horizontal bar) and to permit dragging the window to expand to a larger size as shown in the second screenshot.

I'd like to get the screen to expand down and to show as many additional lines as the space permits, and as have been entered, and to allow moving up and down with keyboard arrows up and down. I assume the cursor always stays at the bottom?

Do you have any suggestions?

Also attached is the calculate_pi C++ file as doc that was saved by form builder.
Also attached is the calculate_pi-revised.dll if someone wants to try it.
Attached Thumbnails
Click image for larger version

Name:	Calculator-without-Hor-Scroll.png
Views:	154
Size:	3.9 KB
ID:	58252   Click image for larger version

Name:	Calculator-without-Hor-Scroll-Multiline.png
Views:	187
Size:	6.9 KB
ID:	58253  

Attached Files
File Type: doc Calc_pi.fbp.doc (87.0 KB, 72 views)
File Type: doc calculator_pi-revised.dll.doc (106.0 KB, 45 views)
rgleason is online now   Reply With Quote
Old 31-03-2013, 07:21   #32
Registered User

Join Date: Jun 2012
Location: on SaltyPaws
Boat: Helia 44
Posts: 66
Re: Calculator_pi New Finished Plugin for OpenCPN

Hi Rgleason,

Thank you for playing with the formbuilder. when I build with your version, the interface on linux does not look great. I have therefore now split the interface for windows and linux. The buildfile and c++ files automatically picks the right files depending on which OS you are building.

I just spend some time playing in the formbuilder working on your suggestion (i.e. adding a flexgridbagsizer and a richtextctrl) before I realised you are probably not looking for a giant input box. Am I correct in that you would see different answers+results on the different lines below?

As the textctrl is currently used as both input and output, I would be hard to work with multiple lines while also taking input. What I could do is cannibalise the help text section, and use this to show the historic lines. The tickbox would switch between single line, and history mode. I could then show a seperate pop-up window for help. How does this sound?
SaltyPaws is offline   Reply With Quote
Old 31-03-2013, 08:33   #33
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Re: Calculator_pi New Finished Plugin for OpenCPN

Dear salty paws, What you suggest sounds good. I will paraphrase below.


what I was trying to do was to see some of the most recent history, (to see results and variables etc,) and one way I thought this could happen, would be to grab and pull down the window, so that appears.

So I see one line of text input using textctrl and the historic lines below (say 3-5 lines or whatever, maybe expandable by dragging?

Then this history is enacted by a tick box for history mode when checked. (single line when not checked). Just a small ? icon popup for help sounds good.

Why don't we try using your revised linux interface and see what happens to simplify it? Then I could adjust if needed?

Best Rick
rgleason is online now   Reply With Quote
Old 31-03-2013, 09:27   #34
Registered User

Join Date: Jun 2012
Location: on SaltyPaws
Boat: Helia 44
Posts: 66
Re: Calculator_pi New Finished Plugin for OpenCPN

Hi Rick,

I have implemented historic mode. give it a spin and let me know what you think. NB on linux the window resizes ok, all answers are visible if it is a big window, smaller window makes colums out of it, and even smaller gives you a scroll bar.

The windows interface is now the same as the linux interface. Lets see if we can live with one gui

Next step is perhaps a help button that shows the old help menu (and option to disable this button in the settings).

Salypaws
SaltyPaws is offline   Reply With Quote
Old 31-03-2013, 10:02   #35
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Re: Calculator_pi New Finished Plugin for OpenCPN

Salty, that was very quick. Compiled it and it runs as you describe with input &output on top and history below, each entry is a column up to about 5 columns, then it goes to the next line. As you say the help check is not working right now and will be a popup?.

For use Windows users there is a horizontal scroll, which I intend to live with to keep the two interfaces the same.

Thanks very much, I find this to be a good improvement!
Attached Files
File Type: doc calculator-2_pi.dll.doc (106.0 KB, 93 views)
rgleason is online now   Reply With Quote
Old 31-03-2013, 11:06   #36
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Re: Calculator_pi New Finished Plugin for OpenCPN

Salty,
I open the plugin in debug mode and there's a break with output (attached.)
I also Continue through the break and the plugin loads.
There are screen shoots folloowing of what it looks like
Also when check the Information
Attached Thumbnails
Click image for larger version

Name:	calculation-1-break.jpg
Views:	181
Size:	400.8 KB
ID:	58295   Click image for larger version

Name:	calculation-3-Continue.jpg
Views:	187
Size:	315.3 KB
ID:	58297  

Click image for larger version

Name:	calculation-4-EnterCalcs.jpg
Views:	185
Size:	322.0 KB
ID:	58298   Click image for larger version

Name:	calculation-5-History.jpg
Views:	188
Size:	321.0 KB
ID:	58299  

Click image for larger version

Name:	calculation-6-WindowBigger.jpg
Views:	222
Size:	295.1 KB
ID:	58300   Click image for larger version

Name:	calculation-7-WindowisSeparate.jpg
Views:	176
Size:	301.5 KB
ID:	58301  

Attached Files
File Type: doc calculation-2-break.doc (4.5 KB, 55 views)
rgleason is online now   Reply With Quote
Old 31-03-2013, 12:20   #37
Registered User

Join Date: Jun 2012
Location: on SaltyPaws
Boat: Helia 44
Posts: 66
Re: Calculator_pi New Finished Plugin for OpenCPN

Hi Rick,

I have just updated the plugin. Attached is how the calculator looks under ubuntu. with regards to the scroll, please use the wxformbuilder, to optimise the layout. will try to make it work under linux as well.

What did you do to break the history? Did you just load the plugin or did you do something else?
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2013-03-31 21:11:36.png
Views:	205
Size:	12.7 KB
ID:	58302   Click image for larger version

Name:	Screenshot from 2013-03-31 21:11:12.png
Views:	180
Size:	40.9 KB
ID:	58303  

SaltyPaws is offline   Reply With Quote
Old 31-03-2013, 15:29   #38
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Re: Calculator_pi New Finished Plugin for OpenCPN

That looks good SaltyP.! Will try it. In answer, I just loaded the plugin and it broke immediately. Then recorded the screen and output and hit "Continue" and it continued and worked fine. More later after I git clone
rgleason is online now   Reply With Quote
Old 01-04-2013, 06:47   #39
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Re: Calculator_pi New Finished Plugin for OpenCPN

Loaded in Debug clean, no breaking.

Changes in wxFormBuilder:
A. m_result:wxTextCtrl style wxTE_DONTWRAP unchecked
B. Switched order of commands in window.

Could not do these changes/Improvements:
C. Would like the ? box to be smaller in width and less real estate. Did not know how to do this.
D. Did not know how to adjust height of overall window and text input/output line but might want it a little shorter, depends on display I suppose.
E.
First load is a very minimal window and needs stretching. Perhaps that is fine. Maybe could make it small with just minimum size.

Attached are Release type Windows version dll as doc.
Windows wxFormBuilder fb
Attached Thumbnails
Click image for larger version

Name:	calculation-1-Better-History.jpg
Views:	151
Size:	408.7 KB
ID:	58346   Click image for larger version

Name:	calculation-Start-Appearance.jpg
Views:	159
Size:	398.0 KB
ID:	58347  

Click image for larger version

Name:	calculation-better-for-windows.jpg
Views:	159
Size:	400.9 KB
ID:	58348  
Attached Files
File Type: doc Calc_pi_windows-1-1-2013.fbp.doc (86.7 KB, 58 views)
File Type: doc calculator-windows2_pi.dll.doc (113.5 KB, 64 views)
rgleason is online now   Reply With Quote
Old 01-04-2013, 14:23   #40
Registered User

Join Date: Jun 2012
Location: on SaltyPaws
Boat: Helia 44
Posts: 66
Re: Calculator_pi New Finished Plugin for OpenCPN

Hi Rick,

(A/B) Thank you for fixing the windows interface . I have updated the repo with your changes in formbuilder. Things look fine in linux as well .

I have updated the settings window. You can pick and choose which buttons are shown. which should take care of C. After changing the settings, disable and enable the plugin to make sure the settings are propagated. I have added command line options (history, and help) so you don’t need the buttons (enter makes it calculate). I have also added showcalculate, showhelp and showhistory so you can add/remove the buttons without using settings.

I have added a fit window command, that should take care of point E. I have deleted my opencpn settings file, and after opening OpenCpn, the window was a good size.

For point D, I am able to resize the window by dragging the corners. Removing the buttons also gives you more space.

Let me know what you think - I think we are closing in on the next release.

Attached: new settings menu, minimalist calculator window with buttons removed from settings.
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2013-04-01 22:56:48.png
Views:	155
Size:	29.3 KB
ID:	58366  
Attached Images
 
SaltyPaws is offline   Reply With Quote
Old 02-04-2013, 14:02   #41
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Re: Calculator_pi New Finished Plugin for OpenCPN

SaltyPaws has improved the Calculator plugin (Version 1.3) with new preferences to minimize size or to provide an optional history window. Thank you SaltyPaws for this effort.

DLL is attached as a *.doc the doc and put in plugins directory.
Attached Files
File Type: doc calculator_pi.dll.doc (129.0 KB, 53 views)
rgleason is online now   Reply With Quote
Old 05-04-2013, 04:33   #42
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Re: Calculator_pi New Finished Plugin for OpenCPN

SaltyPaws this is working great with the output being put in the history window when history is checked. Thank you. I really like the showcalculate, showhistory and showhelp commands. Here is the most recent dll Please remove the doc and put in your plugin directory.
Attached Files
File Type: doc calculator_pi.dll.doc (210.0 KB, 84 views)
rgleason is online now   Reply With Quote
Old 05-04-2013, 06:18   #43
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,417
Re: Calculator_pi New Finished Plugin for OpenCPN

I find a general purpose calculator redundant, however specific functions would be useful.

enter lwl and displacement to get hull speed (use the formula which proves lighter displacement have higher hull speed before they plane.. 1.34*sqrt(lwl) is kind of obsolete)

Use formulas for righting angle, confort factor, etc..

Calculate structural loads of rigging, and give reference for Inputs to calculate breaking strengths of various types of rigging components. This is basically an endless area to work on.

Integration with sailcut and possibly sail7 to calculate loads on the sheets etc.

Survival calculator.. calculate how long you can survive on given water, given temperature, humidity, and body type coefficient.

Many more ideas...
seandepagnier is offline   Reply With Quote
Old 06-04-2013, 02:45   #44
Registered User

Join Date: Jun 2012
Location: on SaltyPaws
Boat: Helia 44
Posts: 66
Re: Calculator_pi New Finished Plugin for OpenCPN

Hi Boat_Alexandra,

I think the current version is quite useful as a calculator, more powerful than the standard OS calculator, and taking up less screen space. In the next version I am planning to implement coordinate conversion. In terms of GUI I am planning to introduce an additional screen with tabs. Each tab can then be explaining a formula, showing input boxes and a calculate button for that formula. I have attached a screenshot of how the menu cool look like. Let me know what you think.
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2013-04-06 11:43:51.png
Views:	180
Size:	26.6 KB
ID:	58659  
SaltyPaws is offline   Reply With Quote
Old 06-04-2013, 04:41   #45
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,633
Images: 2
Re: Calculator_pi New Finished Plugin for OpenCPN

Looks good. I think the tabs may need to become major categories of calculations (Navigation, Rig, Conversion, etc) with an added drop down selector for the actual calculation. There are some spreadsheets of common Sailing calcs I could send you. Rig and sail loads, water characteristics, etc.

From boat_alexandra
Sailcut http://www.sailcut.com/
Sail7 http://www.xflr5.com/sail7/sail7.html
rgleason is online now   Reply With Quote
Reply

Tags
opencpn


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


Advertise Here


All times are GMT -7. The time now is 08:53.


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.