Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

now gathers zero science experiments if and only if there is a scient… #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions ForScience/ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
v 1.5.1 - KSP v1.3 support
- Performance improvements

v 1.5.0 - KSP v1.3 support
- Fixed signature for GetExperimentSubject

v 1.4.1 - KSP v1.2 Support
- Fixed ScienceData signature

v 1.4 - Bugfixapaloosa
- Fixed surface sample being improperly run without the correct unlocks in career
- Fixed for probe shenanigan.
- Removed the now unnecessary biome detection throttling.
- Fixed an issue where the button (color) could get out of sync with the logic state
- Fixed an issue with switching to other vessels in range.
- Fixed an issue with flickering buttons on probes and when a vessel is destroyed

v 1.3 - Support for KSP v 1.1
- Fixed an issue with experiments running before the vessel was fully loaded.

v 1.2 - Science value filtering adjustment
- Increased the minimum value to run an experiment to .1 science.

v 1.1 - EVA science support
- Science will be automaticly gathered while EVA.

v 1.0 - Release Version!
- Reset goo/scijr when scientist is onboard
- Much improved biome detection and throttling.
- Suppressed (actually bypassed altogether) experiment result windows
- Suppressed duplicate results.
- consolidated data on docking.
- Many code improvements

v 0.24.2-1 Bug fixes
- Science mode support
- Disabled when no science container is found. (temporary)

v 0.24-1 - Experiment Filtering
- Experiments without available science will no longer run automatically. (Usually.)
- Plugin and window are disabled in sandbox mode.

v 0.23.5-2 - Experiment Automation

- Experiments will now run automatically when enabled.

v0.23.5-1 - Initial WIP release.

- Automatic science container selection.
- Automatic science experiment collection.
- Temporary user interface to toggle automatic science data collection
Binary file added ForScience/Icons/FS_active.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ForScience/Icons/FS_inactive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ForScience/Plugins/ForScience.dll
Binary file not shown.
34 changes: 34 additions & 0 deletions ForScience/Plugins/ForScience.dll.CodeAnalysisLog.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="c:\program files (x86)\microsoft visual studio\2017\community\team tools\static analysis tools\fxcop\Xml\CodeAnalysisReport.xsl"?>
<FxCopReport Version="15.0">
<Localized>
<String Key="Category">Category</String>
<String Key="Certainty">Certainty</String>
<String Key="CollapseAll">Collapse All</String>
<String Key="CheckId">Check Id</String>
<String Key="Error">Error</String>
<String Key="Errors">error(s)</String>
<String Key="ExpandAll">Expand All</String>
<String Key="Help">Help</String>
<String Key="Line">Line</String>
<String Key="Messages">message(s)</String>
<String Key="LocationNotStoredInPdb">[Location not stored in Pdb]</String>
<String Key="Project">Project</String>
<String Key="Resolution">Resolution</String>
<String Key="Rule">Rule</String>
<String Key="RuleFile">Rule File</String>
<String Key="RuleDescription">Rule Description</String>
<String Key="Source">Source</String>
<String Key="Status">Status</String>
<String Key="Target">Target</String>
<String Key="Warning">Warning</String>
<String Key="Warnings">warning(s)</String>
<String Key="ReportTitle">Code Analysis Report</String>
</Localized>
<Exceptions>
<Exception Keyword="CA0068" Kind="Engine" TreatAsWarning="True">
<Type>Microsoft.FxCop.Sdk.FxCopException</Type>
<ExceptionMessage>Debug information could not be found for target assembly 'ForScience.dll'. For best analysis results, include the .pdb file with debug information for 'ForScience.dll' in the same directory as the target assembly.</ExceptionMessage>
</Exception>
</Exceptions>
</FxCopReport>
18 changes: 11 additions & 7 deletions Source/ForScience.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,21 @@ void TransferScience() // automaticlly find, transer and consolidate science dat
Debug.Log("[ForScience!] Skipping: Experiment is not available for this situation/atmosphere.");

}
else if (CurrentScienceValue(currentExperiment) < 0.1) // this experiment has no more value so we skip it
// TODO - Science Labs can use zero value science , so do not skip it if there is a lab on board
// as a temporary workaround, if there is a scientist on board it will still gather the data.

else if (CurrentScienceValue(currentExperiment) >= 0.1 || IsScientistOnBoard())
{

Debug.Log("[ForScience!] Skipping: No more science is available: ");
Debug.Log("[ForScience!] Running experiment: " + CurrentScienceSubject(currentExperiment.experiment).id);

//manually add data to avoid deployexperiment state issues
ActiveContainer().AddData(NewScienceData(currentExperiment));

}
else
else // this experiment has no more value so we skip it
{
Debug.Log("[ForScience!] Running experiment: " + CurrentScienceSubject(currentExperiment.experiment).id);

ActiveContainer().AddData(NewScienceData(currentExperiment)); //manually add data to avoid deployexperiment state issues
Debug.Log("[ForScience!] Skipping: No more science is available: ");
}

}
Expand Down Expand Up @@ -265,4 +269,4 @@ List<ModuleScienceContainer> GetContainerList() // a list of all science contain
else return GameDatabase.Instance.GetTexture("ForScience/Icons/FS_inactive", false);
}
}
}
}