[UNSTABLE] Added Angular 1.3, started merging panels on control page

pull/183/head
Rick Carlino 2015-05-16 12:44:47 -05:00
parent 26d52db119
commit a514c0d7f1
6 changed files with 24 additions and 22516 deletions

View File

@ -20,6 +20,7 @@ gem 'devise', github: 'plataformatec/devise'
gem 'mutations'
gem 'active_model_serializers', '~> 0.8.3'
gem 'ice_cube'
gem 'rails-assets-angular', '~> 1.3'
gem 'rails-assets-ng-sortable'
gem 'rails-assets-js-data'
gem 'rails-assets-js-data-angular'

View File

@ -366,6 +366,7 @@ DEPENDENCIES
poltergeist
pry
rails (= 4.1.0)
rails-assets-angular (~> 1.3)
rails-assets-jquery
rails-assets-js-data
rails-assets-js-data-angular

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -13,9 +13,27 @@ angular.module('FarmBot').controller "MovementController", [
$scope.home = (axis) -> Devices.send "home_#{axis or 'all'}"
# Coordinates object for fine grained control
$scope.manualMovementCoords = {x: 0, y: 0, z: 0}
$scope.manualMovementCoords = {x: 0, y: 0, z: 0} # Unused attr??????
$scope.manualMovement = ->
that = $scope.manualMovementCoords
Devices.moveRel that.x, that.y, that.z
$scope.xVal = (v) ->
if arguments.length
@bufferx = parseInt(v) or null
else
@bufferx or Devices.current.x
$scope.yVal = (v) ->
if arguments.length
@buffery = parseInt(v) or null
else
@buffery or Devices.current.y
$scope.zVal = (v) ->
if arguments.length
@bufferz = parseInt(v) or null
else
@bufferz or Devices.current.z
Devices.pollStatus()
]

View File

@ -36,21 +36,21 @@
.small-4.columns
%div.control-title Gantry (X)
.small-4.columns
%input.move-input{:placeholder => "3.124", :type => "text", ng_model: "device.current.x"}/
%input.move-input{:placeholder => "3.124", :type => "text", ng_model: "xVal", ng_model_options: "{ getterSetter: true }"}
.small-4.columns
%button.full-width.gray.button-like{ng_click: 'home("x")'} HOME X
.row
.small-4.columns
%div.control-title Cross-Slide (Y)
.small-4.columns
%input.move-input{:placeholder => "1.210", :type => "text", ng_model: "device.current.y"}/
%input.move-input{:placeholder => "1.210", :type => "text", ng_model: "yVal", ng_model_options: "{ getterSetter: true }"}
.small-4.columns
%button.full-width.gray.button-like{ng_click: 'home("y")'} HOME Y
.row
.small-4.columns
%div.control-title Z-Axis (Z)
.small-4.columns
%input.move-input{:placeholder => "0.893", :type => "text", ng_model: "device.current.z"}/
%input.move-input{:placeholder => "0.893", :type => "text", ng_model: "zVal", ng_model_options: "{ getterSetter: true }"}
.small-4.columns
%button.full-width.gray.button-like{ng_click: 'home("z")'} HOME Z
.row.padding-bottom