From 822a0deb5bec0bdecf9a48bf9e7f28a5097c5d13 Mon Sep 17 00:00:00 2001 From: oc Date: Sat, 13 Apr 2019 22:11:08 +0800 Subject: [PATCH] changefloor current position --- _server/MotaAction.g4 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/_server/MotaAction.g4 b/_server/MotaAction.g4 index 4f38fe1e..98f8cdca 100644 --- a/_server/MotaAction.g4 +++ b/_server/MotaAction.g4 @@ -228,7 +228,8 @@ default : [null,"MT1",null,0,0,null,500,null] var toFloorId = IdString_0; if (Floor_List_0!='floorId') toFloorId = Floor_List_0; var loc = ', "loc": ['+Number_0+', '+Number_1+']'; -if (Stair_List_0!=='loc')loc = ', "stair": "'+Stair_List_0+'"'; +if (Stair_List_0==='now')loc = ''; +else if (Stair_List_0!=='loc')loc = ', "stair": "'+Stair_List_0+'"'; DirectionEx_List_0 = DirectionEx_List_0 && (', "direction": "'+DirectionEx_List_0+'"'); Int_0 = (Int_0!=='') ?(', "time": '+Int_0):''; Bool_0 = Bool_0 ?'':(', "ignoreChangeFloor": false'); @@ -1982,8 +1983,8 @@ Floor_List /*Floor_List ['floorId',':before',':next']*/; Stair_List - : '坐标'|'上楼梯'|'下楼梯' - /*Stair_List ['loc','upFloor','downFloor']*/; + : '坐标'|'上楼梯'|'下楼梯'|'保持不变' + /*Stair_List ['loc','upFloor','downFloor','now']*/; SetTextPosition_List : '不改变'|'距离顶部'|'居中'|'距离底部' @@ -2167,7 +2168,10 @@ ActionParser.prototype.parse = function (obj,type) { case 'changeFloor': if(!obj)obj={}; - if(!this.isset(obj.loc))obj.loc=[0,0]; + if(!this.isset(obj.loc)) { + obj.loc=[0,0]; + if (!this.isset(obj.stair)) obj.stair='now'; + } if (obj.floorId==':before'||obj.floorId==':next') { obj.floorType=obj.floorId; delete obj.floorId;