-
Notifications
You must be signed in to change notification settings - Fork 816
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
Yugesh-Kumar-S
wants to merge
9
commits into
fossasia:flutter
Choose a base branch
from
Yugesh-Kumar-S:config-screens
base: flutter
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
95f704b
soundmeter config
Yugesh-Kumar-S de04f81
fixes
Yugesh-Kumar-S ce65982
barometer config
Yugesh-Kumar-S 18f11ad
gyroscope config
Yugesh-Kumar-S 0e05ee4
accelerometer config
Yugesh-Kumar-S 0cd3ef1
Merge branch 'flutter' into config-screens
Yugesh-Kumar-S 637c210
sourcery's suggestions
Yugesh-Kumar-S a0bd717
Merge branch 'flutter' of https://github.com/Yugesh-Kumar-S/pslab-and…
Yugesh-Kumar-S 29407b0
resolved conflicts and adapted localization for config screens
Yugesh-Kumar-S File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.