def createVar(self): info = self.getTypeInfo().split(",") ro = info[1] != "RW" reprs = self.guessRepr() if cpswTreeGUI._ReprOther == reprs: raise cpswTreeGUI.InterfaceNotImplemented("Unkown representation") return VarAdapt( self, ro, reprs, info[2]=="ENM" )
def createVar(self): readOnly = False try: representation = self.guessRepr() if self._path.getNelms( ) > 1 and cpswTreeGUI._ReprString != representation: raise pycpsw.InterfaceNotImplementedError( "Non-String arrays (ScalVal) not supported") # If the representation is 'Other' then this is certainly not # a ScalVal - but it could still be a DoubleVal. # If the representation is 'Float' then it could be a ScalVal for # which the Float representation was chosen deliberately (in yaml) if representation in (cpswTreeGUI._ReprOther, cpswTreeGUI._ReprFloat): try: val = pycpsw.DoubleVal.create(self._path) except pycpsw.InterfaceNotImplementedError: val = pycpsw.DoubleVal_RO.create(self._path) readOnly = True representation = cpswTreeGUI._ReprFloat else: try: val = pycpsw.ScalVal.create(self._path) except pycpsw.InterfaceNotImplementedError: val = pycpsw.ScalVal_RO.create(self._path) readOnly = True except pycpsw.InterfaceNotImplementedError as e: raise cpswTreeGUI.InterfaceNotImplemented(e.args) return (val, readOnly, representation)
def createCmd(self): try: if self._path.getNelms() > 1: raise pycpsw.InterfaceNotImplementedError( "Arrays of commands not supported") cmd = pycpsw.Command.create(self._path) except pycpsw.InterfaceNotImplementedError as e: raise cpswTreeGUI.InterfaceNotImplemented(e.args) return cmd
def createStream(self): try: if self._path.getNelms() > 1: raise pycpsw.InterfaceNotImplementedError( "Arrays of Streams not supported") if self._path.tail().getName() == "Lcls1TimingStream": raise pycpsw.InterfaceNotImplementedError( "Timing Stream Disabled") strm = pycpsw.Stream.create(self._path) except pycpsw.InterfaceNotImplementedError as e: raise cpswTreeGUI.InterfaceNotImplemented(e.args) return strm
def createStream(self): raise cpswTreeGUI.InterfaceNotImplemented("Streams not implemented")
def createCmd(self): info = self.getTypeInfo().split(",") if info[0] == "CMD" and info[2] == "SCL": return CmdAdapt( self ) raise cpswTreeGUI.InterfaceNotImplemented("Streams not implemented")