BGog42

[0.21] GHud - Adds displays to built-in screen on Logitech G19/G510 keyboards (v1.2)

Recommended Posts

Well, I'm glad you're taking charge of this, and I'll gladly offer to help/collaborate, if you want. There is of course GIT/GitHub integration for VS, which means you can use it more or less the same as TFS. Fortunately the license is rather permissive, so just taking over while the original author isn't around is no problem at all. He hasn't posted anything since august '14, where the last commit to the GHud repository was in July.

As for what changes I've made to the code, they're actually rather minor (added 42 and deleted 22 lines or so), but as I said the performance implications were quite significant for me. You can see and look over the specific changes here, and all of them are in GHud.cs. There's also a comment that links to the relevant documentation about coroutines, and most of my source should also contain comments where necessary. All things considered, the patch is rather minor though and you should be able to trivially integrate them on your end.

I do hope you put your code up somewhere in a repository (or even just in a zip or something) so I can (hopefully) help or at least compile it on my end with the coroutine changes, as I simply have to do that or the whole game lags constantly. I haven't tried your build with the KSP 1.0 release so far (haven't had the time), there might've been something fixed on the KSP side such that it no longer causes any problems, but switching over to using coroutines should be done anyway if possible: it's just the better approach for this kind of plugin that doesn't actually interact with the images/frames on the monitor.

Should the original author not return (soon-ish), I'd recommend starting a new thread so that the discussion is separate from this one. Also adding support for the more recent management-plugins might be nice (I could probably also provide that, if you want me to). By that I mean things like CKan or KSP-AVC.

Share this post


Link to post
Share on other sites

To simply get the plugin working from the posted source, there were really only 2 changes that I had to make. Firstly, the line I mentioned in my previous post on OrbitGraph.cs @ line 143:

atmos_dia = dia + (orbit.referenceBody.maxAtmosphereAltitude * 2);

should be changed to:

atmos_dia = dia + (orbit.referenceBody.atmosphereDepth * 2);

When looking over the code I posted, I actually used the wrong value here and so the atmosphere effect is not being properly rendered. The other change is only for when using the test app, the code @ line 134 of GHud.cs:

UnityEngine.Object.DontDestroyOnLoad(GHudmain);

should be changed to:

#if !TEST
UnityEngine.Object.DontDestroyOnLoad(GHudmain);
#endif

I am currently just messing around with refactoring the code so it is easier to follow, breaking out the small bits of rendering code into smaller functions so it is easy to tell what code is rendering what to the display. Also, since I don't have a black and white display I am not really messing with anything that is specific to those devices. Once I get everything cleaned up to a point where I am satisfied with it I will post my changes somewhere and make them available.

Share this post


Link to post
Share on other sites
It would also be nice if you could put your source code up somewhere (GitHub?) so others can have a look at it (and/or help with the project). If you had a GitHub, I could merge the changes myself and all you'd have to do was click a button to apply them ;)

I created a new account on GitHub today... takes a little getting used to... but I forked the original repository and updated it with the latest version of my changes. Be warned!! The code has been pretty drastically restructured, though functionally it is pretty much identical. The GitHub fork can be found here. I am still tinkering around with the code, and will likely update it several more times before the weekend is out.

Share this post


Link to post
Share on other sites

I am also curious if anyone else still has trouble running this mod with KSP 64 bit? It seems to run fine for me using the 64 bit client, but if others still have issues I may have some fresh ideas on a permanent fix.

Share this post


Link to post
Share on other sites

Apparently last feedback for the G510 it's for Kerbal 0.25...

I can confirm anyway that works great in Kerbal 1.0!

Awesome mod!

Share this post


Link to post
Share on other sites

@DMFirmy: Sorry that I kinda disappeared after specifically asking you to put up the sources. Unfortunately I had a suprising and very inconvenient stay at the hospital for a couple of days (nothing serious, as it turns out though). So I might get around to looking at them tomorrow or (more likely) on the weekend, just wanted to let you know that I haven't actually just vanished ;)

Share this post


Link to post
Share on other sites
@DMFirmy: Sorry that I kinda disappeared after specifically asking you to put up the sources. Unfortunately I had a suprising and very inconvenient stay at the hospital for a couple of days (nothing serious, as it turns out though). So I might get around to looking at them tomorrow or (more likely) on the weekend, just wanted to let you know that I haven't actually just vanished ;)

Lol, no worries. That is the nature of communication of a forum.

Share this post


Link to post
Share on other sites

Just did a double triple stability test...

This Plugin works on Windows 10 x64, KSP 1.0.2 using unstable drivers for the G15...

I would consider this plugin rock stable now ;) or in other words: Seems fully compatible with 1.0.2

Share this post


Link to post
Share on other sites

So.... should I consider upgrading from my G15 for the shiny new screen?

I found one at a discount and have been hemming & hawing.

Bear in mind, my old g15 is getting a little unpredictable with the keystrokes so I need a replacement either way.

Share this post


Link to post
Share on other sites

Is there an easy way to get this going on Linux?

All I've managed to get working with the g15 is a clock.

Its a sweet clock to be sure, but you know... GHUD is ever so handy!

Share this post


Link to post
Share on other sites

Not sure how easy/hard it would be but Logitech seems to be moving away from embedded displays and utilizing mobile device displays with their Arx system. Would it be possible to make it Arx compatible?

Share this post


Link to post
Share on other sites

Sorry for necromancing: There is NO way getting this to work on linux as far as i know (and i deal with g15/linux for a long while now)... The official Runtime for the g15 does not work on linux and the linux runtimes cant handle plugins created for the original api (never understood why they didnt reverse engenier it in the first place..)

So long story short: NO, it doesnt work on linux.

Share this post


Link to post
Share on other sites
Sorry for necromancing: There is NO way getting this to work on linux as far as i know (and i deal with g15/linux for a long while now)... The official Runtime for the g15 does not work on linux and the linux runtimes cant handle plugins created for the original api (never understood why they didnt reverse engenier it in the first place..)

So long story short: NO, it doesnt work on linux.

Aww, that's a bummer :(

My logitech flight stick doesn't work properly in linux either :'(

Thanks for looking into it though :)

Share this post


Link to post
Share on other sites

This plugin is working for 1.0.5, on the Logitech G19.

I'm not sure if it needed the fix but in the source code for OrbitGraph they were referencing a deprecated module orbit.referenceBody.maxAtmosphereAltitude. The new module seems to use atmosphereDepth (I kept the math the same because I am unsure the result it returns). I compiled the source with this fix and the new version of KSP, then I just copied the .dll into the Ghud\plugin folder.

I just noticed DMFirmy has slightly took over this mod, and has made an awesome re-work of the code on his github repo. I wish he'd take it over and actively develop this.

Edited by Phreak
I read more of the forum....

Share this post


Link to post
Share on other sites
On 11/12/2015 at 3:49 PM, Phreak said:

This plugin is working for 1.0.5, on the Logitech G19.

I'm not sure if it needed the fix but in the source code for OrbitGraph they were referencing a deprecated module orbit.referenceBody.maxAtmosphereAltitude. The new module seems to use atmosphereDepth (I kept the math the same because I am unsure the result it returns). I compiled the source with this fix and the new version of KSP, then I just copied the .dll into the Ghud\plugin folder.

I just noticed DMFirmy has slightly took over this mod, and has made an awesome re-work of the code on his github repo. I wish he'd take it over and actively develop this.

It's not working for me... I guess it needs the fix. How do you compile the dll? Could you just post the dll?

Sorry for necroposting. I got a G19 for Christmas and this is the first thing I tried to do with it. :D

Share this post


Link to post
Share on other sites

Seems like i'm getting an error of maxaltatmosphere for when i'm trying to display the orbit overview...

 

Guess that's the reason why it won't show up...

Share this post


Link to post
Share on other sites
On 5/1/2015 at 6:56 PM, DMFirmy said:

I created a new account on GitHub today... takes a little getting used to... but I forked the original repository and updated it with the latest version of my changes. Be warned!! The code has been pretty drastically restructured, though functionally it is pretty much identical. The GitHub fork can be found here. I am still tinkering around with the code, and will likely update it several more times before the weekend is out.

hey! how well does this work in 1.1.3? would be really cool if my lcd was no longer just a glorified clock XD

 

Share this post


Link to post
Share on other sites
On ‎9‎/‎24‎/‎2016 at 6:06 PM, MK3424 said:

Any news about bringing this to 1.2 spec?

Ditto! Would love to have my G510 back in service!

Share this post


Link to post
Share on other sites

Hi! I would love to see that, too. I loved this plugin way long ago and refound it just today! Any News? Can I help in any way?

Share this post


Link to post
Share on other sites
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.