Esempio n. 1
0
        //internal double Fuel;

        internal VesselDataClass(Vessel v)
        {
            name        = v.name;
            id          = v.id;
            persistence = HighLogic.SaveFolder;
            string CatalogueCode = v.vesselType.ToString().Substring(0, 1) + v.GetInstanceID().ToString();

            code              = CatalogueCode;
            Mass              = v.GetCorrectVesselMass() * 1000;
            Area              = v.CalculateVesselArea();
            ReferenceBody     = v.orbitDriver.orbit.referenceBody;
            ReferenceBodyName = v.orbitDriver.orbit.referenceBody.GetName();

            SMA = v.GetOrbitDriver().orbit.semiMajorAxis;
            ECC = v.GetOrbitDriver().orbit.eccentricity;
            INC = v.GetOrbitDriver().orbit.inclination;
            EPH = v.GetOrbitDriver().orbit.epoch;
            LAN = v.GetOrbitDriver().orbit.LAN;
            MNA = v.GetOrbitDriver().orbit.meanAnomalyAtEpoch;
            LPE = v.GetOrbitDriver().orbit.argumentOfPeriapsis;

            // Fuel = ???;
        }
Esempio n. 2
0
        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
        }