cpp
This commit is contained in:
parent
cb459dfcc9
commit
c64c8eecb1
@ -84,6 +84,7 @@ struct Index {
|
||||
private simulatorUdpClient?: SimulatorUdpClient
|
||||
private backupUdpClient?: BackMachineUdpClient
|
||||
private outWireControl?: OutWireControl
|
||||
private carStatus: number = 0
|
||||
|
||||
async aboutToAppear() {
|
||||
try {
|
||||
@ -117,12 +118,15 @@ struct Index {
|
||||
break;
|
||||
case -1:
|
||||
this.outWireControl.moveDown()
|
||||
this.carStatus = move
|
||||
break;
|
||||
case 0:
|
||||
this.outWireControl.moveStop()
|
||||
this.carStatus = move
|
||||
break;
|
||||
case 1:
|
||||
this.outWireControl.moveUp()
|
||||
this.carStatus = move
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -251,7 +255,21 @@ struct Index {
|
||||
onCancel() {
|
||||
if (this.status === Status.Running) {
|
||||
this.status = Status.Pause
|
||||
this.outWireControl.moveStop()
|
||||
} else if (this.status === Status.Pause) {
|
||||
switch (this.carStatus) {
|
||||
case -1:
|
||||
this.outWireControl.moveDown()
|
||||
break;
|
||||
case 0:
|
||||
this.outWireControl.moveStop()
|
||||
break;
|
||||
case 1:
|
||||
this.outWireControl.moveUp()
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.status = Status.Running
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user