-
Notifications
You must be signed in to change notification settings - Fork 2
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
Camera Widget Implementation #31
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far so good! I'll need you to factor out the camera widget into it's own file, see the other widgets in the widgets directory to see how we handle comments and general style. You also need to write unit tests for the widget, this could also be super easy, you only need to check for existence and attributes. Also can create a thread for this in the PR channel in Discord and post an image of it working? I don't get a camera feed on my PC but I'm pretty sure it's because I have my webcam configured weird.
@@ -32,7 +32,7 @@ class MavlinkCommunication { | |||
switch (_connectionType) { | |||
case MavlinkCommunicationType.tcp: | |||
log('[$moduleName] Trying to start TCP connection'); | |||
_startupTcpPort(connectionAddress, tcpPort); | |||
//_startupTcpPort(connectionAddress, tcpPort); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this commented out? Might be a mistake please undo this.
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: Camera( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
factor out Camera and it's controller to a separate widget in the widgets directory. I know it's kinda pedantic but we want the most flexibility possible to react to pilot feedback.
Is there any updates on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your code looks good! It doesn't run on my PC but that might be because I have a weird config. You should be good to merge after you tend to the nitpicks I left and test/get some one to test on the WARG laptop
@@ -0,0 +1 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to complete this file to pass CI/CD
import 'package:imacs/widgets/nav_bar_widget.dart'; | ||
import 'package:imacs/widgets/camera_widget.dart'; | ||
|
||
class CameraScreen extends StatelessWidget { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add doc strings to file, see other files for examples
const PlaceholderScreen(title: 'Logs'), | ||
'/camera': (BuildContext context) => | ||
const PlaceholderScreen(title: 'Camera'), | ||
'/logs': (BuildContext context) => const LogDisplayerScreen( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep the logs screen as a placeholder for now
import 'package:camera_universal/camera_universal.dart'; | ||
|
||
/// Widget to display camera feed | ||
class CameraWidget extends StatefulWidget { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the doc string more descriptive
|
||
/// Widget to display camera feed | ||
class CameraWidget extends StatefulWidget { | ||
final CameraController cameraController = CameraController(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This value is never used, you can remove this and make the constructor const
task(); | ||
} | ||
|
||
Future<void> task() async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename function to be more descriptive and add doc string
return Scaffold( | ||
body: Camera( | ||
cameraController: cameraController, | ||
onCameraNotInit: (context) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add log messages to each of the fail states
Implemented the camera widget, code directly from camera_universal package with naming changed to match context