-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5c793fc
Showing
34 changed files
with
335 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using UnityEngine; | ||
|
||
using TestFlightAPI; | ||
|
||
namespace TestFlight | ||
{ | ||
|
||
// Method for determing distance from kerbal to part | ||
// float kerbalDistanceToPart = Vector3.Distance(kerbal.transform.position, targetPart.collider.ClosestPointOnBounds(kerbal.transform.position)); | ||
public class FlightDataRecorder_LRAvionics : FlightDataRecorderBase | ||
{ | ||
[KSPField] | ||
public double emptyThreshold = 0.1; | ||
[KSPField] | ||
public string resourceName = ""; | ||
|
||
public override void OnAwake() | ||
{ | ||
base.OnAwake(); | ||
} | ||
|
||
public override bool IsRecordingFlightData() | ||
{ | ||
if (!isEnabled) | ||
return false; | ||
|
||
//if (this.part.vessel.situation == Vessel.Situations.PRELAUNCH) | ||
// return false; | ||
|
||
PartModuleList mods = this.part.Modules; | ||
ModuleCommand mod = (ModuleCommand)mods.GetModule("ModuleCommand"); | ||
//hibernating protects the probe | ||
if(!mod.IsHibernating) | ||
if (mod.ModuleState == ModuleCommand.ModuleControlState.Nominal || mod.ModuleState == ModuleCommand.ModuleControlState.PartialProbe) | ||
return true; | ||
|
||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using UnityEngine; | ||
|
||
using TestFlightAPI; | ||
|
||
namespace TestFlight | ||
{ | ||
|
||
// Method for determing distance from kerbal to part | ||
// float kerbalDistanceToPart = Vector3.Distance(kerbal.transform.position, targetPart.collider.ClosestPointOnBounds(kerbal.transform.position)); | ||
public class FlightDataRecorder_LRResources : FlightDataRecorderBase | ||
{ | ||
[KSPField] | ||
public double emptyThreshold = 0.1; | ||
[KSPField] | ||
public string resourceName = ""; | ||
|
||
public override void OnAwake() | ||
{ | ||
base.OnAwake(); | ||
} | ||
|
||
public override bool IsRecordingFlightData() | ||
{ | ||
bool isRecording = true; | ||
|
||
if (!isEnabled) | ||
return false; | ||
|
||
if (this.part.vessel.situation == Vessel.Situations.PRELAUNCH) | ||
return false; | ||
|
||
List<PartResource> partResources = this.part.Resources.ToList(); | ||
foreach (PartResource resource in partResources) | ||
{ | ||
if (resourceName == "ALL") | ||
{ | ||
if (resource.amount <= emptyThreshold) | ||
isRecording = false; | ||
} | ||
else if (resourceName == "" || resourceName == resource.resourceName) | ||
{ | ||
isRecording = false; | ||
if (resource.amount > emptyThreshold) | ||
return true; | ||
} | ||
} | ||
return isRecording; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using UnityEngine; | ||
|
||
using TestFlightAPI; | ||
|
||
namespace TestFlight | ||
{ | ||
|
||
// Method for determing distance from kerbal to part | ||
// float kerbalDistanceToPart = Vector3.Distance(kerbal.transform.position, targetPart.collider.ClosestPointOnBounds(kerbal.transform.position)); | ||
public class FlightDataRecorder_LRTanks : FlightDataRecorderBase | ||
{ | ||
[KSPField] | ||
public double emptyThreshold = 0.1; | ||
[KSPField] | ||
public string resourceNames = ""; | ||
|
||
public override void OnAwake() | ||
{ | ||
base.OnAwake(); | ||
} | ||
|
||
public override bool IsRecordingFlightData() | ||
{ | ||
if (!isEnabled) | ||
return false; | ||
|
||
if (this.part.vessel.situation == Vessel.Situations.PRELAUNCH) | ||
return false; | ||
|
||
bool isRecording = false; | ||
|
||
//strip spaces | ||
resourceNames = String.Concat(resourceNames.Where(c => !Char.IsWhiteSpace(c))); | ||
string[] names = resourceNames.Split(','); | ||
|
||
List<PartResource> partResources = this.part.Resources.ToList(); | ||
|
||
if (resourceNames.ToUpper() == "ALL") | ||
{ | ||
isRecording = true; | ||
foreach (PartResource resource in partResources) | ||
{ | ||
if (resource.amount < emptyThreshold || !resource.flowState) | ||
isRecording = false; | ||
} | ||
} | ||
else if(resourceNames == "") | ||
{ | ||
foreach (PartResource resource in partResources) | ||
{ | ||
if (resource.amount >= emptyThreshold && resource.flowState) | ||
isRecording = true; | ||
} | ||
} | ||
else | ||
{ | ||
isRecording = true; | ||
|
||
foreach (PartResource resource in partResources) | ||
{ | ||
bool hasName = false; | ||
foreach (string name in names) | ||
{ | ||
if (resource.resourceName == name) | ||
hasName = true; | ||
} | ||
if (!hasName || resource.amount < emptyThreshold|| !resource.flowState) | ||
isRecording = false; | ||
} | ||
} | ||
|
||
return isRecording; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 pehvbot | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{CB940433-173F-4662-9AAB-1235E7073DDD}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<RootNamespace>LRTF</RootNamespace> | ||
<AssemblyName>LRTF</AssemblyName> | ||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug</OutputPath> | ||
<DefineConstants>DEBUG;</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<ConsolePause>false</ConsolePause> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release</OutputPath> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<ConsolePause>false</ConsolePause> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="Assembly-CSharp-firstpass"> | ||
<HintPath>..\dlls_1_12_2\Assembly-CSharp-firstpass.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Assembly-CSharp"> | ||
<HintPath>..\dlls_1_12_2\Assembly-CSharp.dll</HintPath> | ||
</Reference> | ||
<Reference Include="TestFlightAPI"> | ||
<HintPath>..\dlls_1_12_2\TestFlightAPI.dll</HintPath> | ||
</Reference> | ||
<Reference Include="TestFlightCore"> | ||
<HintPath>..\dlls_1_12_2\TestFlightCore.dll</HintPath> | ||
</Reference> | ||
<Reference Include="UnityEngine"> | ||
<HintPath>..\dlls_1_12_2\UnityEngine.dll</HintPath> | ||
</Reference> | ||
<Reference Include="UnityEngine.CoreModule"> | ||
<HintPath>..\dlls_1_12_2\UnityEngine.CoreModule.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="FlightDataRecorder_LRResources.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="FlightDataRecorder_LRTanks.cs" /> | ||
<Compile Include="FlightDataRecorder_LRAvionics.cs" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
|
||
// Information about this assembly is defined by the following attributes. | ||
// Change them to the values specific to your project. | ||
|
||
[assembly: AssemblyTitle("LRTF")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("")] | ||
[assembly: AssemblyCopyright("${AuthorCopyright}")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". | ||
// The form "{Major}.{Minor}.*" will automatically update the build and revision, | ||
// and "{Major}.{Minor}.{Build}.*" will update just the revision. | ||
|
||
[assembly: AssemblyVersion("1.0.*")] | ||
|
||
// The following attributes are used to specify the signing key for the assembly, | ||
// if desired. See the Mono documentation for more information about signing. | ||
|
||
//[assembly: AssemblyDelaySign(false)] | ||
//[assembly: AssemblyKeyFile("")] | ||
[assembly: KSPAssemblyDependency("TestFlightAPI", 1, 0)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# LRTF | ||
Less Real Test Flight: TestFlight for stock KSP |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// <autogenerated /> | ||
using System; | ||
using System.Reflection; | ||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] |
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cbb18e671488c66969291190467a5dced89955a9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/Users/haslam/Projects/LRTF/LRTF/bin/Debug/LRTF.dll | ||
/Users/haslam/Projects/LRTF/LRTF/bin/Debug/LRTF.pdb | ||
/Users/haslam/Projects/LRTF/LRTF/bin/Debug/Assembly-CSharp-firstpass.dll | ||
/Users/haslam/Projects/LRTF/LRTF/bin/Debug/Assembly-CSharp.dll | ||
/Users/haslam/Projects/LRTF/LRTF/bin/Debug/TestFlightAPI.dll | ||
/Users/haslam/Projects/LRTF/LRTF/bin/Debug/TestFlightCore.dll | ||
/Users/haslam/Projects/LRTF/LRTF/bin/Debug/UnityEngine.CoreModule.dll | ||
/Users/haslam/Projects/LRTF/LRTF/bin/Debug/UnityEngine.dll | ||
/Users/haslam/Projects/LRTF/LRTF/bin/Debug/UnityEngine.PhysicsModule.dll | ||
/Users/haslam/Projects/LRTF/LRTF/bin/Debug/UnityEngine.UI.dll | ||
/Users/haslam/Projects/LRTF/LRTF/bin/Debug/UnityEngine.AnimationModule.dll | ||
/Users/haslam/Projects/LRTF/LRTF/bin/Debug/UnityEngine.IMGUIModule.dll | ||
/Users/haslam/Projects/LRTF/LRTF/bin/Debug/UnityEngine.UnityWebRequestModule.dll | ||
/Users/haslam/Projects/LRTF/LRTF/bin/Debug/UnityEngine.TextRenderingModule.dll | ||
/Users/haslam/Projects/LRTF/LRTF/bin/Debug/UnityEngine.UIModule.dll | ||
/Users/haslam/Projects/LRTF/LRTF/bin/Debug/UnityEngine.InputLegacyModule.dll | ||
/Users/haslam/Projects/LRTF/LRTF/bin/Debug/UnityEngine.JSONSerializeModule.dll | ||
/Users/haslam/Projects/LRTF/LRTF/obj/Debug/LRTF.csproj.AssemblyReference.cache | ||
/Users/haslam/Projects/LRTF/LRTF/obj/Debug/LRTF.csproj.CoreCompileInputs.cache | ||
/Users/haslam/Projects/LRTF/LRTF/obj/Debug/LRTF.csproj.CopyComplete | ||
/Users/haslam/Projects/LRTF/LRTF/obj/Debug/LRTF.dll | ||
/Users/haslam/Projects/LRTF/LRTF/obj/Debug/LRTF.pdb | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/bin/Debug/LRTF.dll | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/bin/Debug/LRTF.pdb | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/bin/Debug/Assembly-CSharp-firstpass.dll | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/bin/Debug/Assembly-CSharp.dll | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/bin/Debug/TestFlightAPI.dll | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/bin/Debug/TestFlightCore.dll | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/bin/Debug/UnityEngine.CoreModule.dll | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/bin/Debug/UnityEngine.dll | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/bin/Debug/UnityEngine.UI.dll | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/bin/Debug/UnityEngine.IMGUIModule.dll | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/bin/Debug/UnityEngine.PhysicsModule.dll | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/bin/Debug/UnityEngine.UIModule.dll | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/bin/Debug/UnityEngine.InputLegacyModule.dll | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/bin/Debug/UnityEngine.AnimationModule.dll | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/bin/Debug/UnityEngine.UnityWebRequestModule.dll | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/bin/Debug/UnityEngine.TextRenderingModule.dll | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/bin/Debug/UnityEngine.JSONSerializeModule.dll | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/obj/Debug/LRTF.csproj.CoreCompileInputs.cache | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/obj/Debug/LRTF.csproj.CopyComplete | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/obj/Debug/LRTF.dll | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/obj/Debug/LRTF.pdb | ||
/Users/haslam/Google Drive/kerbal/LRTF/LRTF/obj/Debug/LRTF.csproj.AssemblyReference.cache |
Binary file not shown.
Binary file not shown.