|
@@ -1,5 +1,6 @@
|
|
|
|
|
|
|
|
|
+import 'package:fis_common/logger/logger.dart';
|
|
|
import 'package:fis_i18n/i18n.dart';
|
|
|
import 'package:fis_jsonrpc/rpc.dart';
|
|
|
import 'package:fis_measure/process/workspace/measure_data_controller.dart';
|
|
@@ -15,9 +16,9 @@ part './measure_configuration_style_components.dart';
|
|
|
|
|
|
|
|
|
class MeasureSelectModel {
|
|
|
- MeasureSelectModel({required this.name, required this.code});
|
|
|
+ MeasureSelectModel({required this.name, required this.value});
|
|
|
final String name;
|
|
|
- final String code;
|
|
|
+ final int value;
|
|
|
}
|
|
|
|
|
|
MeasureCursorType getMeasureSystemSettingCursorType(
|
|
@@ -153,19 +154,19 @@ class _PatternBodyState extends FState<PatternBody> {
|
|
|
static final List<MeasureSelectModel> C_MEASURE_TEXT_SIZE = [
|
|
|
MeasureSelectModel(
|
|
|
name: '10',
|
|
|
- code: '10',
|
|
|
+ value: 10,
|
|
|
),
|
|
|
MeasureSelectModel(
|
|
|
name: '18',
|
|
|
- code: '18',
|
|
|
+ value: 18,
|
|
|
),
|
|
|
MeasureSelectModel(
|
|
|
name: '20',
|
|
|
- code: '20',
|
|
|
+ value: 20,
|
|
|
),
|
|
|
MeasureSelectModel(
|
|
|
name: '32',
|
|
|
- code: '32',
|
|
|
+ value: 32,
|
|
|
),
|
|
|
];
|
|
|
|
|
@@ -277,12 +278,17 @@ class _PatternBodyState extends FState<PatternBody> {
|
|
|
_PatternItem(
|
|
|
title: i18nBook.measure.fontSize.t,
|
|
|
item: _PatternItemSelect(
|
|
|
- textSize: C_MEASURE_TEXT_SIZE,
|
|
|
+ itemList: C_MEASURE_TEXT_SIZE,
|
|
|
value: widget.measureSystemSetting.fontSize.toString(),
|
|
|
onChanged: (value) {
|
|
|
- setState(() {
|
|
|
- measureData.measureSystemSetting.fontSize = value;
|
|
|
- });
|
|
|
+ try {
|
|
|
+ setState(() {
|
|
|
+ measureData.measureSystemSetting.fontSize =
|
|
|
+ int.parse(value);
|
|
|
+ });
|
|
|
+ } catch (e) {
|
|
|
+ logger.e("int.parse failed", e);
|
|
|
+ }
|
|
|
},
|
|
|
),
|
|
|
),
|
|
@@ -324,7 +330,8 @@ class _PatternBodyState extends FState<PatternBody> {
|
|
|
item: _PatternItemSwitch(
|
|
|
onChanged: (value) {
|
|
|
setState(() {
|
|
|
- widget.measureSystemSetting.showDepthGuideline = value;
|
|
|
+ measureData.measureSystemSetting.showDepthGuideline =
|
|
|
+ value;
|
|
|
});
|
|
|
},
|
|
|
value: widget.measureSystemSetting.showDepthGuideline,
|
|
@@ -336,7 +343,8 @@ class _PatternBodyState extends FState<PatternBody> {
|
|
|
item: _PatternItemSwitch(
|
|
|
onChanged: (value) {
|
|
|
setState(() {
|
|
|
- widget.measureSystemSetting.showBriefAnnotation = value;
|
|
|
+ measureData.measureSystemSetting.showBriefAnnotation =
|
|
|
+ value;
|
|
|
});
|
|
|
},
|
|
|
value: widget.measureSystemSetting.showBriefAnnotation,
|
|
@@ -346,12 +354,13 @@ class _PatternBodyState extends FState<PatternBody> {
|
|
|
_PatternItem(
|
|
|
title: i18nBook.measure.autoAdjustCursor.t,
|
|
|
item: _PatternItemSelect(
|
|
|
- textSize: C_MEASURE_TEXT_SIZE,
|
|
|
- value:
|
|
|
- widget.measureSystemSetting.minCursorDistance.toString(),
|
|
|
+ itemList: C_MEASURE_TEXT_SIZE,
|
|
|
+ value: widget.measureSystemSetting.minCursorDistance ??
|
|
|
+ C_MEASURE_TEXT_SIZE[0].value.toString(),
|
|
|
onChanged: (value) {
|
|
|
setState(() {
|
|
|
- widget.measureSystemSetting.minCursorDistance = value;
|
|
|
+ measureData.measureSystemSetting.minCursorDistance =
|
|
|
+ value;
|
|
|
});
|
|
|
},
|
|
|
),
|
|
@@ -360,12 +369,12 @@ class _PatternBodyState extends FState<PatternBody> {
|
|
|
_PatternItem(
|
|
|
title: i18nBook.measure.autoCaptureRange.t,
|
|
|
item: _PatternItemSelect(
|
|
|
- textSize: C_MEASURE_TEXT_SIZE,
|
|
|
- value:
|
|
|
- widget.measureSystemSetting.autoSnapDistance.toString(),
|
|
|
+ itemList: C_MEASURE_TEXT_SIZE,
|
|
|
+ value: widget.measureSystemSetting.autoSnapDistance ??
|
|
|
+ C_MEASURE_TEXT_SIZE[0].value.toString(),
|
|
|
onChanged: (value) {
|
|
|
setState(() {
|
|
|
- widget.measureSystemSetting.autoSnapDistance = value;
|
|
|
+ measureData.measureSystemSetting.autoSnapDistance = value;
|
|
|
});
|
|
|
},
|
|
|
),
|
|
@@ -374,13 +383,18 @@ class _PatternBodyState extends FState<PatternBody> {
|
|
|
_PatternItem(
|
|
|
title: i18nBook.measure.annotationFontSize.t,
|
|
|
item: _PatternItemSelect(
|
|
|
- textSize: C_MEASURE_TEXT_SIZE,
|
|
|
+ itemList: C_MEASURE_TEXT_SIZE,
|
|
|
value:
|
|
|
widget.measureSystemSetting.annotationFontSize.toString(),
|
|
|
onChanged: (value) {
|
|
|
- setState(() {
|
|
|
- widget.measureSystemSetting.annotationFontSize = value;
|
|
|
- });
|
|
|
+ try {
|
|
|
+ setState(() {
|
|
|
+ measureData.measureSystemSetting.annotationFontSize =
|
|
|
+ int.parse(value);
|
|
|
+ });
|
|
|
+ } catch (e) {
|
|
|
+ logger.e("int.parse failed", e);
|
|
|
+ }
|
|
|
},
|
|
|
),
|
|
|
),
|
|
@@ -390,7 +404,7 @@ class _PatternBodyState extends FState<PatternBody> {
|
|
|
item: _PatternItemSwitch(
|
|
|
onChanged: (value) {
|
|
|
setState(() {
|
|
|
- widget.measureSystemSetting.showProtocolInWorkSheet =
|
|
|
+ measureData.measureSystemSetting.showProtocolInWorkSheet =
|
|
|
value;
|
|
|
});
|
|
|
},
|
|
@@ -403,7 +417,7 @@ class _PatternBodyState extends FState<PatternBody> {
|
|
|
item: _PatternItemSwitch(
|
|
|
onChanged: (value) {
|
|
|
setState(() {
|
|
|
- widget.measureSystemSetting.showAnnotation = value;
|
|
|
+ measureData.measureSystemSetting.showAnnotation = value;
|
|
|
});
|
|
|
},
|
|
|
value: widget.measureSystemSetting.showAnnotation,
|