|
@@ -1,9 +1,22 @@
|
1
|
1
|
import krpc
|
2
|
2
|
|
3
|
|
-connected = False
|
|
3
|
+class wire:
|
|
4
|
+ """Functions over the top of the krpc api
|
|
5
|
+ """
|
4
|
6
|
|
|
7
|
+ def __init__(self, name = "Fly by wire", address = krpc.DEFAULT_ADDRESS, rpc = krpc.DEFAULT_RPC_PORT,
|
|
8
|
+ stream = krpc.DEFAULT_STREAM_PORT):
|
|
9
|
+ self._address = address
|
|
10
|
+ self._rpc_port = rpc
|
|
11
|
+ self._stream_port = stream
|
|
12
|
+ self._name = name
|
|
13
|
+ self._conn = krpc.connect(self.name, self._address, self._rpc_port,
|
|
14
|
+ self._stream_port)
|
|
15
|
+
|
|
16
|
+ def name(self):
|
|
17
|
+ return self._name
|
|
18
|
+
|
|
19
|
+ def close():
|
|
20
|
+ self._conn.close()
|
5
|
21
|
|
6
|
22
|
|
7
|
|
-def init(remote = "localhost"):
|
8
|
|
- global conn = krpc.connect("Fly by Wire", remote)
|
9
|
|
- global vessel = conn.
|