Skip to content

feat: ported sensors screen and BMP180 screen #2789

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

Merged
merged 16 commits into from
Aug 10, 2025
Merged
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
Binary file added assets/images/bmp180.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 23 additions & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -362,5 +362,27 @@
"accelerometerUpdatePeriodHint": "Please provide time interval at which data will be updated",
"accelerometerHighLimitHint": "Please provide the maximum limit of lux value to be recorded",
"roboticArmIntro": "• A robotic arm is a programmable mechanical device that mimics the movement of a human arm.\n• It uses servo motors to control its motion, and these motors are operated using PWM signals.\n• The PSLab provides four PWM square wave generators (SQ1, SQ2, SQ3, SQ4), allowing control of up to four servo motors and enabling a robotic arm with up to four degrees of freedom.",
"roboticArmConnection": "• In the above figure, SQ1 is connected to the signal pin of the first servo motor. The servo's GND pin is connected to both the PSLab’s GND and the external power supply GND, while the VCC pin is connected to the external power supply VCC.\n• Similarly, connect the remaining servos to SQ2, SQ3, and SQ4 along with their respective GND and power supply connections.\n• Once connected, each servo can be controlled using either circular sliders for manual control or a timeline-based sequence for automated movement."
"roboticArmConnection": "• In the above figure, SQ1 is connected to the signal pin of the first servo motor. The servo's GND pin is connected to both the PSLab’s GND and the external power supply GND, while the VCC pin is connected to the external power supply VCC.\n• Similarly, connect the remaining servos to SQ2, SQ3, and SQ4 along with their respective GND and power supply connections.\n• Once connected, each servo can be controlled using either circular sliders for manual control or a timeline-based sequence for automated movement.",
"autoscan" : "Autoscan",
"selectSensor" : "Select Sensor",
"notConnected" : "Not Connected",
"autoScanHint" : "Use Autoscan button to find connected sensors to PSLab device",
"noSensorDetected" : "No sensors detected",
"screenNotImplemented" : "screen not implemented yet",
"timeGap" : "Time gap",
"pslabNotConnected" : "PSLab not connected",
"clearData" : "Clear Data",
"numberOfSampes" : "No. of samples",
"pressure" : "Pressure",
"temperature" : "Temperature",
"bmp180" : "BMP180",
"plot" : "Plot",
"dataCleared" : "Data cleared successfully",
"rawData" : "Raw Data",
"pressureUnitLabel" : "Pa",
"temperatureUnitLabel" : "°C",
"altitudeUnitLabel" : "m",
"time" : "Time",
"notAvailable" : "N/A",
"estimated" : "Estimated"
}
132 changes: 132 additions & 0 deletions lib/l10n/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2271,6 +2271,138 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'• In the above figure, SQ1 is connected to the signal pin of the first servo motor. The servo\'s GND pin is connected to both the PSLab’s GND and the external power supply GND, while the VCC pin is connected to the external power supply VCC.\n• Similarly, connect the remaining servos to SQ2, SQ3, and SQ4 along with their respective GND and power supply connections.\n• Once connected, each servo can be controlled using either circular sliders for manual control or a timeline-based sequence for automated movement.'**
String get roboticArmConnection;

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

/// No description provided for @selectSensor.
///
/// In en, this message translates to:
/// **'Select Sensor'**
String get selectSensor;

/// No description provided for @notConnected.
///
/// In en, this message translates to:
/// **'Not Connected'**
String get notConnected;

/// No description provided for @autoScanHint.
///
/// In en, this message translates to:
/// **'Use Autoscan button to find connected sensors to PSLab device'**
String get autoScanHint;

/// No description provided for @noSensorDetected.
///
/// In en, this message translates to:
/// **'No sensors detected'**
String get noSensorDetected;

/// No description provided for @screenNotImplemented.
///
/// In en, this message translates to:
/// **'screen not implemented yet'**
String get screenNotImplemented;

/// No description provided for @timeGap.
///
/// In en, this message translates to:
/// **'Time gap'**
String get timeGap;

/// No description provided for @pslabNotConnected.
///
/// In en, this message translates to:
/// **'PSLab not connected'**
String get pslabNotConnected;

/// No description provided for @clearData.
///
/// In en, this message translates to:
/// **'Clear Data'**
String get clearData;

/// No description provided for @numberOfSampes.
///
/// In en, this message translates to:
/// **'No. of samples'**
String get numberOfSampes;

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

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

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

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

/// No description provided for @dataCleared.
///
/// In en, this message translates to:
/// **'Data cleared successfully'**
String get dataCleared;

/// No description provided for @rawData.
///
/// In en, this message translates to:
/// **'Raw Data'**
String get rawData;

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

/// No description provided for @temperatureUnitLabel.
///
/// In en, this message translates to:
/// **'°C'**
String get temperatureUnitLabel;

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

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

/// No description provided for @notAvailable.
///
/// In en, this message translates to:
/// **'N/A'**
String get notAvailable;

/// No description provided for @estimated.
///
/// In en, this message translates to:
/// **'Estimated'**
String get estimated;
}

class _AppLocalizationsDelegate
Expand Down
67 changes: 67 additions & 0 deletions lib/l10n/app_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1165,4 +1165,71 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get roboticArmConnection =>
'• In the above figure, SQ1 is connected to the signal pin of the first servo motor. The servo\'s GND pin is connected to both the PSLab’s GND and the external power supply GND, while the VCC pin is connected to the external power supply VCC.\n• Similarly, connect the remaining servos to SQ2, SQ3, and SQ4 along with their respective GND and power supply connections.\n• Once connected, each servo can be controlled using either circular sliders for manual control or a timeline-based sequence for automated movement.';

@override
String get autoscan => 'Autoscan';

@override
String get selectSensor => 'Select Sensor';

@override
String get notConnected => 'Not Connected';

@override
String get autoScanHint =>
'Use Autoscan button to find connected sensors to PSLab device';

@override
String get noSensorDetected => 'No sensors detected';

@override
String get screenNotImplemented => 'screen not implemented yet';

@override
String get timeGap => 'Time gap';

@override
String get pslabNotConnected => 'PSLab not connected';

@override
String get clearData => 'Clear Data';

@override
String get numberOfSampes => 'No. of samples';

@override
String get pressure => 'Pressure';

@override
String get temperature => 'Temperature';

@override
String get bmp180 => 'BMP180';

@override
String get plot => 'Plot';

@override
String get dataCleared => 'Data cleared successfully';

@override
String get rawData => 'Raw Data';

@override
String get pressureUnitLabel => 'Pa';

@override
String get temperatureUnitLabel => '°C';

@override
String get altitudeUnitLabel => 'm';

@override
String get time => 'Time';

@override
String get notAvailable => 'N/A';

@override
String get estimated => 'Estimated';
}
2 changes: 2 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import 'package:pslab/view/multimeter_screen.dart';
import 'package:pslab/view/oscilloscope_screen.dart';
import 'package:pslab/view/power_source_screen.dart';
import 'package:pslab/view/robotic_arm_screen.dart';
import 'package:pslab/view/sensors_screen.dart';
import 'package:pslab/view/settings_screen.dart';
import 'package:pslab/view/about_us_screen.dart';
import 'package:pslab/view/software_licenses_screen.dart';
Expand Down Expand Up @@ -75,6 +76,7 @@ class MyApp extends StatelessWidget {
'/luxmeter': (context) => const LuxMeterScreen(),
'/barometer': (context) => const BarometerScreen(),
'/soundmeter': (context) => const SoundMeterScreen(),
'/sensors': (context) => const SensorsScreen()
},
);
}
Expand Down
42 changes: 42 additions & 0 deletions lib/models/chart_data_points.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
class ChartDataPoint {
final double x;
final double y;

ChartDataPoint(this.x, this.y);

@override
String toString() => 'ChartDataPoint(x: $x, y: $y)';

@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
return other is ChartDataPoint && other.x == x && other.y == y;
}

@override
int get hashCode => Object.hash(x, y);

factory ChartDataPoint.fromMap(Map<String, dynamic> map) {
return ChartDataPoint(
map['x']?.toDouble() ?? 0.0,
map['y']?.toDouble() ?? 0.0,
);
}

Map<String, dynamic> toMap() {
return {
'x': x,
'y': y,
};
}

ChartDataPoint copyWith({
double? x,
double? y,
}) {
return ChartDataPoint(
x ?? this.x,
y ?? this.y,
);
}
}
Loading
Loading