commit
005e285e70
|
@ -1,6 +1,4 @@
|
|||
[![Stories in Ready](https://badge.waffle.io/farmbot/farmbot-web-backend.png?label=ready&title=Ready)](https://waffle.io/FarmBot/farmbot-web-app)
|
||||
|
||||
[![Code Climate](https://codeclimate.com/github/FarmBot/farmbot-web-app.png)](https://codeclimate.com/github/FarmBot/farmbot-web-app)
|
||||
[![Stories in Ready](https://badge.waffle.io/farmbot/farmbot-web-backend.png?label=ready&title=Ready)](https://waffle.io/FarmBot/farmbot-web-app)[![Code Climate](https://codeclimate.com/github/FarmBot/farmbot-web-app.png)](https://codeclimate.com/github/FarmBot/farmbot-web-app)
|
||||
|
||||
# Farmbot Web App
|
||||
|
||||
|
|
|
@ -10,6 +10,25 @@ angular.module('FarmBot').controller "OverviewController", [
|
|||
'$scope'
|
||||
'Restangular'
|
||||
($scope, Restangular, Skynet) ->
|
||||
|
||||
$scope.x = 0
|
||||
$scope.y = 0
|
||||
$scope.z = 0
|
||||
|
||||
$scope.upx = ->
|
||||
$scope.x = $scope.x + 5
|
||||
$scope.upy = ->
|
||||
$scope.y = $scope.y + 5
|
||||
$scope.upz = ->
|
||||
$scope.z = $scope.z + 5
|
||||
|
||||
$scope.downx = ->
|
||||
$scope.x = $scope.x - 5
|
||||
$scope.downy = ->
|
||||
$scope.y = $scope.y - 5
|
||||
$scope.downz = ->
|
||||
$scope.z = $scope.z - 5
|
||||
|
||||
Restangular.all('devices').getList().then (data) ->
|
||||
$scope.devices = data
|
||||
$scope.device = data[0]
|
||||
|
@ -33,6 +52,24 @@ angular.module('FarmBot').controller "OverviewController", [
|
|||
console.log data
|
||||
return true
|
||||
|
||||
$scope.goAbs = ->
|
||||
$scope.socket.emit "message",
|
||||
devices: $scope.device.uuid
|
||||
payload:
|
||||
message_type: 'single_command'
|
||||
time_stamp: new Date()
|
||||
command:
|
||||
action: 'MOVE ABSOLUTE'
|
||||
x: $scope.x
|
||||
y: $scope.y
|
||||
z: $scope.z
|
||||
speed: 100 # Not sure about this one.
|
||||
amount: 0 # Is this for "DOSE WATER"?
|
||||
delay: 0
|
||||
, (data) ->
|
||||
console.log data
|
||||
return true
|
||||
|
||||
$scope.connectToSkyNet = ->
|
||||
config =
|
||||
type: "farmbotdss"
|
||||
|
|
|
@ -9,5 +9,4 @@ class ApplicationController < ActionController::Base
|
|||
# devise resources (eg: admin users, etc.)
|
||||
dashboard_path
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# A non-resourceful controller for the 'glue' that holds this SPA together.
|
||||
# Let's try not to overwhelm this control and write as much API as possible.
|
||||
class DashboardController < ApplicationController
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -6,30 +6,30 @@
|
|||
.container.clearfix
|
||||
.large-4.columns Gantry (X)
|
||||
.large-4.columns
|
||||
%span.label.round.success>
|
||||
%span.label.round.success{ng_click: 'upx()'}
|
||||
%i.fi-plus
|
||||
46
|
||||
%span.label.round.alert
|
||||
{{ x }}
|
||||
%span.label.round.alert{ng_click: 'downx()'}
|
||||
%i.fi-minus
|
||||
.large-4.columns Jog to:
|
||||
%br/
|
||||
.container.clearfix
|
||||
.large-4.columns Cross-Slide (Y)
|
||||
.large-4.columns
|
||||
%span.label.round.success>
|
||||
%span.label.round.success{ng_click: 'upy()'}
|
||||
%i.fi-plus
|
||||
46
|
||||
%span.label.round.alert
|
||||
{{ y }}
|
||||
%span.label.round.alert{ng_click: 'downy()'}
|
||||
%i.fi-minus
|
||||
.large-4.columns Jog to:
|
||||
%br/
|
||||
.container.clearfix
|
||||
.large-4.columns Tool Mount (Z)
|
||||
.large-4.columns
|
||||
%span.label.round.success>
|
||||
%span.label.round.success{ng_click: 'upz()'}
|
||||
%i.fi-plus
|
||||
46
|
||||
%span.label.round.alert
|
||||
{{ z }}
|
||||
%span.label.round.alert{ng_click: 'downz()'}
|
||||
%i.fi-minus
|
||||
.large-4.columns Jog to:
|
||||
%br/
|
||||
|
@ -38,7 +38,7 @@
|
|||
%li
|
||||
%a.button.small{href: "", 'ng-click' => 'goHome()'} Jog to Home
|
||||
%li
|
||||
%a.button.small{href: "#"} Calibrate
|
||||
%a.button.small{href: "", ng_click: 'goAbs()'} Move!
|
||||
%li
|
||||
%a.button.small.alert{href: "#"} Shutdown
|
||||
.row
|
||||
|
|
Loading…
Reference in New Issue