Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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/icons/ic_sin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/ic_triangular.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,18 @@
"pinPV2": "PV2",
"pinPV3": "PV3",
"pinPCS": "PCS",
"analog": "Analog",
"digital": "Digital",
"wave1": "Wave 1",
"wave2": "Wave 2",
"sqr1": "sqr1",
"sqr2": "sqr2",
"sqr3": "sqr3",
"sqr4": "sqr4",
"freq": "Freq",
"phase": "Phase",
"duty": "Duty",
"produceSound": "Produce Sound",
"analyze": "Analyze",
"settings": "Settings",
"autoStart": "Auto Start",
Expand Down
72 changes: 72 additions & 0 deletions lib/l10n/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,78 @@ abstract class AppLocalizations {
/// **'PCS'**
String get pinPCS;

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

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

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

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

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

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

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

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

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

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

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

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

/// No description provided for @analyze.
///
/// In en, this message translates to:
Expand Down
36 changes: 36 additions & 0 deletions lib/l10n/app_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,42 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get pinPCS => 'PCS';

@override
String get analog => 'Analog';

@override
String get digital => 'Digital';

@override
String get wave1 => 'Wave 1';

@override
String get wave2 => 'Wave 2';

@override
String get sqr1 => 'sqr1';

@override
String get sqr2 => 'sqr2';

@override
String get sqr3 => 'sqr3';

@override
String get sqr4 => 'sqr4';

@override
String get freq => 'Freq';

@override
String get phase => 'Phase';

@override
String get duty => 'Duty';

@override
String get produceSound => 'Produce Sound';

@override
String get analyze => 'Analyze';

Expand Down
2 changes: 2 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import 'package:pslab/view/about_us_screen.dart';
import 'package:pslab/view/software_licenses_screen.dart';
import 'package:pslab/theme/app_theme.dart';
import 'package:pslab/view/soundmeter_screen.dart';
import 'package:pslab/view/wave_generator_screen.dart';
import 'constants.dart';

void main() {
Expand Down Expand Up @@ -60,6 +61,7 @@ class MyApp extends StatelessWidget {
'/': (context) => const InstrumentsScreen(),
'/oscilloscope': (context) => const OscilloscopeScreen(),
'/multimeter': (context) => const MultimeterScreen(),
'/waveGenerator': (context) => const WaveGeneratorScreen(),
'/logicAnalyzer': (context) => const LogicAnalyzerScreen(),
'/powerSource': (context) => const PowerSourceScreen(),
'/connectDevice': (context) => const ConnectDeviceScreen(),
Expand Down
11 changes: 11 additions & 0 deletions lib/view/instruments_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,17 @@ class _InstrumentsScreenState extends State<InstrumentsScreen> {
);
}
break;
case 4:
if (Navigator.canPop(context) &&
ModalRoute.of(context)?.settings.name == '/waveGenerator') {
Navigator.popUntil(context, ModalRoute.withName('/waveGenerator'));
} else {
Navigator.pushNamedAndRemoveUntil(
context,
'/waveGenerator',
(route) => route.isFirst,
);
}
default:
break;
}
Expand Down
119 changes: 119 additions & 0 deletions lib/view/wave_generator_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
import 'package:flutter/material.dart';
import 'package:pslab/l10n/app_localizations.dart';
import 'package:pslab/providers/locator.dart';
import 'package:pslab/theme/colors.dart';
import 'package:pslab/view/widgets/common_scaffold_widget.dart';
import 'package:pslab/view/widgets/analog_waveform_controls.dart';
import 'package:pslab/view/widgets/wave_generator_graph.dart';
import 'package:pslab/view/widgets/wave_generator_main_controls.dart';

class WaveGeneratorScreen extends StatefulWidget {
const WaveGeneratorScreen({super.key});

@override
State<StatefulWidget> createState() => _WaveGeneratorScreenState();
}

class _WaveGeneratorScreenState extends State<WaveGeneratorScreen> {
AppLocalizations appLocalizations = getIt.get<AppLocalizations>();
@override
Widget build(BuildContext context) {
return CommonScaffold(
title: 'Wave Generator',
body: Container(
margin: const EdgeInsets.all(8.0),
child: Column(
children: [
Expanded(
flex: 30,
child: Container(
color: chartBackgroundColor,
child: WaveGeneratorGraph(),
),
),
Expanded(
flex: 30,
child: Column(
children: [
Expanded(
flex: 70,
child: AnalogWaveformControls(),
),
Expanded(
flex: 30,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Expanded(
child: TextButton(
style: TextButton.styleFrom(
backgroundColor: primaryRed,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),
),
child: Text(
appLocalizations.produceSound,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 14,
),
),
onPressed: () => {},
),
),
const SizedBox(width: 4),
Expanded(
child: TextButton(
style: TextButton.styleFrom(
backgroundColor: primaryRed,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),
),
child: Text(
appLocalizations.analog,
style: TextStyle(
color: Colors.white,
fontSize: 14,
),
),
onPressed: () => {},
),
),
const SizedBox(width: 4),
Expanded(
child: TextButton(
style: TextButton.styleFrom(
backgroundColor: primaryRed,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),
),
child: Text(
appLocalizations.digital,
style: TextStyle(
color: Colors.white,
fontSize: 14,
),
),
onPressed: () => {},
),
),
],
),
),
],
),
),
Expanded(
flex: 40,
child: WaveGeneratorMainControls(),
),
],
),
),
);
}
}
Loading
Loading