Jump to content

[Release - Final] kOSPropMonitor - IVA kOS Monitor


dsonbill

Recommended Posts

kOSPropMonitor
The mod both kOS and RPM team are certain doesn't exist.
kPM-1.7.2.29290-blue.svg  kOS-1.3.2.0-blue.svg  KSP-1.11.1-green.svg

f1d50a84c2eaa4fdc81880fbc676690f.png

FEATURES:

  • kOS Processor Selector!
  • kOS Processor Power Toggle!
  • IVA Keyboard Input!
  • Settable Flags with Settable Labels!
  • Blinky Cursor + Green Text + Completely Customizable Text Colors + Completely Customizable Everything!
  • Now Multi-Monitor Independent States!
  • New Layout Saves Space!
  • Arrows and Enter/Cancel Implemented!
  • Colored Terminal!
  • Removable Flag Panel!
  • Button Function Delegates!

BUTTONS:

  • Next: kOS Processor Selector
  • Prev: kOS Processor Selector
  • STBY: Toggle Processor Power
  • O: Connect Keyboard to Processor
  • All Other Buttons: Scripts can use every single other button on the device!

API Examples (Out Of Date for 1.6.1.37413+):

//Set Shortcuts
set buttons to addons:kpm:buttons.
set flags to addons:kpm:flags.

//Get Monitor Count
set monitors to addons:kpm:getmonitorcount().

//Set Current Monitor - Separare for Buttons and Flags
set buttons:currentmonitor to 0.
set flags:currentmonitor to 0.

//Get Monitor GUID
set id to addons:kpm:getguid(0). // OR set id to addons:kpm:getguidshort(0).

//Get Monitor Index From GUID - Works for Whole GUID and Short GUID
set monindex to addons:kpm:getindexof(id). //If GETINDEXOF Returns -1, GUID Not Found.

//Get Button State
buttons:getstate(0).
//Set Button State
buttons:setstate(0, false).
// -1 is enterButtonState
// -2 is cancelButtonState
// -3 is upButtonState
// -4 is downButtonState
// -5 is leftButtonState
// -6 is rightButtonState
// 0+ is Other Buttons

//Get Button Label
buttons:getlabel(0).
//Set Button Label
buttons:setlabel(0, "BUTTN").
// Only 0+ is Valid

//Get Flag State
flags:getstate(0).
//Set Flag State
flags:setstate(0, false).
// Only 0+ is Valid

//Get Flag Label
flags:getlabel(0).
//Set Flag Label
flags:setlabel(0, "ABRT").
// Only 0+ is Valid

Config Node Fields:

Spoiler

Config Node Fields
//Buttons
[KSPField]
public int processorSelectorUpButton = 7;
[KSPField]
public int processorSelectorDownButton = 8;
[KSPField]
public int connectButton = 4;
[KSPField]
public int toggleProcessorPowerButton = 9;
[KSPField]
public string multiFunctionButtons = "17,18,19,20,21,22,23,10,11,12,13,14,15,16";

//Directional Buttons
[KSPField]
public int upButton = 0;
[KSPField]
public int downButton = 1;
[KSPField]
public int leftButton = 6;
[KSPField]
public int rightButton = 5;

//Enter and Cancel
[KSPField]
public int enterButton = 2;
[KSPField]
public int cancelButton = 3;

//Terminal Fields
[KSPField]
public int flagCount = 14;
[KSPField]
public string template = "";
[KSPField]
public string buttonSide = "##########";
[KSPField]
public string buttonSideSmall = "#";
[KSPField]
public string buttonEmptyLabel = "        ";
[KSPField]
public string flagSide = "##########";
[KSPField]
public string flagSideSmall = "#";
[KSPField]
public string flagEmptyLabel = "        ";
[KSPField]
public string textTint = "[#009900ff]";
[KSPField]
public string textTintUnpowered = "[#ffffff3e]";
[KSPField]
public string textTintButtonOn = "[#009900ff]";
[KSPField]
public string textTintButtonOff = "[#ffffffff]";
[KSPField]
public string textTintFlagOn = "[#009900ff]";
[KSPField]
public string textTintFlagOff = "[#000000]";
[KSPField]
public string keyboardActiveLabel = "KBRD";
[KSPField]
public string keyboardActiveTint = "[#FFF72B]";
[KSPField]
public string keyboardInactiveTint = "[#000000]";
[KSPField]
public int consoleWidth = 40;
[KSPField]
public int consoleHeight = 20;

 

Known Bugs:

Spoiler

Nothing to report.

DOWNLOAD FROM SPACEDOCK

**ALWAYS DELETE THE OLD VERSION COMPLETELY BEFORE UPDATING**

 

Source: kOSPropMonitor on GitHub
License: GNU GPL V.3 (Some portions of the source come straight from kOS, and are the works of the kOS team)

People who have contributed to this in some way, shape or form (even if they don't know it)
Erendrake - for making kOS what it is today. Without him, this project would probably not exist.

Mihara - for making JSI RasterPropMonitor.
Godarklight - C# evil ninja hacker, he will eat your code!
The kOS Team - kOS is just nuts, even more so after looking through the source and considering the fact that it works so damned well. Amazing job guys!
karamazovnew - Integrated BasicMFD Layout concept 

Edited by dsonbill
Link to comment
Share on other sites

This is awesome.

But just be warned that the stuff I'm working on at the moment in kOS is specifically terminal related, in such a way that there's a risk it might affect whatever method calls you're making use of. You'll need to be careful to keep track of updates to the development platform of kOS over the next several weeks.

Specifically, I was working on making the terminal remote-able through telnet, which in turn means making it resizable and other stuff. In the long run it will be better for rasterpropmonitor stuff, but it may mess up the API a bit.

Getting this system in place is one of the main reasons we haven't implemented proper keyboard input to scripts yet - I want to make sure I know how the remotable input works first, and then funnel key reading through that system, however it ends up looking in the end.

Link to comment
Share on other sites

I kind of figured as much, given that I initially tried to use the release build with an assembly built from kOS' master, thinking "well, it'll be similar enough for testing, right?" Holy wrong! :P

I'm fully prepared for it to change often! I kind of expected it getting into kOS stuff, though not as much as I saw. I realize now I came at kind of a bad time (and also a good time, as resizing isn't at all clean on 0.15.5 from what I can tell). I'll probably be a bit slower than my initial work for updates, of course, but I'll be sure to keep a close eye on the activity going on in the kOS repo up until the next kOS release.

Thanks for the heads up!

Link to comment
Share on other sites

  • 3 months later...
  • 4 months later...
Did anyone managed to make this work? Or at least has any idea how to modify the files (it obviously isn't working out of the box)?

I'm using it for a while, I just recompile it against last kos and change the "@text = " thing in kOS_home40x20.txt which is wrong.

Salud.

PS: fixed modulemanager file and extra configs for the 60x30 and 50x18 monitors in the alcor pod, kos page is in the autopilot button or in the vesselview one, depends of the monitor. Tell me if you are unable to recompile or too lazy XD. here Remember to use only one monitor size at once, or use diferent kOS cpus in each monitor or they will start fighting about the terminal size and make the game crash...

Edited by agises
Link to comment
Share on other sites

I'm using it for a while, I just recompile it against last kos and change the "@text = " thing in kOS_home40x20.txt which is wrong.

Salud.

PS: fixed modulemanager file and extra configs for the 60x30 and 50x18 monitors in the alcor pod, kos page is in the autopilot button or in the vesselview one, depends of the monitor. Tell me if you are unable to recompile or too lazy XD. here Remember to use only one monitor size at once, or use diferent kOS cpus in each monitor or they will start fighting about the terminal size and make the game crash...

Thanks! It totally works, and moreover I've learned how to compile Visual Studio / MSBuild projects on linux (use xbuild, that is packaged in mono-devel on Fedora, btw for any struggling person that would read this). It's kinda irritating only that the dependency paths in the source had to be manually corrected for me.

Now only to figure out how to move the navyfish's docking indicator iva to ingine ignitor button, or to add completely another button in the upper row...

Link to comment
Share on other sites

would either of you mind sharing the binaries? Would be cool to have this even in its current limited capacity just for screen caps for my roleplay. I'll admit it is part laziness, mostly lack of time to go and set up an environment to compile in that I totally don't even have right now

Link to comment
Share on other sites

would either of you mind sharing the binaries? Would be cool to have this even in its current limited capacity just for screen caps for my roleplay. I'll admit it is part laziness, mostly lack of time to go and set up an environment to compile in that I totally don't even have right now

Here is the library compiled for 1.0.2 version of KSP (w/ modified gui and module manager files from agises); hope it works for newer versions as well.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...
  • 4 months later...
On 1/15/2016 at 11:52 AM, Redneck said:

Is this mod still working? Is there a correct way to install it? If it is not working what is the reason

I'm sorry, I've neglected this mod for *far* too long. Expect an update soon hopefully.

 

EDIT: Somehow, with @agises patch fixing my foolishness, this mod still mostly works when compiled fresh. I'm going to fix it up a bit before releasing it, still.

Edited by dsonbill
Link to comment
Share on other sites

9 hours ago, dsonbill said:

I'm sorry, I've neglected this mod for *far* too long. Expect an update soon hopefully.

 

EDIT: Somehow, with @agises patch fixing my foolishness, this mod still mostly works when compiled fresh. I'm going to fix it up a bit before releasing it, still.

@dsonbill oh goodness. It's alive :lol:

You are awesome !!!!

https://spacedock.info/mod/712/kOSPropMonitor

Link to comment
Share on other sites

18 hours ago, dsonbill said:

I'm sorry, I've neglected this mod for *far* too long. Expect an update soon hopefully.

 

EDIT: Somehow, with @agises patch fixing my foolishness, this mod still mostly works when compiled fresh. I'm going to fix it up a bit before releasing it, still.

aww heck yeah man cool thank you

Link to comment
Share on other sites

New version 1.0.5 is out!

I need to change over more props in individual IVAs, but the initial release is ready :)

Let me know if you guys encounter any bugs, how you like the console, and if you have any requests.

 

Known bugs:

  • Input lag (known fix)
  • Screwy cpu selector
  • Button and light stuff not always set properly in all cpus(work-around possible)
  • Probably bad IVA locations for stuff and not enough consoles(known fix)
  • Left out arrow keys and enter/cancel buttons(easy fix)

Planned Features:

  • Logging consoles on stock RPM
  • Fancy RPM features like graphs, vector graphics, and textures(possible, not certain)
  • Maintenance console for certain tasks during IVA
Edited by dsonbill
Link to comment
Share on other sites

Sweet!  Hey, the splash says " All Other Buttons: Scripts can use every single other button on the device! " but I can't find any documentation on how.  What's the means for a script to detect a button press?

Link to comment
Share on other sites

2 hours ago, Steven Mading said:

Sweet!  Hey, the splash says " All Other Buttons: Scripts can use every single other button on the device! " but I can't find any documentation on how.  What's the means for a script to detect a button press?

Hey Steven! Sorry it's taken me an entire year to actually fix this up - I've switched over to ProcessOneInputChar, but I still find it necessary to get the processor shares for things like the BindingMgr/ 

As for the buttons, I've added them the same as Action Groups - you just check to see if one has changed to True and you know it's been pressed. The buttons are named buttonT0, buttonT1 etc, and the labels for the buttons are buttonT0Label, etc. I may change this if I can come up with a better naming scheme, but functionality is more important to me right now than nice identifiers. In addition to the buttons, there are lights which work in the same way for people's scripts - if you do 'SET LIGHTT0 TO TRUE.', the top left light will come on.

Hopefully that made sense for now - I'll add better documentation soon hopefully!

 

I do seem to experience the occasional problem where the processor share won't have the above getters and setters added, but I think I may have a work-around or even a possible real fix.

Thanks for working so hard on kOS :)

Edited by dsonbill
Link to comment
Share on other sites

Hmm.  I had a quick (10 minute) scan through your github code to see how you were doing that (adding new bound variables to KOS from another mod outside of kOS).  Clever trick.  We hadn't planned on that but it's an interesting solution.

I wonder how hard it would be to make an "ADDONS" module for it instead, just for namespace preservation (so for example the bound variable could be something like:

SET ADDONS:KOSPROP:LIGHT0 to TRUE.

or to be less wordy, storing the first part of that in a handle:

SET PRP TO ADDONS:KOSPROP.
SET PRP:LIGHT0 TO TRUE.

One issue we've been tossing around back and forth in the kOS dev channel is how we can make the Addons part of kOS easier for other modders to use, so they don't have to donate code to the kOS github repo to do it and can instead do it from inside their own mod's DLL's.  We haven't really settled on anything, but seeing this thread reminded me of it.

Link to comment
Share on other sites

Uhmm... this can't be right... getting spammed with and none of the screens working

[Exception]: ArgumentOutOfRangeException:Argument is out of range

Parameter name:index.

http://i.imgur.com/wbeATgb.jpg?1

When I press the O button it does input to the KOS terminal, but not into RPM. Maybe creating a separate prop is a bad idea? I liked having just a page for it. By the way, you can still "overwrite" the buttons even within a page. You could make a separate prop with just KOS so people can change their interiors if they want. 

Here's a comment I made a long time ago, the method might still work.

http://forum.kerbalspaceprogram.com/index.php?/topic/83570-112-b9-aerospace-release-611-updated-030516/&do=findComment&comment=1621235

It describes page nesting and blocking specific buttons from accessing other pages freeing them up for other uses (the buttons on top and bottom of the screen). So you could build different pages with whatever background you want, just for kOS. I recommend leaving the top right button on default setting, so you can exit KOS at any time, and set the X button to bring you back to the default KOS screen, while still accessing it like in the previous version and leaving everything else in RPM unchanged

. Also, is it possible to make the Left-Right buttons move the cursor and the UP button show the previous commands (as the normal kos terminal does it?). Also, pressing the input button needs a more "visible" reminder that the keyboard is locked. I recommend putting an overlay with a label, sort of like how the Navball displays "ORB" and "SURF" when you press the same button.

Edited by karamazovnew
Link to comment
Share on other sites

On 5/19/2016 at 3:20 PM, karamazovnew said:

Uhmm... this can't be right... 

http://i.imgur.com/wbeATgb.jpg?1

When I press the O button it does input to the KOS terminal, but not into RPM. Maybe creating a separate prop is a bad idea? I liked having just a page for it. By the way, you can still "overwrite" the buttons even within a page. You could make a separate prop with just KOS so people can change their interiors if they want. 

Here's a comment I made a long time ago, the method might still work.

http://forum.kerbalspaceprogram.com/index.php?/topic/83570-112-b9-aerospace-release-611-updated-030516/&do=findComment&comment=1621235

It describes page nesting and blocking specific buttons from accessing other pages freeing them up for other uses (the buttons on top and bottom of the screen). So you could build different pages with whatever background you want, just for kOS. I recommend leaving the top right button on default setting, so you can exit KOS at any time, and set the X button to bring you back to the default KOS screen, while still accessing it like in the previous version and leaving everything else in RPM unchanged

. Also, is it possible to make the Left-Right buttons move the cursor and the UP button show the previous commands (as the normal kos terminal does it?). Also, pressing the input button needs a more "visible" reminder that the keyboard is locked. I recommend putting an overlay with a label, sort of like how the Navball displays "ORB" and "SURF" when you press the same button.

The thing is broken, sorry. It has nothing to do with the prop being standalone. I just fixed this a second ago - wait for the hotfix.

On the topic of main RPM pages, what do you think of the following instead of converting back completely?

A list of full-text pages that are settable from inside scripts, and will be accessible from RPM, separate to the main processor window. They may or may not have button pass-through. The windows will fit the standard 40x20 resolution, while the stand-alone will continue to support scritpts in 100x35.

Visual keyboard indicator: I'll actually tie this to the last light or something. As for the arrow buttons, that can definitely be arranged. It'd be nice if others could chime in with their opinion on the subject as well.

 

@Steven Mading, thanks :) Getters and setters are a pretty decent way to do buttons and lights - it just makes sense.

Either of those scenarios is definitely acceptable. The naming is the main thing I'm not happy with as far as the interface to scripting goes. Whatever you guys end up going with will be awesome - but this is definitely acceptable for now.

 

 

EDIT: Version 1.0.5.1 now live - hotfix for malfunctioning processor list. Everything should be working fine again.

EDIT2: @karamazovnew, I might actually know how to change the resolution in individual pages now - I'll try some stuff out. If this works out, we'll probably be switching off a stand-alone device, but people will lose at least one button.
I do like the idea of using the arrows as the keyboard arrows - I haven't come up with a solution to make the camera stop moving unfortunately.

EDIT 3: Version 1.0.5.2 live on SpaceDock!

Edited by dsonbill
Link to comment
Share on other sites

Works now, but seriously, the font is too small :D And yeah, the input lag is.... quite big :D 

Took me a bit of time (I just spent 1 hour writing useless tips), but I finally realized just how brilliant your method is. It basically does 99% of what I was about to suggest and all in one screen. Wow.... 

One minor bug, I usually test my flights with KCT's simulations. But if I exit the flight back to VAB while in "keyboard focus" mode, the interface is stuck and I have to exit the game. Mouse moves, right click works but camera controls and left click don't work. 

Don't worry about the arrow keys, we can disable them in the game's main menu. The only problem is that some other addons shortcuts (such as KAS which opens his interface on pressing P) still trigger, but that's true of the normal kOS terminal as well. In fact, in IVA I can't even use the kOS terminal unless I first press your button, so good job on that. If you could find a solution, make sure to tell the guys at KOS as well :D. Regarding the "has keyboard focus" is it possible to just alter the background color of that RPM screen? 

By the way, why don't you use a transparent image layer to replace most of the #### characters and gain some extra space? Lights could keep them as I like how they push eachother outside the screen. But can't they be more "like lights"? I mean something like green background for the characters? Maybe even add two more properties for them: background and fontcolor. 

More questions:

- Is it possible to use the name of the CPU (if altered) instead of the "kCPUx" names in the processor list? It could remain as default. 

- Is there any event when changing the active processor? I'd like to change the button labels and the lights based on what processor is active through a "refresh gui" script.

- RPM has one button currently bugged, the Engine Ignitor button. You could use that for your main page. Instead of leaving it as standalone, you could attach it to that and use some of the other buttons more wisely. For example: X as CTRL-C (probably will jump us out of IVA), Green Arrow as activate/deactivate processor, LEFT-RIGHT for selecting processor, UP-DOWN for resolution, PREV-NEXT for line history (or just make arrow keys work and use them for something else), and finally Standby for standard RPM standby. So you don't actually loose any of the "customizable" buttons. Heck, one more option would be to even use the STANDBY button itself and replace the "boot" page of RPM. :0.0:

THIS:

Quote

A list of full-text pages that are settable from inside scripts, and will be accessible from RPM, separate to the main processor window. They may or may not have button pass-through. The windows will fit the standard 40x20 resolution, while the stand-alone will continue to support scritpts in 100x35.

This gives me hope. Ship telemetry with proper delay and only available when probe has signal? Been wanting that for AGES. Combined with buttons that can alter the scripts that alter the page? HOLY MOLY! The only thing missing would be the RPM assets to actually take their data from the scripts and ignore the "realtime" telemetry. That would be cool. Having a probe run out of fuel 10 minutes before you see it happen in ProbeControlRoom. Torture.

By the way, since I can't test this now, if I show the kPM page on multiple RPM monitors, what would I see? Would they all be identical? If not, nesting pages would be cooler than ice :) But I don't see how you could add link between the active monitor, active page, last button pressed conditionals and events into KOS. If you could... wow boy. But let's leave that for later, what we have is nice enough if polished. Still... wow... 

Edited by karamazovnew
Link to comment
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.

×
×
  • Create New...