Skip to content

Commit

Permalink
🔖 Prepare for release 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bongijo committed Aug 18, 2021
1 parent 75844df commit a13480a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package parkmanagerservice.controller

import fan.CoapFan
import fan.FanInterface
import it.unibo.actor0.sysUtil
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.beans.factory.annotation.Value
import org.springframework.http.HttpHeaders
Expand Down Expand Up @@ -36,30 +35,34 @@ class BaseController() {
@Autowired
constructor (template: SimpMessagingTemplate) : this() {
this.template = template
}

//TODO Initialize temperature in ParkingAreaKb

init {
try {
val tmax = System.getenv("TMAX")
if(tmax != null)
if(tmax != null){
THERMOMETER_THRESHOLD = tmax.toInt()
println("BaseController: Use value TMAX=$THERMOMETER_THRESHOLD")
}
else
println("BaseController: Use default value TMAX=$THERMOMETER_THRESHOLD")
} catch (e: NumberFormatException) {
println("BaseController: TMAX must be an integer. Use default value $THERMOMETER_THRESHOLD")
}
try {
val dtfree = System.getenv("DTFREE")
if(dtfree != null)
if(dtfree != null) {
TIMER_THRESHOLD = dtfree.toInt()
println("BaseController: Use value DTFREE=$TIMER_THRESHOLD")
}
else
println("BaseController: Use default value DTFREE=$TIMER_THRESHOLD")
} catch (e: NumberFormatException) {
println("BaseController: DTFREE must be an integer. Use default value $TIMER_THRESHOLD")
}
}

//TODO Initialize temperature in ParkingAreaKb

init {
println("%%%%%% BaseController | START FOR OBSERVE: ThermometerController at $PARKINGAREA_HOSTNAME:$PARKINGAREA_PORT")
ThermometerController(CoapThermometer("coap://$PARKINGAREA_HOSTNAME:$PARKINGAREA_PORT/parkingarea/thermometer"), THERMOMETER_THRESHOLD).addObserver{
println("%%%%%% BaseController | OBSERVE: ThermometerController")
Expand Down
4 changes: 2 additions & 2 deletions it.unibo.sembrava_qualcuno.sprint4/variables.env
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ WEIGHTSENSOR_START_VALUE=0
SONAR_START_VALUE=false

# Requirements alarm trigger values
TMAX=20
DTFREE=60
TMAX=30
DTFREE=60

0 comments on commit a13480a

Please sign in to comment.