Skip to content

Commit 72f29a6

Browse files
authored
Merge pull request #8 from iss2022-BCR/sprint1
Sprint1 finito
2 parents 979b52d + 0411a14 commit 72f29a6

File tree

53 files changed

+1509
-248
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1509
-248
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Sprint1/Sprint1_ProblemAnalysis/.idea/.name

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sprint1/Sprint1_ProblemAnalysis/build2022.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@ application {
108108
mainClass = 'it.unibo.ctx_transporttrolley_test.MainCtx_transporttrolley_testKt'
109109
}
110110

111+
tasks.withType(Test) {
112+
testLogging {
113+
exceptionFormat "full"
114+
events "started", "skipped", "passed", "failed"
115+
showStandardStreams true
116+
}
117+
}
118+
111119
jar {
112120
println("building jar")
113121
from sourceSets.main.allSource
Loading
Loading
Loading
Loading
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
run_AndroidEmulator.bat
2+
run_VirtualRobot.bat
3+
run_WasteService.bat
4+
run_SmartDevice.bat
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:: run Android Emulator
2+
flutter emulators --launch Pixel_3a_API_30_x86
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:: Run Docker Desktop
2+
start "C:\Program Files\Docker\Docker\Docker Desktop.exe"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@echo off
2+
3+
set ip=%1
4+
set port=%2
5+
set waste_type=%3
6+
set waste_weight=%4
7+
8+
if "%~1" == "" goto default
9+
if "%~2" == "" goto default
10+
if "%~3" == "" goto default
11+
if "%~4" == "" goto default
12+
13+
echo [SmartDevice Demo] Starting demo with the following parameters:
14+
echo IP = %ip%
15+
echo Port = %port%
16+
echo StoreRequest_Type = %waste_type%
17+
echo PortStoreRequest_Weight = %waste_weight%
18+
19+
goto end
20+
21+
:default
22+
cd ../sprint1_smart_device/
23+
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"
24+
25+
:usage
26+
echo usage: ./demo_sprint1 waste_service_IP waste_service_port waste_type waste_weight
27+
goto end
28+
29+
:end
30+
cd ../sprint1_smart_device/
31+
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%"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
:: Run Docker Image
2+
cd ..\..\..\unibo.basicrobot22
3+
start docker-compose -f .\virtualRobotOnly4.0.yaml up
4+
5+
:: Open Chrome
6+
cd "C:\Program Files\Google\Chrome\Application\"
7+
start chrome.exe --new-window http:\\localhost:8090
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
cd ../sprint1_waste_service
2+
3+
:: Run VirtualRobot Context
4+
start .\gradlew runCtx_Robot
5+
6+
:: Run TransportTrolley Context
7+
start .\gradlew runCtx_TransportTrolley
8+
9+
:: Run WasteService Context
10+
start .\gradlew runCtx_WasteService

Sprint1/Sprint1_Project/sprint1_echo_waste_server/lib/model/appl_message.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ class ApplMessage {
2626

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

32-
msgId = parsed[0].trim();
31+
msgId = parsed[0].split('(')[1].trim();
3332
message = message.replaceFirst(msgId, '');
3433
parsed.removeAt(0);
3534

Sprint1/Sprint1_Project/sprint1_smart_device/lib/model/appl_message.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ class ApplMessage {
2727

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

33-
msgId = parsed[0].trim();
32+
msgId = parsed[0].split('(')[1].trim();
3433
message = message.replaceFirst(msgId, '');
3534
parsed.removeAt(0);
3635

Sprint1/Sprint1_Project/sprint1_waste_service/.idea/uiDesigner.xml

Lines changed: 124 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
from diagrams import Cluster, Diagram, Edge
2+
from diagrams.custom import Custom
3+
import os
4+
os.environ['PATH'] += os.pathsep + 'C:/Program Files/Graphviz/bin/'
5+
6+
graphattr = { #https://www.graphviz.org/doc/info/attrs.html
7+
'fontsize': '22',
8+
}
9+
10+
nodeattr = {
11+
'fontsize': '22',
12+
'bgcolor': 'lightyellow'
13+
}
14+
15+
eventedgeattr = {
16+
'color': 'red',
17+
'style': 'dotted'
18+
}
19+
with Diagram('demo_waste_serviceArch', show=False, outformat='png', graph_attr=graphattr) as diag:
20+
with Cluster('env'):
21+
sys = Custom('','./qakicons/system.png')
22+
with Cluster('ctx_demo_wasteservice', graph_attr=nodeattr):
23+
typesprovider=Custom('typesprovider','./qakicons/symActorSmall.png')
24+
wasteservice=Custom('wasteservice','./qakicons/symActorSmall.png')
25+
transporttrolley=Custom('transporttrolley','./qakicons/symActorSmall.png')
26+
pathexecutor=Custom('pathexecutor','./qakicons/symActorSmall.png')
27+
basicrobot=Custom('basicrobot','./qakicons/symActorSmall.png')
28+
typesprovider >> Edge(color='green', style='dashed', xlabel='typesreply') >> sys
29+
wasteservice >> Edge(color='magenta', style='solid', xlabel='deposit') >> transporttrolley
30+
wasteservice >> Edge(color='green', style='dashed', xlabel='loadrejected') >> sys
31+
wasteservice >> Edge(color='green', style='dashed', xlabel='loadrejected') >> sys
32+
wasteservice >> Edge(color='green', style='dashed', xlabel='loadaccepted') >> sys
33+
transporttrolley >> Edge(color='magenta', style='solid', xlabel='dopath') >> pathexecutor
34+
transporttrolley >> Edge(color='green', style='dashed', xlabel='pickupcompleted') >> sys
35+
transporttrolley >> Edge(color='blue', style='solid', xlabel='depositcompleted') >> wasteservice
36+
pathexecutor >> Edge(color='blue', style='solid', xlabel='cmd') >> basicrobot
37+
pathexecutor >> Edge(color='magenta', style='solid', xlabel='step') >> basicrobot
38+
sys >> Edge(color='red', style='dashed', xlabel='alarm') >> pathexecutor
39+
pathexecutor >> Edge(color='green', style='dashed', xlabel='dopathdone') >> sys
40+
pathexecutor >> Edge(color='green', style='dashed', xlabel='dopathfail') >> sys
41+
basicrobot >> Edge(color='green', style='dashed', xlabel='stepdone') >> sys
42+
basicrobot >> Edge(color='green', style='dashed', xlabel='stepfail') >> sys
43+
diag
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
from diagrams import Cluster, Diagram, Edge
2+
from diagrams.custom import Custom
3+
import os
4+
os.environ['PATH'] += os.pathsep + 'C:/Program Files/Graphviz/bin/'
5+
6+
graphattr = { #https://www.graphviz.org/doc/info/attrs.html
7+
'fontsize': '22',
8+
}
9+
10+
nodeattr = {
11+
'fontsize': '22',
12+
'bgcolor': 'lightyellow'
13+
}
14+
15+
eventedgeattr = {
16+
'color': 'red',
17+
'style': 'dotted'
18+
}
19+
with Diagram('logical_architecture_waste_serviceArch', show=False, outformat='png', graph_attr=graphattr) as diag:
20+
with Cluster('env'):
21+
sys = Custom('','./qakicons/system.png')
22+
with Cluster('ctx_smartdevice', graph_attr=nodeattr):
23+
smartdevice_simulator=Custom('smartdevice_simulator','./qakicons/symActorSmall.png')
24+
with Cluster('ctx_wasteservice', graph_attr=nodeattr):
25+
typesprovider=Custom('typesprovider','./qakicons/symActorSmall.png')
26+
wasteservice=Custom('wasteservice','./qakicons/symActorSmall.png')
27+
with Cluster('ctx_transporttrolley', graph_attr=nodeattr):
28+
transporttrolley=Custom('transporttrolley','./qakicons/symActorSmall.png')
29+
pathexecutor=Custom('pathexecutor','./qakicons/symActorSmall.png')
30+
with Cluster('ctx_robot', graph_attr=nodeattr):
31+
basicrobot=Custom('basicrobot(ext)','./qakicons/externalQActor.png')
32+
smartdevice_simulator >> Edge(color='magenta', style='solid', xlabel='typesrequest') >> typesprovider
33+
smartdevice_simulator >> Edge(color='magenta', style='solid', xlabel='storerequest') >> wasteservice
34+
typesprovider >> Edge(color='green', style='dashed', xlabel='typesreply') >> sys
35+
wasteservice >> Edge(color='magenta', style='solid', xlabel='deposit') >> transporttrolley
36+
wasteservice >> Edge(color='green', style='dashed', xlabel='loadrejected') >> sys
37+
wasteservice >> Edge(color='green', style='dashed', xlabel='loadrejected') >> sys
38+
wasteservice >> Edge(color='green', style='dashed', xlabel='loadaccepted') >> sys
39+
transporttrolley >> Edge(color='magenta', style='solid', xlabel='dopath') >> pathexecutor
40+
transporttrolley >> Edge(color='green', style='dashed', xlabel='pickupcompleted') >> sys
41+
transporttrolley >> Edge(color='blue', style='solid', xlabel='depositcompleted') >> wasteservice
42+
pathexecutor >> Edge(color='blue', style='solid', xlabel='cmd') >> basicrobot
43+
pathexecutor >> Edge(color='magenta', style='solid', xlabel='step') >> basicrobot
44+
sys >> Edge(color='red', style='dashed', xlabel='alarm') >> pathexecutor
45+
pathexecutor >> Edge(color='green', style='dashed', xlabel='dopathdone') >> sys
46+
pathexecutor >> Edge(color='green', style='dashed', xlabel='dopathfail') >> sys
47+
diag

Sprint1/Sprint1_Project/sprint1_waste_service/Arch_waste_service.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,14 @@
1919
with Diagram('waste_serviceArch', show=False, outformat='png', graph_attr=graphattr) as diag:
2020
with Cluster('env'):
2121
sys = Custom('','./qakicons/system.png')
22-
with Cluster('ctx_smartdevice', graph_attr=nodeattr):
23-
smartdevice_simulator=Custom('smartdevice_simulator','./qakicons/symActorSmall.png')
2422
with Cluster('ctx_wasteservice', graph_attr=nodeattr):
2523
typesprovider=Custom('typesprovider','./qakicons/symActorSmall.png')
2624
wasteservice=Custom('wasteservice','./qakicons/symActorSmall.png')
2725
with Cluster('ctx_transporttrolley', graph_attr=nodeattr):
2826
transporttrolley=Custom('transporttrolley','./qakicons/symActorSmall.png')
2927
pathexecutor=Custom('pathexecutor','./qakicons/symActorSmall.png')
3028
with Cluster('ctx_robot', graph_attr=nodeattr):
31-
basicrobot=Custom('basicrobot(ext)','./qakicons/externalQActor.png')
32-
smartdevice_simulator >> Edge(color='magenta', style='solid', xlabel='typesrequest') >> typesprovider
33-
smartdevice_simulator >> Edge(color='magenta', style='solid', xlabel='storerequest') >> wasteservice
29+
basicrobot=Custom('basicrobot','./qakicons/symActorSmall.png')
3430
typesprovider >> Edge(color='green', style='dashed', xlabel='typesreply') >> sys
3531
wasteservice >> Edge(color='magenta', style='solid', xlabel='deposit') >> transporttrolley
3632
wasteservice >> Edge(color='green', style='dashed', xlabel='loadrejected') >> sys
@@ -44,4 +40,6 @@
4440
sys >> Edge(color='red', style='dashed', xlabel='alarm') >> pathexecutor
4541
pathexecutor >> Edge(color='green', style='dashed', xlabel='dopathdone') >> sys
4642
pathexecutor >> Edge(color='green', style='dashed', xlabel='dopathfail') >> sys
43+
basicrobot >> Edge(color='green', style='dashed', xlabel='stepdone') >> sys
44+
basicrobot >> Edge(color='green', style='dashed', xlabel='stepfail') >> sys
4745
diag

0 commit comments

Comments
 (0)