Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Sardana device pool for SPEC lovers - BLISS Seminar - January 15, 2007 The Sardana device pool for SPEC lovers BLISS Seminar January 15, 2007 Tiago.

Similar presentations


Presentation on theme: "The Sardana device pool for SPEC lovers - BLISS Seminar - January 15, 2007 The Sardana device pool for SPEC lovers BLISS Seminar January 15, 2007 Tiago."— Presentation transcript:

1 The Sardana device pool for SPEC lovers - BLISS Seminar - January 15, 2007 The Sardana device pool for SPEC lovers BLISS Seminar January 15, 2007 Tiago Coutinho - ALBA

2 The Sardana device pool for SPEC lovers - BLISS Seminar - January 15, 2007 Agenda What is Sardana Guidelines Structure Sardana and other systems Adding new features Examples Current state Future

3 The Sardana device pool for SPEC lovers - BLISS Seminar - January 15, 2007 Runtime add/update of new SW features Enables creation of lightweight, platform rich client interfaces: Java/ATK IPython PyQT C++/QT,C++/MFC etc Efficient, reliable, time consistent information feedback to the user Easy creation and deployment of new SW features What is Sardana? A software system for instrument control and data acquisition Client-server architecture Event driven architecture Plug-in architecture Scriptable Multi-user Open source Where have I heard this before?

4 The Sardana device pool for SPEC lovers - BLISS Seminar - January 15, 2007 Guidelines Long lifetime usage Core is HW independent →HW specific code written as plug-ins Performance →Minimize HW calls

5 The Sardana device pool for SPEC lovers - BLISS Seminar - January 15, 2007 Sardana Configuration API Sardana Structure Motors / Pseudo Motors MCAs Motor Groups Counters / Pseudo counters LibController LibPseudo Motor Lib … Configuration Tool Client Applications.SO CCDs Measurement Groups Controllers HW ETH GPIB CAN TANGO Device Server Remote PC... HW Remote PC SPEC HW

6 The Sardana device pool for SPEC lovers - BLISS Seminar - January 15, 2007 Sardana / SPEC SardanaSPEC Core code (C++ Tango Device – called Pool) C code SardanaConfig tooledconf pseudo motors constraints* in python macro motors calc motors macro hooks in ‘SPEC’ language IPython CLISPEC prompt / executable Extra Server*Macros, Data files, Plot * not yet implemented

7 The Sardana device pool for SPEC lovers - BLISS Seminar - January 15, 2007 Sardana / Tango Abstract classes SardanaAbstract classes As much code as possible ↓ interface & generic behavior No code ↓ Just interface Adapter design pattern (aka Wrapper) Union design pattern (inheritance & polimorphism) Evolution is foreseen Entire problem is well known Dynamic interfacesStatic interface

8 The Sardana device pool for SPEC lovers - BLISS Seminar - January 15, 2007 Adding new features Controllers (motor, counter, MCA, CCD, etc.) Pseudo Motors Pseudo Counters Constraints Languages: –Python –C++ (only for controllers)

9 The Sardana device pool for SPEC lovers - BLISS Seminar - January 15, 2007 Write a new motor controller topBlade beam Blade 1 Blade 2 bottomBlade gap offset Sardana dummy ctrl01 Motor Controller Lib topBlade bottomBlade Config Interface 1.Get the motor controller skeleton 2.Change it to your needs 3.Put it in the right place 4.Create an instance of the controller 5.Create motors 6.Enjoy class MotorControllerSkeleton(MotorController): """Insert your motor controller description here""" ctrl_extra_attributes = { # insert your extra features here } ctrl_features = [ # insert features supported by your controller here ] def __init__(self,inst,props): MotorController.__init__(self,inst,props) def PreStartAll(self): pass def PreStartOne(self,axis,pos): return True def StartOne(self,axis,pos): pass def StartAll(self): pass. class MotorControllerSkeleton(MotorController): """Insert your motor controller description here""" ctrl_extra_attributes = { # insert your extra features here } ctrl_features = [ # insert features supported by your controller here ] def __init__(self,inst,props): MotorController.__init__(self,inst,props) def PreStartAll(self): pass def PreStartOne(self,axis,pos): return True def StartOne(self,axis,pos): pass def StartAll(self): pass. IDLE : Motor Controller Skeleton.py Example class FirePapController(MotorController): ""“An IcePap controller for Sardana""" ctrl_extra_attributes = { } ctrl_features = [‘Encoder','Backlash'] def __init__(self,inst,props): MotorController.__init__(self,inst,props) self.socket_connected = False def PreStartAll(self): pass def PreStartOne(self,axis,pos): return True def StartOne(self,axis,pos): self.GOAbsolute(axis,pos) def StartAll(self): pass. class FirePapController(MotorController): ""“An IcePap controller for Sardana""" ctrl_extra_attributes = { } ctrl_features = [‘Encoder','Backlash'] def __init__(self,inst,props): MotorController.__init__(self,inst,props) self.socket_connected = False def PreStartAll(self): pass def PreStartOne(self,axis,pos): return True def StartOne(self,axis,pos): self.GOAbsolute(axis,pos) def StartAll(self): pass. IDLE : FirePapCtrl.py

10 The Sardana device pool for SPEC lovers - BLISS Seminar - January 15, 2007 Write a new pseudo motor topBlade beam Blade 1 Blade 2 bottomBlade gap offset Sardana dummy ctrl01 Pseudo Motor Lib topBlade bottomBlade Config Interface 1.Get the pseudo motor skeleton 2.Change it to your needs 3.Put it in the right place 4.Create an instance of it 5.Enjoy class PseudoMotorSkeleton(PseudoMotor): """Insert your pseudo motor system description here""" pseudo_motor_roles = () motor_roles = () class_prop = { # insert your properties here } def calc_physical(self,index,pseudo_pos): # insert your code here pass def calc_pseudo(self,index,physical_pos): # insert your code here pass class PseudoMotorSkeleton(PseudoMotor): """Insert your pseudo motor system description here""" pseudo_motor_roles = () motor_roles = () class_prop = { # insert your properties here } def calc_physical(self,index,pseudo_pos): # insert your code here pass def calc_pseudo(self,index,physical_pos): # insert your code here pass IDLE : Pseudo Motor Skeleton.py class Slit(PseudoMotor): """A Slit pseudo motor system for controlling gap and offset pseudo motors""" pseudo_motor_roles = ("Gap", "Offset") motor_roles = ("sl2t", "sl2b") class_prop = { 'a_string' : { 'Description' : 'string property example', 'Type' : 'PyTango.DevString', 'DefaultValue' : 'something to print' } } def calc_physical(self,index,pseudo_pos): print self.a_string half_gap = pseudo_pos[0]/2.0 if index == 0: return raw_offset – half_gap else: return raw_offset + half_gap def calc_pseudo(self,index,physical_pos): if index == 0: return physical_pos[1] - physical_pos[0] else: return (physical_pos[0] + physical_pos[1])/2.0 class Slit(PseudoMotor): """A Slit pseudo motor system for controlling gap and offset pseudo motors""" pseudo_motor_roles = ("Gap", "Offset") motor_roles = ("sl2t", "sl2b") class_prop = { 'a_string' : { 'Description' : 'string property example', 'Type' : 'PyTango.DevString', 'DefaultValue' : 'something to print' } } def calc_physical(self,index,pseudo_pos): print self.a_string half_gap = pseudo_pos[0]/2.0 if index == 0: return raw_offset – half_gap else: return raw_offset + half_gap def calc_pseudo(self,index,physical_pos): if index == 0: return physical_pos[1] - physical_pos[0] else: return (physical_pos[0] + physical_pos[1])/2.0 IDLE : Slit.py gap offset Example # ipython Welcome to the IPython Sardana CLI SPEC emulator 1.ISardana> wa Current Positions (user, dial) topBlade100.000.0 bottomBlade50.000.0 gap50.00 offset75.00 2.ISardana> mv gap 10 3.ISardana> wa Current Positions (user, dial) topBlade80.00-20.0 bottomBlade70.00 20.0 gap10.00 offset75.00 4.ISardana> # ipython Welcome to the IPython Sardana CLI SPEC emulator 1.ISardana> wa Current Positions (user, dial) topBlade100.000.0 bottomBlade50.000.0 gap50.00 offset75.00 2.ISardana> mv gap 10 3.ISardana> wa Current Positions (user, dial) topBlade80.00-20.0 bottomBlade70.00 20.0 gap10.00 offset75.00 4.ISardana> IPython By the way: This is a 300 line of code example!

11 The Sardana device pool for SPEC lovers - BLISS Seminar - January 15, 2007

12 Current state Server –Multi-threaded Pool core –Motor Controller –Motor –Pseudo Motor –Motor Group –Counter Controller* –Counter, Timer* Client –IPython (not up to date) –Java ATK configuration (up to date) Simulators –Motor Controller –Counter Controller Motor Controllers: –IcePap *Early development stage

13 The Sardana device pool for SPEC lovers - BLISS Seminar - January 15, 2007 Future data acquisition –counter –timer –pseudo counter –multimeter –MCA –CCD –data storage –... scan operations data acquisition simulator geometry library safety –static pre-conditions –dynamic limit check –... IPython client GUI Plotting Macros windows platform SPEC interaction …

14 The Sardana device pool for SPEC lovers - BLISS Seminar - January 15, 2007 Thank you for your time Questions

15 The Sardana device pool for SPEC lovers - BLISS Seminar - January 15, 2007 Nice Features # ipython Welcome to the IPython Sardana CLI SPEC emulator 1.ISardana> wa Current Positions (user, dial) topBlade100.000.0 bottomBlade50.000.0 gap50.00 offset75.00 2.ISardana> mv gap 10 3.ISardana> # ipython Welcome to the IPython Sardana CLI SPEC emulator 1.ISardana> wa Current Positions (user, dial) topBlade100.000.0 bottomBlade50.000.0 gap50.00 offset75.00 2.ISardana> mv gap 10 3.ISardana> IPython Sardana Add/modify features without havingAdd/modify features without having restart the server Multiple clientsMultiple clients Copy/paste beamlineCopy/paste beamlineconfigurations

16 The Sardana device pool for SPEC lovers - BLISS Seminar - January 15, 2007 Sardana Layer CORBA Sardana Tango motors, counters, scans, procedures, data files IPythonATK SPEC BLISSFramework Network Abstraction Layer Devices, commands, attributes, properties CLI user interface


Download ppt "The Sardana device pool for SPEC lovers - BLISS Seminar - January 15, 2007 The Sardana device pool for SPEC lovers BLISS Seminar January 15, 2007 Tiago."

Similar presentations


Ads by Google