def __init__(self): QMainWindow.__init__(self) self.setupUi(self) self.recipeModel = recipeModel.Model(self.recipeTable) self.instructionModel = instructionModel.Model(self.instructionTable) self.windowManager = WindowManager(self.windowsMenu) self.recipe_manager = RecipeManager("kitchenModel_1.5.pck") self.recipeBrowser = recipeBrowser.MainWindow(self.recipe_manager) self.recipeBrowser.show() self.windowManager.addWindow(self.recipeBrowser) self.costFunctionBrowser = costFunctionBrowser.MainWindow( [0, 10, 0, 10], self.recipe_manager.task_planner) self.costFunctionBrowser.save_state_tree = True self.costFunctionBrowser.allow_null_action = False self.windowManager.addWindow(self.costFunctionBrowser) self.connect( self.recipeTable.selectionModel(), SIGNAL("selectionChanged ( QItemSelection, QItemSelection )"), self.selectRecipe) self.connect(self.sendInstructionButton, SIGNAL("clicked()"), self.sendInstruction) self.connect(self.sendRecipeButton, SIGNAL("clicked()"), self.sendRecipe)
def initialize(): global app global cfb if app != None: return app = basewindow.makeApp() state, am = waverly_state_truck() if cfb and state == cfb.state: return tp = nodeSearch.BeamSearch(CostFnCrf.from_mallet( "%s/tools/crf_training/models/crf_discrete_forklift_1.5.pck" % SLU_HOME), useRrt=False) cfb = costFunctionBrowser.MainWindow([10, 40, 10, 40], tp, show_gui=False) print 'updating state' cfb.setState(state) #parameters cfb.beamWidthBox.setValue(2) cfb.seqBeamWidthBox.setValue(10) cfb.searchDepthBox.setValue(3) cfb.selectEsdcExtractor() print 'starting tests'
def __init__(self): QMainWindow.__init__(self) self.setupUi(self) self.recipeModel = recipeModel.Model(self.recipeTable) self.instructionModel = instructionModel.Model(self.instructionTable) self.inferredInstructionModel = inferredInstructionModel.Model( self.inferredTable) #self.modeManager = WindowManager(self.modeMenu) self.recipe_manager = RecipeManager("kitchenModel_1.5.pck") ## self.recipeBrowser = recipeBrowser.MainWindow(self.recipe_manager) ## self.recipeBrowser.show() ## self.windowManager.addWindow(self.recipeBrowser) self.costFunctionBrowser = costFunctionBrowser.MainWindow( [0, 10, 0, 10], self.recipe_manager.task_planner) self.costFunctionBrowser.save_state_tree = True self.costFunctionBrowser.allow_null_action = False #self.windowManager.addWindow(self.costFunctionBrowser) self.ev = evaluatorGui.Evaluator() #TODO: Set title based on mode self.setWindowTitle( "Recipe Evaluation Browser - Instruction Level Mode") self.connect( self.recipeTable.selectionModel(), SIGNAL("selectionChanged ( QItemSelection, QItemSelection )"), self.selectRecipe) self.connect( self.instructionTable.selectionModel(), SIGNAL("selectionChanged ( QItemSelection, QItemSelection )"), self.selectInstruction)
def __init__(self, model): QMainWindow.__init__(self) self.setupUi(self) self.windowManager = WindowManager(self.windowsMenu) self.taskPlanner = nodeSearch.BeamSearch( cf.CostFnCrf.from_mallet(model)) self.cfBrowser = costFunctionBrowser.MainWindow( limits=[10, 40, 10, 40], taskPlanner=self.taskPlanner, initialState=False) self.cfBrowser.setWindowTitle( str(self.cfBrowser.windowTitle()) + " (Evaluation Results Browser)") self.windowManager.addWindow(self.cfBrowser) self.nodeFeatureWeights = nodeFeatureWeights.MainWindow() self.gggBrowser = gggBrowser.MainWindow() self.gggBrowser.setWindowTitle(self.gggBrowser.windowTitle() + " (Evaluation Results Browser)") self.windowManager.addWindow(self.gggBrowser) self.contextWindow = context3d.MainWindow() self.contextWindow.setWindowTitle(self.contextWindow.windowTitle() + " - Annotation") self.windowManager.addWindow(self.contextWindow) self.contextWindowInferred = context3d.MainWindow() self.contextWindowInferred.setWindowTitle( self.contextWindow.windowTitle() + " - Inferred") self.windowManager.addWindow(self.contextWindowInferred) self.original_commands_fname = None self.figure = mpl.figure() self.axes = self.figure.gca() self.limits = [10, 40, 10, 40] self.restoreLimits() self.figure.canvas.mpl_connect('draw_event', self.updateLimits) self.resultsModel = resultsModel.Model(self.resultsTable) self.resultListModel = resultsModel.Model(self.resultListTable) self.nodeResultsModel = nodeResultsModel.Model(self.nodeResultsTable) self.model = None self.dataset = None self.connect( self.resultsTable.selectionModel(), SIGNAL("selectionChanged ( QItemSelection, QItemSelection )"), self.selectResult) self.connect( self.nodeResultsTable.selectionModel(), SIGNAL("selectionChanged ( QItemSelection, QItemSelection )"), self.selectNodeResult) self.connect(self.sendToCfbButton, SIGNAL("clicked()"), self.sendToCfb) self.connect(self.recomputeEntropyButton, SIGNAL("clicked()"), self.recomputeEntropy) self.connect(self.saveNodeResultsButton, SIGNAL("clicked()"), self.saveNodeResults) self.connect(self.plotEntropyButton, SIGNAL("clicked()"), self.plotEntropy) self.connect(self.sendToCfbNodeButton, SIGNAL("clicked()"), self.sendToCfbNode) self.connect(self.esdcFilter, SIGNAL("editingFinished()"), self.filterEsdcs) self.connect(self.nodeFilter, SIGNAL("editingFinished()"), self.filterNodes) print "adding export button" self.connect(self.exportResultsButton, SIGNAL("clicked()"), self.sendToClipboard) print "adding export button" self.connect(self.exportNodeResultsButton, SIGNAL("clicked()"), self.sendToClipboardNodeResults) self.filterEsdcs() self.filterNodes() self.resultsTable.selectRow(0) signal.signal(signal.SIGINT, lambda *s: self.cleanup())