Skip to content

Commit f12fe78

Browse files
feat: Port the configuration screens for remaining instruments. (#2778)
Co-authored-by: Marc Nause <[email protected]>
1 parent 117c601 commit f12fe78

21 files changed

+1315
-15
lines changed

lib/l10n/app_en.arb

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@
290290
"showLuxmeterConfig": "Lux Meter Configurations",
291291
"luxmeterConfigurations": "Lux Meter Configurations",
292292
"updatePeriod": "Update Period",
293-
"updatePeriodHint": "Please provide time interval at which data will be updated (100 ms to 1000 ms)",
293+
"luxmeterUpdatePeriodHint": "Please provide time interval at which data will be updated (100 ms to 1000 ms)",
294294
"highLimit": "High Limit",
295-
"highLimitHint": "Please provide the maximum limit of lux value to be recorded (10 Lx to 10000 Lx)",
295+
"luxmeterHighLimitHint": "Please provide the maximum limit of lux value to be recorded (10 Lx to 10000 Lx)",
296296
"sensorGain": "Sensor Gain",
297297
"sensorGainHint": "Please set gain of the sensor",
298298
"locationData": "Include Location Data",
@@ -305,5 +305,14 @@
305305
"baroMeterBulletPoint1": "The Barometer can be used to measure Atmospheric pressure. This instrument is compatible with either the built in pressure sensor on any android device or the BMP-180 pressure sensor",
306306
"baroMeterBulletPoint2": "If you want to use the sensor BMP-180, connect the sensor to PSLab device as shown in the figure.",
307307
"baroMeterBulletPoint3": "The above pin configuration has to be same except for the pin GND. GND is meant for Ground and any of the PSLab device GND pins can be used since they are common.",
308-
"baroMeterBulletPoint4": "Select the sensor by going to the Configure tab from the bottom navigation bar and choose BMP-180 in the drop down menu under Select Sensor."
308+
"baroMeterBulletPoint4": "Select the sensor by going to the Configure tab from the bottom navigation bar and choose BMP-180 in the drop down menu under Select Sensor.",
309+
"soundmeterConfig" : "Soundmeter Configurations",
310+
"barometerConfig" : "Barometer Configurations",
311+
"baroUpdatePeriodHint" : "Please provide time interval at which data will be updated (100 ms to 2000 ms)",
312+
"barometerHighLimitHint" : "Please provide the maximum limit of lux value to be recorded (0 atm to 1.10 atm)",
313+
"gyroscopeConfigurations" : "Gyroscope Configurations",
314+
"gyroscopeHighLimitHint" : "Please provide the maximum limit of lux value to be recorded (0 rad/s to 1000 rad/s)",
315+
"accelerometerConfigurations" : "Accelerometer Configurations",
316+
"accelerometerUpdatePeriodHint" : "Please provide time interval at which data will be updated",
317+
"accelerometerHighLimitHint" : "Please provide the maximum limit of lux value to be recorded"
309318
}

lib/l10n/app_localizations.dart

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,23 +1834,23 @@ abstract class AppLocalizations {
18341834
/// **'Update Period'**
18351835
String get updatePeriod;
18361836

1837-
/// No description provided for @updatePeriodHint.
1837+
/// No description provided for @luxmeterUpdatePeriodHint.
18381838
///
18391839
/// In en, this message translates to:
18401840
/// **'Please provide time interval at which data will be updated (100 ms to 1000 ms)'**
1841-
String get updatePeriodHint;
1841+
String get luxmeterUpdatePeriodHint;
18421842

18431843
/// No description provided for @highLimit.
18441844
///
18451845
/// In en, this message translates to:
18461846
/// **'High Limit'**
18471847
String get highLimit;
18481848

1849-
/// No description provided for @highLimitHint.
1849+
/// No description provided for @luxmeterHighLimitHint.
18501850
///
18511851
/// In en, this message translates to:
18521852
/// **'Please provide the maximum limit of lux value to be recorded (10 Lx to 10000 Lx)'**
1853-
String get highLimitHint;
1853+
String get luxmeterHighLimitHint;
18541854

18551855
/// No description provided for @sensorGain.
18561856
///
@@ -1929,6 +1929,60 @@ abstract class AppLocalizations {
19291929
/// In en, this message translates to:
19301930
/// **'Select the sensor by going to the Configure tab from the bottom navigation bar and choose BMP-180 in the drop down menu under Select Sensor.'**
19311931
String get baroMeterBulletPoint4;
1932+
1933+
/// No description provided for @soundmeterConfig.
1934+
///
1935+
/// In en, this message translates to:
1936+
/// **'Soundmeter Configurations'**
1937+
String get soundmeterConfig;
1938+
1939+
/// No description provided for @barometerConfig.
1940+
///
1941+
/// In en, this message translates to:
1942+
/// **'Barometer Configurations'**
1943+
String get barometerConfig;
1944+
1945+
/// No description provided for @baroUpdatePeriodHint.
1946+
///
1947+
/// In en, this message translates to:
1948+
/// **'Please provide time interval at which data will be updated (100 ms to 2000 ms)'**
1949+
String get baroUpdatePeriodHint;
1950+
1951+
/// No description provided for @barometerHighLimitHint.
1952+
///
1953+
/// In en, this message translates to:
1954+
/// **'Please provide the maximum limit of lux value to be recorded (0 atm to 1.10 atm)'**
1955+
String get barometerHighLimitHint;
1956+
1957+
/// No description provided for @gyroscopeConfigurations.
1958+
///
1959+
/// In en, this message translates to:
1960+
/// **'Gyroscope Configurations'**
1961+
String get gyroscopeConfigurations;
1962+
1963+
/// No description provided for @gyroscopeHighLimitHint.
1964+
///
1965+
/// In en, this message translates to:
1966+
/// **'Please provide the maximum limit of lux value to be recorded (0 rad/s to 1000 rad/s)'**
1967+
String get gyroscopeHighLimitHint;
1968+
1969+
/// No description provided for @accelerometerConfigurations.
1970+
///
1971+
/// In en, this message translates to:
1972+
/// **'Accelerometer Configurations'**
1973+
String get accelerometerConfigurations;
1974+
1975+
/// No description provided for @accelerometerUpdatePeriodHint.
1976+
///
1977+
/// In en, this message translates to:
1978+
/// **'Please provide time interval at which data will be updated'**
1979+
String get accelerometerUpdatePeriodHint;
1980+
1981+
/// No description provided for @accelerometerHighLimitHint.
1982+
///
1983+
/// In en, this message translates to:
1984+
/// **'Please provide the maximum limit of lux value to be recorded'**
1985+
String get accelerometerHighLimitHint;
19321986
}
19331987

19341988
class _AppLocalizationsDelegate

lib/l10n/app_localizations_en.dart

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -931,14 +931,14 @@ class AppLocalizationsEn extends AppLocalizations {
931931
String get updatePeriod => 'Update Period';
932932

933933
@override
934-
String get updatePeriodHint =>
934+
String get luxmeterUpdatePeriodHint =>
935935
'Please provide time interval at which data will be updated (100 ms to 1000 ms)';
936936

937937
@override
938938
String get highLimit => 'High Limit';
939939

940940
@override
941-
String get highLimitHint =>
941+
String get luxmeterHighLimitHint =>
942942
'Please provide the maximum limit of lux value to be recorded (10 Lx to 10000 Lx)';
943943

944944
@override
@@ -985,4 +985,36 @@ class AppLocalizationsEn extends AppLocalizations {
985985
@override
986986
String get baroMeterBulletPoint4 =>
987987
'Select the sensor by going to the Configure tab from the bottom navigation bar and choose BMP-180 in the drop down menu under Select Sensor.';
988+
989+
@override
990+
String get soundmeterConfig => 'Soundmeter Configurations';
991+
992+
@override
993+
String get barometerConfig => 'Barometer Configurations';
994+
995+
@override
996+
String get baroUpdatePeriodHint =>
997+
'Please provide time interval at which data will be updated (100 ms to 2000 ms)';
998+
999+
@override
1000+
String get barometerHighLimitHint =>
1001+
'Please provide the maximum limit of lux value to be recorded (0 atm to 1.10 atm)';
1002+
1003+
@override
1004+
String get gyroscopeConfigurations => 'Gyroscope Configurations';
1005+
1006+
@override
1007+
String get gyroscopeHighLimitHint =>
1008+
'Please provide the maximum limit of lux value to be recorded (0 rad/s to 1000 rad/s)';
1009+
1010+
@override
1011+
String get accelerometerConfigurations => 'Accelerometer Configurations';
1012+
1013+
@override
1014+
String get accelerometerUpdatePeriodHint =>
1015+
'Please provide time interval at which data will be updated';
1016+
1017+
@override
1018+
String get accelerometerHighLimitHint =>
1019+
'Please provide the maximum limit of lux value to be recorded';
9881020
}

lib/models/accelerometer_config.dart

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
class AccelerometerConfig {
2+
final int updatePeriod;
3+
final int highLimit;
4+
final String activeSensor;
5+
final int sensorGain;
6+
final bool includeLocationData;
7+
8+
const AccelerometerConfig({
9+
this.updatePeriod = 1000,
10+
this.highLimit = 2000,
11+
this.activeSensor = 'In-built Sensor',
12+
this.sensorGain = 1,
13+
this.includeLocationData = true,
14+
});
15+
16+
AccelerometerConfig copyWith({
17+
int? updatePeriod,
18+
int? highLimit,
19+
String? activeSensor,
20+
int? sensorGain,
21+
bool? includeLocationData,
22+
}) {
23+
return AccelerometerConfig(
24+
updatePeriod: updatePeriod ?? this.updatePeriod,
25+
highLimit: highLimit ?? this.highLimit,
26+
activeSensor: activeSensor ?? this.activeSensor,
27+
sensorGain: sensorGain ?? this.sensorGain,
28+
includeLocationData: includeLocationData ?? this.includeLocationData,
29+
);
30+
}
31+
32+
Map<String, dynamic> toJson() {
33+
return {
34+
'updatePeriod': updatePeriod,
35+
'highLimit': highLimit,
36+
'activeSensor': activeSensor,
37+
'sensorGain': sensorGain,
38+
'includeLocationData': includeLocationData,
39+
};
40+
}
41+
42+
factory AccelerometerConfig.fromJson(Map<String, dynamic> json) {
43+
return AccelerometerConfig(
44+
updatePeriod: json['updatePeriod'] ?? 1000,
45+
highLimit: json['highLimit'] ?? 2000,
46+
activeSensor: json['activeSensor'] ?? 'In-built Sensor',
47+
sensorGain: json['sensorGain'] ?? 1,
48+
includeLocationData: json['includeLocationData'] ?? true,
49+
);
50+
}
51+
}

lib/models/barometer_config.dart

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
class BarometerConfig {
2+
final int updatePeriod;
3+
final double highLimit;
4+
final String activeSensor;
5+
final bool includeLocationData;
6+
7+
const BarometerConfig({
8+
this.updatePeriod = 1000,
9+
this.highLimit = 1.10,
10+
this.activeSensor = 'In-built Sensor',
11+
this.includeLocationData = true,
12+
});
13+
14+
BarometerConfig copyWith({
15+
int? updatePeriod,
16+
double? highLimit,
17+
String? activeSensor,
18+
bool? includeLocationData,
19+
}) {
20+
return BarometerConfig(
21+
updatePeriod: updatePeriod ?? this.updatePeriod,
22+
highLimit: highLimit ?? this.highLimit,
23+
activeSensor: activeSensor ?? this.activeSensor,
24+
includeLocationData: includeLocationData ?? this.includeLocationData,
25+
);
26+
}
27+
28+
Map<String, dynamic> toJson() {
29+
return {
30+
'updatePeriod': updatePeriod,
31+
'highLimit': highLimit,
32+
'activeSensor': activeSensor,
33+
'includeLocationData': includeLocationData,
34+
};
35+
}
36+
37+
factory BarometerConfig.fromJson(Map<String, dynamic> json) {
38+
return BarometerConfig(
39+
updatePeriod: json['updatePeriod'] ?? 1000,
40+
highLimit: json['highLimit'] ?? 1.10,
41+
activeSensor: json['activeSensor'] ?? 'In-built Sensor',
42+
includeLocationData: json['includeLocationData'] ?? true,
43+
);
44+
}
45+
}

lib/models/gyroscope_config.dart

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
class GyroscopeConfig {
2+
final int updatePeriod;
3+
final int highLimit;
4+
final int sensorGain;
5+
final bool includeLocationData;
6+
7+
const GyroscopeConfig({
8+
this.updatePeriod = 1000,
9+
this.highLimit = 20,
10+
this.sensorGain = 1,
11+
this.includeLocationData = true,
12+
});
13+
14+
GyroscopeConfig copyWith({
15+
int? updatePeriod,
16+
int? highLimit,
17+
int? sensorGain,
18+
bool? includeLocationData,
19+
}) {
20+
return GyroscopeConfig(
21+
updatePeriod: updatePeriod ?? this.updatePeriod,
22+
highLimit: highLimit ?? this.highLimit,
23+
sensorGain: sensorGain ?? this.sensorGain,
24+
includeLocationData: includeLocationData ?? this.includeLocationData,
25+
);
26+
}
27+
28+
Map<String, dynamic> toJson() {
29+
return {
30+
'updatePeriod': updatePeriod,
31+
'highLimit': highLimit,
32+
'sensorGain': sensorGain,
33+
'includeLocationData': includeLocationData,
34+
};
35+
}
36+
37+
factory GyroscopeConfig.fromJson(Map<String, dynamic> json) {
38+
return GyroscopeConfig(
39+
updatePeriod: json['updatePeriod'] ?? 1000,
40+
highLimit: json['highLimit'] ?? 20,
41+
sensorGain: json['sensorGain'] ?? 1,
42+
includeLocationData: json['includeLocationData'] ?? true,
43+
);
44+
}
45+
}

lib/models/soundmeter_config.dart

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
class SoundMeterConfig {
2+
final bool includeLocationData;
3+
const SoundMeterConfig({
4+
this.includeLocationData = true,
5+
});
6+
SoundMeterConfig copyWith({
7+
bool? includeLocationData,
8+
}) {
9+
return SoundMeterConfig(
10+
includeLocationData: includeLocationData ?? this.includeLocationData,
11+
);
12+
}
13+
14+
Map<String, dynamic> toJson() {
15+
return {
16+
'includeLocationData': includeLocationData,
17+
};
18+
}
19+
20+
factory SoundMeterConfig.fromJson(Map<String, dynamic> json) {
21+
return SoundMeterConfig(
22+
includeLocationData: json['includeLocationData'] ?? true,
23+
);
24+
}
25+
}

0 commit comments

Comments
 (0)