1

I have written 2 separate classes in 2 separate files. File 1 named atcore_py.pyx hadAndorCameraSDK and file 2 has a python class AndorCameraGUI. Find below the snippets of each of them.

File 1: 
cdef class AndorCameraSDK(object):
    def __cinit__(self, master):
        print('SDK Init') # Show that AndorCameraSDK.__init__ runs
        self.master = master         # Save reference to master

    def LiveAcquisition(self):
       print('SDK LiveAcquisition') # Show that AndorCameraSDK.LiveAcquisition runs
       pBuf = 'Some data'       # Dummy data
       self.master.LivePlot(pBuf ) # Call instance of AndorCameraGUI.LivePlot

file 2: 
import AndorCameraSDK as andorcamera
class AndorCameraGUI(andorcamera):
def __init__(self):
    print('GUI Init') # Show that AndorCameraGUI.__init__ runs

def LiveImageGUI(self):
    print('GUI LiveImageGUI') # Show that AndorCameraGUI.LiveImageGUI runs
    self.camera = andorcamera(self) # Create instance of AndorCameraSDK
    self.camera.LiveAcquisition() # Call AndorCameraSDK.LiveAcquisition

def LivePlot(self):
    print('GUI LivePlot') # Show that AndorCameraGUI.LivePlot runs

app = AndorCameraGUI()
app.LiveImageGUI() 

I am able to call functions within AndorCameraSDK in AndorCameraGUI. but the reverse doesnt work.It returns saying self.master = master is not an attribute in AndorCameraSDK. could anyone tell me how could I fix this issue.

0 Answers0