Beispiel #1
0
 public KACAlarm(String NewName, double UT, AlarmTypeEnum atype, AlarmActions aAction)
     : this(UT)
 {
     Name         = NewName;
     TypeOfAlarm  = atype;
     this.Actions = aAction.Duplicate();
 }
Beispiel #2
0
 public KACAlarm(String NewName, double UT, AlarmTypeEnum atype, AlarmActionEnum aAction)
     : this(UT)
 {
     Name        = NewName;
     TypeOfAlarm = atype;
     AlarmAction = aAction;
 }
 public bool Equals(AlarmTypeEnum obj)
 {
     if ((object)obj == null)
     {
         return(false);
     }
     return(StringComparer.OrdinalIgnoreCase.Equals(this.Value, obj.Value));
 }
 public Result <string, string> CreateAlarm(string alarmType, string name, double UT)
 {
     if (createAlarmMethod == null)
     {
         return(Result.Err <string, string>("KerbalAlarmClock addon not available"));
     }
     try {
         AlarmTypeEnum newAlarmType = (AlarmTypeEnum)Enum.Parse(typeof(AlarmTypeEnum), alarmType);
         return(Result.Ok <string, string>((string)createAlarmMethod.Invoke(actualKAC, new object[] {
             (Int32)newAlarmType, name, UT
         })));
     } catch (ArgumentException) {
         return(Result.Err <string, string>($"Invalid alarm type {alarmType}"));
     }
 }
        /// <summary>
        /// Create a new Alarm
        /// </summary>
        /// <param name="AlarmType">What type of alarm are we creating</param>
        /// <param name="Name">Name of the Alarm for the display</param>
        /// <param name="UT">Universal Time for the alarm</param>
        /// <returns>ID of the newly created alarm</returns>
        public String CreateAlarm(AlarmTypeEnum AlarmType, String Name, Double UT)
        {
            // Is KaC Ready?
            if (!this.APIReady())
            {
                return(String.Empty);
            }

            var result = this.invoke(new System.Object[] { (Int32)AlarmType, Name, UT });

            if (result != null)
            {
                return((String)result);
            }
            return(String.Empty);
        }
Beispiel #6
0
 /// <summary>
 /// Create a new Alarm
 /// </summary>
 /// <param name="AlarmType">What type of alarm are we creating</param>
 /// <param name="Name">Name of the Alarm for the display</param>
 /// <param name="UT">Universal Time for the alarm</param>
 /// <returns>ID of the newly created alarm</returns>
 internal String CreateAlarm(AlarmTypeEnum AlarmType, String Name, Double UT)
 {
     return((String)CreateAlarmMethod.Invoke(actualKAC, new System.Object[] { (Int32)AlarmType, Name, UT }));
 }
Beispiel #7
0
 public KACAlarm(String vID, String NewName, String NewNotes, double UT, Double Margin, AlarmTypeEnum atype, AlarmActions aAction, ITargetable NewTarget)
     : this(vID, NewName, NewNotes, UT, Margin, atype, aAction)
 {
     //Set the ITargetable proerty
     TargetObject = NewTarget;
 }
Beispiel #8
0
 public KACAlarm(String vID, String NewName, String NewNotes, double UT, Double Margin, AlarmTypeEnum atype, AlarmActions aAction, KACXFerTarget NewTarget)
     : this(vID, NewName, NewNotes, UT, Margin, atype, aAction)
 {
     //Set target details
     XferOriginBodyName = NewTarget.Origin.bodyName;
     XferTargetBodyName = NewTarget.Target.bodyName;
 }
Beispiel #9
0
 public KACAlarm(String vID, String NewName, String NewNotes, double UT, Double Margin, AlarmTypeEnum atype, AlarmActions aAction, List <ManeuverNode> NewManeuvers)
     : this(vID, NewName, NewNotes, UT, Margin, atype, aAction)
 {
     //set maneuver node
     ManNodes = NewManeuvers;
 }
Beispiel #10
0
 public KACAlarm(String vID, String NewName, String NewNotes, double UT, Double Margin, AlarmTypeEnum atype, AlarmActions aAction)
     : this(vID, NewName, UT, atype, aAction)
 {
     Notes           = NewNotes;
     AlarmMarginSecs = Margin;
 }
Beispiel #11
0
 public KACAlarm(String vID, String NewName, double UT, AlarmTypeEnum atype, AlarmActions aAction)
     : this(NewName, UT, atype, aAction)
 {
     VesselID = vID;
 }
Beispiel #12
0
 /// <summary>
 /// Create a new Alarm
 /// </summary>
 /// <param name="AlarmType">What type of alarm are we creating</param>
 /// <param name="Name">Name of the Alarm for the display</param>
 /// <param name="UT">Universal Time for the alarm</param>
 /// <returns>ID of the newly created alarm</returns>
 internal string CreateAlarm(AlarmTypeEnum AlarmType, string Name, double UT)
 {
     return((string)CreateAlarmMethod.Invoke(actualKAC, new object[] { (int)AlarmType, Name, UT }));
 }