Example #1
0
 private void genericReplyOnRelease(SmartphoneCommand command)
 {
     if (command.state == SmartphoneCommand.States.Released)
     {
         tool.confirmReception(command);
     }
 }
Example #2
0
 private void onDrawMesh(SmartphoneCommand command)
 {
     if (command.mode == SmartphoneCommand.Modes.DrawMesh && command.state == SmartphoneCommand.States.Released)
     {
         SmartphoneCommand c = new SmartphoneCommand();
         c.mode = SmartphoneCommand.Modes.ExtrudeMesh;
         tool.sendCommand(c);
     }
 }
Example #3
0
 private void onTransform(SmartphoneCommand command)
 {
     if (command.mode == SmartphoneCommand.Modes.EndTransform && command.state == SmartphoneCommand.States.Released)
     {
         tool.confirmReception(command);
     }
     else if (command.mode == SmartphoneCommand.Modes.InDirectTrans && command.state == SmartphoneCommand.States.Released)
     {
         tool.confirmReception(command);
     }
 }
Example #4
0
    // Useful for sending a command locally only
    public void sendCommandToCallback(SmartphoneCommand command)
    {
        int commandValue = (int)command.commandType;

        if (commandValue < (int)SmartphoneCommand.Commands.Count)
        {
            // Specific callback
            if (onCommand[commandValue] != null)
            {
                onCommand[commandValue].Invoke(command);
            }
        }
    }
Example #5
0
    private void ResetClientLater()
    {
        // Because of the BluetoothToTCP man-in-the-middle, we may be connected
        // to the middle-man, but not yet to the device.
        // Send data continuously until we get a confirm
        while (!resetHasBeenConfirmed)
        {
            Thread.Sleep(200);

            SmartphoneCommand command = new SmartphoneCommand();
            command.commandType = SmartphoneCommand.Commands.Reset;
            sendCommand(command);
            firstClientSinceLaunch = false;
        }
    }
Example #6
0
    public SmartphoneCommand(SmartphoneCommand c)
    {
        commandId   = c.commandId;
        commandType = c.commandType;
        state       = c.state;
        mode        = c.mode;
        text        = c.text;
        coord       = c.coord;
        color       = c.color;
        lines       = new List <Line2D>(c.lines);
        floatValue  = c.floatValue;
        returnValue = c.returnValue;

        populateListOfCommands();
    }
Example #7
0
 private void replyWithSameCommand(SmartphoneCommand command)
 {
     tool.sendCommand(command);
 }
Example #8
0
    // public



    private void genericReply(SmartphoneCommand command)
    {
        tool.confirmReception(command);
    }
Example #9
0
 public void confirmReception(SmartphoneCommand command, int returnValue = 0)
 {
     command.commandType = SmartphoneCommand.Commands.ConfirmReception;
     command.returnValue = returnValue;
     sendCommand(command);
 }
Example #10
0
 public void sendCommand(SmartphoneCommand command)
 {
     //dataServer.sendData(SerializerTool.SerializeObject<SmartphoneCommand>(command));
     //dataServer.sendData("Hello from Unity!");
 }
Example #11
0
 private void OnResetConfirmed(SmartphoneCommand command)
 {
     resetHasBeenConfirmed = true;
 }