Beispiel #1
0
        public HttpResponseMessage Put(CircleArgs circleArgs)
        {
            ActionMessage.Length = 0;
            HttpStatusCode code = HttpStatusCode.Created;

            if (circleArgs == null)
            {
                code = HttpStatusCode.ExpectationFailed;
                ActionMessage.Append("Circleargs argument is not supplied.");
            }
            else
            {
                if (!DrawCircle(circleArgs))
                {
                    code = HttpStatusCode.ExpectationFailed;
                }
            }

            if (code != HttpStatusCode.Created)
            {
                return(Request.CreateErrorResponse(code, ActionMessage.ToString()));
            }
            else
            {
                return(Request.CreateResponse <string>(code, ActionMessage.ToString()));
            }
        }
Beispiel #2
0
    private void OnReceivedActionMessage(NetworkMessage netMsg)
    {
        ActionMessage msg = netMsg.ReadMessage <ActionMessage>();

        Debug.Log("Device : " + netMsg.conn.connectionId);
        DeviceInfo device = server.getRegisteredDevice(netMsg.conn.connectionId);
        Vector3    offset = (calibration.bottomRight - calibration.topLeft);

        if (msg.triggered)
        {
            GameObject.Find("SpawnTarget").GetComponent <SpawnTarget>().Spawn(msg.position, device.target.GetComponent <SpriteRenderer>().color);
            Debug.Log("Message received from device : " + device.name);
            Debug.Log(msg.ToString());
        }
        else
        {
            if (device.target == null)
            {
                device.target = Instantiate(target);
                device.target.GetComponent <SpriteRenderer>().color = new Color(Random.value, Random.value, Random.value);
            }
            if (targetDebug)
            {
                device.target.SetActive(true);
            }
            else
            {
                device.target.SetActive(false);
            }
            device.target.transform.position = msg.position;
        }
    }
Beispiel #3
0
        public HttpResponseMessage Put([FromBody] AcadSysVar sysVar)
        {
            ActionMessage.Length = 0;
            HttpStatusCode code = HttpStatusCode.Accepted;

            if (sysVar == null)
            {
                code = HttpStatusCode.ExpectationFailed;
                ActionMessage.Append("SysVar argument is not supplied.");
            }
            else
            {
                if (!UpdateSystemVariable(sysVar))
                {
                    code = HttpStatusCode.ExpectationFailed;
                }
            }

            if (code != HttpStatusCode.Accepted)
            {
                return(Request.CreateErrorResponse(
                           code, ActionMessage.ToString()));
            }
            else
            {
                return(Request.CreateResponse <string>(
                           code, ActionMessage.ToString()));
            }
        }
Beispiel #4
0
 public void SetActionMessage(PolytexControls.Label label, ActionMessage actionMessage)
 {
     switch (actionMessage)
     {
         case ActionMessage.InsertedSuccessfuly:
             SetActionMessage(label, actionMessage.ToString(), ActionMessageType.Success);
             break;
         case ActionMessage.InsertFailure:
             SetActionMessage(label, actionMessage.ToString(), ActionMessageType.Failure);
             break;
         case ActionMessage.UpdatedSuccessfuly:
             SetActionMessage(label, actionMessage.ToString(), ActionMessageType.Success);
             break;
         case ActionMessage.UpdateFailure:
             SetActionMessage(label, actionMessage.ToString(), ActionMessageType.Failure);
             break;
         case ActionMessage.EnabledSuccessfuly:
             SetActionMessage(label, actionMessage.ToString(), ActionMessageType.Success);
             break;
         case ActionMessage.DisabledSuccessfuly:
             SetActionMessage(label, actionMessage.ToString(), ActionMessageType.Success);
             break;
         case ActionMessage.DeletedSuccessfuly:
             SetActionMessage(label, actionMessage.ToString(), ActionMessageType.Success);
             break;
         case ActionMessage.DeleteFailure:
             SetActionMessage(label, actionMessage.ToString(), ActionMessageType.Success);
             break;
     }
 }