Skip to content

Commit 979b52d

Browse files
authored
Merge pull request #7 from iss2022-BCR/sprint1
Sprint1 quasi concluso
2 parents 1ec1b88 + 9dcae86 commit 979b52d

File tree

570 files changed

+19579
-1144
lines changed

Some content is hidden

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

570 files changed

+19579
-1144
lines changed

.gitignore

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,85 @@
2222
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2323
hs_err_pid*
2424

25+
#IntelliJ
26+
.DS_Store
27+
.idea/shelf
28+
/confluence/target
29+
/dependencies/repo
30+
/android.tests.dependencies
31+
/dependencies/android.tests.dependencies
32+
/dist
33+
/local
34+
/gh-pages
35+
/ideaSDK
36+
/clionSDK
37+
/android-studio/sdk
38+
out/
39+
/tmp
40+
/intellij
41+
workspace.xml
42+
*.versionsBackup
43+
/idea/testData/debugger/tinyApp/classes*
44+
/jps-plugin/testData/kannotator
45+
/js/js.translator/testData/out/
46+
/js/js.translator/testData/out-min/
47+
/js/js.translator/testData/out-pir/
48+
.gradle/
49+
build/
50+
!**/src/**/build
51+
!**/test/**/build
52+
*.iml
53+
!**/testData/**/*.iml
54+
.idea/remote-targets.xml
55+
.idea/libraries/Gradle*.xml
56+
.idea/libraries/Maven*.xml
57+
.idea/artifacts/PILL_*.xml
58+
.idea/artifacts/KotlinPlugin.xml
59+
.idea/modules
60+
.idea/runConfigurations/JPS_*.xml
61+
.idea/runConfigurations/PILL_*.xml
62+
.idea/runConfigurations/_FP_*.xml
63+
.idea/runConfigurations/_MT_*.xml
64+
.idea/libraries
65+
.idea/modules.xml
66+
.idea/gradle.xml
67+
.idea/compiler.xml
68+
.idea/inspectionProfiles/profiles_settings.xml
69+
.idea/.name
70+
.idea/artifacts/dist_auto_*
71+
.idea/artifacts/dist.xml
72+
.idea/artifacts/ideaPlugin.xml
73+
.idea/artifacts/kotlinc.xml
74+
.idea/artifacts/kotlin_compiler_jar.xml
75+
.idea/artifacts/kotlin_plugin_jar.xml
76+
.idea/artifacts/kotlin_jps_plugin_jar.xml
77+
.idea/artifacts/kotlin_daemon_client_jar.xml
78+
.idea/artifacts/kotlin_imports_dumper_compiler_plugin_jar.xml
79+
.idea/artifacts/kotlin_main_kts_jar.xml
80+
.idea/artifacts/kotlin_compiler_client_embeddable_jar.xml
81+
.idea/artifacts/kotlin_reflect_jar.xml
82+
.idea/artifacts/kotlin_stdlib_js_ir_*
83+
.idea/artifacts/kotlin_test_js_ir_*
84+
.idea/artifacts/kotlin_stdlib_wasm_*
85+
.idea/artifacts/kotlinx_atomicfu_runtime_*
86+
.idea/artifacts/kotlinx_cli_jvm_*
87+
.idea/jarRepositories.xml
88+
.idea/csv-plugin.xml
89+
.idea/libraries-with-intellij-classes.xml
90+
.idea/misc.xml
91+
.idea/protoeditor.xml
92+
node_modules/
93+
.rpt2_cache/
94+
libraries/tools/kotlin-test-js-runner/lib/
95+
local.properties
96+
buildSrcTmp/
97+
distTmp/
98+
outTmp/
99+
/test.output
100+
/kotlin-native/dist
101+
kotlin-ide/
102+
25103
#tmp
26104
Sprint2*/
27-
Sprint3*/
105+
Sprint3*/
106+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</div>
1111

1212
<div align="center">
13-
<img align="center" width="25%" src="./gfx/walle.jpg"/>
13+
<img align="center" width="25%" src="commons/resources/imgs/walle.jpg"/>
1414

1515
<h1>WasteService</h1>
1616

Sprint0/Sprint0_RequirementAnalysis/.idea/modules/unibo.test_storerequest.test.iml

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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('demoArch', show=False, outformat='png', graph_attr=graphattr) as diag:
20+
with Cluster('env'):
21+
sys = Custom('','./qakicons/system.png')
22+
with Cluster('ctx_wasteservice', graph_attr=nodeattr):
23+
wasteservice=Custom('wasteservice','./qakicons/symActorSmall.png')
24+
transporttrolley=Custom('transporttrolley','./qakicons/symActorSmall.png')
25+
with Cluster('ctx_monitor', graph_attr=nodeattr):
26+
wasteservicestatusgui=Custom('wasteservicestatusgui','./qakicons/symActorSmall.png')
27+
with Cluster('ctx_raspdevice', graph_attr=nodeattr):
28+
alarmdevice=Custom('alarmdevice','./qakicons/symActorSmall.png')
29+
warningdevice=Custom('warningdevice','./qakicons/symActorSmall.png')
30+
with Cluster('ctx_smartdevice_test', graph_attr=nodeattr):
31+
smartdevice_test=Custom('smartdevice_test','./qakicons/symActorSmall.png')
32+
with Cluster('ctx_basicrobot', graph_attr=nodeattr):
33+
basicrobot=Custom('basicrobot(ext)','./qakicons/externalQActor.png')
34+
smartdevice_test >> Edge(color='magenta', style='solid', xlabel='storerequest') >> wasteservice
35+
wasteservice >> Edge(color='green', style='dashed', xlabel='loadaccepted') >> sys
36+
wasteservice >> Edge(color='blue', style='solid', xlabel='doDeposit') >> transporttrolley
37+
wasteservice >> Edge(color='green', style='dashed', xlabel='loadrejected') >> sys
38+
wasteservice >> Edge(color='blue', style='solid', xlabel='updategui') >> wasteservicestatusgui
39+
wasteservice >> Edge(color='blue', style='solid', xlabel='stop') >> transporttrolley
40+
wasteservice >> Edge(color='blue', style='solid', xlabel='resume') >> transporttrolley
41+
transporttrolley >> Edge(color='blue', style='solid', xlabel='updateled') >> warningdevice
42+
transporttrolley >> Edge(color='blue', style='solid', xlabel='updategui') >> wasteservicestatusgui
43+
transporttrolley >> Edge(color='magenta', style='solid', xlabel='step') >> basicrobot
44+
transporttrolley >> Edge(color='blue', style='solid', xlabel='cmd') >> basicrobot
45+
alarmdevice >> Edge(color='blue', style='solid', xlabel='distance') >> wasteservice
46+
diag

Sprint0/Sprint0_RequirementAnalysis/build2022.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ eclipse {
105105

106106
application {
107107
// Define the main class for the application.
108-
mainClass = 'it.unibo.ctx_basicrobot.MainCtx_basicrobotKt'
108+
mainClass = 'it.unibo.ctx_test_storerequest.MainCtx_test_storerequestKt'
109109
}
110110

111111
jar {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
%====================================================================================
2+
% demo description
3+
%====================================================================================
4+
context(ctx_wasteservice, "localhost", "TCP", "11800").
5+
context(ctx_monitor, "localhost", "TCP", "11801").
6+
context(ctx_raspdevice, "localhost", "TCP", "11802").
7+
context(ctx_smartdevice_test, "localhost", "TCP", "11803").
8+
context(ctx_basicrobot, "localhost", "TCP", "11810").
9+
qactor( basicrobot, ctx_basicrobot, "external").
10+
qactor( smartdevice_test, ctx_smartdevice_test, "it.unibo.smartdevice_test.Smartdevice_test").
11+
qactor( wasteservice, ctx_wasteservice, "it.unibo.wasteservice.Wasteservice").
12+
qactor( transporttrolley, ctx_wasteservice, "it.unibo.transporttrolley.Transporttrolley").
13+
qactor( alarmdevice, ctx_raspdevice, "it.unibo.alarmdevice.Alarmdevice").
14+
qactor( warningdevice, ctx_raspdevice, "it.unibo.warningdevice.Warningdevice").
15+
qactor( wasteservicestatusgui, ctx_monitor, "it.unibo.wasteservicestatusgui.Wasteservicestatusgui").
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
rootProject.name = "unibo.demo_system_overview_v0"
1+
rootProject.name = "unibo.test_storerequest"

Sprint0/Sprint0_RequirementAnalysis/src/it/unibo/ctx_basicrobot/MainCtx_basicrobot.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import kotlinx.coroutines.runBlocking
66

77
fun main() = runBlocking {
88
QakContext.createContexts(
9-
"localhost", this, "demo_system_overview_v0.pl", "sysRules.pl","ctx_basicrobot"
9+
"localhost", this, "demo.pl", "sysRules.pl","ctx_basicrobot"
1010
)
1111
}
1212

Sprint0/Sprint0_RequirementAnalysis/src/it/unibo/ctx_monitor/MainCtx_monitor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import kotlinx.coroutines.runBlocking
66

77
fun main() = runBlocking {
88
QakContext.createContexts(
9-
"localhost", this, "demo_system_overview_v0.pl", "sysRules.pl","ctx_monitor"
9+
"localhost", this, "demo.pl", "sysRules.pl","ctx_monitor"
1010
)
1111
}
1212

Sprint0/Sprint0_RequirementAnalysis/src/it/unibo/ctx_raspdevice/MainCtx_raspdevice.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import kotlinx.coroutines.runBlocking
66

77
fun main() = runBlocking {
88
QakContext.createContexts(
9-
"localhost", this, "demo_system_overview_v0.pl", "sysRules.pl","ctx_raspdevice"
9+
"localhost", this, "demo.pl", "sysRules.pl","ctx_raspdevice"
1010
)
1111
}
1212

Sprint0/Sprint0_RequirementAnalysis/src/it/unibo/ctx_smartdevice_test/MainCtx_smartdevice_test.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import kotlinx.coroutines.runBlocking
66

77
fun main() = runBlocking {
88
QakContext.createContexts(
9-
"localhost", this, "demo_system_overview_v0.pl", "sysRules.pl","ctx_smartdevice_test"
9+
"localhost", this, "demo.pl", "sysRules.pl","ctx_smartdevice_test"
1010
)
1111
}
1212

Sprint0/Sprint0_RequirementAnalysis/src/it/unibo/ctx_wasteservice/MainCtx_wasteservice.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import kotlinx.coroutines.runBlocking
66

77
fun main() = runBlocking {
88
QakContext.createContexts(
9-
"localhost", this, "demo_system_overview_v0.pl", "sysRules.pl","ctx_wasteservice"
9+
"localhost", this, "demo.pl", "sysRules.pl","ctx_wasteservice"
1010
)
1111
}
1212

Sprint0/Sprint0_RequirementAnalysis/src/it/unibo/wasteservice/Wasteservice.kt

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class Wasteservice ( name: String, scope: CoroutineScope ) : ActorBasicFsm( nam
2828
var CurrentGlass = 0.0f
2929
println("$name in ${currentState.stateName} | $currentMsg")
3030
println("[WasteService] Reset:")
31-
println(" Plastic: $CurrentPlastic / ${wasteservice.Constants.MAXPB} KG")
32-
println(" Glass: $CurrentGlass / ${wasteservice.Constants.MAXGB} KG")
31+
println(" Plastic: $CurrentPlastic")
32+
println(" Glass: $CurrentGlass")
3333
//genTimer( actor, state )
3434
}
3535
//After Lenzi Aug2002
@@ -39,7 +39,6 @@ class Wasteservice ( name: String, scope: CoroutineScope ) : ActorBasicFsm( nam
3939
}
4040
state("state_idle") { //this:State
4141
action { //it:State
42-
println("[WasteService] Idle...")
4342
//genTimer( actor, state )
4443
}
4544
//After Lenzi Aug2002
@@ -60,24 +59,15 @@ class Wasteservice ( name: String, scope: CoroutineScope ) : ActorBasicFsm( nam
6059
// enough space
6160
(Type == wasteservice.WasteType.PLASTIC && CurrentPlastic + TruckLoad <= wasteservice.Constants.MAXPB) ||
6261
(Type == wasteservice.WasteType.GLASS && CurrentGlass + TruckLoad <= wasteservice.Constants.MAXGB)
63-
){
64-
if (Type == wasteservice.WasteType.PLASTIC) {
65-
CurrentPlastic += TruckLoad
66-
}
67-
else {
68-
CurrentGlass += TruckLoad
69-
}
70-
answer("storerequest", "loadaccepted", "loadaccepted(_)" )
62+
){answer("storerequest", "loadaccepted", "loadaccepted(_)" )
7163
forward("doDeposit", "doDeposit(TYPE,WEIGHT)" ,"transporttrolley" )
72-
delay(1000)
7364
}
7465
else
7566
{answer("storerequest", "loadrejected", "loadaccepted(_)" )
7667
}
7768
forward("updategui", "updategui(_)" ,"wasteservicestatusgui" )
78-
println(" Plastic: $CurrentPlastic / ${wasteservice.Constants.MAXPB} KG")
79-
println(" Glass: $CurrentGlass / ${wasteservice.Constants.MAXGB} KG")
8069
}
70+
delay(1000)
8171
//genTimer( actor, state )
8272
}
8373
//After Lenzi Aug2002
Binary file not shown.
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/.idea/modules/unibo.test_echo_waste_server.test.iml

Lines changed: 0 additions & 4 deletions
This file was deleted.

Sprint1/Sprint1_ProblemAnalysis/.idea/modules/unibo.waste_service.test.iml

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)