コード例 #1
0
    def _purgeFioFile(self):
        """
        purges the contents of, e.g., /<ScanDir>/<scanName>.fio
        """

        fioFile = "%s/%s.fio" % (self.scanDir, self.scanName)
        fioObj = HasyUtils.fioReader(fioFile)
        #
        # we must not start to delete from the beginning so reverse the order
        #
        self.iDoubles.reverse()
        for i in self.iDoubles:
            for col in fioObj.columns:
                del col.x[i]
                del col.y[i]
        #
        # and bring it back into the right order
        #
        self.iDoubles.reverse()
        #
        # create the new fio file 'in place'
        #
        os.remove(fioFile)
        HasyUtils.fioWriter(fioObj)
        self._writer("ppPurge: re-created %s" % fioObj.fileName)
        return True
コード例 #2
0
 def cb_showCtrlAxis(self):
     hsh = HasyUtils.getEnv("_ViewOptions")
     if self.w_showCtrlAxisCheckBox.isChecked():
         hsh['ShowCtrlAxis'] = True
     else:
         hsh['ShowCtrlAxis'] = False
     HasyUtils.setEnv("_ViewOptions", hsh)
コード例 #3
0
def assertPyspMonitorRunning():
    """
    returns (status, wasLaunched)

    it tests whether the pyspMonitor responds to isAlive. 
    If so, the function return rather quickly.

    Otherwise we call assertProcessRunning() which may take some time
    """
    res = HasyUtils.toPyspMonitor({'isAlive': True}, testAlive=False)
    if res['result'] == 'done':
        return (True, False)
    else:
        #
        # even if the pyspMonitor does not reply to 'isAlive',
        # the process may exist
        #
        if utils.findProcessByName("/usr/bin/pyspMonitor.py"):
            utils.killProcess("/usr/bin/pyspMonitor.py")
        if utils.findProcessByName("/usr/bin/pyspMonitor3.py"):
            utils.killProcess("/usr/bin/pyspMonitor3.py")

        if HasyUtils.getPythonVersionSardana() == '/usr/bin/python':
            return utils.assertProcessRunning("/usr/bin/pyspMonitor.py")
        else:
            return utils.assertProcessRunning("/usr/bin/pyspMonitor3.py")
コード例 #4
0
    def testToPyspMonitorColumns(self):
        import random
        print "testZmqIfc.testToPyspMonitor1"

        if utils.getHostname() != definitions.hostTK:
            return

        hsh = HasyUtils.toPyspMonitor({'command': ['cls', 'delete']})
        self.assertEqual(hsh['result'], 'done')

        MAX = 25
        pos = np.linspace(0, 10, MAX)
        d1 = np.random.random_sample((len(pos), )) * 1000.
        d2 = np.random.random_sample((len(pos), )) * 1000.

        hsh = HasyUtils.toPyspMonitor({
            'putData': {
                'title':
                "testing putData & columns",
                'comment':
                "a comment",
                'columns': [{
                    'name': "eh_mot01",
                    'data': pos
                }, {
                    'name': "eh_c01",
                    'data': d1
                }, {
                    'name': "eh_c02",
                    'data': d2,
                    'symbolColor': 'blue',
                    'symbol': '+',
                    'symbolSize': 5,
                    'xLog': False,
                    'yLog': False,
                    'showGridX': False,
                    'showGridY': False
                }]
            }
        })
        self.assertEqual(hsh['result'], 'done')
        HasyUtils.toPyspMonitor({'command': ['display']})
        self.assertEqual(hsh['result'], 'done')
        time.sleep(1)

        #
        # retrieve the data
        #
        hsh = HasyUtils.toPyspMonitor({'getData': True})
        self.assertEqual(hsh['result'], 'done')
        #
        # ... and compare.
        #
        for i in range(MAX):
            self.assertEqual(pos[i], hsh['getData']['EH_C01']['x'][i])
            self.assertEqual(d1[i], hsh['getData']['EH_C01']['y'][i])
            self.assertEqual(d2[i], hsh['getData']['EH_C02']['y'][i])

        print "testZmqIfc.testToPyspMonitorColumns DONE"
        return
コード例 #5
0
ファイル: tngAPI.py プロジェクト: thorstenkracht/TngGui
    def cb_applyDeviceProperties(self):
        count = 0
        #
        # check, whether there is some input at all
        #
        for prop in self.props:
            line = self.propDct[prop]["w_line"]
            if line is None:
                continue
            if len(line.text()) > 0:
                count += 1
                propFound = prop
        if count == 0:
            self.logWidget.append("motorProp.cb_apply: no input")
            return
        #
        # More than one input: clear the input lines
        #
        if count > 1:
            for prop in self.props:
                line = self.propDct[prop]["w_line"]
                if line is None:
                    continue
                line.clear()
            self.logWidget.append("motorProp.cb_apply: more that one input")
            return

        prop = propFound
        line = self.propDct[prop]["w_line"]

        temp = line.text()
        HasyUtils.putDeviceProperty(self.dev['device'], prop, temp,
                                    self.dev['hostname'])
        line.clear()
コード例 #6
0
    def testToPyspMonitorCompleteImagePutData(self):
        '''
        use putData to transfer a complete image at once
        '''
        print "testZmqIfc.testToPyspMonitor6"

        if utils.getHostname() != definitions.hostTK:
            return

        hsh = HasyUtils.toPyspMonitor({'command': ['cls', 'delete']})
        self.assertEqual(hsh['result'], 'done')
        hsh = HasyUtils.toPyspMonitor({'command': ['setWsViewport dina5s']})
        self.assertEqual(hsh['result'], 'done')

        (xmin, xmax) = (-2., -0.5)
        (ymin, ymax) = (0, 1.5)
        (width, height) = (100, 100)
        maxiter = 25
        #
        # fill the image, pixel by pixel
        #
        r1 = np.linspace(xmin, xmax, width)
        r2 = np.linspace(ymin, ymax, height)
        data = np.ndarray((width, height), np.float64)
        for i in range(width):
            for j in range(height):
                res = mandelbrot(r1[i] + 1j * r2[j], maxiter)
                data[i][j] = int(res)

        #
        # title: putData transfers the complete image at once
        #
        hsh = HasyUtils.toPyspMonitor({
            'command':
            ['setTitle "putData transfers the complete image at once"']
        })
        self.assertEqual(hsh['result'], 'done')

        hsh = HasyUtils.toPyspMonitor({
            'putData': {
                'images': [{
                    'name': "MandelBrot",
                    'data': data,
                    'xMin': xmin,
                    'xMax': xmax,
                    'yMin': ymin,
                    'yMax': ymax
                }]
            }
        })
        self.assertEqual(hsh['result'], 'done')

        hsh = HasyUtils.toPyspMonitor({'command': ['display']})
        self.assertEqual(hsh['result'], 'done')
        time.sleep(2)

        print "testZmqIfc.testToPyspMonitorCompleteImagePutData DONE"

        return
コード例 #7
0
 def cb_activeMntGrpChanged(self):
     temp = str(self.activeMntGrpComboBox.currentText())
     if len(temp.strip()) == 0:
         return
     HasyUtils.setEnv("ActiveMntGrp", temp)
     elements = HasyUtils.getMgElements(temp)
     #self.logWidget.append( "macroServerIfc.cb_activeMntGrpChanged: ActiveMntGrp to %s: %s" % (temp, elements))
     return
コード例 #8
0
 def cb_generalStop(self):
     if self.w_generalStopCheckBox.isChecked():
         HasyUtils.runMacro("gs_enable")
         a = HasyUtils.getEnv("GeneralOnStopFunction")
         self.logWidget.append("General on stop: %s" % repr(a))
     else:
         HasyUtils.runMacro("gs_disable")
         self.logWidget.append("General on stop: disabled")
コード例 #9
0
 def cb_onCondition(self):
     if self.w_onConditionCheckBox.isChecked():
         HasyUtils.runMacro("gc_enable")
         a = HasyUtils.getEnv("GeneralCondition")
         self.logWidget.append("General condition: %s" % repr(a))
     else:
         HasyUtils.runMacro("gc_disable")
         self.logWidget.append("General condition: disabled")
コード例 #10
0
 def cb_LogMacro(self):
     if self.w_LogMacroCheckBox.isChecked():
         HasyUtils.setEnv("LogMacro", True)
         a = HasyUtils.getEnv("LogMacro")
         self.logWidget.append("LogMacro: %s" % repr(a))
     else:
         HasyUtils.setEnv("LogMacro", False)
         self.logWidget.append("LogMacro: disabled")
コード例 #11
0
    def cb_generalHooks(self):

        if self.w_generalHooksCheckBox.isChecked():
            HasyUtils.runMacro("gh_enable")
            hsh = HasyUtils.getEnv("_GeneralHooks")
            self.logWidget.append("GeneralHooks: %s" % repr(hsh))
        else:
            HasyUtils.runMacro("gh_disable")
            self.logWidget.append("GeneralHooks: disabled")
コード例 #12
0
 def cb_reloadGeneralHooks(self):
     lst = HasyUtils.getEnv("_GeneralHooks")
     if lst is None:
         self.logWidget.append("GeneralHooks: disabled")
         return
     #
     # use the first hook macro name. relmac pulls-in the whole file
     #
     HasyUtils.runMacro("relmac %s" % lst[0][0])
     return
コード例 #13
0
ファイル: DoAll.py プロジェクト: thorstenkracht/TngGui
def main():
    parser = argparse.ArgumentParser(
        formatter_class=argparse.RawDescriptionHelpFormatter,
        description="  updates python-%s, python3-~ on all hosts from the repo"
        % (PACKET_NAME))

    parser.add_argument(
        '-x',
        dest="execute",
        action="store_true",
        default=False,
        help='update python-%s, python3-~ on all nodes, from repo' %
        (PACKET_NAME))

    parser.add_argument('-r',
                        dest="updateRepo",
                        action="store_true",
                        default=False,
                        help='update repo first')

    args = parser.parse_args()

    if not args.execute:
        parser.print_help()
        return

    if args.updateRepo:
        if os.system("./UpdateDebianRepo.py -x"):
            print "Failed to update the debian repo"
            return

    nodes = HasyUtils.readHostList(HOST_LIST)

    sz = len(nodes)
    count = 1
    countFailed = 0
    countOffline = 0
    for host in nodes:
        if not HasyUtils.checkHostRootLogin(host):
            print "-- checkHostRootLogin returned error %s" % host
            countOffline += 1
            continue
        cmd = 'ssh -l root %s "apt-get update && apt -y install python-%s && apt install -y python3-%s && dpkg -s python-%s && dpkg -s python3-%s && echo "" > /dev/null 2>&1"' % (
            host, PACKET_NAME, PACKET_NAME, PACKET_NAME, PACKET_NAME)
        # print( "%s" % cmd)
        if os.system(cmd):
            print "Failed to update %s" % host
            countFailed += 1
            continue
        else:
            print("Updated %s OK" % host)
        print "\nDoAll: %d/%d (offline %d, failed %d) %s \n" % (
            count, sz, countOffline, countFailed, host)
        count += 1
    return
コード例 #14
0
 def cb_applyMacroServerIfc(self):
     for var in self.varsEnv:
         hsh = self.dct[var]
         inp = str(hsh["w_line"].text())
         if len(inp) > 0:
             self.logWidget.append("setting %s to %s %s" %
                                   (var, repr(inp), type(inp)))
             HasyUtils.setEnv(var, inp)
             hsh['w_value'].setText(repr(HasyUtils.getEnv(var)))
             hsh["w_line"].clear()
     return
コード例 #15
0
    def cb_restartBoth(self):

        try:
            MsName = HasyUtils.getLocalMacroServerServers()[0]
        except Exception as e:
            self.logWidget.append("cb_restartBoth: failed to get MS names")
            self.logWidget.append("cb_restartBoth: %s" % repr(e))
            return

        try:
            PoolName = HasyUtils.getLocalPoolServers()[0]
        except Exception as e:
            self.logWidget.append("cb_restartBoth: failed to get Pool name")
            self.logWidget.append("cb_restartBoth: %s" % repr(e))
            return

        self.logWidget.append("cb_restartBoth: restarting %s and %s" %
                              (MsName, PoolName))
        self.parent.app.processEvents()

        self.logWidget.append("cb_restartBoth: stopping %s" % MsName)
        self.parent.app.processEvents()
        HasyUtils.stopServer(MsName)

        self.logWidget.append("cb_restartBoth: restarted %s" % PoolName)
        self.parent.app.processEvents()
        HasyUtils.restartServer(PoolName)

        self.logWidget.append("cb_restartBoth: restarted %s DONE" % PoolName)
        self.parent.app.processEvents()

        HasyUtils.startServer(MsName)
        print("cb_restartBoth: restarting %s and %s DONE" % (MsName, PoolName))
        return
コード例 #16
0
    def cb_restartMS(self):

        try:
            MsName = HasyUtils.getLocalMacroServerServers()[0]
        except Exception as e:
            self.logWidget.append("cb_restartMS: failed to get MS names")
            self.logWidget.append("cb_restartMS: %s" % repr(e))
            return

        self.logWidget.append("cb_restartMS: restarting %s" % MsName)
        self.parent.app.processEvents()

        HasyUtils.restartServer(MsName)
        self.logWidget.append("cb_restartMS: restarting %s DONE" % MsName)
        return
コード例 #17
0
 def cb_editGeneralHooks(self):
     lst = HasyUtils.getEnv("_GeneralHooks")
     if lst is None:
         self.logWidget.append("GeneralHooks: disabled, enable before edit")
         return
     #
     # need just one hooks macro name to identify the file
     #
     hooksMacroName = lst[0][0]
     hsh = HasyUtils.getMacroInfo(hooksMacroName)
     editor = os.getenv("EDITOR")
     if editor is None:
         editor = "emacs"
     os.system("%s %s&" % (editor, hsh['file_path']))
     return
コード例 #18
0
ファイル: cursorGui.py プロジェクト: thorstenkracht/TngGui
    def cb_ssa(self):
        reasons = [
            'ok', 'np < 6', 'signal2BG', 'no y > 0', 'midpoint calc',
            'midpoint calc.', 'max outside x-range'
        ]
        #SSA_REASON  0: ok, 1: np < 6, 2: stbr, 3: no y(i) > 0.,
        #            4, 5: midpoint calc, 6: max outside x-range

        Spectra.gra_command("delete/nowarn temp_fit_ssa.*")
        cmd = "create/ssa=%s/x_min=%g/x_max=%g/notext temp_fit_ssa" % (
            self.scan.name, self.scan.x_min, self.scan.x_max)
        self.logWidget.append(HasyUtils.getDateTime())
        self.logWidget.append(cmd)
        Spectra.gra_command(cmd)
        (sts, ret) = Spectra.gra_decode_int("SSA_STATUS")
        if ret == 0:
            (sts, reason) = Spectra.gra_decode_int("SSA_REASON")
            if reason < len(reasons):
                self.logWidget.append("SSA failed, reason: %s" %
                                      reasons[reason])
            else:
                self.logWidget.append("SSA failed, reason %d (unknown)" %
                                      reason)
        else:
            Spectra.gra_command("deactivate %s.2" % self.scan.name)
            Spectra.gra_command("cls/graphic")
            Spectra.gra_command("set/v0 %s" % self.scan.name)
            Spectra.gra_command("set/v0 temp_fit_ssa")
            Spectra.gra_command("display")
コード例 #19
0
def main():
    args = parseCLI()

    if not HasyUtils.checkDistroVsPythonVersion(__file__):
        print("pyspViewer*.main: %s does not match distro (Debian-9, 10)" %
              __file__)
        return

    if os.getenv("DISPLAY") != ':0':
        QtGui.QApplication.setStyle('Cleanlooks')

    app = QtGui.QApplication(sys.argv)

    if args.fontSize is not None:
        font = QtGui.QFont('Sans Serif')
        font.setPixelSize(int(args.fontSize))
        app.setFont(font)

    o = PySpectra.pySpectraGuiClass.pySpectraGui(args.files)
    o.show()

    try:
        sys.exit(app.exec_())
    except Exception as e:
        print("pyspViewer.main, exception")
        print(repr(e))
コード例 #20
0
    def run(self, measgroup):

        actmg = self.getEnv('ActiveMntGrp')
        a1 = HasyUtils.getLocalMgNames()
        la = len(a1)
        if measgroup != -999:
            i = 0
            while i < la:
                mg = a1[i].split('/')[2]
                if measgroup == i:
                    self.setEnv('ActiveMntGrp', mg)
                    actmg = mg
                i += 1
            self.output("Active measurement group: %s" % (actmg))

        else:
            i = 0
            while i < la:
                mg = a1[i].split('/')[2]
                self.output("[%i] %s" % (i, mg))
                if actmg == mg:
                    nact = i
                i += 1
            self.output("")
            a2 = self.input("Your choice? ", default_value=nact)
            i = 0
            while i < la:
                mg = a1[i].split('/')[2]
                if int(a2) == i:
                    self.setEnv('ActiveMntGrp', mg)
                    actmg = mg
                i += 1
            self.output("")
            self.output("Active measurement group: %s" % (actmg))
コード例 #21
0
ファイル: mcaWidget.py プロジェクト: thorstenkracht/TngGui
    def _printHelper(self, frmt):
        '''
        do the visible plot only
        '''
        prnt = os.getenv("PRINTER")
        if prnt is None:
            QtGui.QMessageBox.about(self, 'Info Box',
                                    "No shell environment variable PRINTER.")
            return

        fName = graPyspIfc.createHardCopy(printer=prnt,
                                          format=frmt,
                                          flagPrint=False)
        self.logWidget.append(HasyUtils.getDateTime())
        self.logWidget.append("Created %s (%s)" % (fName, frmt))

        msg = "Send %s to %s" % (fName, prnt)
        reply = QtGui.QMessageBox.question(self, 'YesNo', msg,
                                           QtGui.QMessageBox.Yes,
                                           QtGui.QMessageBox.No)
        if reply == QtGui.QMessageBox.Yes:
            if os.system("/usr/bin/lpr -P %s %s" % (prnt, fName)):
                self.logWidget.append("failed to print %s on %s" %
                                      (fName, prnt))
            self.logWidget.append(" printed on %s" % (prnt))
コード例 #22
0
ファイル: mcaWidget.py プロジェクト: thorstenkracht/TngGui
    def reconfigureWidget(self):
        """
        called from selectTimerAndMCAs
        """
        lst = HasyUtils.getMgElements("mg_tnggui")
        if len(lst) == 0:
            self.logWidget.append("reconfigureWidget: mg_tnggui is empty")
            return
        #
        # ['eh_t01', 'eh_c01', 'eh_mca01']
        #
        self.selectedTimers = []
        for elm in lst:
            if elm.find('_t0') != -1:
                self.selectedTimers.append(self.getDev(elm))
        self.selectedMCAs = []
        for elm in lst:
            if elm.find('_mca') != -1:
                self.selectedMCAs.append(self.getDev(elm))

        #self.selectedTimers.sort()
        #self.selectedMCAs.sort()
        self.mcaComboBox.clear()
        for dev in self.selectedMCAs:
            self.mcaComboBox.addItem(dev['name'])
        self.mcaOntop = self.selectedMCAs[0]
        return
コード例 #23
0
    def test_ssa(self):
        '''
        overlay 2 scans
        '''
        PySpectra.cls()
        PySpectra.delete()
        g = PySpectra.Scan(name="gauss",
                           xMin=-5.,
                           xMax=5.,
                           nPts=101,
                           lineColor='red')
        mu = 0.
        sigma = 1.
        g.y = 1 / (sigma * np.sqrt(2. * np.pi)) * np.exp(-(g.y - mu)**2 /
                                                         (2. * sigma**2))

        hsh = HasyUtils.ssa(g.x, g.y)
        self.assertEqual(hsh['status'], 1)
        self.assertEqual(hsh['midpoint'], 0.)
        self.assertAlmostEqual(hsh['l_back'], 2.521e-5)
        self.assertAlmostEqual(hsh['r_back'], 2.521e-5)
        self.assertAlmostEqual(hsh['integral'], 0.9997473505)
        self.assertEqual(hsh['reason'], 0)
        self.assertEqual(hsh['peak_x'], 0)
        self.assertAlmostEqual(hsh['peak_y'], 0.3989170740)
        self.assertAlmostEqual(hsh['cms'], 1.2989313e-16)
        self.assertAlmostEqual(hsh['fwhm'], 2.35522977)
        self.assertAlmostEqual(hsh['back_int'], 0.0002520637)

        print repr(hsh)
コード例 #24
0
ファイル: testSpock.py プロジェクト: thorstenkracht/PySpectra
    def testMvsa( self) : 
        print "testSpock.testMvsa"

        if HasyUtils.getHostname() != definitions.hostTK: 
            return 

        ( status, wasLaunched) = utils.assertProcessRunning( "/usr/bin/pyspMonitor.py")
        print( "testSpock.testAscan: ascan eh_mot66 50 51 40 0.1")

        hsh =  PySpectra.toPyspLocal( { 'spock': 'ascan eh_mot66 50 51 40 0.1'})
        self.assertEqual( hsh[ 'result'], 'done')

        hsh =  PySpectra.toPyspLocal( { 'getDoorState': True})
        while hsh[ 'result'] != 'ON': 
            time.sleep( 0.5)
            hsh =  PySpectra.toPyspLocal( { 'getDoorState': True})

        hsh =  PySpectra.toPyspLocal( { 'getDoorState': True})
        self.assertEqual( hsh[ 'result'], 'ON')

        hsh =  PySpectra.toPyspLocal( { 'spock': 'mvsa peak 0'})
        self.assertEqual( hsh[ 'result'], 'done')

        if wasLaunched:
            print( "testSpock.testAscan kill pyspMonitor.py") 
            os.system( "kill_proc -f pyspMonitor.py")

        return 
コード例 #25
0
 def fillMgComboBox(self):
     """
     called initially but also after new MGs have been created
     """
     activeMntGrp = HasyUtils.getEnv("ActiveMntGrp")
     count = 0
     self.activeMntGrpComboBox.clear()
     for mg in HasyUtils.getMgAliases():
         self.activeMntGrpComboBox.addItem(mg)
         #
         # initialize the comboBox to the current ActiveMntGrp
         #
         if activeMntGrp == mg:
             self.activeMntGrpComboBox.setCurrentIndex(count)
         count += 1
     return
コード例 #26
0
ファイル: testSpock.py プロジェクト: thorstenkracht/PySpectra
    def testMv( self) : 
        print "testSpock.testMv"

        if HasyUtils.getHostname() != definitions.hostTK: 
            return 

        print "testSpock.testMv, eh_mot66 to 50"
        
        hsh =  PySpectra.toPyspLocal( { 'spock': 'mv eh_mot66 50'})
        self.assertEqual( hsh[ 'result'], 'done')

        hsh =  PySpectra.toPyspLocal( { 'getDoorState': True})
        while hsh[ 'result'] == 'RUNNING': 
            time.sleep( 0.5)
            hsh =  PySpectra.toPyspLocal( { 'getDoorState': True})

        hsh =  PySpectra.toPyspLocal( { 'getDoorState': True})
        self.assertEqual( hsh[ 'result'], 'ON')

        print "testSpock.testMv, eh_mot66 to 51"
        hsh =  PySpectra.toPyspLocal( { 'spock': 'mv eh_mot66 51'})
        self.assertEqual( hsh[ 'result'], 'done')

        hsh =  PySpectra.toPyspLocal( { 'getDoorState': True})
        while hsh[ 'result'] == 'RUNNING': 
            time.sleep( 0.5)
            hsh =  PySpectra.toPyspLocal( { 'getDoorState': True})

        hsh =  PySpectra.toPyspLocal( { 'getDoorState': True})
        self.assertEqual( hsh[ 'result'], 'ON')

        return 
コード例 #27
0
ファイル: testIFC.py プロジェクト: thorstenkracht/PySpectra
    def test_toPyspMonitorScan(self):
        import random

        print "testIFC.test_toPyspMonitorScan"
        #
        # see, if the pyspMonitor is running. If not, return silently
        #
        hsh = HasyUtils.toPyspMonitor({'isAlive': True})
        if hsh['result'] != "done":
            print "test_toPyspMonitorScan: no pyspMonitor running"
            return

        ret = HasyUtils.toPyspMonitor({'command': ["cls", "delete"]})
        self.assertEqual(ret['result'], 'done')

        ret = HasyUtils.toPyspMonitor({
            'command': [
                "setTitle \"An important title\"",
                "setComment \"An interesting comment\""
            ]
        })
        self.assertEqual(ret['result'], 'done')

        max = 101
        name = "TestScan"
        ret = HasyUtils.toPyspMonitor({
            'Scan': {
                'name': name,
                'xMin': 0.,
                'xMax': 100.,
                'yMin': 0.,
                'yMax': 1.,
                'symbol': '+',
                'symbolColor': 'red',
                'symbolSize': 7,
                'lineColor': 'blue',
                'nPts': max,
                'autoscaleX': False,
                'autoscaleY': True
            }
        })
        self.assertEqual(ret['result'], 'done')

        for i in range(max):
            pos = float(i)
            posY = random.random() * 10
            HasyUtils.toPyspMonitor({
                'command':
                ['setXY %s %d %s %s' % (name, i, repr(pos), repr(posY))]
            })
            HasyUtils.toPyspMonitor({'command': ["display"]})
            time.sleep(0.1)

        print "testIFC.test_toPyspMonitorScan DONE"

        return
コード例 #28
0
    def run(self, macro_name, hook_pos):

        if HasyUtils.versionSardanaNewMg():
            self.gh_enableD9(macro_name, hook_pos)
            return
        else:
            self.gh_enableD8(macro_name, hook_pos)
            return
コード例 #29
0
    def run(self, hook_pos):

        if HasyUtils.versionSardanaNewMg():
            self.gh_disableD9(hook_pos)
        else:
            self.gh_disableD8(hook_pos)

        return
コード例 #30
0
    def run(self, hook_pos):
        result = False

        if HasyUtils.versionSardanaNewMg():
            result = self.gh_isEnabledD9(hook_pos)
        else:
            result = self.gh_isEnabledD8(hook_pos)

        return result