...
 
Commits (5)
......@@ -419,6 +419,12 @@ var ProgramContainerLayer = pmui.DragAndDropLayout.extend(/** @lends ProgramCont
var selectedButton = FunctionButton.selectedButton;
if (this._program.symbols[elementPos.x][elementPos.y].type === pm.SymbolType.Function)
{
button.select();
return;
}
if(selectedButton)
{
FunctionButton.deselect();
......@@ -443,9 +449,6 @@ var ProgramContainerLayer = pmui.DragAndDropLayout.extend(/** @lends ProgramCont
return;
}
if (this._program.symbols[elementPos.x][elementPos.y].type === pm.SymbolType.Function)
return;
if(selectedButton.type === button.type ||
(button.type === FunctionButton.Type.CondRepeater &&
selectedButton.type === FunctionButton.Type.Condition))
......
......@@ -8,6 +8,8 @@
*/
pm.BLEPhysicalRobotConnector = pm.PhysicalRobotConnector.extend(/** @lends pm.BLEPhysicalRobot# */{
_currentCommand: "",
connect: function()
{
if(pm.btleManager && pm.btleManager.isBTLEAvailable())
......@@ -50,6 +52,7 @@ pm.BLEPhysicalRobotConnector = pm.PhysicalRobotConnector.extend(/** @lends pm.BL
return;
this._runningCommand = true;
this._currentCommand = command;
cc.log("Sending command to BLE Physical robot:" + command);
......@@ -59,6 +62,11 @@ pm.BLEPhysicalRobotConnector = pm.PhysicalRobotConnector.extend(/** @lends pm.BL
_dataReceiveCallback: function(data)
{
cc.log("Received response from BLE Physical robot:" + data);
this._runningCommand = false;
if(this._currentCommand && data.indexOf("ok_" + this._currentCommand ) !== -1)
{
this._currentCommand = "";
this._runningCommand = false;
}
}
});