Skip to content
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

I179 web content #187

Merged
merged 19 commits into from
Apr 4, 2019
Merged
Show file tree
Hide file tree
Changes from all 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 modified robot_software/followPath.pyc
Binary file not shown.
32 changes: 32 additions & 0 deletions robot_software/rasppi_listener.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import socket
import json

def listen():
PORT = 65432 # Port to listen on (non-privileged ports are > 1023)

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
HOST = socket.gethostbyname(socket.gethostname())
s.bind((HOST, PORT))
print("Listening on {}:{}".format(HOST,PORT))
while True:
s.listen(1)
conn, addr = s.accept()

print('Connected by', addr)

data = conn.recv(1024)
data = data.decode('utf-8')
data = data.split(' ')
if data[0] == 'grab':
print('grab')
elif data[0] == 'prepare':
print('prepare_grabber')
elif data[0] == 'wait_for_bump':
print('wait for bump')
raw_input()
print("BUMP!")
elif data[0] == 'lift':
print('lift to {}'.format(data[1]))

conn.sendall(b'done')
conn.close()
7 changes: 4 additions & 3 deletions website/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ module.exports = {
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'stylesheet', type: 'text/css', href: '//cdn.materialdesignicons.com/2.0.46/css/materialdesignicons.min.css' },
{ rel: 'stylesheet', type: 'text/css', href: 'https://fonts.googleapis.com/css?family=Raleway&Open+Sans' }
// { rel: 'stylesheet', type: 'text/css', href: '//cdn.materialdesignicons.com/2.0.46/css/materialdesignicons.min.css' },
// { rel: 'stylesheet', type: 'text/css', href: 'https://fonts.googleapis.com/css?family=Raleway&Open+Sans' }
]
},

Expand All @@ -34,7 +34,8 @@ module.exports = {
** Global CSS
*/
css: [
'@/assets/sass/style.sass'
'@/assets/sass/style.sass',
'@/node_modules/@mdi/font/css/materialdesignicons.min.css',
],

/*
Expand Down
18 changes: 18 additions & 0 deletions website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"test": "jest"
},
"dependencies": {
"@mdi/font": "^3.5.95",
"@nuxtjs/axios": "^5.3.6",
"@nuxtjs/bulma": "^1.2.1",
"axios": "^0.18.0",
Expand All @@ -20,6 +21,7 @@
"firebase": "^5.8.2",
"node-sass": "^4.11.0",
"nuxt": "^2.3.4",
"nuxt-material-design-icons": "^1.0.4",
"sass-loader": "^7.1.0",
"vue-cookies": "^1.5.12",
"vue-headroom": "^0.9.0",
Expand Down
23 changes: 13 additions & 10 deletions website/pages/merchant/items/create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="box p30 pl50 pr50">
<form action="">
<div class="field">
<label class="label">Item name:</label>
<label class="label">* Item name:</label>
<div class="control">
<input class="input" type="text" placeholder="Enter item name" v-model="name">
</div>
Expand All @@ -43,7 +43,7 @@
<option
:value="n - 1"
v-for="n in (warehouse.dimensions.x + 1)">
{{ n - 1 }}
{{ n }}
</option>
</select>
</div>
Expand All @@ -56,7 +56,7 @@
<option
:value="n - 1"
v-for="n in (warehouse.dimensions.y + 1)">
{{ n - 1 }}
{{ n }}
</option>
</select>
</div>
Expand All @@ -69,7 +69,7 @@
<option
:value="n - 1"
v-for="n in warehouse.dimensions.z.length">
{{ n - 1 }}
{{ n }}
</option>
</select>
</div>
Expand All @@ -78,12 +78,15 @@
<div class="field" v-if="warehouse.dimensions">
<div class="control columns">
<div class="column is-6">
<label class="label">Quantity:</label>
<label class="label">* Quantity:</label>
<input class="input" type="number" placeholder="Enter item quantity" v-model.number="quantity">
</div>
<div class="column is-6">
<label class="label">Unit:</label>
<input class="input" type="text" placeholder="Enter measerment unit" v-model="unit">
<p class="help is-size-8 mb0">
<i>kg</i>, <i>lbs</i>, <i>litres</i>, etc... or blank.
</p>
</div>
</div>
</div>
Expand All @@ -107,7 +110,7 @@
</div>
<div class="field">
<div class="control">
<label class="label">Price:</label>
<label class="label">* Price (in GBP):</label>
<input class="input" type="number" placeholder="Enter item price" v-model.number="price">
</div>
</div>
Expand Down Expand Up @@ -146,17 +149,17 @@ export default {
warehouseId: this.$nuxt._route.params.id,
warehouse: {},

name: null,
name: "",
image: null,
position: {
x: 0,
y: 0,
z: 0,
},
quantity: null,
quantity: "",
unit: null,
size: 'tiny',
price: null
price: ""
}
},
methods: {
Expand Down Expand Up @@ -222,7 +225,7 @@ export default {
},
computed: {
can_submit: function () {
return this.name && this.quantity && this.price
return this.name.toString().length > 0 && this.quantity.toString().length > 0 && this.price.toString().length > 0
}
},
mounted: function () {
Expand Down
2 changes: 1 addition & 1 deletion website/pages/merchant/items/edit/_id.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<section class="section pt60 pt30t pb0">
<div class="container has-text-centered">
<h1 class="is-inline-block is-relative mb25">
Add item
Edit item
</h1>
</div>
</section>
Expand Down
42 changes: 28 additions & 14 deletions website/pages/merchant/warehouses/create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="box p30 pl50 pr50">
<form action="">
<div class="field">
<label class="label">Warehouse name:</label>
<label class="label">* Warehouse name:</label>
<div class="control">
<input class="input" type="text" placeholder="Enter your warehouse name" v-model="name">
</div>
Expand Down Expand Up @@ -42,22 +42,33 @@
</p>
<div class="control columns">
<div class="column is-6">
<input class="input" type="number" placeholder="Enter X dim" v-model.number="dimensions.x">
<input class="input" type="number" placeholder="* Enter X dim" v-model.number="dimensions.x">
</div>
<div class="column is-6">
<input class="input" type="number" placeholder="Enter Y dim" v-model.number="dimensions.y">
<input class="input" type="number" placeholder="* Enter Y dim" v-model.number="dimensions.y">
</div>
</div>
<p class="help is-size-8">
The Z values are the amount of shelfs and their respected heights from the robot's perspective. (Include bottom shelf as 0.0)
</p>
<input
type="number"
class="input half-width mb10"
<div
v-for="(shelf, i) in dimensions.z"
:key="'shelf-' + i"
:placeholder="'Enter shelf N' + (i + 1) + ' height'"
v-model.number="dimensions.z[i]">
class="is-flex align-center mb10">

<input
type="number"
class="input half-width"
:placeholder="'Enter shelf N' + (i + 1) + ' height'"
v-model.number="dimensions.z[i]">
<a
href="javascript:;"
class="is-inline-block has-text-danger ml10"
@click="deleteShelf(i)">

<i class="mdi mdi-minus-circle is-size-4"></i>
</a>
</div>

<a href="javascript:;" class="button is-link is-outlined is-smallish mt15" @click="addShelf()">
<span>Add a shelf</span>
Expand Down Expand Up @@ -95,15 +106,15 @@ export default {
},
data: function () {
return {
name: null,
name: "",
image: null,
location: {
latitude: null,
longitude: null
latitude: "",
longitude: ""
},
dimensions: {
x: null,
y: null,
x: "",
y: "",
z: [
0.0
]
Expand All @@ -114,6 +125,9 @@ export default {
addShelf: function () {
this.dimensions.z.push(this.dimensions.z[this.dimensions.z.length - 1])
},
deleteShelf: function (i) {
this.dimensions.z.splice(i, 1)
},
uploadFile: function (event) {
let file = event.target.files[0]
this.createImage(file);
Expand Down Expand Up @@ -158,7 +172,7 @@ export default {
},
computed: {
can_submit: function () {
return this.name && this.location.latitude && this.location.longitude && this.dimensions.x && this.dimensions.y
return this.name.toString().length > 0 && this.dimensions.x.toString().length > 0 && this.dimensions.y.toString().length > 0
}
}
};
Expand Down