Пример #1
0
    def initCam(self):
#        print('init cam')
        self.mte = cameraClass.picam()
        #camProp=self.mte.getAvailableCameras()
        print('camIDconnected :',self.camID)
        self.mte.connect(self.camID)
        self.threadTemp = ThreadTemperature(mte=self.mte)
        self.threadTemp.stopTemp=False
        self.threadTemp.TEMP.connect(self.update_temp)
        self.threadTemp.start()
        self.mte.SetAdcConf( gain="High", speed=1.0)
        self.mte.setParameter("CleanCycleCount"     , int(1))
        self.mte.setParameter("CleanCycleHeight"    , int(1))
        self.mte.setParameter("ExposureTime"        , int(100))
        #self.mte.setParameter("TriggerResponse"     , int(1)) # pas de trig
        self.mte.setParameter("TriggerDetermination", int(1))
        self.w = self.mte.getParameter("ActiveWidth")
        self.h = self.mte.getParameter("ActiveHeight")
        self.mte.setROI(0, self.w, 1, 0, self.h, 1, 0) # full frame
        self.mte.sendConfiguration()
        self.dimx=self.w
        self.dimy=self.h
#        print('adc',self.mte.getParameter("AdcSpeed"))
#        print('ShutterTimingMode',self.mte.getParameter("ShutterTimingMode"))
        self.mte.SetTemperature(20)
        self.mte.sendConfiguration()
        self.tempWidget=TEMPWIDGET(mte=self.mte)
        print('analog Gain',self.mte.getParameter("AdcAnalogGain"))
Пример #2
0
    def initCam(self):
#        print('init cam')
        self.mte = cameraClass.picam()
        camProp=self.mte.getAvailableCameras()
        print('Camera name is : ' ,str(self.ccdName))
        serialAvailable=camProp[2]
        modelAvailable=camProp[0]
        
        self.serial=self.conf.value(self.nbcam+"/serial")
#        print(len(serialAvailable))
        if self.serial==serialAvailable[0].decode():
            self.camID=0
        if len(serialAvailable)>1:
            if self.serial==serialAvailable[1].decode():
                self.camID=1
        if len(serialAvailable)>2:
            if self.serial==serialAvailable[2].decode():
                self.camID=2
        
        try :
            self.mte.connect(self.camID)
            self.setWindowTitle(str(self.ccdName)+'  '+str(modelAvailable[self.camID])+ '  S/N : '+str(serialAvailable[self.camID].decode())+'       v.'+ version)
            self.isConnected=True
        except :
            try:
                self.mte.connect(0)
                self.setWindowTitle(str(self.ccdName)+ '  S/N :'+str(serialAvailable[0].decode())+'       v.'+ version)
                self.camID=0
                self.isConnected=True
            except:
                self.isConnected=False
        
        if self.isConnected==True: 
            self.sh=int(self.conf.value(self.nbcam+"/shutter")   )
            
            self.threadTemp = ThreadTemperature(mte=self.mte)
            self.threadTemp.stopTemp=False
            self.threadTemp.TEMP.connect(self.update_temp)
            self.threadTemp.start()
            
            self.mte.setParameter("CleanCycleCount"     , int(1))
            self.mte.setParameter("CleanCycleHeight"    , int(1))
            self.mte.setParameter("ExposureTime"        , int(100))
            #self.mte.setParameter("TriggerResponse"     , int(1)) # pas de trig
            self.mte.setParameter("TriggerDetermination", int(1))
            self.w = self.mte.getParameter("ActiveWidth")
            self.h = self.mte.getParameter("ActiveHeight")
            self.mte.setROI(0, self.w, 1, 0, self.h, 1, 0) # full frame
            self.mte.setParameter("ExposureTime", int(self.sh))
            self.mte.sendConfiguration()
            self.dimx=self.w
            self.dimy=self.h
    #        print('adc',self.mte.getParameter("AdcSpeed"))
    #        print('ShutterTimingMode',self.mte.getParameter("ShutterTimingMode"))
            self.mte.SetTemperature(20)
            self.mte.sendConfiguration()
            self.tempWidget=TEMPWIDGET(mte=self.mte)