public static PIDErrorController GetSAS(this SASList id, SurfSAS instance) { return(instance.SASControllers[(int)id]); }
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(); }
public static void UpdateSSASPreset(SurfSAS instance) { Instance.activeSSASPreset.Update(instance.SASControllers); saveToFile(); }
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); }