예제 #1
0
 public int AdjustCommand(CMD_NAV_Adjust cmd)
 {
         Clients.Group("vehicles").sendAdjustCommand(cmd, Context.ConnectionId);
         return cmd.Id;
 }
예제 #2
0
        public IHttpActionResult PostCMD_DO_ADJUST(int uid, CMD_NAV_Adjust jsObject)
        {
            CMD_NAV_Adjust cmd_nav_adjust = new CMD_NAV_Adjust();
            cmd_nav_adjust.Id = jsObject.Id;
            cmd_nav_adjust.Latitude = jsObject.Latitude;
            cmd_nav_adjust.Longitude = jsObject.Longitude;
            cmd_nav_adjust.UAVId = jsObject.UAVId;

            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.CMD_NAV_Adjust.Add(cmd_nav_adjust);
            db.SaveChanges();

            return Ok();
        }