Closed PiezPiedPy closed 5 years ago
I've added all I need to the API for now. Any more upgrades to Kerbalisms Signal System that may need more API methods wont be in the near future. Any changes you think will improve performance or a different way to return the needed information will be appreciated.
It will take while to review codes and test on my side before this PR can be accepted.
Likely, I may reformat some codes for better performance or enforce the RT's best practices after this PR merge.
Many thanks for your contributions on Kerbalism and RT API!
@PiezPiedPy, are you able to verify in the space center scene that RT's satellite count is not zero when API's enabledInSPC
is on?
My debugging tells RT does not have any satellite running in this scene.
I've not accessed the RT satellite count in Kerbalism so I couldn't tell you what it is but I can tell you that the API functions I created for RT return the correct information I need when in the SPC.
IsRTActive
RTPacketSize
RTPacketInterval
and the resHandler
are also returning correct values from the ProtoPartModuleSnapshot
and part_prefab.Modules
for unloaded vessels parts with ModuleRTAntenna
modules.
See this section of code https://github.com/steamp0rt/Kerbalism/pull/161/files#diff-7818d9d8809983022d8b760418a16a2dR268
Also I enable the enabledInSPC
flag when in the MainMenu scene before a save game is loaded.
https://github.com/steamp0rt/Kerbalism/pull/161/files#diff-d2a2ed5c7f12f6715930759b6c3b5293R11
Any way this could be backported to 1.3.1?
Cant see why not, I compiled a 1.3.1 private build that worked. I can make a PR with the changes needed to the .csproj and build scripts but for CI, changes will be needed similar to Kerbalisms method of CI compiling that someone in the RT Team will have to make.
@steamp0rt I don't see why not too. I will do this along with a next RT release. PiezPiedPy, don't need to make CI changes to our RT csproj because the cores of 1.2, 1.3 and 1.4 are very similar to each other and we just swap KSP assemblies for these versions.
@PiezPiedPy, thanks for your patience. Please help to update and test Kerbalism on your pull request.
If it goes well, this pull request will be accepted.
@KSP-TaxiService Tested your changes and they work fine, Thanks 😃
@KSP-TaxiService tell me when the new version of RT is out
I target this Sunday as I need to do a rigorous test on all new changes since the last release.
Ok.
Added two methods for a Power Down state.
SetPowerDownGuid
method enables/disables asatellite.IsInPowerDown
mode.GetPowerDownGuid
method returns the state of thesatellite.IsInPowerDown
mode.I created this functionality for Kerbalism so we can disable satellites when EC is Zero. I could not use the
IsInRadioBlackout
as it was conflicting with our Blackout system due to it usingIsInRadioBlackout
to detect if the satellite is in Blackout, we do this just in case another mod sets this flag independently of Kerbalism's CME Storms. SettingIsInRadioBlackout
as a workaround for loss of power would trigger our signals display to show a Blackout for the satellite when there was none. Adding a check to not show the Blackout condition when EC was zero caused the signals display to show no Blackout when a Blackout condition existed and EC was Zero 👿Works identically to the
IsInRadioBlackout
flag. Could probably be implemented better but I did not want to go messing with your code too much since I am not familiar with your project source.Added an
RTCoreSpaceCenter
Class which allows mods to access connection data via API from the Space Center scene. This is needed by Kerbalism to allow it to show connection details in the Space Center Monitor display. TheRTCoreSpaceCenter
Class is enabled/disabled via an API methodEnableInSPC
Added a method to determine if a vessel directly targets a ground station. Kerbalism uses this to determine if a vessel is directly linked to the KSC or if the connection to KSC is via a relay connection. Also a method to retrieve the name of the directly targeted ground station with the shortest link and a method to retrieve the name of the first hop satellite to KSC with the shortest link, used for the Signal monitor tooltip in Kerbalism.
HasGroundStationTarget
GetNameGroundStationTarget
GetFirstHopNameToKSC
Added a method to retrieve the names of satellites. Kerbalism uses this to display names in its signals tooltip.
GetName
method retrieves the name of a satellite with the specified Guid.