// analyze a sample static void Analyze(Vessel v, string filename, double amount) { // get vessel drive Drive drive = DB.Vessel(v).drive; // get sample Sample sample = drive.samples[filename]; // analyze, and produce data amount = Math.Min(amount, sample.size); bool completed = amount >= sample.size - double.Epsilon; drive.Delete_Sample(filename, amount); drive.Record_File(filename, amount); // if the analysis is completed if (completed) { // inform the user Message.Post ( Lib.BuildString("<color=cyan><b>ANALYSIS COMPLETED</b></color>\nOur laboratory on <b>", v.vesselName, "</b> analyzed <b>", Science.Experiment(filename).name, "</b>"), "The results can be transmitted now" ); // record landmark event if (!Lib.Landed(v)) { DB.landmarks.space_analysis = true; } } }
public void DumpData(ScienceData data) { // get drive Drive drive = DB.Vessel(vessel).drive; // if not the preferred drive if (drive.location != part.flightID) { return; } // remove the data if (data.baseTransmitValue > float.Epsilon || data.transmitBonus > double.Epsilon) { drive.Delete_File(data.subjectID, data.dataAmount); } else { drive.Delete_Sample(data.subjectID, data.dataAmount); } }