1616from m4 .ground import logger_set_up as lsu , timestamp , read_data as rd
1717
1818#put the imports from Mic Library
19+ from Microgate .adopt .AOClient import AO_CLIENT
20+ #this import reads automatically the HW configuration of the system, as a TN conf passed. in the TN all the relevant data are stored
1921
2022#here we define the M4 class.
2123#implement it properly!!!
@@ -57,15 +59,63 @@ class AdOpticaDM(BaseDeformableMirror): #ereditare BaseDeformableMirror #forse
5759
5860 """
5961
60- def __init__ (self , tracknum ):
62+ def __init__ (self , tracknum = None ):
6163 """The constructor"""
64+ """
6265 print(f"Initializing the M4AU with configuration: '{os.path.join(fn.MIRROR_FOLDER,tracknum)}'")
6366 self.dmConf = os.path.join(fn.MIRROR_FOLDER,tracknum)
6467 self.nActs = self._initNActuators()
6568 self.mirrorModes = self._initMirrorModes()
6669 self.actCoord = self._initActCoord()
6770 self.workingActs = self._initWorkingActs()
71+ """
72+ self ._aoClient = AO_CLIENT (tracknum )
73+ ffm = (self ._aoClient .aoSystem .sysConf .gen .FFWDSvdMatrix )[0 ]#
74+ ff = self ._aoClient .aoSystem .sysConf .gen .FFWDMatrix
75+
76+ print ('init the DM with no configurations' )
77+
78+ def getCounter (self ):
79+ """
80+ Function which returns the current shape of the mirror.
81+
82+ Returns
83+ -------
84+ shape: numpy.ndarray
85+ Current shape of the mirror.
86+ """
87+ fc = self ._aoClient .getCounters ()
88+ skipByCommand = fc .skipByCommand
89+ #.....
90+ return skipByCommand
91+
92+ def get_shape (self ):
93+ """
94+ Function which returns the current shape of the mirror.
6895
96+ Returns
97+ -------
98+ shape: numpy.ndarray
99+ Current shape of the mirror.
100+ """
101+ #micLibrary.get_position()
102+ pos = self ._aoClient .getPosition ()
103+ return pos
104+
105+
106+ def get_force (self ):
107+ """
108+ Function which returns the current force applied to the mirror.
109+
110+ Returns
111+ -------
112+ force: numpy.ndarray
113+ Current force applied to the mirror actuators.
114+
115+ """
116+ #micLibrary.getForce()
117+ force = self ._aoClient .getForce ()
118+ return force
69119
70120 def set_shape (self , cmd ):#cmd, segment=None):
71121 """
@@ -84,6 +134,7 @@ def set_shape(self, cmd):#cmd, segment=None):
84134
85135 """
86136 #micLibrary.mirrorCommand(cmd)
137+ self ._aoClient .mirrorCommand (cmd )
87138 print ('Command applied' )
88139
89140
@@ -119,35 +170,6 @@ def runCmdHist():
119170 print ('Command history running...' )
120171
121172
122- def get_shape (self ):
123- """
124- Function which returns the current shape of the mirror.
125-
126- Returns
127- -------
128- shape: numpy.ndarray
129- Current shape of the mirror.
130- """
131- #micLibrary.get_position()
132- shape = 3
133- return shape
134-
135-
136- def get_force (self ):
137- """
138- Function which returns the current force applied to the mirror.
139-
140- Returns
141- -------
142- force: numpy.ndarray
143- Current force applied to the mirror actuators.
144-
145- """
146- #micLibrary.getForce()
147- force = 3
148- return force
149-
150-
151173 def _initNActuators (self ):
152174 """
153175 Function which reads the number of actuators of the DM from a configuration
0 commit comments