Hakansv / ais-vd_pi

Write voyage data to ais tranceiver(class A)
GNU General Public License v3.0
0 stars 1 forks source link

improvements? #7

Open RooieDirk opened 2 years ago

RooieDirk commented 2 years ago

Hi Hakan, I was able to do a small test this afternoon in the local AIS workshop. The most important findings: eta date: the ais is only using month and year. So no need for setting the year eta time: Same the seconds are not used. Every time the tap/page is opened/reopened there should be a new read request call being send, to make sure up to date data is viewed. (If you change something now on the AIS itself, the data in the plugin is not updated.

Test was done on an "Trueheading" dual inland/solas AIS. WKR Dirk

Hakansv commented 2 years ago

Dirk..

eta date: the ais is only using month and year. So no need for setting the year eta time: Same the seconds are not used.

Yes, I know only MMdd and hhmm.00 are sent. The use of wxWidgets date and time controls I suppose was a convenient solution. However simple conditioned list boxes would be feasible here? Not less since the date and time controls are not behaving quite the same on our different system.

Every time the tap/page is opened/reopened there should be a new read request call being send, to make sure up to date data is viewed.

An interesting idea to let the connected AIS update all controls while initiating. If no AIS is replying we could use the last saved values as now and maybe indicate the absence of an AIS in some way already then and not only at the attempt to "Send to AIS".

I could look into that.

Very good you're testing on a Trueheading, I've a SAAB R3.

Hakansv commented 2 years ago

Dirk Instead of the unnecessarily comprehensive date/time controls would something like this make more sens? Håkan

bild

RooieDirk commented 2 years ago

Much better in my opinion. Don't forget to add some logic that makes it impossible to use invalid values. Hours always in the 0-23 range etc. The reply sentence is also human readable now.

Hakansv commented 2 years ago

Dirk.. New code in master branch. changes:

I do think this update is better than before. Hopefully it fulfills your good ideas. Any thoughts before release?

Thanks Håkan

bild

After any edit: bild

Hakansv commented 2 years ago

BTW:... There are binaries at Cloudsmith if you want to test. If so and you've access to the Trueheading please if possible check if that one report "Persons on board". My SAAB R3 didn't.

Hakansv commented 2 years ago

@RooieDirk Version 1.6.2 available at Cloudsmith if you want to download and import a tarball for test? No big function changes since last message. Mostly pluginmanager tweaks to get more system tarballs to work. So my plan is to release to master catalog in a day or so.

RooieDirk commented 2 years ago

Goodmorning Hakan, Something is going bad, although I guess it is in the plugin managing system. My system is a linux variant. OpenCPN pluginsettings see picture. Screenshot_20220216_092218 Using the regular plugin import I get this file: ais-vd-1.5.0+239.68423ca_ubuntu-gtk3-20.04-x86_64.tar.gz, but the ...20.04-x86_64 flavour is not available in your CloudSmith download map. And trying anotherone gives an "incompatible plugin detected error" I'm running the latest 'master' from github, and I do know there have been some changes in the plugin manager since 5.6.0

Hakansv commented 2 years ago

Dirk.. Yes that system is obviously missing in the actual build PM process. We'll see if Alec could help.. @leamas The Circleci result of the build results yields this Cloudsmith This time I'm using these upload script as of Shipdriver. What would be added to build for the system as of Dirk's shot above? Any hints appreciated. Thanks/Håkan

leamas commented 2 years ago

Hm...On cloudsmith I find this tarball. It has the 'ubuntu-gtk3-x86_64:20.04' ABI.

Looking at your screenshot it seems that the host also is using 'ubuntu-gtk3-x86_64:20.04' ABI.

@RooieDirk : Could you please start opencpn on the command line using 'opencpn --loglevel debug', try to import the tarball and then just exit. And then post the opencpn.log file as an attachment?

Github requires you to compress the logfile before you attach it; use something like gzip ~/.opencpn/opencpn.log to create ~/.opencpn/opencpn.log.gz which can be attached

RooieDirk commented 2 years ago

Alex, opencpn.tar.gz

You are aware that the tarrball in your link is an old version? Anyhow, if I download tat file, and import it works fine. See log.

leamas commented 2 years ago

No, I'm not aware of that it's an old version. Still, we now know how to test things. Could you do the same with the new tarball which fails: start using --loglevel debug, try to import it and post the compressed log?

While on it, also post the link to the tarball you are trying to import.

Hakansv commented 2 years ago

Alec.. Yes, the old plugin version as of your "this tarball" included that system but I couldn't find out which script created that one. So I'm not sure what to include to build it again.

leamas commented 2 years ago

The root is the .circleci/config.yml file. In the very end you find the different builds, basically just a list. 20.04 a. k. a Focal is triggered by these two lines.

     - build-focal:
          <<: *std-filters

The actual build is done by this snippet in the same file:

 build-focal:
    docker:
      - image: cimg/base:stable-20.04
    environment:
      - OCPN_TARGET: focal
      - CMAKE_BUILD_PARALLEL_LEVEL: 2
    <<: *debian-steps

Is this what you are looking for?

Hakansv commented 2 years ago

Yes exactly that build-focal snippet is included. So "focal" is Ubuntu? But still no "-ubuntu-gtk3-20.04-x86_64.tar.gz" by Circleci?

leamas commented 2 years ago

So "focal" is Ubuntu?

No, Focal is 20.04 or more exact Ubuntu-20.04

But still no "-ubuntu-gtk3-20.04-x86_64.tar.gz" by Circleci?

Could you please link to the build logs.

Hakansv commented 2 years ago

The links as of above: The Circleci result of the build results yields this Cloudsmith This time I'm using these upload script as of Shipdriver. I'm though not sure what logs you're asking for? But, again, what I did was to use the same scripts and config.yml as Shipdriver. Obviously I then deleted some other script to make ubuntu-gtk3-20.04-x86_64.tar.gz?

leamas commented 2 years ago

Wait... there is a build log above, sorry. And it includes an upload of ubuntu-gtk3-20.04-x86_64. However, i doesn't seem to be visible on cloudsmith.

The hairy details: The complete version on cloudsmith is 1.2.0+146.e5881bd, but the current git HEAD is at 909ca5073d. And the cloudsmtih version is indeed way too old.

EDIT: This measn that the actual version on cloudsmith should be 1.2.0+148.909ca5073d or so. 148 is the build number, could be anything. But the last part should be the git commit hash

I have no clue...

Hakansv commented 2 years ago

So, now we are two wo a clue??

leamas commented 2 years ago

Indeed. Let me think & eat

leamas commented 2 years ago

I should have known. Something is broken with the opencpn/ais-vd_pi cloudsmith repo.

Forked https://github.com/Hakansv/ais-vd_pi.git, set it up to upload to my repo at https://cloudsmith.io/~alec-leamas/repos/opencpn-plugins-unstable/packages/ using my CLOUDSMITH_API_KEY and CLOUDSMITH_UNSTABLE_REPO which points to my repo. The build goes fine, everything uploaded and available (for some reason without git metadata in the version).

Ergo: something is wrong with the cloudsmith opencpn/ais-vd_pi repo, either the repo or the cloudsmith organization. You have to talk to Rick about it, I don't use that organization myself.

EDIT: @RooieDirk: You can try the tarball at https://dl.cloudsmith.io/public/alec-leamas/opencpn-plugins-unstable/raw/names/ais-vd-1.6-ubuntu-gtk3-20.04-tarball/versions/1.6.3/ais-vd-1.6.3_ubuntu-gtk3-20.04-x86_64.tar.gz for now.

leamas commented 2 years ago

@rgleason: ^

Hakansv commented 2 years ago

Thanks. Then we're on a path at least. What I can see is the "ubuntu-gtk3-20.04-x86_64.tar.gz" was built for the previous plugin version, 1.5, 6 days ago. Could there have been some kind of limitation for how many uploads are allowed recently? If Rick may check it would be great.

leamas commented 2 years ago

Could there have been some kind of limitation for how many uploads are allowed recently?

Not as far as I know, repos are cleaned using a FIFO algorithm: When there are "too many" packages, older ones are thrown away. But the latest should always pass.

You might want to merge my PR. Currently there is no git metadata in the version which makes it identical to the previous one in some cases. That should not really matter, but who knows? Try a new build after merging and see what happens.

Hakansv commented 2 years ago

You might want to merge my PR

That was a "massive" change according to the example Shipdriver. Thanks! I'll make a try but what about the password and key you changed. Are these yours or did you just hid mine?

rgleason commented 2 years ago

I just read this.

ais-vd-1.5.0+239.68423ca_ubuntu-gtk3-20.04-x86_64.tar.gz, but the ...20.04-x86_64 flavour is not available

ubuntu-gtk3-x86_64:20.04'

Now I see version 1.6.3 being created. I would check the build logs for errors. Maybe the file is not getting pushed? but Hakan's builds all seem to be completing https://github.com/Hakansv/ais-vd_pi

I have a hard time identifying exactly which one is missing from the Cloudsmith naming.... no gtk3-x86_64 named.. Which one is the problem?

BTW Ubuntu 14.04 or whatever is being canned by Circleci. May not affect you but I have about 15 plugin to update.

rgleason commented 2 years ago

PS the CS search feature is very good and may help.

leamas commented 2 years ago

Support for ubuntu 14.04 /Trusty is dropped since long, this is no problem. The updated plugin does not make any Trusty build.

While a somewhat big change, the only thing I did was to run 'update-templates 3.0.3-beta1'. (While beta, it will be identical to upcoming 3.0.3 as far as I know).

The one you are looking for is Focal-20.04. This is , well, not that transparent ;)

leamas commented 2 years ago

´@hakansv: Sorry, the one you are looking for is ais-vd-1.6-ubuntu-gtk3-20.04-tarball. Should not take things out of the top of my head.

rgleason commented 2 years ago

I am finding that with a search in the alpha branch. There are 4 versions sub1, sub2, sub3, sub4

https://cloudsmith.io/~opencpn/repos/ais-vd-alpha/packages/?q=ais-vd-1.6-ubuntu-gtk3-20.04-tarball

Hakansv commented 2 years ago

@leamas Many thanks for your support. After merging your changes and a push all seems to be present at Cloudsmith also the one missed before. @rgleason Thanks for your checks and the search example. So all was about the files where "hidden" or strange sorted then? @RooieDirk Here's the last file for your system from "my" Git to Cloudsmith Alpha

rgleason commented 2 years ago

The alpha repos retention policy is listed in the dev manual. It is more frequent. The prod repos has been expanded to keep more files as we found that we needed to do that.

https://opencpn-manuals.github.io/main/AlternativeWorkflow/InstallConfigure/Cloudsmith.html

Summary of settings

*Plugin-alpha, Limit by days = 28, Limit by count=100, Limit by size = 0 Plugin-beta, Limit by days = 0, Limit by count=100, Limit by size = 0 Plugin-prod, Limit by days = 0, Limit by count=526, Limit by size = 0 Using a "0" means "disabled"

rgleason commented 2 years ago

Hakan, the files were going to the "alpha" repository because you had not made a tagged push which sends them to the "prod" repos.

If you look in the alpha repos you will see them.

Hakansv commented 2 years ago

Thanks. I know I'm on Alpha. I found it a good place to check the build process and also to download tarballs for my checks on different system. (Instead of build on each system.) Now when I know the restrictions things are easier to overcome. Thanks all for your help! Dirk.. now we can go back to where we started. Check the plugin's function :) Håkan

RooieDirk commented 2 years ago

OK did another try. Loading the tarball goes fine now. As far as I see only a little layout problem. In my screen there is only the '-' btn inside the entrybox visible. I guess there should be also a '+' btn, and indeed if I go to the extreme right and click there the value goes up. see screenshot. And maybe a little logic for the amount of days in a month. Only 30 days allowed in months 4,6,9,11 and month 2 max 29. Screenshot_20220216_170928 Alex if you are still here if I change the catalog to Alpha, O does crash.

Hakansv commented 2 years ago
  1. Spin controls looks fine in Windows and Linux Rpi, strange. Se shots from RPi and Win. I'll see if I can increase the height for a test?
  2. So you think we need logic for month/dates in the spin controls now when date picker is not used. Hmm. I'll see what I can do.
  3. I'm not using plugin management through the OCPN-plugins meta data and alpha catalog for this. The Cloudsmith Alpha folder It's just place to save created tarballs. You have to look up correct file and download yourself or ask me for a link. Once a public release is ready I'll of course use the OCPN plugin manager process.

bild

bild

Hakansv commented 2 years ago

BTW the language file is in Crowdin if you like?

Hakansv commented 2 years ago

@RooieDirk Try this update if the spin control looks better on your system. It's a "hack" with a specific control size instead of "default". Not nice but a test. I also set max day according to your suggests.

Here's a download link to the tarball for import: Version 1.6.6_ubuntu-gtk3-20.04-x86_64

Hakansv commented 2 years ago

Dirk.. The "hack" was not good on RPi but to you see the arrows? bild

RooieDirk commented 2 years ago

Your going fast;-). But my pictures look different. I tried both 1.6.6 and 1.6.7. The both look like Screenshot_20220217_183333 :

Hakansv commented 2 years ago

@RooieDirk.. @bdbcat I asked Dave about this strange spin control of yours and we may continue here for a solution and common knowledge? "What machine is Dirk running on? I have never seen a spin control like this, with "+/-" So can you elaborate where this Ubuntu 20 is running. Thanks Håkan

RooieDirk commented 2 years ago

I think this is the problem/cause. https://forums.wxwidgets.org/viewtopic.php?f=23&t=47821

Hakansv commented 2 years ago

OK I have read but not sure I understand what to do. On my RPi4 Rasbpian(Debian) Buster 32 GTK 2 (if the same?) the arrows are there as intended. @bdbcat Is there something we can do for the plugin to come over it? Would it be a problem an all Ubuntu 20.04?

RooieDirk commented 2 years ago

Likely it could be solved by a GTK version check. Something like:

#if GTK_CHECK_VERSION(3, 0, 0)
  spinctrl->SetWidth((int)spinctr->width()*1.2);
#endif //GTK_CHECK_VERSION(3, 0, 0)

I didn't noticed it before either, but now I do know in OpenCPN on my box the spinctrl looks also different. Screenshot_20220220_180531

bdbcat commented 2 years ago

Looks to me that the +/- spinbutton is all that is available for GTK3. Dirk's idea looks good. For reference, please check (on the target system) the appearance of wxDatePickerCtrl in the Route Properties dialog. That is, make a route, pull up its properties, and look at the the "Departure Date" control.. This core code uses exactly the same class and method as the ais-vd plugin. How does it look there?

RooieDirk commented 2 years ago

Screenshot_20220220_181541 Screenshot_20220220_181604

bdbcat commented 2 years ago

That is pretty strange. In RoutePropDialog code:

  m_dpDepartureDate =
      new wxDatePickerCtrl(m_pnlBasic, wxID_ANY, wxDefaultDateTime,
                           wxDefaultPosition, wxDefaultSize, wxDP_DEFAULT);

In ais-vd_pi:

 DatePicker = new wxDatePickerCtrl(m_AIS_VoyDataWin, ID_DATECTRL, wxDateTime(),
                                      wxDefaultPosition, wxDefaultSize, wxDP_DEFAULT);

Is there some way the wxGTK2 and GTK3 are both being used? That is, GTK2 for the core, and GTK3 for the plugin?

Hakansv commented 2 years ago

Dave.. Since we are not interested in year and more the date/time-picker control are replaced by SpinControls. That's the present test. The last code is here with a try to control the size to avoid default size but it didn't helped: link to source But I can of course try Dirk's patch.

RooieDirk commented 2 years ago

Hakan, I think you would look for something like this:

m_pCtrlMonth = new wxSpinCtrl(m_AIS_VoyDataWin, wxID_ANY, wxEmptyString,
                                wxDefaultPosition, wxSize(90, 40), 
                                wxSP_ARROW_KEYS, 1, 12, EtaInitMonth);
#if GTK_CHECK_VERSION(3,0,0)
        m_pCtrlMonth->SetMinClientSize( wxSize(m_pCtrlMonth->GetSize().GetY()*5, -1));
#endif
......

This would set the minimum width at least 5x the height of the control. My guess is that this should leave enough space for a "- +" btn's. And it should work on different screen pixel distances. But Dave might have better ideas

Hakansv commented 2 years ago

Basically we may first check a simple wxdefaultsize ans see if that survives instead of my try to shrink the controls.

Hakansv commented 2 years ago

Dirk.. I regret. Here's version 1.6.8 with this change: All Spincntrl size are (80, -1) and //Adjust spincontrols to fit Ubuntu GTK2

#ifdef GTK_CHECK_VERSION(3,0,0)
  m_pCtrlMonth->SetMinClientSize(wxSize(m_pCtrlMonth->GetSize().GetY() * 5, -1));
  m_pCtrlDay->SetMinClientSize(wxSize(m_pCtrlMonth->GetSize().GetY() * 5, -1));
  m_pCtrlHour->SetMinClientSize(wxSize(m_pCtrlMonth->GetSize().GetY() * 5, -1));
  m_pCtrlMinute->SetMinClientSize(wxSize(m_pCtrlMonth->GetSize().GetY() * 5, -1));
#endif