This commit is contained in:
Vadim 2023-05-16 09:42:48 +02:00
parent c8ab4a362e
commit 44fa4460fd
3 changed files with 28 additions and 23 deletions

View file

@ -132,11 +132,13 @@ class MeteringBloc extends Bloc<MeteringEvent, MeteringState> {
_meteringInteractor.quickVibration();
_communicationBloc.add(const communication_events.MeasureEvent());
_isMeteringInProgress = true;
emit(LoadingState(
film: _film,
iso: _iso,
nd: _nd,
));
emit(
LoadingState(
film: _film,
iso: _iso,
nd: _nd,
),
);
}
void _updateMeasurements() => _handleEv100(_ev100);
@ -153,27 +155,31 @@ class MeteringBloc extends Bloc<MeteringEvent, MeteringState> {
_meteringInteractor.responseVibration();
_ev100 = event.ev100;
final ev = event.ev100 + log2(_iso.value / 100) - _nd.stopReduction;
emit(MeteringDataState(
ev: ev,
film: _film,
iso: _iso,
nd: _nd,
exposurePairs: _buildExposureValues(ev),
continuousMetering: _isMeteringInProgress,
));
emit(
MeteringDataState(
ev: ev,
film: _film,
iso: _iso,
nd: _nd,
exposurePairs: _buildExposureValues(ev),
continuousMetering: _isMeteringInProgress,
),
);
}
void _onMeasureError(MeasureErrorEvent _, Emitter emit) {
_meteringInteractor.errorVibration();
_ev100 = null;
emit(MeteringDataState(
ev: null,
film: _film,
iso: _iso,
nd: _nd,
exposurePairs: const [],
continuousMetering: _isMeteringInProgress,
));
emit(
MeteringDataState(
ev: null,
film: _film,
iso: _iso,
nd: _nd,
exposurePairs: const [],
continuousMetering: _isMeteringInProgress,
),
);
}
List<ExposurePair> _buildExposureValues(double ev) {

View file

@ -193,7 +193,7 @@ class CameraContainerBloc extends EvSourceBlocBase<CameraContainerEvent, CameraC
final apertureValueRatio = (tags["EXIF FNumber"]?.values as IfdRatios?)?.ratios.first;
final speedValueRatio = (tags["EXIF ExposureTime"]?.values as IfdRatios?)?.ratios.first;
if (iso == null || apertureValueRatio == null || speedValueRatio == null) {
log('Error parsing EXIF: ${tags.keys.toString()}');
log('Error parsing EXIF: ${tags.keys}');
return null;
}

View file

@ -2,7 +2,6 @@ import 'package:clipboard/clipboard.dart';
import 'package:flutter/material.dart';
import 'package:lightmeter/environment.dart';
import 'package:lightmeter/generated/l10n.dart';
import 'package:lightmeter/res/dimens.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';