Skip to content

Commit

Permalink
Removed logs and fixed active alarm icon
Browse files Browse the repository at this point in the history
  • Loading branch information
baranonen committed Oct 3, 2024
1 parent c251116 commit dc343e7
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 25 deletions.
2 changes: 1 addition & 1 deletion simulation/ats/ats.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class ATS {
navigationBar.appendChild(alarmsButton)

var activeAlarmButton = document.createElement("button")
activeAlarmButton.style.backgroundImage = "url(./ats/resources/activeAlarm.svg)"
activeAlarmButton.style.backgroundImage = "url(./ats/resources/activealarm.svg)"
navigationBar.appendChild(activeAlarmButton)

this.interlockingAnswerFirstLine = document.createElement("p")
Expand Down
1 change: 0 additions & 1 deletion simulation/simulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ interlocking.getCycleFromName("TAK_1").enable()
interlocking.getCycleFromName("4LV_22").enable()
interlocking.getCycleFromName("4LV_22").currentPhase = "exit"

console.log("a")
var trains = []
trains.push(new Train("01", 4, map, track, map.getTrackCircuitFromName("OSM_01T"), "northbound", interlocking, ats))
trains.push(new Train("02", 4, map, track, map.getTrackCircuitFromName("GAY_10T"), "southbound", interlocking, ats))
Expand Down
19 changes: 0 additions & 19 deletions simulation/trains/atconboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,27 +81,15 @@ class ATCOnboard {
checkDwellTime() {
if (this.train.direction == "northbound") {
if (!this.stoppedAtStation) {
if (this.train.name == "01") {
console.log("current not stopped")
}
if (this.train.carPositions[0].mapTrackCircuit.northboundPlatform != null) {
if (this.train.name == "01") {
console.log("in platform area")
}
if (this.train.carPositions[0].position == this.train.carPositions[0].mapTrackCircuit.northboundPlatform.northboundPosition && !this.departing) {
if (this.train.name == "01") {
console.log("start stopping at station")
}
this.stoppedAtStation = true
this.currentlyStoppedPlatform = this.train.carPositions[0].mapTrackCircuit.northboundPlatform
this.stopAtStationTimestamp = Date.now()
return false
}
}
} else {
if (this.train.name == "01") {
console.log("current stopped")
}
if (this.currentlyStoppedPlatform.terminus && !this.alreadyChangedEnds) {
this.alreadyChangedEnds = true
this.train.driver.changeEnds()
Expand All @@ -111,17 +99,10 @@ class ATCOnboard {
this.currentlyStoppedPlatform.direction == "northbound" && !this.ats.regulation.globalNorthboundHold
|| this.currentlyStoppedPlatform.direction == "southbound" && !this.ats.regulation.globalSouthboundHold
) && this.isMALongEnoughToDepart()) {
if (this.train.name == "01") {
console.log("can depart")
}
this.departing = true
this.stoppedAtStation = false
this.alreadyChangedEnds = false
} else {
if (this.train.name == "01") {
console.log("can not depart")
console.log("current waited time " + (Date.now() - this.stopAtStationTimestamp) / 1000)
}
return false
}
}
Expand Down
4 changes: 0 additions & 4 deletions simulation/trains/train.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ class Train {
)) {
this.continueUntilNextSignal = false
}
if (this.name == "01") {
console.log("update 1")
console.log(nextUpdate)
}
setTimeout(this.updatePosition.bind(this), Math.random() * (400) + nextUpdate)
}

Expand Down

0 comments on commit dc343e7

Please sign in to comment.