ISO value change callback
This commit is contained in:
@@ -43,13 +43,23 @@ class AperturePriorityPage(Gtk.Box):
|
||||
aperture_priority_aperture_dropdown = Gtk.Template.Child()
|
||||
aperture_priority_time_label = Gtk.Template.Child()
|
||||
|
||||
def onValuesChanged(self, isoSpeed: int, sensorValue: float, sensorUnit: str):
|
||||
lastSensorValue = None
|
||||
|
||||
def onValuesChanged(self, isoSpeed: int, sensorValue: float, sensorUnit: str):
|
||||
# Check the unit is absolute ("lux")
|
||||
if sensorUnit != "lux":
|
||||
return
|
||||
|
||||
self.lastSensorValue = sensorValue
|
||||
self.updateView(isoSpeed, sensorValue)
|
||||
|
||||
|
||||
def onIsoSpeedChanged(self, isoSpeed: int):
|
||||
if self.lastSensorValue:
|
||||
self.updateView(isoSpeed, self.lastSensorValue)
|
||||
|
||||
def updateView(self, isoSpeed: int, sensorValue: float):
|
||||
apertureValue = self.aperture_priority_speed_dropdown_values[self.aperture_priority_aperture_dropdown.get_selected()]
|
||||
shutterSpeed = EVCalculator.calcShutterSpeed(isoSpeed, sensorValue, apertureValue)
|
||||
# TODO: Round shutter speed value to nearest existing value and set label color to red if outside 1 stop range
|
||||
self.aperture_priority_time_label.set_label("f/ {:.2f}".format(shutterSpeed))
|
||||
|
||||
|
@@ -30,3 +30,5 @@ class ManualExposurePage(Gtk.Box):
|
||||
if sensorUnit != "lux":
|
||||
return
|
||||
|
||||
def onIsoSpeedChanged(self, isoSpeed: int):
|
||||
print("ME: onIsoSpeedChanged {}".format(isoSpeed))
|
||||
|
@@ -44,3 +44,5 @@ class SensorReadingsPage(Gtk.Box):
|
||||
if self.ev_label:
|
||||
self.ev_label.set_label("{:.1f} EV".format(ev))
|
||||
|
||||
def onIsoSpeedChanged(self, isoSpeed: int):
|
||||
print("SR: onIsoSpeedChanged {}".format(isoSpeed))
|
||||
|
@@ -51,13 +51,22 @@ class TimePriorityPage(Gtk.Box):
|
||||
time_priority_speed_dropdown = Gtk.Template.Child()
|
||||
time_priority_aperture_label = Gtk.Template.Child()
|
||||
|
||||
lastSensorValue = None
|
||||
|
||||
def onValuesChanged(self, isoSpeed: int, sensorValue: float, sensorUnit: str):
|
||||
# Check the unit is absolute ("lux")
|
||||
if sensorUnit != "lux":
|
||||
return
|
||||
|
||||
self.lastSensorValue = sensorValue
|
||||
self.updateView(isoSpeed, sensorValue)
|
||||
|
||||
def onIsoSpeedChanged(self, isoSpeed: int):
|
||||
if self.lastSensorValue:
|
||||
self.updateView(isoSpeed, self.lastSensorValue)
|
||||
|
||||
def updateView(self, isoSpeed: int, sensorValue: float):
|
||||
shutterSpeed = self.time_priority_speed_dropdown_values[self.time_priority_speed_dropdown.get_selected()]
|
||||
apertureValue = EVCalculator.calcAperture(isoSpeed, sensorValue, shutterSpeed)
|
||||
# TODO: Round aperture value to nearest existing value and set label color to red if outside 1 stop range
|
||||
self.time_priority_aperture_label.set_label("f/ {:.2f}".format(apertureValue))
|
||||
|
||||
|
Reference in New Issue
Block a user