Beispiel #1
0
# Pyrame is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# Pyrame is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrame.  If not, see <http://www.gnu.org/licenses/>

import pools, getapi, conf_strings

ag_81160_pool = pools.pool()

from time import sleep

# Put serialized API in memory if not called via import
if __name__ == '__main__':
    global api; api = getapi.load_api(__file__)

# Functions
def getapi_ag_81160():
    submod.setres(1,api)

def init_ag_81160(conf_string):
    """Initialize ag_81160 pattern generator.
    
    *conf_string*: must include a bus parameter with the conf_string of the underlying link module (gpib, tcp, serial, ...)
Beispiel #2
0
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Frédéric Magniette, Miguel Rubio-Roy, LLR
#

import pools

import common_roc
if __name__=='__main__':
    common_roc.submod = submod

skiroc_pool=pools.pool("skiroc")

skiroc_bs_length=616

#************************* BITSTREAM MANIPULATION FUNCTIONS ***************

# **************************************************************************
# trigger mode
# **************************************************************************

def set_trigmode_reg(skiroc,mode):
    "set the trigger mode of a skiroc"
    if mode!="undef":
        if mode=="ext":
            return common_roc.apply_mask(skiroc,9,common_roc.split_bin(1,1))
        if mode=="int":
            return common_roc.apply_mask(skiroc,9,common_roc.split_bin(0,1))
    return 0,"Unknown mode %s. Supported mode are int or ext"%(mode)
Beispiel #3
0
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# Pyrame is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrame.  If not, see <http://www.gnu.org/licenses/>

import time
import getapi,pools,conf_strings

nw_esp301_pool = pools.pool()

# Axes
axes = ["1","2","3"]

# Ports
ports = ["A","B"]

# COMMANDS #######################################################

# Put serialized API in memory if not called via import
if __name__=='__main__':
    global api; api = getapi.load_api(__file__)

def getapi_nw_esp301():
    submod.setres(1,api)
Beispiel #4
0
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# Pyrame is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrame.  If not, see <http://www.gnu.org/licenses/>

from re import sub,search
import getapi,pools,vicp

ly_lt344_pool = pools.pool()

# Available channels
valid_channels = ["M1","M2","M3","M4","C1","C2","C3","C4","TA","TB","TC","TD"]

# Put serialized API in memory if not called via import
if __name__ == '__main__':
    global api; api = getapi.load_api(__file__)

# Functions
def getapi_ly_lt344():
    submod.setres(1,api)

def init_ly_lt344(dso_hostname):
    """Initialize ly_lt344 DSO. *dso_hostname* is the IP address or resolvable network name
Beispiel #5
0
# Pyrame is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# Pyrame is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrame.  If not, see <http://www.gnu.org/licenses/>

import pools, getapi, conf_strings

ag_33200_pool = pools.pool()

from time import sleep

# Put serialized API in memory if not called via import
if __name__ == '__main__':
    global api; api = getapi.load_api(__file__)

# Functions
def getapi_ag_33200():
    submod.setres(1,api)

def init_ag_33200(conf_string):
    """Initialize ag_33200 pattern generator.
    
    *conf_string*: must include a bus parameter with the conf_string of the underlying link module (gpib, tcp, serial, ...)
Beispiel #6
0
# Pyrame is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# Pyrame is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrame.  If not, see <http://www.gnu.org/licenses/>

import pools, getapi

sigsquare_pool = pools.pool()

# Put serialized API in memory if not called via import
if __name__ == '__main__':
    global api; api = getapi.load_api(__file__)

# Functions
def getapi_sigsquare():
    submod.setres(1,api)

def init_sigsquare(dev_name,parent_device,conf_string,channel):
    #init the pg
    retcode,res=submod.execcmd("init_pg_signal",conf_string)
    if retcode==0:
        submod.setres(0,"sigsquare: Can't init pg <- %s"%(res))
        return
Beispiel #7
0
# Pyrame is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# Pyrame is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrame.  If not, see <http://www.gnu.org/licenses/>

import pools, getapi

sigpulse_pool = pools.pool()

# Put serialized API in memory if not called via import
if __name__ == '__main__':
    global api; api = getapi.load_api(__file__)

# Functions
def getapi_sigpulse():
    submod.setres(1,api)

def init_sigpulse(dev_name,parent_device,conf_string,channel):
    #init the pg
    retcode,res=submod.execcmd("init_pg_signal",conf_string)
    if retcode==0:
        submod.setres(0,"sigpulse: Can't init pg <- %s"%(res))
        return
Beispiel #8
0
# Pyrame is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# Pyrame is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrame.  If not, see <http://www.gnu.org/licenses/>

import pools, getapi, conf_strings

ag_33500_pool = pools.pool()

from time import sleep

# Put serialized API in memory if not called via import
if __name__ == '__main__':
    global api; api = getapi.load_api(__file__)

# Functions
def getapi_ag_33500():
    submod.setres(1,api)

def init_ag_33500(conf_string):
    """Initialize ag_33500 pattern generator.
    
    *conf_string*: must include a bus parameter with the conf_string of the underlying link module (gpib, tcp, serial, ...)
Beispiel #9
0
 def __init__(self):
     self.gpib_pool = pools.pool()
Beispiel #10
0
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# Pyrame is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrame.  If not, see <http://www.gnu.org/licenses/>

from re import sub,search
import getapi,pools,vicp

ly_zi_pool = pools.pool()

# Available channels
valid_channels = ["M1","M2","M3","M4","C1","C2","C3","C4","F1","F2","F3","F4","F5","F6","F7","F8"]

# Put serialized API in memory if not called via import
if __name__ == '__main__':
    global api; api = getapi.load_api(__file__)

# Functions
def getapi_ly_zi():
    submod.setres(1,api)

def init_ly_zi(dso_hostname):
    """Initialize ly_zi DSO. *dso_hostname* is the IP address or resolvable network name
Beispiel #11
0
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Frédéric Magniette, Miguel Rubio-Roy, LLR
#

import pools

import common_roc
if __name__=='__main__':
    common_roc.submod = submod

spiroc_pool=pools.pool("spiroc")

spiroc_bs_length=929

#************************* BITSTREAM MANIPULATION FUNCTIONS ***************

# **************************************************************************
# trigger threshold
# **************************************************************************

def set_gtrigger(spiroc_id,gtrigger):
    "set the trigger threshold of a spiroc"
    if gtrigger!="undef":
        return common_roc.apply_to_roc(spiroc_pool,spiroc_id,common_roc.apply_inv_mask,"set trigger threshold",239,common_roc.split_bin(int(gtrigger),10))
    return 1,"ok"

def set_gtrigger_spiroc(spiroc_id,gtrigger):
    "set the trigger threshold of a spiroc"
    retcode,res = set_gtrigger(spiroc_id,gtrigger)
Beispiel #12
0
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Frédéric Magniette, Miguel Rubio-Roy, LLR
#

import pools

import common_roc

if __name__ == "__main__":
    common_roc.submod = submod

easiroc_pool = pools.pool("easiroc")

easiroc_bs_length = 456

# ************************* BITSTREAM MANIPULATION FUNCTIONS ***************

# **************************************************************************
# D OUTPUT
# **************************************************************************


def set_d_output(easiroc_id, value):
    return common_roc.apply_to_roc(easiroc_pool, easiroc_id, common_roc.on_off_bit, "enable/disable d output", 6, value)


def set_d_output_easiroc(easiroc_id):
    "Enable digital multiplexed output (Hit mux out)"
    retcode, res = enable_d_output(easiroc_id)
Beispiel #13
0
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrame is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrame.  If not, see <http://www.gnu.org/licenses/>

import pools, getapi
import heapq

paths_pool = pools.pool()
volume_pool = pools.pool()
matrix_pool = pools.pool()


def check_param(param, valid_list, default_param, map_func, unique=True):
    if param == "undef" or param == "":
        param = default_param
    if len(param) != len(default_param) or any(c not in valid_list for c in param):
        return 0, "invalid param"
    result = map(map_func, param)
    if unique and len(set(result)) != len(result):
        return 0, "repeated characters"
    return 1, result

Beispiel #14
0
 def __init__(self):
     self.pool=pools.pool()
Beispiel #15
0
 def __init__(self):
     self.th_apt_pool = pools.pool()
Beispiel #16
0
                )
                print(f"Mining difficulty: {network_info['difficulty']}")
                print(f"Client version: {network_info['client_version']} \n")

            else:
                print(
                    Fore.RED +
                    "\nCould not retrieve network stats, please try again. \n")

            continue

        elif command in pool_commands:

            if not command_args:

                pool_info = pool()
                print(pool_info['table'])

                print(
                    Fore.YELLOW +
                    'You can also use "pools <pool name>" to get information on a specific pool.'
                )
                print(
                    Fore.YELLOW +
                    '\nAdditionally, you can run "pools all" to view detailed stats on all pools.'
                )

            else:

                if command_args[0] == 'all':
                    pool_info = everypool()
Beispiel #17
0
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Frédéric Magniette, Miguel Rubio-Roy, LLR
#

import pools

import common_roc
if __name__=='__main__':
    common_roc.submod = submod

maroc3_pool=pools.pool("maroc3")

maroc3_bs_length=829

#************************* BITSTREAM MANIPULATION FUNCTIONS ***************

# **************************************************************************
# Powerpulsing bandgap
# **************************************************************************

def set_pp_bandgap(maroc3_id,value):
    return common_roc.apply_to_roc(maroc3_pool,maroc3_id,common_roc.on_off_bit,"enable/disable power pulsing for bandgap",0,value)

def set_pp_bandgap_maroc3(maroc3_id,value):
    "Activate (ON or 1) or desactivate (OFF or 0) power pulsing (pp) for bandgap"
    retcode,res = set_pp_bandgap(maroc3_id,value)
    if retcode==0:
        submod.setres(0,"maroc3: %s"%(res))
    submod.setres(1,res)
Beispiel #18
0
# Pyrame is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# Pyrame is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrame.  If not, see <http://www.gnu.org/licenses/>

import conf_strings, pools, getapi

motion_pool=pools.pool()

def check_param(param,valid_list,default_param,map_func,unique=True):
    if param=="undef" or param=="":
        param = default_param
    if len(param)!=len(default_param) or any(c not in valid_list for c in param):
        return 0,"invalid param"
    result = map(map_func,param)
    if unique and len(set(result))!=len(result):
        return 0,"repeated characters"
    return 1,result

def init_motion(cs1,cs2,cs3):
    "Initialize motion system. Provide the conf_strings for its three axis *csn* (for axis number n: 1,2,3)"
    motion = {}
    cs = [cs1,cs2,cs3]
Beispiel #19
0
# Pyrame is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrame is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrame.  If not, see <http://www.gnu.org/licenses/>

import pools, getapi, conf_strings, apipools

signal_pool = pools.pool()
pg_pool = pools.pool()
api_pool = apipools.api_pool()

from time import sleep

# Put serialized API in memory if not called via import
if __name__ == "__main__":
    global api
    api = getapi.load_api(__file__)

# Functions
def getapi_signal():
    submod.setres(1, api)

Beispiel #20
0
 def __init__(self):
     self.ls_421_pool = pools.pool()