QMAPP-mq / qudi

A modular laboratory experiment management suite.
GNU General Public License v3.0
4 stars 0 forks source link

ntmdt.getConfiguration() behaves different on different machines #38

Closed mvbnano closed 6 years ago

mvbnano commented 6 years ago

On anteroom PC ntmdt.getConfiguration() returns:

OrderedDict([('module.Class', 'motor.ntmdt_piezo_stage.PiezoStageNTMDT'),
             ('axis_labels', ['x', 'y', 'z', 'tube_x', 'tube_y', 'tube_z']),
             ('x',
              OrderedDict([('device_id', 1),
                           ('channel', 0),
                           ('constraints',
                            OrderedDict([('pos_min', 0.0),
                                         ('pos_max', 0.0001)]))])),
             ('y',
              OrderedDict([('device_id', 1),
                           ('channel', 1),
                           ('constraints',
                            OrderedDict([('pos_min', 0.0),
                                         ('pos_max', 0.0001)]))])),
             ('z',
              OrderedDict([('device_id', 1),
                           ('channel', 2),
                           ('constraints',
                            OrderedDict([('pos_min', 0.0),
                                         ('pos_max', 6e-06)]))])),
             ('tube_x',
              OrderedDict([('device_id', 0),
                           ('channel', 0),
                           ('constraints',
                            OrderedDict([('pos_min', 0.0),
                                         ('pos_max', 0.0001)]))])),
             ('tube_y',
              OrderedDict([('device_id', 0),
                           ('channel', 0),
                           ('constraints',
                            OrderedDict([('pos_min', 0.0),
                                         ('pos_max', 0.0001)]))])),
             ('tube_z',
              OrderedDict([('device_id', 0),
                           ('channel', 0),
                           ('constraints',
                            OrderedDict([('pos_min', 0.0),
                                         ('pos_max', 6e-06)]))]))])

wheras on netbook laptop ntmdt.getConfiguration() returns:

OrderedDict([('x',
              {'channel': 0,
               'label': 'x',
               'pos_max': 0.0001,
               'pos_min': 0.0,
               'scanner': 1}),
             ('y',
              {'channel': 1,
               'label': 'y',
               'pos_max': 0.0001,
               'pos_min': 0.0,
               'scanner': 1}),
             ('z',
              {'channel': 2,
               'label': 'z',
               'pos_max': 6e-06,
               'pos_min': 0.0,
               'scanner': 1}),
             ('tube_x',
              {'channel': 0,
               'label': 'tube_x',
               'pos_max': 0.0001,
               'pos_min': 0.0,
               'scanner': 0}),
             ('tube_y',
              {'channel': 0,
               'label': 'tube_y',
               'pos_max': 0.0001,
               'pos_min': 0.0,
               'scanner': 0}),
             ('tube_z',
              {'channel': 0,
               'label': 'tube_z',
               'pos_max': 6e-06,
               'pos_min': 0.0,
               'scanner': 0})])
mvbnano commented 6 years ago

The difference is that ntmdt._configuration['axis_labels'] is not created on the netbook laptop.

@latchr would you have any idea as to why this is?

mvbnano commented 6 years ago

Work-around created on branch hack_ntmdt_stage, and tube axes removed from qmapp_ntmdt_dev_vm.cfg.

mvbnano commented 6 years ago

This is a reoccurring bug that is now effecting everything.

The netbook laptop is returning KeyError: 'device_id' when calling

constraints = self.get_constraints()

Something is happening to cause the configuration not to load completely!

On the netbook laptop config = getConfiguration() returns:

OrderedDict([('x',
              {'channel': 0,
               'label': 'x',
               'pos_max': 0.0001,
               'pos_min': 0.0,
               'scanner': 1}),
             ('y',
              {'channel': 1,
               'label': 'y',
               'pos_max': 0.0001,
               'pos_min': 0.0,
               'scanner': 1}),
             ('z',
              {'channel': 2,
               'label': 'z',
               'pos_max': 6e-06,
               'pos_min': 0.0,
               'scanner': 1})])

Whereas on the anteroom PC, config = getConfiguration() returns:

OrderedDict([('module.Class', 'motor.ntmdt_piezo_stage.PiezoStageNTMDT'),
             ('remoteaccess', True),
             ('axis_labels', ['x', 'y', 'z', 'tube_x', 'tube_y', 'tube_z']),
             ('x',
              OrderedDict([('device_id', 1),
                           ('channel', 0),
                           ('constraints',
                            OrderedDict([('pos_min', 0.0),
                                         ('pos_max', 0.0001)]))])),
             ('y',
              OrderedDict([('device_id', 1),
                           ('channel', 1),
                           ('constraints',
                            OrderedDict([('pos_min', 0.0),
                                         ('pos_max', 0.0001)]))])),
             ('z',
              OrderedDict([('device_id', 1),
                           ('channel', 2),
                           ('constraints',
                            OrderedDict([('pos_min', 0.0),
                                         ('pos_max', 6e-06)]))]))])
mvbnano commented 6 years ago

It works now with no error given on the netbook laptop but still the KeyError on the PC connecting to it remotely.

I don't understand what is going on, but it seems to be working for now.

mvbnano commented 6 years ago

One of these responses is the configuration and the other is the constraints. Regardless, I do not understand why I am getting the KeyError.

mvbnano commented 6 years ago

Update this morning:

Somehow, the module loads find on the netbook laptop (still config = getConfiguration() returns different).

The KeyError is just occurring when the module is activated on the PC connecting to the netbook to use the stage module.

The KeyError then reoccurs when the confocal gui is activated.

Communication with the stage appears fine, so does this even matter?

mvbnano commented 6 years ago

Commit 8018964a96305e9f4988de51489cb76de03467ff moved

self._configuration = self.get_constraints()

to load regardless of whether the Nova Px handshake is successful. This had no effect in resolving the KeyError.

As a result of this error, the confocal cannot build its 'blank' xy scan area when it is activated.

mvbnano commented 6 years ago

Loading the confocal on the PC (that uses the remote hardware from the netbook) will trigger the KeyError on the netbook also.

mvbnano commented 6 years ago

This was smartly resolved by @latchr in commit 08cd2dd04df9fbcf8eb7c4bbf71041cb8ae7015a.

This bug may be present on other dev branches!!

Therefore, this issue should stay open until they are checked.

mvbnano commented 6 years ago

checked and corrected all motor dev branchs. note that pi dev branch may be ready to send upstream.