OrsayDev / OrsayLaser

Instrumentation for Laser / Blanker / Gain usage in Nionswift
0 stars 0 forks source link

Broken func in 0.15.1 @ gain_panel.py #39

Closed yvesauad closed 3 years ago

yvesauad commented 4 years ago

My good old trick of finding the data item using a standardized way of naming them are simply broken now. Nionwisft 0.15.1 removed from class DocumentModel the function get_data_item_by_title('TITLE')

Well, nothing super bad as now data_items are part of a big list(), which in fact makes sense.

for data_items in self.document_controller.document_model._DocumentModel__data_items:
            if data_items.title == 'Laser Wavelength ' + str(nacq):
                nacq += 1

You can simply check data_item existence using above snippet. You check directly in object self.__data_items for the object .title.

Putting as an issue because 100% of my data treatement is based on this, but i haven't fixed it yet (other stuff to do now) so i remember what i must do next