예제 #1
0
 def __init__(self, *args, **kwargs):
     super(DeviceDialog,self).__init__(*args, **kwargs)
     ui.load('devicedialog.ui', self)
     self._nodes = {}
     for domain in redhawk.scan():
         self.domainNameEdit.addItem(domain)
     self.nodeListWidget.itemDoubleClicked.connect(self.onTreeWidgetItemDoubleClicked)
예제 #2
0
 def __init__(self, *args, **kwargs):
     super(DeviceDialog, self).__init__(*args, **kwargs)
     ui.load('devicedialog.ui', self)
     for domain in redhawk.scan():
         self.domainNameEdit.addItem(domain)
     self.nodeTreeWidget.itemDoubleClicked.connect(
         self.onTreeWidgetItemDoubleClicked)
예제 #3
0
    def __init__(self, *args, **kwargs):
        super(CommandWidget,self).__init__(*args, **kwargs)
        ui.load('commandwidget.ui', self)

        self._process = QtCore.QProcess(self)
        QtCore.QObject.connect(self._process, QtCore.SIGNAL('readyReadStandardOutput()'), self.readStandardOutput)
        QtCore.QObject.connect(self._process, QtCore.SIGNAL('readyReadStandardError()'), self.readStandardError)
        QtCore.QObject.connect(self._process, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.processExited)
        QtCore.QObject.connect(self._process, QtCore.SIGNAL('stateChanged(QProcess::ProcessState)'), self.processStateChanged)
예제 #4
0
    def __init__(self, sdrroot, *args, **kwargs):
        super(LauncherWindow,self).__init__(*args, **kwargs)
        ui.load('launcherwindow.ui', self)

        self._sdrroot = sdrroot
        dmdfile = os.path.join(self._sdrroot, 'dom/domain/DomainManager.dmd.xml')
        if os.path.exists(dmdfile):
            dom = dmd.parse(dmdfile)
            self._defaultDomain = dom.get_name()
        else:
            self._defaultDomain = 'REDHAWK_DEV'
예제 #5
0
    def __init__(self, *args, **kwargs):
        super(CommandWidget, self).__init__(*args, **kwargs)
        ui.load("commandwidget.ui", self)

        self._process = QtCore.QProcess(self)
        QtCore.QObject.connect(self._process, QtCore.SIGNAL("readyReadStandardOutput()"), self.readStandardOutput)
        QtCore.QObject.connect(self._process, QtCore.SIGNAL("readyReadStandardError()"), self.readStandardError)
        QtCore.QObject.connect(self._process, QtCore.SIGNAL("finished(int,QProcess::ExitStatus)"), self.processExited)
        QtCore.QObject.connect(
            self._process, QtCore.SIGNAL("stateChanged(QProcess::ProcessState)"), self.processStateChanged
        )
예제 #6
0
    def __init__(self, sdrroot, *args, **kwargs):
        super(LauncherWindow,self).__init__(*args, **kwargs)
        ui.load('launcherwindow.ui', self)

        self._sdrroot = sdrroot
        dmdfile = os.path.join(self._sdrroot, 'dom/domain/DomainManager.dmd.xml')
        if os.path.exists(dmdfile):
            dom = dmd.parse(dmdfile)
            self._defaultDomain = dom.get_name()
        else:
            self._defaultDomain = 'REDHAWK_DEV'
예제 #7
0
def step_1(s):
    """Move the robot"""
    s.ui.filename = lvl_directory+"/level1"
    s = ui.load(s)
    s = ui.wild(s)
    s.ui.log_text = ""
    s.ui.story_text = """Neither bob nor the red robot can go through white rocks."""
    s.ui.obj_text = "Make the red robot go into the trap"
    return s
예제 #8
0
def step_1(s):
    """Move the robot"""
    s.ui.filename = lvl_directory+"/level2"
    s = ui.load(s)
    s = ui.wild(s)
    s.ui.log_text = ""
    s.ui.story_text = """This is slightly more challenging than the tutorial.
For a real challenge try to train bob with only two crystals."""
    s.ui.obj_text = "Make the red robot go into the trap"
    return s
예제 #9
0
def step_1(s):
    """Move the robot"""
    s.ui.filename = lvl_directory+"/level3"
    s = ui.load(s)
    s = ui.wild(s)
    s.ui.log_text = ""
    s.ui.story_text = """It is impossible to lose on that level. Try to win by
outsmarting the red robot,
and not by making it step through a long random walk."""
    s.ui.obj_text = "Make the red robot go into the trap"
    return s
예제 #10
0
    def __init__(self, *args, **kwargs):

        self.sftp_client = dict()

        self.centerwidget, self.rightwidget, self.leftwidget = ui.load()

        # INIT FORMS
        self.computationForm = None
        self._detectorForm = None
        self._scatteringForm = None

        # SETUP FEATURES
        featuremanager.layout = ui.leftwidget.featuresList
        featuremanager.load()

        # INIT EXPERIMENT
        self.newExperiment()

        # WIREUP CONTROLS
        self.leftwidget.addFeatureButton.clicked.connect(
            featuremanager.addLayer)
        self.leftwidget.addSubstrateButton.clicked.connect(
            featuremanager.addSubstrate)
        self.leftwidget.addParticleButton.clicked.connect(
            featuremanager.addParticle)
        #self.leftwidget.showComputationButton.clicked.connect(self.showComputation)
        self.leftwidget.showDetectorButton.clicked.connect(self.showDetector)
        self.leftwidget.addParticleButton.setMenu(ui.particlemenu)
        self.leftwidget.save.clicked.connect(self.save)
        self.leftwidget.load.clicked.connect(self.load)

        # RUN MENU
        self.runmenu = QtGui.QMenu()
        self.runmenu.addAction(QtGui.QIcon('xicam/gui/icons_34.png'),
                               "Run Local", self.runLocal)
        self.runmenu.addAction(QtGui.QIcon('xicam/gui/icons_40.png'),
                               "Run Remote", self.runRemote)
        self.runmenu.addAction(QtGui.QIcon('xicam/gui/icons_41.png'),
                               "Run Dask", self.runDask)
        self.leftwidget.run.setMenu(self.runmenu)
        self.leftwidget.run.clicked.connect(self.runLocal)

        # inject loginwidget
        from xicam.widgets import login
        self.loginwidget = login.LoginDialog()
        self.leftwidget.layout().addWidget(self.loginwidget)

        # SETUP DISPLAY
        display.load()
        display.redraw()
        self.centerwidget.addWidget(display.viewWidget)

        super(HipGISAXSPlugin, self).__init__(*args, **kwargs)
예제 #11
0
def enter():
    gfw.world.init([
        'bg', 'tile', 'object', 'score_object', 'monster', 'whip', 'player',
        'effect', 'ui'
    ])
    global player, bg, player_ui, main_bgm, black_canvas, black_pos

    bg = HorzScrollBackground('Background.png')
    gfw.world.add(gfw.layer.bg, bg)

    ui.load()
    objects.load()
    monster.load()
    tile.load()
    camera.camera_init()

    (e_x, e_y), (o_x, o_y) = all_stage_gen.make_all_map()
    e_x, e_y, o_x, o_y = change_to_screen(e_x, e_y, o_x, o_y)
    player = Player((e_x + 32, e_y + 32))
    gfw.world.add(gfw.layer.player, player)

    clear_in_out(e_x, e_y, o_x, o_y)

    player_ui = ui.Ui(player)
    gfw.world.add(gfw.layer.ui, player_ui)

    black_canvas = gfw.image.load('res/black.png')
    black_pos = 0, get_canvas_height() + 600

    main_bgm = load_music('res/stage_bgm.mp3')
    main_bgm.set_volume(10)
    main_bgm.repeat_play()

    global fade_in_sound, fade_out_sound
    fade_in_sound = load_wav('res/wav/fadein.wav')
    fade_out_sound = load_wav('res/wav/fadein.wav')
예제 #12
0
def step_1(s):
    """Move the robot"""
    s.ui.filename = lvl_directory+"/tutorial"
    s = ui.load(s)
    s = ui.lab(s)
    s.ui.active = ui.ALL_INACTIVE
    s.ui.active["editor_wild_lab_terrain"] = True
    s.ui.active["lab_wild_quit"] = True
    s.ui.active.update({k: True for k in ui.ALL_INACTIVE
                        if "_text" in k})
    s.ui.log_text = ""
    s.ui.story_text = """This is your lab.
The blue robot is a test robot.
His name is Bob.
You can control its position."""
    s.ui.obj_text = "Click on the green patch to move the robot there."
    s.obj_func = lambda s: s.lab[6, 8] % 1000 == 201
    s.next_func = step_2
    return s
예제 #13
0
import sys
import ui

castle.shuffle()
#desc.desc()
#castle.init_castle()
playing = True
current = castle.rooms[8]
counter = 0

# Something analogous to a 'menu screen'
print "Load previous game?"

var = raw_input("> ")
if (var and var[0].lower() == 'y'):
    current = castle.find_room(ui.load().name)

else:
    castle.init_npcs()
    while (not current):
        print "Where are you?"
        var = raw_input("> ")
        current = castle.find_room(var)

print ""
print "       - ---=<0>=--- -"
print "Welcome to Whitecliff Castle!"
print "       - ---=====--- -"

print ""
print ""
예제 #14
0
 def __init__(self, *args, **kwargs):
     super(DomainDialog, self).__init__(*args, **kwargs)
     ui.load('domaindialog.ui', self)
예제 #15
0
import ui
from companies import Companies
from models import Models
companies = Companies()
models = Models()
companies = ui.load("companies.pkl")
models = ui.load("models.pkl")
if not companies:
    companies = Companies()
if not models:
    models = Models()
key = 0
while not key == 9:
    ui.clear()
    ui.print_menu()
    key = ui.getKey("Please, input the number you would like to choose: ")
    ui.clear()
    try:
        if key == 0:
            ui.showCompanies(companies)
        elif key == 1:
            ui.showModels(models)
        elif key == 2:
            if ui.addCompany(companies):
                print "Company successfully added"
        elif key == 3:
            if ui.addModel(companies, models):
                print "Model successfully added"
        elif key == 4:
            if ui.deleteCompany(companies, models):
                print "Company successfully deleted"