コード例 #1
0
ファイル: mks937b_sim.py プロジェクト: dls-controls/mks937b
 def __init__(self, address="001", tcpPort=None, ui=None, name='none'):
     self.address = address
     self.chan_ack = "@%sACK" % self.address
     self.name = name
     serial_device.__init__(self, ui=ui)
     self.unit = "mbar"
     self.channels = [Channel("img"),
                      Channel("img"),
                      Channel(""),
                      Channel("pirani"),
                      Channel("pirani"),
                      Channel(""),
                      Channel(""),
                      Channel(""),
                      Channel(""),
                      Channel(""),
                      Channel(""),
                      Channel("")]
     self.controller_funcs = {"U": lambda: "@%sACK%s" % (address, self.unit),
                              "FV6": lambda: "@%sACK6.0" % address,
                              "FV5": lambda: "@%sACK5.0" % address,
                              "MT": lambda: "@%sACKHC,CC,T1" % address}
     self.Terminator = ";FF"
     if tcpPort is not None:
         self.start_ip(tcpPort)
コード例 #2
0
 def __init__(self, address="001", tcpPort=None, ui=None, name='none'):
     self.address = address
     self.chan_ack = "@%sACK" % self.address
     self.name = name
     serial_device.__init__(self, ui=ui)
     self.unit = "mbar"
     self.channels = [
         Channel("img"),
         Channel("img"),
         Channel(""),
         Channel("pirani"),
         Channel("pirani"),
         Channel(""),
         Channel(""),
         Channel(""),
         Channel(""),
         Channel(""),
         Channel(""),
         Channel("")
     ]
     self.controller_funcs = {
         "U": lambda: "@%sACK%s" % (address, self.unit),
         "FV6": lambda: "@%sACK6.0" % address,
         "FV5": lambda: "@%sACK5.0" % address,
         "MT": lambda: "@%sACKHC,CC,T1" % address
     }
     self.Terminator = ";FF"
     if tcpPort is not None:
         self.start_ip(tcpPort)
コード例 #3
0
 def __init__(self, name='none', tcpPort=9100, ui=None):
     print "Create Digitel MPC controller %s" % name
     self.name = name
     serial_device.__init__(self, ui=ui)
     self.voltageStrapping = 240
     self.autoRestart = False
     self.fanControl = False
     self.setPoints = {}
     self.supplies = {}
     self.supplies[1] = PowerSupply("%s:%s" % (name, 1))
     self.supplies[2] = PowerSupply("%s:%s" % (name, 2))
     serial_device.Terminator = "\r"
     self.start_ip(tcpPort)
コード例 #4
0
ファイル: Mks937aCrate.py プロジェクト: dls-controls/mks937a
 def __init__(self, name="", tcpPort=None, ui=None):
     self.name = name
     serial_device.__init__(self, ui=ui)
     self.gauges = {}
     self.gauges[1] = Mks937aChannel(name + ":1", "img")
     self.gauges[2] = Mks937aChannel(name + ":2", "img")
     self.gauges[3] = Mks937aChannel(name + ":3", "")
     self.gauges[4] = Mks937aChannel(name + ":4", "pirani")
     self.gauges[5] = Mks937aChannel(name + ":5", "pirani")
     serial_device.Terminator = "\r"
     if tcpPort:
         self.start_ip(tcpPort)
     self.diagnostic("Created MKS937A crate %s" % name)
コード例 #5
0
 def __init__(self):
     '''Constructor.  Remember to call the base class constructor.'''
     serial_device.__init__(self,
         protocolBranches = ["sensorraw", "temp", "setdate", "date", "settime",\
                             "time", "ipaddress", "macAddress", "reseed"])
     print "Initialising CryoconM14 simulator, V1.0"
     self.raw = dict(zip('ABCD', [1, 2, 3, 4]))
     self.temp = dict(zip('ABCD', [11, 12, 13, 14]))
     self.ipad = '0.0.0.0'
     self.mac = '00:01:02:03:04:05'
     self.date = '01/02/2003'
     self.time = '01:02:03'
     self.seedset = int(False)
     self.on = True
     self.command("diaglevel 5")
     return
コード例 #6
0
 def __init__(self):
     '''Constructor.  Remember to call the base class constructor.'''
     serial_device.__init__(self, protocolBranches=[])
     print "Initialising Elcomat3000 simulator, V1.0"
     print "Power is %s" % self.power
     self.transmitType1 = False
     self.transmitType3 = False
     self.transmitType5 = False
     self.transmitType6 = False
     self.measuredX = 4.5
     self.measuredY = 2.3
     self.day = 12
     self.month = 1
     self.year = 2001
     self.focalLength = 300
     return
コード例 #7
0
ファイル: RgaMv2.py プロジェクト: rorydog1/epics
 def __init__(self, name='none', tcpPort=None, ui=None):
     '''Create an MV2 RGA simulator.'''
     self.name = name
     serial_device.__init__(self, ui=ui)
     self.InTerminator = "\r\n"
     self.OutTerminator = "\r\r"
     if tcpPort is not None:
         self.start_ip(tcpPort)
     self.userApplication = ''
     self.userVersion = ''
     self.barchartName = ''
     self.barchartStartMass = 1
     self.barchartEndMass = 50
     self.barchartFilterMode = 'PeakCenter'
     self.barchartAccuracy = 5
     self.barchartEGainIndex = 0
     self.barchartSourceIndex = 0
     self.barchartDetectorIndex = 0
     self.scanMeasurement = ''
     self.schedule(self.process, 1)
     self.diagnostic("Created MV2 RGA simulator %s\n" % name)
コード例 #8
0
ファイル: RgaMv2.py プロジェクト: rorydog1/epics
 def __init__(self, name="none", tcpPort=None, ui=None):
     """Create an MV2 RGA simulator."""
     self.name = name
     serial_device.__init__(self, ui=ui)
     self.InTerminator = "\r\n"
     self.OutTerminator = "\r\r"
     if tcpPort is not None:
         self.start_ip(tcpPort)
     self.userApplication = ""
     self.userVersion = ""
     self.barchartName = ""
     self.barchartStartMass = 1
     self.barchartEndMass = 50
     self.barchartFilterMode = "PeakCenter"
     self.barchartAccuracy = 5
     self.barchartEGainIndex = 0
     self.barchartSourceIndex = 0
     self.barchartDetectorIndex = 0
     self.scanMeasurement = ""
     self.schedule(self.process, 1)
     self.diagnostic("Created MV2 RGA simulator %s\n" % name)
コード例 #9
0
 def __init__(self):
     serial_device.__init__(self)
     self.devices = []
     self.start_no_io()
     self.schedule(self.process, 1)
コード例 #10
0
 def __init__(self):
     self.pump_state = ":"
     self.properties = {
         "force": {
             "values": [20],
             "types": [int],
             "get format": "\n{values[0]}%\r\n{pump}",
             "test": lambda val: val if 1 <= val[0] <= 100 else False,
             "error format": "Argument error: %s\n   Out of range"},
         "poll": {
             "values": ["OFF"],
             "types": [str],
             "get format": "Polling mode is {values[0]}\r\n{pump}",
             "test": lambda val:
                 val if val[0].upper() in ("ON", "OFF") else False,
             "error format": ""},
         "diameter": {
             "values": [10.0],
             "types": [float],
             "get format": "\n{values[0]:.4f} mm\r\n{pump}",
             "test": lambda val:
                 val if 0.1 <= round(val[0], 4) <= 99 else False,
             "error format": "Argument error: %s\n   Diameter out of range"},
         "irun": {
             "new pump state": ">"},
         "wrun": {
             "new pump state": "<"},
         "stop": {
             "new pump state": ":"},
         "stp": {
             "new pump state": ":"},
         "irate": {
             "values": [0.0, "ul/min"],
             "types": [float, str],
             "get format":
                 "\n{values[0]:.4f} {values[1]}\r\n{pump}",
             "test": lambda val:
                 (val if 0.0 <= round(val[0], 4) <= 10000000 and
                  re.search("^[pnum]l/sec|min|hr", val[1],
                            re.IGNORECASE) else False),
             "error format": "Argument error: {0[0]} {0[1]} {pump}"},
         "wrate": {
             "values": [0.0, "ul/min"],
             "types": [float, str],
             "get format":
                 "\n{values[0]:.4f} {values[1]}\r\n{pump}",
             "test": lambda val:
                 (val if 0.0 <= round(val[0], 4) <= 10000000 and
                  re.search("^[pnum]l/sec|min|hr", val[1],
                            re.IGNORECASE) else False),
             "error format": "Argument error: {0[0]} {0[1]} {pump}"},
         "tvolume": {
             "values": [0.0, "nl"],
             "types": [float, str],
             "get format": "\n{values[0]} {values[1]}\r\n{pump}",
             "test": self.tvolume_test,
             "error format": "Argument error: {0[0]} {0[1]} {pump}"},
         "ivolume": {
             "values": [0.0, "nl"],
             "types": [float, str],
             "get format": "\n{values[0]} {values[1]}\r\n{pump}"},
         "wvolume": {
             "values": [0.0, "nl"],
             "types": [float, str],
             "get format": "\n{values[0]} {values[1]}\r\n{pump}"},
         "ttime": {
             "values": ["0 seconds"],
             "types": [str, str],
             "get format": "\n{values[0]}\r\n{pump}",
             "test": self.ttime_test}
         }
     serial_device.__init__(self)
コード例 #11
0
    def __init__(self):
        '''Constructor.  Remember to call the base class constructor.'''
        # See file CryoconM32.protocol for comment on what these functions do.
        serial_device.__init__(self,
                               protocolBranches=[
                                   "getSensorraw",
                                   "getTemp",
                                   "getTempUnits",
                                   "getTempMin",
                                   "getTempMax",
                                   "getTempVariance",
                                   "getTempSlope",
                                   "getTempOffset",
                                   "getSetpointT",
                                   "setSetpointT",
                                   "getLoopType",
                                   "setLoopType",
                                   "getLoopSource",
                                   "getLoopRamp",
                                   "getLoopRampRate",
                                   "setLoopRampRate",
                                   "getLoopPGain",
                                   "setLoopPGain",
                                   "getLoopIGain",
                                   "setLoopIGain",
                                   "getLoopDGain",
                                   "setLoopDGain",
                                   "getLoopManOutput",
                                   "setLoopManOutput",
                                   "reseed",
                                   "getFirmwareRev",
                                   "getHardwareRev",
                                   "getModel",
                                   "getControllerName",
                                   "getAmbientT",
                                   "getSinkT",
                                   "getStatsTime",
                                   "resetStats",
                                   "getFilterTC",
                                   "getDisplayRes",
                                   "getPUControl",
                               ])

        print "CryoconM32_sim: Initialising."
        self.on = 0

        self.channelA = Sensor("A")
        self.channelB = Sensor("B")
        self.channels = {"A": self.channelA, "B": self.channelB}

        self.loop1 = Loop("1", self.channelA)
        self.loop2 = Loop("2", self.channelB)
        self.loops = {"1": self.loop1, "2": self.loop2}

        self.firmwareRev = "Simulation XYZ"
        self.hardwareRev = "Simulation ABC"
        self.model = "CryoconM32"
        self.controllerName = "Magnet-22"
        # The protocol file at present has a carriage return character in its format
        # definition.  Need to test this against the real instrument to figure out
        # what is going on.
        self.ambientT = "+32C"
        self.sinkT = "+50C"
        self.calcStatsReset()

        print "CryoconM32_sim: Initialised."
        return
コード例 #12
0
 def __init__(self):
     # place your initialisation code here
     serial_device.__init__(self)
コード例 #13
0
ファイル: mks937b_sim.py プロジェクト: mdavidsaver/mks937b
 def __init__(self):
     # place your initialisation code here
     serial_device.__init__(self)
     self.nDebugLevel = 0