mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-23 16:00:41 +00:00
integrated calibration to the metering bloc
This commit is contained in:
parent
dda0a38a0f
commit
43990ffd5e
3 changed files with 4 additions and 2 deletions
|
@ -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
|
||||||
|
|
|
@ -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));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue