Esempio n. 1
0
def Cchange() -> bool:
    if oCard.getState():
        # change and come to same card option for further dev
        oCard.setState(0)
        oCard.setUsedSpace(0)
        oCard.setState(1)
        return True
    else:
        return False
Esempio n. 2
0
def CremovePhoto(currentPhoto=0):
    if oCard.getState():
        if not oCard.getUsageState():
            oCard.setInUsageState(1)
            oCard.delete("Photo", currentPhoto)
            time.sleep(0.2)
            oCard.setInUsageState(0)
        else:
            pass
            # info about busy card slot
    else:
        pass
Esempio n. 3
0
def CreadFromCard(currentPhoto=0):
    if oCard.getState():
        if not oCard.getUsageState():
            oCard.setInUsageState(1)
            temp = oCard.read("Photo", currentPhoto)
            time.sleep(temp.size / oCard.getReadSpeed())
            # show info about photo
            oCard.setInUsageState(0)
            return temp.showPhoto()
        else:
            pass
            # info about busy card
    else:
        pass
Esempio n. 4
0
def TURNOFF() -> bool:
    if oBattery.getState():
        if oBody.getState():
            if oCard.getState():
                if oCard.getUsageState():
                    return False
                    #card still in usage
            if oSensor.getState():
                return False
                # sensor still in usage
            if oShutter.getState():
                return False
                # shutter still in usage
            if oLens.getState():
                if oAperture.getState():
                    return False
                    # aperture still enclosed in usage

            oDisplay.setState(0)
            oShutter.setEnclosureState(0)
            oShutter.setState(0) # shutter is not busy when cam is off
            oSensor.setAction('lv')
            oSensor.setState(-1)
            if oLens.getState():
                oAperture.setState(0)
            if oCard.getState():
                oCard.setInUsageState(0)
            oBody.setMode('lv')
            oBody.setState(0)
            return True

        else:
            return False
            # camera not turned on
    else:
        return False
Esempio n. 5
0
def CwriteToCard(photo: Photo):
    if oCard.getState():
        if not oCard.getUsageState():
            oCard.setInUsageState(1)
            if oCard.write(photo):
                # writing file to card promp
                time.sleep(photo.size / oCard.getWriteSpeed())
                # saved
            else:
                pass
                # not enough space promp
            oCard.setInUsageState(0)
        else:
            pass
            # info about busy card
    else:
        pass