def setFreeButtonMapping(self, button, shot, APMmode): # our index is 0 -> Button A, 1 -> Button B index = button - btn_msg.ButtonA if index < 0 or index > 1: logger.log("[button]: Error, someone tried to map button %d" % (button)) return if APMmode not in modes.MODE_NAMES.keys(): logger.log( "[button]: Error, someone tried to map an invalid mode %d" % (APMmode)) return if shot not in shots.SHOT_NAMES.keys(): logger.log( "[button]: Error, someone tried to map an invalid shot %d" % (shot)) return self.freeButtonMappings[index] = (shot, APMmode) self.setButtonMappings() buttonName = "A" if button == btn_msg.ButtonA else "B" value = "%d, %d" % (shot, APMmode) settings.writeSetting(buttonName, value)
def setGoProEnabled(self, enabled): self.enabled = enabled value = 1 if enabled else 0 settings.writeSetting("GoProEnabled", str(value)) self.setGimbalEnabledParam() logger.log("[gopro]: We have set GoProEnabled to %d" % (value))