我正在使用设想工作,我想在处理程序中获得服务。在_tcp_send_changed
功能中我如何获得服务。在插件中有self.application.get_service(....)
但是在这里我怎样才能找到它们?
更新
这是我的看法
class MCLidarGUIView( HasTraits ):
traits_ui_view = View(
VGroup(
HGroup(
Item( 'lidar_list',
show_label = False,
editor = TabularEditor(
show_titles = False,
selected = 'selected',
editable = False,
multi_select = True,
adapter = LidarAdapter()
),
),
),
Item(
"lidars_command"
),
HGroup(
Item( 'handler.tcp_send',
show_label = False,
editor = ButtonEditor( label = "TCP:Send" )
),
)
),
id = 'forwind.lidarapi.giuview',
resizable = True,
handler = MCLidarActions()
)
lidar_list = [LidarObject( lidar_name = "No Connected Lidar" )]
lidars_command = ''
这是我的处理程序:
class MCLidarActions( Handler ):
tcp_send = Event
def object__updated_changed( self, info ):
print info;
pass;
def _tcp_send_changed( self ):
print( " info" )