Skip to content
This repository was archived by the owner on Aug 2, 2021. It is now read-only.

Rc controller window#174

Open
MrSusanovo wants to merge 10 commits into
UWARG:masterfrom
MrSusanovo:RC-Controller-Window
Open

Rc controller window#174
MrSusanovo wants to merge 10 commits into
UWARG:masterfrom
MrSusanovo:RC-Controller-Window

Conversation

@MrSusanovo
Copy link
Copy Markdown

A Separate window for displaying RC controller values.

  • A GUI simulating the RC controller pad. (does not work when receiving un-scaled value from RC)
  • Button shape indicating if auto pilot is on or off.
  • Text displaying for actual value Received from RC.

Copy link
Copy Markdown

@sergei1152 sergei1152 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks alot better. Please squash the commits in this PR, as you've got alot of the same ones on here

@@ -0,0 +1,23 @@
<!DOCTYPE html>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a window, not a view. File name wrong

</div>
</div>

<div class="controllerInputsView square back twothree">
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing as the other pr in terms of using classes

Comment thread styles/views/controller-inputs-view.css Outdated
position: relative;
margin-left: 43%;
//margin-right: 50%;
//margin-bottom: 50%;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid css

Comment thread config/vehicle-channel-config.js Outdated
@@ -0,0 +1,13 @@
var SettingsLoader=require('../app/util/PersistentSettings');

var vehicle_channel_config = {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is too speficic. Let's generalize it to just vehicle_config for vehicle all vehicle specific settings

Comment thread config/picpilot-config.js Outdated
internal_battery_cell_count: 3,
motor_battery_cell_count: 4
motor_battery_cell_count: 4,
type: "fixed_wing"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename the key to be "vehicle_type"

@@ -0,0 +1,16 @@
var ControllerInputsView = require('../../app/views/ControllerInputsView')(Marionette, Backbone);
var WindowShortCuts = require('../../app/core/WindowShortcuts');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a window, not view. Rename file

Comment thread app/views/ControllerInputsView.js Outdated
var Template = require('../util/Template');
var TelemetryData = remote.require('./app/models/TelemetryData');
var Logger = remote.require('./app/util/Logger');
var Validator = require('../util/Validator');
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove modules you're not using from here and the file header, like the validator

Comment thread app/views/ControllerInputsView.js Outdated
this.setOnOff(ch5);
},

onRender: function(){
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Listen to telemetry in here

@MrSusanovo MrSusanovo force-pushed the RC-Controller-Window branch from 49a32cb to 9b24471 Compare June 22, 2017 18:01
@MrSusanovo MrSusanovo force-pushed the RC-Controller-Window branch from a888a4f to 7021bdc Compare June 22, 2017 18:41
@sergei1152
Copy link
Copy Markdown

Could you also display all the channel inputs and outputs in this window? They can be numeric, it'd make this view more useful. Also make sure to center the elements relative to the window.

@sergei1152
Copy link
Copy Markdown

Never mind actually, the calibration window should have that information anyways.

Comment thread app/views/ControllerInputsView.js Outdated
this.type = picpilot_conf.get('vehicle_type');
},

rcIsOff: function(data){
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repeated code. It'd be better to just make this function take in an array or 5 parameters and let it check if any of them are -10000

Comment thread app/views/ControllerInputsView.js Outdated
this.ui.front23.css({"margin-left": "43%","margin-top":"43%",
"background-color": "rgba(244,122,122,1)",
"border-color": "rgba(244,122,122,1"});
}else{
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a space before and after the else

Comment thread app/views/ControllerInputsView.js Outdated
}
},
/*
onRender: function () {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get rid of commented code

Comment thread app/views/ControllerInputsView.js Outdated
if(val != null){
if(this.control_off){
this.ui.ch1_text.text("");
}else{
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space. Try to fix all your if and else statements this way (add sufficient space in the curly brackets. ie. }else{ -> } else {

and if(val != null){ -> if (val != null) {

</div>

<div class="square back twothree">
<div class="circle front twothree">
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should't need to declare a child with the same class as a parent, as it defeats the purpose of having a class. You'll have to modify your css to account for this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants