diff --git a/vn.rpc/testClient.py b/vn.rpc/testClient.py index 6df0305f..e613cad5 100644 --- a/vn.rpc/testClient.py +++ b/vn.rpc/testClient.py @@ -25,7 +25,7 @@ if __name__ == '__main__': subAddress = 'tcp://localhost:0602' tc = TestClient(reqAddress, subAddress) - tc.subscribe('') + tc.subscribeTopic('') tc.start() while 1: diff --git a/vn.rpc/vnrpc.py b/vn.rpc/vnrpc.py index f95d0597..7cda51f5 100644 --- a/vn.rpc/vnrpc.py +++ b/vn.rpc/vnrpc.py @@ -281,7 +281,7 @@ class RpcClient(RpcObject): raise NotImplementedError #---------------------------------------------------------------------- - def subscribe(self, topic): + def subscribeTopic(self, topic): """ 订阅特定主题的广播数据 diff --git a/vn.trader/uiMainWindow.py b/vn.trader/uiMainWindow.py index 09aa651e..de1514f1 100644 --- a/vn.trader/uiMainWindow.py +++ b/vn.trader/uiMainWindow.py @@ -132,34 +132,36 @@ class MainWindow(QtGui.QMainWindow): menubar = self.menuBar() # 设计为只显示存在的接口 + l = self.mainEngine.getAllGatewayNames() + sysMenu = menubar.addMenu(u'系统') - if 'CTP' in self.mainEngine.gatewayDict: + if 'CTP' in l: sysMenu.addAction(connectCtpAction) - if 'LTS' in self.mainEngine.gatewayDict: + if 'LTS' in l: sysMenu.addAction(connectLtsAction) - if 'FEMAS' in self.mainEngine.gatewayDict: + if 'FEMAS' in l: sysMenu.addAction(connectFemasAction) - if 'XSPEED' in self.mainEngine.gatewayDict: + if 'XSPEED' in l: sysMenu.addAction(connectXspeedAction) - if 'QDP' in self.mainEngine.gatewayDict: + if 'QDP' in l: sysMenu.addAction(connectQdpAction) - if 'KSOTP' in self.mainEngine.gatewayDict: + if 'KSOTP' in l: sysMenu.addAction(connectKsotpAction) - if 'KSGOLD' in self.mainEngine.gatewayDict: + if 'KSGOLD' in l: sysMenu.addAction(connectKsgoldAction) - if 'SGIT' in self.mainEngine.gatewayDict: + if 'SGIT' in l: sysMenu.addAction(connectSgitAction) sysMenu.addSeparator() - if 'IB' in self.mainEngine.gatewayDict: + if 'IB' in l: sysMenu.addAction(connectIbAction) - if 'SHZD' in self.mainEngine.gatewayDict: + if 'SHZD' in l: sysMenu.addAction(connectShzdAction) - if 'OANDA' in self.mainEngine.gatewayDict: + if 'OANDA' in l: sysMenu.addAction(connectOandaAction) - if 'OKCOIN' in self.mainEngine.gatewayDict: + if 'OKCOIN' in l: sysMenu.addAction(connectOkcoinAction) sysMenu.addSeparator() - if 'Wind' in self.mainEngine.gatewayDict: + if 'Wind' in l: sysMenu.addAction(connectWindAction) sysMenu.addSeparator() sysMenu.addAction(connectDbAction)