Skip to content

Commit ff8c73d

Browse files
feat: ported sensors screen and BMP180 screen (#2789)
1 parent 369c5ed commit ff8c73d

13 files changed

+1708
-2
lines changed

assets/images/bmp180.jpg

288 KB
Loading

lib/l10n/app_en.arb

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,5 +362,27 @@
362362
"accelerometerUpdatePeriodHint": "Please provide time interval at which data will be updated",
363363
"accelerometerHighLimitHint": "Please provide the maximum limit of lux value to be recorded",
364364
"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.",
365-
"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."
365+
"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.",
366+
"autoscan" : "Autoscan",
367+
"selectSensor" : "Select Sensor",
368+
"notConnected" : "Not Connected",
369+
"autoScanHint" : "Use Autoscan button to find connected sensors to PSLab device",
370+
"noSensorDetected" : "No sensors detected",
371+
"screenNotImplemented" : "screen not implemented yet",
372+
"timeGap" : "Time gap",
373+
"pslabNotConnected" : "PSLab not connected",
374+
"clearData" : "Clear Data",
375+
"numberOfSampes" : "No. of samples",
376+
"pressure" : "Pressure",
377+
"temperature" : "Temperature",
378+
"bmp180" : "BMP180",
379+
"plot" : "Plot",
380+
"dataCleared" : "Data cleared successfully",
381+
"rawData" : "Raw Data",
382+
"pressureUnitLabel" : "Pa",
383+
"temperatureUnitLabel" : "°C",
384+
"altitudeUnitLabel" : "m",
385+
"time" : "Time",
386+
"notAvailable" : "N/A",
387+
"estimated" : "Estimated"
366388
}

lib/l10n/app_localizations.dart

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,6 +2271,138 @@ abstract class AppLocalizations {
22712271
/// In en, this message translates to:
22722272
/// **'• 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.'**
22732273
String get roboticArmConnection;
2274+
2275+
/// No description provided for @autoscan.
2276+
///
2277+
/// In en, this message translates to:
2278+
/// **'Autoscan'**
2279+
String get autoscan;
2280+
2281+
/// No description provided for @selectSensor.
2282+
///
2283+
/// In en, this message translates to:
2284+
/// **'Select Sensor'**
2285+
String get selectSensor;
2286+
2287+
/// No description provided for @notConnected.
2288+
///
2289+
/// In en, this message translates to:
2290+
/// **'Not Connected'**
2291+
String get notConnected;
2292+
2293+
/// No description provided for @autoScanHint.
2294+
///
2295+
/// In en, this message translates to:
2296+
/// **'Use Autoscan button to find connected sensors to PSLab device'**
2297+
String get autoScanHint;
2298+
2299+
/// No description provided for @noSensorDetected.
2300+
///
2301+
/// In en, this message translates to:
2302+
/// **'No sensors detected'**
2303+
String get noSensorDetected;
2304+
2305+
/// No description provided for @screenNotImplemented.
2306+
///
2307+
/// In en, this message translates to:
2308+
/// **'screen not implemented yet'**
2309+
String get screenNotImplemented;
2310+
2311+
/// No description provided for @timeGap.
2312+
///
2313+
/// In en, this message translates to:
2314+
/// **'Time gap'**
2315+
String get timeGap;
2316+
2317+
/// No description provided for @pslabNotConnected.
2318+
///
2319+
/// In en, this message translates to:
2320+
/// **'PSLab not connected'**
2321+
String get pslabNotConnected;
2322+
2323+
/// No description provided for @clearData.
2324+
///
2325+
/// In en, this message translates to:
2326+
/// **'Clear Data'**
2327+
String get clearData;
2328+
2329+
/// No description provided for @numberOfSampes.
2330+
///
2331+
/// In en, this message translates to:
2332+
/// **'No. of samples'**
2333+
String get numberOfSampes;
2334+
2335+
/// No description provided for @pressure.
2336+
///
2337+
/// In en, this message translates to:
2338+
/// **'Pressure'**
2339+
String get pressure;
2340+
2341+
/// No description provided for @temperature.
2342+
///
2343+
/// In en, this message translates to:
2344+
/// **'Temperature'**
2345+
String get temperature;
2346+
2347+
/// No description provided for @bmp180.
2348+
///
2349+
/// In en, this message translates to:
2350+
/// **'BMP180'**
2351+
String get bmp180;
2352+
2353+
/// No description provided for @plot.
2354+
///
2355+
/// In en, this message translates to:
2356+
/// **'Plot'**
2357+
String get plot;
2358+
2359+
/// No description provided for @dataCleared.
2360+
///
2361+
/// In en, this message translates to:
2362+
/// **'Data cleared successfully'**
2363+
String get dataCleared;
2364+
2365+
/// No description provided for @rawData.
2366+
///
2367+
/// In en, this message translates to:
2368+
/// **'Raw Data'**
2369+
String get rawData;
2370+
2371+
/// No description provided for @pressureUnitLabel.
2372+
///
2373+
/// In en, this message translates to:
2374+
/// **'Pa'**
2375+
String get pressureUnitLabel;
2376+
2377+
/// No description provided for @temperatureUnitLabel.
2378+
///
2379+
/// In en, this message translates to:
2380+
/// **'°C'**
2381+
String get temperatureUnitLabel;
2382+
2383+
/// No description provided for @altitudeUnitLabel.
2384+
///
2385+
/// In en, this message translates to:
2386+
/// **'m'**
2387+
String get altitudeUnitLabel;
2388+
2389+
/// No description provided for @time.
2390+
///
2391+
/// In en, this message translates to:
2392+
/// **'Time'**
2393+
String get time;
2394+
2395+
/// No description provided for @notAvailable.
2396+
///
2397+
/// In en, this message translates to:
2398+
/// **'N/A'**
2399+
String get notAvailable;
2400+
2401+
/// No description provided for @estimated.
2402+
///
2403+
/// In en, this message translates to:
2404+
/// **'Estimated'**
2405+
String get estimated;
22742406
}
22752407

22762408
class _AppLocalizationsDelegate

lib/l10n/app_localizations_en.dart

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,4 +1165,71 @@ class AppLocalizationsEn extends AppLocalizations {
11651165
@override
11661166
String get roboticArmConnection =>
11671167
'• 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.';
1168+
1169+
@override
1170+
String get autoscan => 'Autoscan';
1171+
1172+
@override
1173+
String get selectSensor => 'Select Sensor';
1174+
1175+
@override
1176+
String get notConnected => 'Not Connected';
1177+
1178+
@override
1179+
String get autoScanHint =>
1180+
'Use Autoscan button to find connected sensors to PSLab device';
1181+
1182+
@override
1183+
String get noSensorDetected => 'No sensors detected';
1184+
1185+
@override
1186+
String get screenNotImplemented => 'screen not implemented yet';
1187+
1188+
@override
1189+
String get timeGap => 'Time gap';
1190+
1191+
@override
1192+
String get pslabNotConnected => 'PSLab not connected';
1193+
1194+
@override
1195+
String get clearData => 'Clear Data';
1196+
1197+
@override
1198+
String get numberOfSampes => 'No. of samples';
1199+
1200+
@override
1201+
String get pressure => 'Pressure';
1202+
1203+
@override
1204+
String get temperature => 'Temperature';
1205+
1206+
@override
1207+
String get bmp180 => 'BMP180';
1208+
1209+
@override
1210+
String get plot => 'Plot';
1211+
1212+
@override
1213+
String get dataCleared => 'Data cleared successfully';
1214+
1215+
@override
1216+
String get rawData => 'Raw Data';
1217+
1218+
@override
1219+
String get pressureUnitLabel => 'Pa';
1220+
1221+
@override
1222+
String get temperatureUnitLabel => '°C';
1223+
1224+
@override
1225+
String get altitudeUnitLabel => 'm';
1226+
1227+
@override
1228+
String get time => 'Time';
1229+
1230+
@override
1231+
String get notAvailable => 'N/A';
1232+
1233+
@override
1234+
String get estimated => 'Estimated';
11681235
}

lib/main.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import 'package:pslab/view/multimeter_screen.dart';
1515
import 'package:pslab/view/oscilloscope_screen.dart';
1616
import 'package:pslab/view/power_source_screen.dart';
1717
import 'package:pslab/view/robotic_arm_screen.dart';
18+
import 'package:pslab/view/sensors_screen.dart';
1819
import 'package:pslab/view/settings_screen.dart';
1920
import 'package:pslab/view/about_us_screen.dart';
2021
import 'package:pslab/view/software_licenses_screen.dart';
@@ -75,6 +76,7 @@ class MyApp extends StatelessWidget {
7576
'/luxmeter': (context) => const LuxMeterScreen(),
7677
'/barometer': (context) => const BarometerScreen(),
7778
'/soundmeter': (context) => const SoundMeterScreen(),
79+
'/sensors': (context) => const SensorsScreen()
7880
},
7981
);
8082
}

lib/models/chart_data_points.dart

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
class ChartDataPoint {
2+
final double x;
3+
final double y;
4+
5+
ChartDataPoint(this.x, this.y);
6+
7+
@override
8+
String toString() => 'ChartDataPoint(x: $x, y: $y)';
9+
10+
@override
11+
bool operator ==(Object other) {
12+
if (identical(this, other)) return true;
13+
return other is ChartDataPoint && other.x == x && other.y == y;
14+
}
15+
16+
@override
17+
int get hashCode => Object.hash(x, y);
18+
19+
factory ChartDataPoint.fromMap(Map<String, dynamic> map) {
20+
return ChartDataPoint(
21+
map['x']?.toDouble() ?? 0.0,
22+
map['y']?.toDouble() ?? 0.0,
23+
);
24+
}
25+
26+
Map<String, dynamic> toMap() {
27+
return {
28+
'x': x,
29+
'y': y,
30+
};
31+
}
32+
33+
ChartDataPoint copyWith({
34+
double? x,
35+
double? y,
36+
}) {
37+
return ChartDataPoint(
38+
x ?? this.x,
39+
y ?? this.y,
40+
);
41+
}
42+
}

0 commit comments

Comments
 (0)