public static void ClearVesselData(Vessel vessel) { VesselDataClass vdc; if (VesselInformationDict.TryGetValue(vessel.id, out vdc)) { VesselInformationDict.Remove(vessel.id); } else { Log.Info("Vessel not found: " + vessel.id); } #if false ConfigNode VesselNode = new ConfigNode("VESSEL"); bool found = false; foreach (ConfigNode node in VesselInformation.GetNodes("VESSEL")) { if (node.GetValue("id") == vessel.id.ToString()) { VesselNode = node; found = true; break; } } if (found) { VesselInformation.RemoveNode(VesselNode); } #endif }
public void UnitTest() { VesselInformation target = myVesselInformation; string expected = "A"; string actual; actual = target.Unit; Assert.AreEqual(expected, actual); }
public void TubeSheetNumberingTypeTest() { VesselInformation target = myVesselInformation; TubeSheetNumberType expected = TubeSheetNumberType.COORDINATE; TubeSheetNumberType actual; actual = target.TubeSheetNumberingType; Assert.AreEqual(expected, actual); }
public static void OnQuickLoad() // 1.5.3 quick load fixes { VesselInformationDict.Clear(); #if false File.ClearNodes(); VesselInformation.ClearNodes(); #endif print("WhitecatIndustries - Orbital Decay - Vessel Information lost OnQuickLoad"); }
public void PlantNameTest() { VesselInformation target = myVesselInformation; string expected = "Bruce_SG_A"; string actual; actual = target.PlantName; Assert.AreEqual(expected, actual); }
public void OutletVesselIDTest() { VesselInformation target = myVesselInformation; string expected = "XX"; string actual; actual = target.OutletVesselID; Assert.AreEqual(expected, actual); }
public void YDesignationTest() { VesselInformation target = myVesselInformation; string expected = "ROW"; string actual; actual = target.YDesignation; Assert.AreEqual(expected, actual); }
public void VesselTypeTest() { VesselInformation target = myVesselInformation; VesselType expected = VesselType.RECIRC; VesselType actual; actual = target.VesselType; Assert.AreEqual(expected, actual); }
public void MinimumTubeRadiusTest() { VesselInformation target = myVesselInformation; Decimal expected = 2.190000M; // TODO: Initialize to an appropriate value Decimal actual; actual = target.MinimumTubeRadius; Assert.AreEqual(expected, actual); }
public void InletRow1Col1LocationTest() { VesselInformation target = myVesselInformation; InletRow1Col1LocationType expected = InletRow1Col1LocationType.MANWAY; InletRow1Col1LocationType actual; actual = target.InletRow1Col1Location; Assert.AreEqual(expected, actual); }
public void InletChannelHeadTest() { VesselInformation target = myVesselInformation; ChannelHeadLocationType expected = ChannelHeadLocationType.LEFT; ChannelHeadLocationType actual; actual = target.InletChannelHead; Assert.AreEqual(expected, actual); }
public void ContractorTest() { VesselInformation target = myVesselInformation; string expected = string.Empty; string actual; actual = target.Contractor; Assert.AreEqual(expected, actual); }
public void YxXyNotationTest() { VesselInformation target = myVesselInformation; YxXyNotationType expected = YxXyNotationType.YX_NOTATION; YxXyNotationType actual; actual = target.YxXyNotation; Assert.AreEqual(expected, actual); }
public void BowlRadiusTest() { VesselInformation target = myVesselInformation; Decimal expected = 43.500999M; Decimal actual; actual = target.BowlRadius; Assert.AreEqual(expected, actual); }
public void UtilityNameTest() { VesselInformation target = myVesselInformation; string expected = string.Empty; string actual; actual = target.UtilityName; Assert.AreEqual(expected, actual); }
public void ModelNameTest() { VesselInformation target = myVesselInformation; string expected = "BGA_33110_SG"; string actual; actual = target.ModelName; Assert.AreEqual(expected, actual); }
public void VesselIDTypeTest() { VesselInformation target = myVesselInformation; VesselIDType expected = VesselIDType.SET_BY_RESULTS; VesselIDType actual; actual = target.VesselIDType; Assert.AreEqual(expected, actual); }
public void OutletCalNumberingTest() { VesselInformation target = myVesselInformation; CalNumberingType expected = CalNumberingType.BOTH; CalNumberingType actual; actual = target.OutletCalNumbering; Assert.AreEqual(expected, actual); }
public void ComponentDesignationTest() { VesselInformation target = myVesselInformation; string expected = "Component"; string actual; actual = target.ComponentDesignation; Assert.AreEqual(expected, actual); }
public void XDesignationTest() { VesselInformation target = myVesselInformation; string expected = "COL"; string actual; target.XDesignation = expected; actual = target.XDesignation; Assert.AreEqual(expected, actual); }
public void SectionsActiveTest() { VesselInformation target = myVesselInformation; bool expected = false; bool actual; target.SectionsActive = expected; actual = target.SectionsActive; Assert.AreEqual(expected, actual); }
public static bool CheckIfContained(Vessel vessel) { bool Contained = false; foreach (ConfigNode node in VesselInformation.GetNodes("VESSEL")) { if (node.GetValue("id") == vessel.id.ToString()) { Contained = true; } } return(Contained); }
public void OnDestroy() { if (DecayManager.CheckSceneStateMain(HighLogic.LoadedScene)) { if (Planetarium.GetUniversalTime() == HighLogic.CurrentGame.UniversalTime || HighLogic.LoadedScene == GameScenes.FLIGHT) { print("WhitecatIndustries - Orbital Decay - Vessel Information saved. Ondestroy"); SaveVesselInformation(); #if false File.ClearNodes(); VesselInformation.Save(FilePath); // VesselInformation.ClearNodes(); #endif } } }
public static void UpdateActiveVesselData(Vessel vessel) { VesselDataClass vdc; if (VesselInformationDict.TryGetValue(vessel.id, out vdc)) { vdc.Mass = vessel.GetCorrectVesselMass() * 1000; vdc.Area = vessel.CalculateVesselArea(); } else { Log.Info("Vessel not found: " + vessel.id); } #if false ConfigNode VesselNode = new ConfigNode("VESSEL"); bool found = false; foreach (ConfigNode node in VesselInformation.GetNodes("VESSEL")) { if (node.GetValue("id") == vessel.id.ToString()) { VesselNode = node; found = true; break; } } if (found) { VesselNode.SetValue("Mass", (vessel.GetCorrectVesselMass() * 1000).ToString()); VesselNode.SetValue("Area", CalculateVesselArea(vessel).ToString()); } #endif }
public void VesselInformationConstructorTest() { VesselInformation target = new VesselInformation(); Assert.IsNotNull(target); }
public void MyTestInitialize() { myVesselInformation = XMLModelReader.ReadVesselInformationFromZetecModelFile("BGA-33110-SG.xml"); }