integrated calibration to the metering bloc

This commit is contained in:
Vadim 2023-01-25 22:42:10 +03:00
parent dda0a38a0f
commit 43990ffd5e
3 changed files with 4 additions and 2 deletions

View file

@ -10,6 +10,8 @@ class MeteringInteractor {
this._hapticsService, this._hapticsService,
); );
double get cameraEvCalibration => _userPreferencesService.cameraEvCalibration;
bool get isHapticsEnabled => _userPreferencesService.haptics; bool get isHapticsEnabled => _userPreferencesService.haptics;
/// Executes vibration if haptics are enabled in settings /// Executes vibration if haptics are enabled in settings

View file

@ -61,7 +61,7 @@ class CameraBloc extends EvSourceBloc<CameraEvent, CameraState> {
if (communicationState is communication_states.MeasureState) { if (communicationState is communication_states.MeasureState) {
_takePhoto().then((ev100) { _takePhoto().then((ev100) {
if (ev100 != null) { if (ev100 != null) {
communicationBloc.add(communication_event.MeasuredEvent(ev100)); communicationBloc.add(communication_event.MeasuredEvent(ev100 + _meteringInteractor.cameraEvCalibration));
} }
}); });
} }

View file

@ -23,7 +23,7 @@ class CalibrationDialogBloc extends Bloc<CalibrationDialogEvent, CalibrationDial
void _onCameraEvCalibrationReset(CameraEvCalibrationResetEvent event, Emitter emit) { void _onCameraEvCalibrationReset(CameraEvCalibrationResetEvent event, Emitter emit) {
_settingsInteractor.quickVibration(); _settingsInteractor.quickVibration();
_cameraEvCalibration = _settingsInteractor.cameraEvCalibration; _cameraEvCalibration = 0;
emit(CalibrationDialogState(_cameraEvCalibration)); emit(CalibrationDialogState(_cameraEvCalibration));
} }