public static void Main() { var connection = new KRPC.Client.Connection (address: IPAddress.Parse ("10.0.2.2")); var vessel = connection.SpaceCenter ().ActiveVessel; KRPC.Client.Tuple<double,double,double,double> q = vessel.Flight ().Rotation; Console.WriteLine (q.Item1 + "," + q.Item2 + "," + q.Item3 + "," + q.Item4); }
public static void Main() { var connection = new KRPC.Client.Connection(); var vessel = connection.SpaceCenter().ActiveVessel; KRPC.Client.Tuple <double, double, double> v = vessel.Flight().Prograde; Console.WriteLine(v.Item1 + "," + v.Item2 + "," + v.Item3); }
public static void Main() { var connection = new KRPC.Client.Connection (name: "Kerbal Alarm Clock Example", address: IPAddress.Parse ("10.0.2.2")); var kac = connection.KerbalAlarmClock (); var alarm = kac.CreateAlarm (AlarmType.Raw, "My New Alarm", connection.SpaceCenter ().UT + 10); alarm.Notes = "10 seconds have now passed since the alarm was created."; alarm.Action = AlarmAction.MessageOnly; }
public static void Main() { var connection = new KRPC.Client.Connection(); var vessel = connection.SpaceCenter().ActiveVessel; KRPC.Client.Tuple <double, double, double, double> q = vessel.Flight().Rotation; Console.WriteLine(q.Item1 + "," + q.Item2 + "," + q.Item3 + "," + q.Item4); }
public static void Main() { var connection = new KRPC.Client.Connection(name: "Kerbal Alarm Clock Example"); var kac = connection.KerbalAlarmClock(); var alarm = kac.CreateAlarm(AlarmType.Raw, "My New Alarm", connection.SpaceCenter().UT + 10); alarm.Notes = "10 seconds have now passed since the alarm was created."; alarm.Action = AlarmAction.MessageOnly; }
public static void Main() { var connection = new KRPC.Client.Connection (address: IPAddress.Parse ("10.0.2.2")); var vessel = connection.SpaceCenter ().ActiveVessel; var root = vessel.Parts.Root; var stack = new Stack<KRPC.Client.Tuple<Part,int>> (); stack.Push (new KRPC.Client.Tuple<Part,int> (root, 0)); while (stack.Count > 0) { var item = stack.Pop (); Part part = item.Item1; int depth = item.Item2; Console.WriteLine (new String (' ', depth) + part.Title); foreach (var child in part.Children) stack.Push (new KRPC.Client.Tuple<Part,int> (child, depth + 1)); } }
public static void Main() { var connection = new KRPC.Client.Connection (name: "InfernalRobotics Example", address: IPAddress.Parse ("10.0.2.2")); var ir = connection.InfernalRobotics (); var group = ir.ServoGroupWithName ("MyGroup"); if (group == null) { Console.WriteLine ("Group not found"); return; } foreach (var servo in group.Servos) Console.WriteLine (servo.Name + " " + servo.Position); group.MoveRight (); Thread.Sleep (1000); group.Stop (); }
public static void Main() { var connection = new KRPC.Client.Connection(); var vessel = connection.SpaceCenter().ActiveVessel; var root = vessel.Parts.Root; var stack = new Stack <KRPC.Client.Tuple <Part, int> > (); stack.Push(new KRPC.Client.Tuple <Part, int> (root, 0)); while (stack.Count > 0) { var item = stack.Pop(); Part part = item.Item1; int depth = item.Item2; Console.WriteLine(new String(' ', depth) + part.Title); foreach (var child in part.Children) { stack.Push(new KRPC.Client.Tuple <Part, int> (child, depth + 1)); } } }
public static void Main() { var connection = new KRPC.Client.Connection(name: "InfernalRobotics Example"); var ir = connection.InfernalRobotics(); var group = ir.ServoGroupWithName("MyGroup"); if (group == null) { Console.WriteLine("Group not found"); return; } foreach (var servo in group.Servos) { Console.WriteLine(servo.Name + " " + servo.Position); } group.MoveRight(); Thread.Sleep(1000); group.Stop(); }
public void setConnection(Connection con) { connection = con; hasConnection = true; }
public StreamCollection(Connection con) { connection = con; hasConnection = true; }
//private KRPC.Client.Connection connection; public void setConnection(KRPC.Client.Connection con) { //this.connection = con; }
private void Poll() { while (_shouldPoll) { try { UpdateFromRPC(_spaceCenter.ActiveVessel); } catch (Exception e) { _shouldPoll = false; _connection = null; _spaceCenter = null; Notifications.LastErrorMessage = string.Format("Error on update: {0}", e.Message); ConnectedAndViewsVisbilityChanged(); } Thread.Sleep(100); } }
public void SetConnectionAndStartPolling(KRPC.Client.Connection connection) { _connection = connection; _spaceCenter = _connection.SpaceCenter(); _shouldPoll = true; _pollingThread = new Thread(Poll); _pollingThread.Start(); ConnectedAndViewsVisbilityChanged(); }