From 43990ffd5e61b7db99bd1a7664e243edeff26781 Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Wed, 25 Jan 2023 22:42:10 +0300 Subject: [PATCH] integrated calibration to the metering bloc --- lib/interactors/metering_interactor.dart | 2 ++ lib/screens/metering/ev_source/camera/bloc_camera.dart | 2 +- .../components/calibration_dialog/bloc_dialog_calibration.dart | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/interactors/metering_interactor.dart b/lib/interactors/metering_interactor.dart index 0905a01..6a58905 100644 --- a/lib/interactors/metering_interactor.dart +++ b/lib/interactors/metering_interactor.dart @@ -10,6 +10,8 @@ class MeteringInteractor { this._hapticsService, ); + double get cameraEvCalibration => _userPreferencesService.cameraEvCalibration; + bool get isHapticsEnabled => _userPreferencesService.haptics; /// Executes vibration if haptics are enabled in settings diff --git a/lib/screens/metering/ev_source/camera/bloc_camera.dart b/lib/screens/metering/ev_source/camera/bloc_camera.dart index fefc0fd..5ee7552 100644 --- a/lib/screens/metering/ev_source/camera/bloc_camera.dart +++ b/lib/screens/metering/ev_source/camera/bloc_camera.dart @@ -61,7 +61,7 @@ class CameraBloc extends EvSourceBloc { if (communicationState is communication_states.MeasureState) { _takePhoto().then((ev100) { if (ev100 != null) { - communicationBloc.add(communication_event.MeasuredEvent(ev100)); + communicationBloc.add(communication_event.MeasuredEvent(ev100 + _meteringInteractor.cameraEvCalibration)); } }); } diff --git a/lib/screens/settings/components/calibration/components/calibration_dialog/bloc_dialog_calibration.dart b/lib/screens/settings/components/calibration/components/calibration_dialog/bloc_dialog_calibration.dart index d14dd6c..1466d04 100644 --- a/lib/screens/settings/components/calibration/components/calibration_dialog/bloc_dialog_calibration.dart +++ b/lib/screens/settings/components/calibration/components/calibration_dialog/bloc_dialog_calibration.dart @@ -23,7 +23,7 @@ class CalibrationDialogBloc extends Bloc