Ejemplo n.º 1
0
 public static PIDErrorController GetSAS(this SASList id, SurfSAS instance)
 {
     return(instance.SASControllers[(int)id]);
 }
Ejemplo n.º 2
0
        public static void loadSSASPreset(SSASPreset p, SurfSAS instance)
        {
            PIDErrorController[] c = instance.SASControllers;

            foreach (SASList s in Enum.GetValues(typeof(SASList)))
            {
                c[(int)s].PGain = p.PIDGains[(int)s, 0];
                c[(int)s].IGain = p.PIDGains[(int)s, 1];
                c[(int)s].DGain = p.PIDGains[(int)s, 2];
                c[(int)s].Scalar = p.PIDGains[(int)s, 3];
            }

            Instance.activeSSASPreset = p;

            if (Instance.activeSSASPreset != Instance.craftPresetDict[craftDefaultName].SSASPreset)
                updateCraftPreset(p, instance.vesModule.vesselRef);
            saveToFile();
        }
Ejemplo n.º 3
0
 public static void UpdateSSASPreset(SurfSAS instance)
 {
     Instance.activeSSASPreset.Update(instance.SASControllers);
     saveToFile();
 }
Ejemplo n.º 4
0
 public static void loadCraftSSASPreset(SurfSAS instance)
 {
     if (Instance.craftPresetDict.ContainsKey(FlightGlobals.ActiveVessel.vesselName) && !ReferenceEquals(Instance.craftPresetDict[FlightGlobals.ActiveVessel.vesselName].SSASPreset, null))
         loadSSASPreset(Instance.craftPresetDict[FlightGlobals.ActiveVessel.vesselName].SSASPreset, instance);
     else
         loadSSASPreset(Instance.craftPresetDict[craftDefaultName].SSASPreset, instance);
 }