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