Commit 58055186 authored by boncoi's avatar boncoi
Browse files

Bug fix wrong function call

parent 3501794e
......@@ -71,9 +71,11 @@ function changeButton(floor, currentState, lastState, id) {
function initLastData() {
for (let k = 0; k < nbFloor; k++)
for (let i = 0; i < maxBit; i++) {
lastDataInput[k][i] = 0;
if(i==3)lastDataInput[k][i] = 1;
else lastDataInput[k][i] = 0;
if(i<8)lastDataOutput[k][i] = 0;
}
lastDataInput[0][0]==1;
}
......@@ -158,6 +160,7 @@ function upSensorFloor(floor, currentState,lastState) {
if(currentState==lastState)return;
if (floor == 0) return;
changeIndicator(floor, currentState,lastState, "indicatorUF" + floor);
//if(currentState==1)checkAnimationCabin(floor,1);
}
function downSensorFloor(floor, currentState,lastState) {
......@@ -168,14 +171,14 @@ function downSensorFloor(floor, currentState,lastState) {
}
function openDoors(floor,currentState,lastState) {
if(currentState==lastState || currentState==0)return;
if(currentState==lastState || currentState==0 || currentState!=1)return;
let door = document.getElementById("imageDoor" + floor);
addImage(door, "DoorOPEN", door.alt + floor, "jpg", door.id);
if(currentState==1)checkAnimationCabin(floor,1);
}
function closeDoors(floor, currentState,lastState) {
if(currentState==lastState || currentState==0)return;
if(currentState==lastState || currentState==0 || currentState!=1)return;
let door = document.getElementById("imageDoor" + floor);
addImage(door, "DoorCLOSE", door.alt + floor, "jpg", door.id);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment