Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 30-03-2013, 17:45   #31
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,356
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:	83
Size:	3.9 KB
ID:	58252   Click image for larger version

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

Attached Files
File Type: doc Calc_pi.fbp.doc (87.0 KB, 42 views)
File Type: doc calculator_pi-revised.dll.doc (106.0 KB, 21 views)
__________________

__________________
rgleason is offline   Reply With Quote
Old 31-03-2013, 08: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, 09:33   #33
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,356
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 offline   Reply With Quote
Old 31-03-2013, 10: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, 11:02   #35
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,356
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, 36 views)
__________________
rgleason is offline   Reply With Quote
Old 31-03-2013, 12:06   #36
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,356
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:	87
Size:	400.8 KB
ID:	58295   Click image for larger version

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

Click image for larger version

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

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

Click image for larger version

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

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

Attached Files
File Type: doc calculation-2-break.doc (4.5 KB, 22 views)
__________________
rgleason is offline   Reply With Quote
Old 31-03-2013, 13: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:	82
Size:	12.7 KB
ID:	58302   Click image for larger version

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

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

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,356
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 offline   Reply With Quote
Old 01-04-2013, 07:47   #39
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,356
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:	84
Size:	408.7 KB
ID:	58346   Click image for larger version

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

Click image for larger version

Name:	calculation-better-for-windows.jpg
Views:	91
Size:	400.9 KB
ID:	58348  
Attached Files
File Type: doc Calc_pi_windows-1-1-2013.fbp.doc (86.7 KB, 29 views)
File Type: doc calculator-windows2_pi.dll.doc (113.5 KB, 21 views)
__________________
rgleason is offline   Reply With Quote
Old 01-04-2013, 15: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:	78
Size:	29.3 KB
ID:	58366  
Attached Images
 
__________________
SaltyPaws is offline   Reply With Quote
Old 02-04-2013, 15:02   #41
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,356
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, 32 views)
__________________
rgleason is offline   Reply With Quote
Old 05-04-2013, 05:33   #42
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,356
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, 54 views)
__________________
rgleason is offline   Reply With Quote
Old 05-04-2013, 07:18   #43
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: Masachusetts
Boat: bristol 27
Posts: 2,803
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...
__________________
boat_alexandra is offline   Reply With Quote
Old 06-04-2013, 03: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:	84
Size:	26.6 KB
ID:	58659  
__________________
SaltyPaws is offline   Reply With Quote
Old 06-04-2013, 05:41   #45
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,356
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 offline   Reply With Quote
Reply

Tags
opencpn

Thread Tools
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




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 02:52.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.