Skip to content

feat: Port the configuration screens for remaining instruments. #2778

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: flutter
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@
"showLuxmeterConfig": "Lux Meter Configurations",
"luxmeterConfigurations": "Lux Meter Configurations",
"updatePeriod": "Update Period",
"updatePeriodHint": "Please provide time interval at which data will be updated (100 ms to 1000 ms)",
"luxmeterUpdatePeriodHint": "Please provide time interval at which data will be updated (100 ms to 1000 ms)",
"highLimit": "High Limit",
"highLimitHint": "Please provide the maximum limit of lux value to be recorded (10 Lx to 10000 Lx)",
"luxmeterHighLimitHint": "Please provide the maximum limit of lux value to be recorded (10 Lx to 10000 Lx)",
"sensorGain": "Sensor Gain",
"sensorGainHint": "Please set gain of the sensor",
"locationData": "Include Location Data",
Expand All @@ -305,5 +305,14 @@
"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",
"baroMeterBulletPoint2": "If you want to use the sensor BMP-180, connect the sensor to PSLab device as shown in the figure.",
"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.",
"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."
"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.",
"soundmeterConfig" : "Soundmeter Configurations",
"barometerConfig" : "Barometer Configurations",
"baroUpdatePeriodHint" : "Please provide time interval at which data will be updated (100 ms to 2000 ms)",
"barometerHighLimitHint" : "Please provide the maximum limit of lux value to be recorded (0 atm to 1.10 atm)",
"gyroscopeConfigurations" : "Gyroscope Configurations",
"gyroscopeHighLimitHint" : "Please provide the maximum limit of lux value to be recorded (0 rad/s to 1000 rad/s)",
"accelerometerConfigurations" : "Accelerometer Configurations",
"accelerometerUpdatePeriodHint" : "Please provide time interval at which data will be updated",
"accelerometerHighLimitHint" : "Please provide the maximum limit of lux value to be recorded"
}
62 changes: 58 additions & 4 deletions lib/l10n/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1834,23 +1834,23 @@ abstract class AppLocalizations {
/// **'Update Period'**
String get updatePeriod;

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

/// No description provided for @highLimit.
///
/// In en, this message translates to:
/// **'High Limit'**
String get highLimit;

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

/// No description provided for @sensorGain.
///
Expand Down Expand Up @@ -1929,6 +1929,60 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'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.'**
String get baroMeterBulletPoint4;

/// No description provided for @soundmeterConfig.
///
/// In en, this message translates to:
/// **'Soundmeter Configurations'**
String get soundmeterConfig;

/// No description provided for @barometerConfig.
///
/// In en, this message translates to:
/// **'Barometer Configurations'**
String get barometerConfig;

/// No description provided for @baroUpdatePeriodHint.
///
/// In en, this message translates to:
/// **'Please provide time interval at which data will be updated (100 ms to 2000 ms)'**
String get baroUpdatePeriodHint;

/// No description provided for @barometerHighLimitHint.
///
/// In en, this message translates to:
/// **'Please provide the maximum limit of lux value to be recorded (0 atm to 1.10 atm)'**
String get barometerHighLimitHint;

/// No description provided for @gyroscopeConfigurations.
///
/// In en, this message translates to:
/// **'Gyroscope Configurations'**
String get gyroscopeConfigurations;

/// No description provided for @gyroscopeHighLimitHint.
///
/// In en, this message translates to:
/// **'Please provide the maximum limit of lux value to be recorded (0 rad/s to 1000 rad/s)'**
String get gyroscopeHighLimitHint;

/// No description provided for @accelerometerConfigurations.
///
/// In en, this message translates to:
/// **'Accelerometer Configurations'**
String get accelerometerConfigurations;

/// No description provided for @accelerometerUpdatePeriodHint.
///
/// In en, this message translates to:
/// **'Please provide time interval at which data will be updated'**
String get accelerometerUpdatePeriodHint;

/// No description provided for @accelerometerHighLimitHint.
///
/// In en, this message translates to:
/// **'Please provide the maximum limit of lux value to be recorded'**
String get accelerometerHighLimitHint;
}

class _AppLocalizationsDelegate
Expand Down
36 changes: 34 additions & 2 deletions lib/l10n/app_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -931,14 +931,14 @@ class AppLocalizationsEn extends AppLocalizations {
String get updatePeriod => 'Update Period';

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

@override
String get highLimit => 'High Limit';

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

@override
Expand Down Expand Up @@ -985,4 +985,36 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get 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.';

@override
String get soundmeterConfig => 'Soundmeter Configurations';

@override
String get barometerConfig => 'Barometer Configurations';

@override
String get baroUpdatePeriodHint =>
'Please provide time interval at which data will be updated (100 ms to 2000 ms)';

@override
String get barometerHighLimitHint =>
'Please provide the maximum limit of lux value to be recorded (0 atm to 1.10 atm)';

@override
String get gyroscopeConfigurations => 'Gyroscope Configurations';

@override
String get gyroscopeHighLimitHint =>
'Please provide the maximum limit of lux value to be recorded (0 rad/s to 1000 rad/s)';

@override
String get accelerometerConfigurations => 'Accelerometer Configurations';

@override
String get accelerometerUpdatePeriodHint =>
'Please provide time interval at which data will be updated';

@override
String get accelerometerHighLimitHint =>
'Please provide the maximum limit of lux value to be recorded';
}
51 changes: 51 additions & 0 deletions lib/models/accelerometer_config.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
class AccelerometerConfig {
final int updatePeriod;
final int highLimit;
final String activeSensor;
final int sensorGain;
final bool includeLocationData;

const AccelerometerConfig({
this.updatePeriod = 1000,
this.highLimit = 2000,
this.activeSensor = 'In-built Sensor',
this.sensorGain = 1,
this.includeLocationData = true,
});

AccelerometerConfig copyWith({
int? updatePeriod,
int? highLimit,
String? activeSensor,
int? sensorGain,
bool? includeLocationData,
}) {
return AccelerometerConfig(
updatePeriod: updatePeriod ?? this.updatePeriod,
highLimit: highLimit ?? this.highLimit,
activeSensor: activeSensor ?? this.activeSensor,
sensorGain: sensorGain ?? this.sensorGain,
includeLocationData: includeLocationData ?? this.includeLocationData,
);
}

Map<String, dynamic> toJson() {
return {
'updatePeriod': updatePeriod,
'highLimit': highLimit,
'activeSensor': activeSensor,
'sensorGain': sensorGain,
'includeLocationData': includeLocationData,
};
}

factory AccelerometerConfig.fromJson(Map<String, dynamic> json) {
return AccelerometerConfig(
updatePeriod: json['updatePeriod'] ?? 1000,
highLimit: json['highLimit'] ?? 2000,
activeSensor: json['activeSensor'] ?? 'In-built Sensor',
sensorGain: json['sensorGain'] ?? 1,
includeLocationData: json['includeLocationData'] ?? true,
);
}
}
45 changes: 45 additions & 0 deletions lib/models/barometer_config.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
class BarometerConfig {
final int updatePeriod;
final double highLimit;
final String activeSensor;
final bool includeLocationData;

const BarometerConfig({
this.updatePeriod = 1000,
this.highLimit = 1.10,
this.activeSensor = 'In-built Sensor',
this.includeLocationData = true,
});

BarometerConfig copyWith({
int? updatePeriod,
double? highLimit,
String? activeSensor,
bool? includeLocationData,
}) {
return BarometerConfig(
updatePeriod: updatePeriod ?? this.updatePeriod,
highLimit: highLimit ?? this.highLimit,
activeSensor: activeSensor ?? this.activeSensor,
includeLocationData: includeLocationData ?? this.includeLocationData,
);
}

Map<String, dynamic> toJson() {
return {
'updatePeriod': updatePeriod,
'highLimit': highLimit,
'activeSensor': activeSensor,
'includeLocationData': includeLocationData,
};
}

factory BarometerConfig.fromJson(Map<String, dynamic> json) {
return BarometerConfig(
updatePeriod: json['updatePeriod'] ?? 1000,
highLimit: json['highLimit'] ?? 1.10,
activeSensor: json['activeSensor'] ?? 'In-built Sensor',
includeLocationData: json['includeLocationData'] ?? true,
);
}
}
45 changes: 45 additions & 0 deletions lib/models/gyroscope_config.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
class GyroscopeConfig {
final int updatePeriod;
final int highLimit;
final int sensorGain;
final bool includeLocationData;

const GyroscopeConfig({
this.updatePeriod = 1000,
this.highLimit = 20,
this.sensorGain = 1,
this.includeLocationData = true,
});

GyroscopeConfig copyWith({
int? updatePeriod,
int? highLimit,
int? sensorGain,
bool? includeLocationData,
}) {
return GyroscopeConfig(
updatePeriod: updatePeriod ?? this.updatePeriod,
highLimit: highLimit ?? this.highLimit,
sensorGain: sensorGain ?? this.sensorGain,
includeLocationData: includeLocationData ?? this.includeLocationData,
);
}

Map<String, dynamic> toJson() {
return {
'updatePeriod': updatePeriod,
'highLimit': highLimit,
'sensorGain': sensorGain,
'includeLocationData': includeLocationData,
};
}

factory GyroscopeConfig.fromJson(Map<String, dynamic> json) {
return GyroscopeConfig(
updatePeriod: json['updatePeriod'] ?? 1000,
highLimit: json['highLimit'] ?? 20,
sensorGain: json['sensorGain'] ?? 1,
includeLocationData: json['includeLocationData'] ?? true,
);
}
}
25 changes: 25 additions & 0 deletions lib/models/soundmeter_config.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
class SoundMeterConfig {
final bool includeLocationData;
const SoundMeterConfig({
this.includeLocationData = true,
});
SoundMeterConfig copyWith({
bool? includeLocationData,
}) {
return SoundMeterConfig(
includeLocationData: includeLocationData ?? this.includeLocationData,
);
}

Map<String, dynamic> toJson() {
return {
'includeLocationData': includeLocationData,
};
}

factory SoundMeterConfig.fromJson(Map<String, dynamic> json) {
return SoundMeterConfig(
includeLocationData: json['includeLocationData'] ?? true,
);
}
}
Loading
Loading