antipole2 / JavaScript_pi

JavaScript plugin for OpenCPN
GNU General Public License v3.0
2 stars 4 forks source link

Console not seen after disabling and re-enabling plugin #102

Open antipole2 opened 1 month ago

antipole2 commented 1 month ago

@torrmundi reports If I disable/reenable Javascript PI, clicking on the {JS} icon no longer brings up my console. Nothing happens, except the icon goes grey (on) or black (off) on succcessive clicks. I have to stop/restart OpenCPN to regain a working console. Then it behaves as before: 1st try no responses, 2nd and onward gets responses. regain a working console. Then it behaves as before: 1st try no responses, 2nd and onward gets responses.

Looks like you have uncovered an issue whereby console is positioned out of sight. May arise because of your screen resolution. To help me investigate, please do the following:

  1. With plug-in behaving correctly, take dump, capturing all data.
  2. Disable plugin (by unticking in the list of plugins)
  3. Capture your OCPN config file OpenCPN.ini
  4. Re-enable the plug-in and open the tools via the Preferences button in the plugin entry
  5. Find Diagnostics tab and take another dump, capturing all data.
  6. Go to the Consoles tab in tool and pull down on the ‘Change name of console, list. Can you see the names of your consoles in this list(even though you cannot see the consoles)?

Suggest you zip the three files to avoid long reply in this thread. Thanks for your help with this.

antipole2 commented 1 month ago

Something else to check/try first before bothering about the dumps…. In Consoles tab of Tools bottom left is an option Float consoles on top. Is that unselected? If you turn it on, does that change the behaviour - I.e. do you then see the console after re-enabling the plugin?

torrmundi commented 1 month ago

New Issue: The Tools Consoles tab does have that Float... button, but it's hidden until I drag the dialog bottom downwards, exposing the two checkboxes. My screen is 1920x1200 (highest available) and my Scale is 125%.

I didn't have the float option enabled. But enabling it doesn't change behavior. It's also the same if the console is parked, or open when I disable the PI.

torrmundi commented 1 month ago

Something different this time. When I re-enabled, my console suddenly reappeared. Files are attached. Step 6: Yes, the name (WhoGoesThere) is in the dropdown. WhoGoesThere 1.zip I'll try this again. I don't think I did anything different, except Step 4.

torrmundi commented 1 month ago

Weird. Now the console pops up every time I re-enable (or the parked console pops up). But, the Preferences button no longer brings up a dialog. I restarted OCPN. Opened the console, ran the script (ok), Opened the Preferences (ok). Closed Preferences. I disabled the PI. Re-enabled, opened Preferences (ok). Continuing, got the dump. Console name is in the dropdown. WhoGoesThere2.zip FYI, When things go well, Alt-Tab shows windows for the Tools, the Console, and OpenCPN. When things are not showing up, only OpenCPN is available via Alt-Tab. That makes me think the window isn't hidden - rather, it doesn't exist.

antipole2 commented 1 month ago

New Issue: The Tools Consoles tab does have that Float... button, but it's hidden until I drag the dialog bottom downwards, exposing the two checkboxes. My screen is 1920x1200 (highest available) and my Scale is 125%.

I didn't have the float option enabled. But enabling it doesn't change behavior. It's also the same if the console is parked, or open when I disable the PI.

Separate issue created for this one.

antipole2 commented 1 month ago

@torrmundi Please confirm whether when you report Preferences button not working, is this in a console (Tools) or in the Plugins list 'Preferences' button? The dumps you sent show the console being restored in the same position as was before disabling.

If the Preferences button in the plugins entry is not working, it suggests the plugin was not being re-enabl;ed correctly - hence the consoles not appearing. Please send the relevant bit of the log when this happens. It should be logging the initialisation process.

I am on board and mostly working on a roaming mobile signal and small screen, so bit limited on how deep I can go.

torrmundi commented 1 month ago

@antipole2 I believe I got the dump you want, with pref not working as accessed from the PI list. Included a screen cap. Javascript PI Prefs.zip. I'll be unavailable for Tu/We/Thu I think, as we're returning to the US.

antipole2 commented 1 month ago

In the screenshot you sent, the JavaScript plugin is not enabled. The Enabled box is not ticked. Hence Preferences is greyed out.

On my system if I untick this, the JS icon in the left hand bar does not go away until I dismiss the options panel.

When I tick the Enable box, the consoles seem to appear but the JS icon does not appear until I dismiss the options panel.

The options panel is modal. It blocks many other processes until it is dismissed. Are you dismissing it after enabling before trying to use the plugin?

torrmundi commented 1 month ago

I'm not always dismissing the PI List. Try this: When I click on the Javascript PI in the list, it opens up the list to show the options like Preferences, but it also unchecks the enabled button. Open PI in the list, disable JPI. OK. {JS} is in the console still, toggles black/gray, does nothing when clicked. Open PI List, enable JPI. Parked WhoGoesThere appears. OK Open PI List, open JPI entry, disable. OK {JS} still in console, still does nothing. Open PI List, open JPI entry, enable. Preferences button goes gray to black. Click on Preferences. Nothing. OK Open PI List, open JPI entry Click on Preferences. Preferences dialog opens.

On Mon, Jun 3, 2024 at 1:03 PM Tony @.***> wrote:

In the screenshot you sent, the JavaScript plugin is not enabled. The Enabled box is not ticked. Hence Preferences is greyed out.

On my system if I untick this, the JS icon in the left hand bar does not go away until I dismiss the options panel.

When I tick the Enable box, the consoles seem to appear but the JS icon does not appear until I dismiss the options panel.

The options panel is modal. It blocks many other processes until it is dismissed. Are you dismissing it after enabling before trying to use the plugin?

— Reply to this email directly, view it on GitHub https://github.com/antipole2/JavaScript_pi/issues/102#issuecomment-2145712947, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU7AEMCQTU7HDBWZZ7SRPYTZFSOXXAVCNFSM6AAAAABIVKGKYWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBVG4YTEOJUG4 . You are receiving this because you were mentioned.Message ID: @.***>

antipole2 commented 1 month ago

The {JS} black/grey button:

I suspect most of the oddities you list are because you are not clicking Apply or closing the panel thus allowing OCPN to complete the changes you have made, which includes refreshing the window so it shows what it should in the right colour/shade or hides what it should not show.