Skip to content

Commit

Permalink
Merge pull request #8 from iss2022-BCR/sprint1
Browse files Browse the repository at this point in the history
Sprint1 finito
  • Loading branch information
mikyll authored Nov 24, 2022
2 parents 979b52d + 0411a14 commit 72f29a6
Show file tree
Hide file tree
Showing 53 changed files with 1,509 additions and 248 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Sprint1/Sprint1_ProblemAnalysis/.gradle/file-system.probe
Binary file not shown.
2 changes: 1 addition & 1 deletion Sprint1/Sprint1_ProblemAnalysis/.idea/.name

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

8 changes: 8 additions & 0 deletions Sprint1/Sprint1_ProblemAnalysis/build2022.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ application {
mainClass = 'it.unibo.ctx_transporttrolley_test.MainCtx_transporttrolley_testKt'
}

tasks.withType(Test) {
testLogging {
exceptionFormat "full"
events "started", "skipped", "passed", "failed"
showStandardStreams true
}
}

jar {
println("building jar")
from sourceSets.main.allSource
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Sprint1/Sprint1_ProblemAnalysis/qakicons/codedQActor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Sprint1/Sprint1_ProblemAnalysis/qakicons/externalQActor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Sprint1/Sprint1_ProblemAnalysis/qakicons/symActorSmall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Sprint1/Sprint1_Project/scripts/demo_sprint1.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
run_AndroidEmulator.bat
run_VirtualRobot.bat
run_WasteService.bat
run_SmartDevice.bat
2 changes: 2 additions & 0 deletions Sprint1/Sprint1_Project/scripts/run_AndroidEmulator.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:: run Android Emulator
flutter emulators --launch Pixel_3a_API_30_x86
2 changes: 2 additions & 0 deletions Sprint1/Sprint1_Project/scripts/run_DockerDesktop.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:: Run Docker Desktop
start "C:\Program Files\Docker\Docker\Docker Desktop.exe"
31 changes: 31 additions & 0 deletions Sprint1/Sprint1_Project/scripts/run_SmartDevice.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@echo off

set ip=%1
set port=%2
set waste_type=%3
set waste_weight=%4

if "%~1" == "" goto default
if "%~2" == "" goto default
if "%~3" == "" goto default
if "%~4" == "" goto default

echo [SmartDevice Demo] Starting demo with the following parameters:
echo IP = %ip%
echo Port = %port%
echo StoreRequest_Type = %waste_type%
echo PortStoreRequest_Weight = %waste_weight%

goto end

:default
cd ../sprint1_smart_device/
flutter test ./integration_test/smart_device_demo.dart --dart-define="IP=192.168.1.4" --dart-define="PORT=11800" --dart-define="WASTE_TYPE=GLASS" --dart-define="WASTE_WEIGHT=10.0"

:usage
echo usage: ./demo_sprint1 waste_service_IP waste_service_port waste_type waste_weight
goto end

:end
cd ../sprint1_smart_device/
flutter test ./integration_test/smart_device_demo.dart --dart-define="IP=%ip%" --dart-define="PORT=%port%" --dart-define="WASTE_TYPE=%waste_type%" --dart-define="WASTE_WEIGHT=%waste_weight%"
7 changes: 7 additions & 0 deletions Sprint1/Sprint1_Project/scripts/run_VirtualRobot.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:: Run Docker Image
cd ..\..\..\unibo.basicrobot22
start docker-compose -f .\virtualRobotOnly4.0.yaml up

:: Open Chrome
cd "C:\Program Files\Google\Chrome\Application\"
start chrome.exe --new-window http:\\localhost:8090
10 changes: 10 additions & 0 deletions Sprint1/Sprint1_Project/scripts/run_WasteService.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cd ../sprint1_waste_service

:: Run VirtualRobot Context
start .\gradlew runCtx_Robot

:: Run TransportTrolley Context
start .\gradlew runCtx_TransportTrolley

:: Run WasteService Context
start .\gradlew runCtx_WasteService
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ class ApplMessage {

// msg(msgId, msgType, msgSender, msgReceiver, msgId(msgContent), msgNum)
ApplMessage.fromString(String message) {
message = message.replaceAll('msg(', '');
List<String> parsed = message.split(',');

msgId = parsed[0].trim();
msgId = parsed[0].split('(')[1].trim();
message = message.replaceFirst(msgId, '');
parsed.removeAt(0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ class ApplMessage {

// msg(msgId, msgType, msgSender, msgReceiver, msgId(msgContent), msgNum)
ApplMessage.fromString(String message) {
message = message.replaceAll('msg(', '');
List<String> parsed = message.split(',');

msgId = parsed[0].trim();
msgId = parsed[0].split('(')[1].trim();
message = message.replaceFirst(msgId, '');
parsed.removeAt(0);

Expand Down
124 changes: 124 additions & 0 deletions Sprint1/Sprint1_Project/sprint1_waste_service/.idea/uiDesigner.xml

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from diagrams import Cluster, Diagram, Edge
from diagrams.custom import Custom
import os
os.environ['PATH'] += os.pathsep + 'C:/Program Files/Graphviz/bin/'

graphattr = { #https://www.graphviz.org/doc/info/attrs.html
'fontsize': '22',
}

nodeattr = {
'fontsize': '22',
'bgcolor': 'lightyellow'
}

eventedgeattr = {
'color': 'red',
'style': 'dotted'
}
with Diagram('demo_waste_serviceArch', show=False, outformat='png', graph_attr=graphattr) as diag:
with Cluster('env'):
sys = Custom('','./qakicons/system.png')
with Cluster('ctx_demo_wasteservice', graph_attr=nodeattr):
typesprovider=Custom('typesprovider','./qakicons/symActorSmall.png')
wasteservice=Custom('wasteservice','./qakicons/symActorSmall.png')
transporttrolley=Custom('transporttrolley','./qakicons/symActorSmall.png')
pathexecutor=Custom('pathexecutor','./qakicons/symActorSmall.png')
basicrobot=Custom('basicrobot','./qakicons/symActorSmall.png')
typesprovider >> Edge(color='green', style='dashed', xlabel='typesreply') >> sys
wasteservice >> Edge(color='magenta', style='solid', xlabel='deposit') >> transporttrolley
wasteservice >> Edge(color='green', style='dashed', xlabel='loadrejected') >> sys
wasteservice >> Edge(color='green', style='dashed', xlabel='loadrejected') >> sys
wasteservice >> Edge(color='green', style='dashed', xlabel='loadaccepted') >> sys
transporttrolley >> Edge(color='magenta', style='solid', xlabel='dopath') >> pathexecutor
transporttrolley >> Edge(color='green', style='dashed', xlabel='pickupcompleted') >> sys
transporttrolley >> Edge(color='blue', style='solid', xlabel='depositcompleted') >> wasteservice
pathexecutor >> Edge(color='blue', style='solid', xlabel='cmd') >> basicrobot
pathexecutor >> Edge(color='magenta', style='solid', xlabel='step') >> basicrobot
sys >> Edge(color='red', style='dashed', xlabel='alarm') >> pathexecutor
pathexecutor >> Edge(color='green', style='dashed', xlabel='dopathdone') >> sys
pathexecutor >> Edge(color='green', style='dashed', xlabel='dopathfail') >> sys
basicrobot >> Edge(color='green', style='dashed', xlabel='stepdone') >> sys
basicrobot >> Edge(color='green', style='dashed', xlabel='stepfail') >> sys
diag
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
from diagrams import Cluster, Diagram, Edge
from diagrams.custom import Custom
import os
os.environ['PATH'] += os.pathsep + 'C:/Program Files/Graphviz/bin/'

graphattr = { #https://www.graphviz.org/doc/info/attrs.html
'fontsize': '22',
}

nodeattr = {
'fontsize': '22',
'bgcolor': 'lightyellow'
}

eventedgeattr = {
'color': 'red',
'style': 'dotted'
}
with Diagram('logical_architecture_waste_serviceArch', show=False, outformat='png', graph_attr=graphattr) as diag:
with Cluster('env'):
sys = Custom('','./qakicons/system.png')
with Cluster('ctx_smartdevice', graph_attr=nodeattr):
smartdevice_simulator=Custom('smartdevice_simulator','./qakicons/symActorSmall.png')
with Cluster('ctx_wasteservice', graph_attr=nodeattr):
typesprovider=Custom('typesprovider','./qakicons/symActorSmall.png')
wasteservice=Custom('wasteservice','./qakicons/symActorSmall.png')
with Cluster('ctx_transporttrolley', graph_attr=nodeattr):
transporttrolley=Custom('transporttrolley','./qakicons/symActorSmall.png')
pathexecutor=Custom('pathexecutor','./qakicons/symActorSmall.png')
with Cluster('ctx_robot', graph_attr=nodeattr):
basicrobot=Custom('basicrobot(ext)','./qakicons/externalQActor.png')
smartdevice_simulator >> Edge(color='magenta', style='solid', xlabel='typesrequest') >> typesprovider
smartdevice_simulator >> Edge(color='magenta', style='solid', xlabel='storerequest') >> wasteservice
typesprovider >> Edge(color='green', style='dashed', xlabel='typesreply') >> sys
wasteservice >> Edge(color='magenta', style='solid', xlabel='deposit') >> transporttrolley
wasteservice >> Edge(color='green', style='dashed', xlabel='loadrejected') >> sys
wasteservice >> Edge(color='green', style='dashed', xlabel='loadrejected') >> sys
wasteservice >> Edge(color='green', style='dashed', xlabel='loadaccepted') >> sys
transporttrolley >> Edge(color='magenta', style='solid', xlabel='dopath') >> pathexecutor
transporttrolley >> Edge(color='green', style='dashed', xlabel='pickupcompleted') >> sys
transporttrolley >> Edge(color='blue', style='solid', xlabel='depositcompleted') >> wasteservice
pathexecutor >> Edge(color='blue', style='solid', xlabel='cmd') >> basicrobot
pathexecutor >> Edge(color='magenta', style='solid', xlabel='step') >> basicrobot
sys >> Edge(color='red', style='dashed', xlabel='alarm') >> pathexecutor
pathexecutor >> Edge(color='green', style='dashed', xlabel='dopathdone') >> sys
pathexecutor >> Edge(color='green', style='dashed', xlabel='dopathfail') >> sys
diag
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,14 @@
with Diagram('waste_serviceArch', show=False, outformat='png', graph_attr=graphattr) as diag:
with Cluster('env'):
sys = Custom('','./qakicons/system.png')
with Cluster('ctx_smartdevice', graph_attr=nodeattr):
smartdevice_simulator=Custom('smartdevice_simulator','./qakicons/symActorSmall.png')
with Cluster('ctx_wasteservice', graph_attr=nodeattr):
typesprovider=Custom('typesprovider','./qakicons/symActorSmall.png')
wasteservice=Custom('wasteservice','./qakicons/symActorSmall.png')
with Cluster('ctx_transporttrolley', graph_attr=nodeattr):
transporttrolley=Custom('transporttrolley','./qakicons/symActorSmall.png')
pathexecutor=Custom('pathexecutor','./qakicons/symActorSmall.png')
with Cluster('ctx_robot', graph_attr=nodeattr):
basicrobot=Custom('basicrobot(ext)','./qakicons/externalQActor.png')
smartdevice_simulator >> Edge(color='magenta', style='solid', xlabel='typesrequest') >> typesprovider
smartdevice_simulator >> Edge(color='magenta', style='solid', xlabel='storerequest') >> wasteservice
basicrobot=Custom('basicrobot','./qakicons/symActorSmall.png')
typesprovider >> Edge(color='green', style='dashed', xlabel='typesreply') >> sys
wasteservice >> Edge(color='magenta', style='solid', xlabel='deposit') >> transporttrolley
wasteservice >> Edge(color='green', style='dashed', xlabel='loadrejected') >> sys
Expand All @@ -44,4 +40,6 @@
sys >> Edge(color='red', style='dashed', xlabel='alarm') >> pathexecutor
pathexecutor >> Edge(color='green', style='dashed', xlabel='dopathdone') >> sys
pathexecutor >> Edge(color='green', style='dashed', xlabel='dopathfail') >> sys
basicrobot >> Edge(color='green', style='dashed', xlabel='stepdone') >> sys
basicrobot >> Edge(color='green', style='dashed', xlabel='stepfail') >> sys
diag
Loading

0 comments on commit 72f29a6

Please sign in to comment.