Commit 6fc5eb11 authored by cermak's avatar cermak
Browse files

Add thermofisher serial device

Change-Id: Ia692d94e63509925481b3c4142906b539dc57981
parent 0366847c
# -*- coding: utf-8 -*-
# *****************************************************************************
# MLZ library of Tango servers
# Copyright (c) 2015-2019 by the authors, see LICENSE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# This program 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 General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Module authors:
# Petr Cermak <cermak@mag.mff.cuni.cz>
#
# *****************************************************************************
from entangle import base
from entangle.core import Attr, Cmd, Prop, intrange, subdev, listof, \
ON, OFF, ALARM, FAULT, states
from entangle.core.errors import ConfigurationError, InvalidValue, \
CommunicationFailure, InvalidOperation
from entangle.device.serial import StringIO as SerialStringIO
class StringIO(SerialStringIO):
"""Special serial StringIO device for thermofisher x-ray sources."""
def Communicate(self, msg):
self.WriteLine(msg)
firstline = self.ReadLine()
if firstline != msg:
raise CommunicationFailure("command not repeated")
return self.ReadLine()
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment