Skip to content

Commit

Permalink
Merge pull request #53 from IssaHanou/develop-sprint-1
Browse files Browse the repository at this point in the history
End of sprint 1 merge
  • Loading branch information
IssaHanou authored Dec 2, 2019
2 parents 70b9a11 + 13cb286 commit 34c4b28
Show file tree
Hide file tree
Showing 130 changed files with 5,149 additions and 3,629 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 100
ignore = E722
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
/cc_library/.idea
__pycache__/
**/.idea
**/pkg
**/bin
**/src/*
!**/src/sciler
*/debug.log
18 changes: 10 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ matrix:

# https://medium.com/faun/configuring-travis-ci-for-angular-application-34afee1715f
- language: node_js
node_js:
- "12.13.1"
node_js: 12.13.1
services:
- xvfb
dist: xenial
Expand All @@ -33,12 +32,15 @@ matrix:
chrome: stable

- language: go
go_import_path: github.com/IssaHanou/BEP_1920_Q2
go: 1.13.4
go_import_path: github.com/IssaHanou/BEP_1920_Q2/back-end
before_install:
- go get github.com/stretchr/testify/assert
- go get -u golang.org/x/lint/golint
- export GOPATH=$TRAVIS_BUILD_DIR/back-end
- cd back-end/src/sciler
- go get github.com/stretchr/testify/assert
script:
- cd back-end
- golint -set_exit_status ./..
- go test -v ./...
- go build
- cd ../..
- golint -set_exit_status sciler/...
- go test -v sciler/...
- go build sciler
2 changes: 2 additions & 0 deletions back-end/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/bin
/pkg
6 changes: 0 additions & 6 deletions back-end/.idea/vcs.xml

This file was deleted.

6 changes: 5 additions & 1 deletion back-end/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
The back-end is written in Go. Tools used are go fmt, golint and Testify.

External imports that need to be retrieved should be added in `.travis.yml` in the `before_script`.

Configure (project) GOPATH to /back-end folder in /BEP_1920_Q2.
When using Goland uncheck `Use GOPATH that is defined in system environment` and check `Index entire GOPATH`

run `go get ./...` in the `sciler` folder to go get all dependencies

### Setup gofmt and golint to run automatically:
- install golint: `go get -u golang.org/x/lint/golint`
- natigate to Settings > Tools > File Watchers
Expand Down
Binary file added back-end/back-end.exe
Binary file not shown.
40 changes: 0 additions & 40 deletions back-end/config/config.go

This file was deleted.

16 changes: 0 additions & 16 deletions back-end/config/config_test.go

This file was deleted.

15 changes: 0 additions & 15 deletions back-end/main.go

This file was deleted.

136 changes: 94 additions & 42 deletions back-end/resources/room_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,52 +13,52 @@
"redSwitch": "boolean",
"orangeSwitch": "boolean",
"greenSwitch": "boolean",
"slider1": "integer",
"slider2": "integer",
"slider3": "integer",
"slider1": "numeric",
"slider2": "numeric",
"slider3": "numeric",
"mainSwitch": "boolean"
},
"output": {
"greenLight1": {
"type": "string",
"instruction": {
"interval": "integer",
"delay": "integer"
"interval": "numeric",
"delay": "numeric"
}
},
"greenLight2": {
"type": "string",
"instruction": {
"interval": "integer",
"delay": "integer"
"interval": "numeric",
"delay": "numeric"
}
},
"greenLight3": {
"type": "string",
"instruction": {
"interval": "integer",
"delay": "integer"
"interval": "numeric",
"delay": "numeric"
}
},
"redLight1": {
"type": "string",
"instruction": {
"interval": "integer",
"delay": "integer"
"interval": "numeric",
"delay": "numeric"
}
},
"redLight2": {
"redLight2": {
"type": "string",
"instruction": {
"interval": "integer",
"delay": "integer"
"interval": "numeric",
"delay": "numeric"
}
},
"redLight3": {
"redLight3": {
"type": "string",
"instruction": {
"interval": "integer",
"delay": "integer"
"interval": "numeric",
"delay": "numeric"
}
}
}
Expand All @@ -67,12 +67,21 @@
"id": "telephone",
"description": "The telephone can ring and display a message. It will also record the numbers turned, and send these as sequence",
"input": {
"turningWheel": "array"
"turningWheel": "num-array"
},
"output": {
"audio": "string",
"ringTone": "string"
}
},
{
"id": "door1",
"description": "De deur kan open en dicht zijn en neemt geen input.",
"input": {
},
"output": {
"open": "boolean"
}
}
],
"puzzles": [
Expand All @@ -86,11 +95,12 @@
"conditions": [
{
"type": "device",
"id": "telphone",
"type_id": "telephone",
"constraints": [
{
"comparison": "eq",
"turningWheel": [
"comp": "eq",
"component_id": "turningWheel",
"value": [
0,
1,
2,
Expand All @@ -101,7 +111,7 @@
"actions": [
{
"type": "device",
"id": "controlBoard",
"type_id": "controlBoard",
"message": {
"output": {
"greenLight1": {
Expand Down Expand Up @@ -141,28 +151,26 @@
"conditions": [
{
"type": "device",
"id": "controlBoard",
"type_id": "controlBoard",
"constraints": [
{
"component_id": "mainSwitch",
"comparison": "eq",
"comp": "eq",
"value": true
},
{
"component_id": "greenSwitch",
"comp": "eq",
"value": true
},
{
"component_id": "redSwitch",
"comp": "eq",
"value": true
},
[
{
"component_id": "greenSwitch",
"comparison": "eq",
"value": true
},
{
"component_id": "redSwitch",
"comparison": "eq",
"value": true
}
],
{
"component_id": "slider2",
"comparison": "lt",
"comp": "lt",
"value": 30
}
]
Expand All @@ -171,7 +179,7 @@
"actions": [
{
"type": "device",
"id": "telephone",
"type_id": "telephone",
"message": {
"output": {
"audio": "audio_1"
Expand All @@ -180,7 +188,7 @@
},
{
"type": "device",
"id": "controlBoard",
"type_id": "controlBoard",
"message": {
"output": {
"greenLight1": false,
Expand Down Expand Up @@ -211,10 +219,10 @@
"conditions": [
{
"type": "timer",
"id": "telephone",
"type_id": "timer1",
"constraints": [
{
"comparison": "eq",
"comp": "eq",
"value": "00:01:00"
}
]
Expand All @@ -223,16 +231,60 @@
"actions": [
{
"type": "device",
"id": "telephone",
"type_id": "telephone",
"message": {
"output": {
"ringTone": "standard",
"audio": "audio_1"
}
}
}
]
}
]
},
{
"name": "Stop",
"rules": [
{
"id": "flipSwitch",
"description": "Als de knop omgaat, stopt het spel: tijd stopt en deur gaat open.",
"limit": 1,
"conditions": [
{
"type": "device",
"type_id": "controlBoard",
"constraints": [
{
"component_id": "mainSwitch",
"comp": "eq",
"value": true
}
]
}
],
"actions": [
{
"type": "timer",
"type_id": "timer1",
"message": {
"output": {
"instruction": "stop"
}
}
},
{
"type": "device",
"type_id": "door1",
"message": {
"output": {
"open": true
}
}
}
]
}
]
}
]
}
Loading

0 comments on commit 34c4b28

Please sign in to comment.