outcome_tool.py
Go to the documentation of this file.
00001 import tool_utils as tu
00002 from PyQt4.QtGui import *
00003 from PyQt4.QtCore import *
00004 
00005 
00006 #class EmptyState(tu.StateBase):
00007 
00008     #def __getstate__(self):
00009     #    state = tu.StateBase.__getstate__(self)
00010     #    my_state = [self.temporary]
00011     #    return {'parent_state': state, 'self': my_state}
00012 
00013     #def __setstate__(self, state):
00014     #    tu.StateBase.__setstate__(self, state['parent_state'])
00015     #    self.temporary = state['self'][0]
00016 
00017 class OutcomeTool(tu.ToolBase):
00018 
00019     def __init__(self, button, rcommander):
00020         tu.ToolBase.__init__(self, rcommander, tu.EmptyState.TOOL_NAME, 'Add Outcome', tu.EmptyState)
00021         self.button = button
00022         self.rcommander.connect(self.button, SIGNAL('clicked()'), self.activate_cb)
00023 
00024     def activate_cb(self, loaded_node_name=None):
00025         tu.ToolBase.activate_cb(self, loaded_node_name)
00026         self.outcome_mode()
00027 
00028     def outcome_mode(self):
00029         cidx = self.rcommander.ui.node_settings_tabs.indexOf(self.rcommander.ui.connections_tab)
00030         self.rcommander.ui.node_settings_tabs.setCurrentIndex(cidx)
00031         self.rcommander.ui.run_button.setDisabled(True)
00032         self.rcommander.ui.reset_button.setDisabled(True)
00033 
00034     def new_node(self, name=None):
00035         if name == None:
00036             nname = self.name + str(self.counter)
00037         else:
00038             nname = name
00039         state = tu.EmptyState(nname, False) 
00040         return state
00041 
00042     def set_node_properties(self, node):
00043         self.rcommander.disable_buttons()
00044         self.outcome_mode()
00045 
00046     #Don't have any properties
00047     def fill_property_box(self, pbox):
00048         return
00049 
00050     #Can't reset
00051     def reset(self):
00052         return
00053 
00054     #Can't save
00055     def save(self):
00056         return
00057 
00058 #NavigateState setting state {'self': ['navigate1', [0.0, 0.0], 0.0, 'map'], 
00059 #                             'simple_state': ['navigate1', 'navigate', 
00060 #                                 {'preempted': PyQt4.QtCore.QString(u'preempted'), 'aborted': PyQt4.QtCore.QString(u'aborted'), 'succeeded': PyQt4.QtCore.QString(u'succeeded')}]}
00061 #    


rcommander
Author(s): Hai Nguyen (haidai@gmail.com)
autogenerated on Thu Nov 28 2013 11:46:34