public EventController(IClubClient _club, IEventClient _repo,IEventRegistration _reg, UserManager<ApplicationUser> _user, IMapClient _rContext) { _context = _repo; _routeContext = _rContext; _userManager = _user; _clubContext = _club; _evntReg = _reg; }
public static void Activate() { EndpointSettings endpointSettings = new EndpointSettings(IPAddress.Loopback); IMapClient mapClient = ClientFactory.CreateTcpMapClient(endpointSettings); ViewModelLocator.MapViewModel.Model = mapClient; }
public EventController(IClubClient _club, IEventClient _repo, IEventRegistration _reg, UserManager <ApplicationUser> _user, IMapClient _rContext) { _context = _repo; _routeContext = _rContext; _userManager = _user; _clubContext = _club; _evntReg = _reg; }
public HomeController(IEventClient _repo, UserManager <ApplicationUser> _user, IMapClient _rContext, ILoggerFactory factory) { if (_logger == null) { _logger = factory.CreateLogger("Unhandled Error"); } _context = _repo; _routeContext = _rContext; _userManager = _user; }
public HomeController(IEventClient _repo, UserManager<ApplicationUser> _user, IMapClient _rContext, ILoggerFactory factory) { if (_logger == null) { _logger = factory.CreateLogger("Unhandled Error"); } _context = _repo; _routeContext = _rContext; _userManager = _user; }
public static IEnumerable <MoveData> GetAllMoveData(this IMapClient mapClient) { IEnumerable <MoveData> moveDataSet; ServiceOperationResult result = mapClient.TryGetAllMoveData(out moveDataSet); if (result.IsSuccessfull) { return(moveDataSet); } else { throw Tools.GetException(result); } }
private static void HandleCreateJob(EndpointSettings endpointSettings) { IEnumerable <NodeDto> nodes = null; // Using the map manager client, get the ids of all nodes in the map using (IMapClient mapClient = SchedulingClients.Core.ClientFactory.CreateTcpMapClient(endpointSettings)) { IServiceCallResult <NodeDto[]> nodeResults = mapClient.GetAllNodes(); if (!nodeResults.IsSuccessful()) { Console.WriteLine($"Failed to get nodes, serviceCode:{nodeResults.ServiceCode}"); } else { nodes = nodeResults.Value; } } // Create a multijob using (IJobBuilderClient jobBuilder = SchedulingClients.Core.ClientFactory.CreateTcpJobBuilderClient(endpointSettings)) { IServiceCallResult <JobDto> createResult = jobBuilder.CreateJob(); if (!createResult.IsSuccessful()) { Console.WriteLine($"Failed to create job, serviceCode:{createResult.ServiceCode}"); } IServiceCallResult <int> createUnorderedListTaskResult = jobBuilder.CreateUnorderedListTask(createResult.Value.RootOrderedListTaskId); if (!createUnorderedListTaskResult.IsSuccessful()) { Console.WriteLine($"Failed to create unordered list task, serviceCode:{createResult.ServiceCode}"); } string[] targets = new string[] { "A0", "B0", "C0", "A1", "B1", "C1" }; foreach (string target in targets) { AddGoToTask(jobBuilder, createUnorderedListTaskResult.Value, nodes, target); } IServiceCallResult commitResult = jobBuilder.CommitJob(createResult.Value.JobId); if (!commitResult.IsSuccessful()) { Console.WriteLine($"Failed to commit job, serviceCode:{commitResult.ServiceCode}"); } } }
private static void Main(string[] args) { // Here we create an endpoint settings object that defines where the fleet manager service is currently running // For this demo we are assuming it is running on localhost, using the default TCP port of 41917. EndpointSettings endpointSettings = new EndpointSettings(IPAddress.Loopback, 41916, 41917); IEnumerable <int> nodeIds = Enumerable.Empty <int>(); // Create an array to store node ids in NodeDto startNode = null; // Using the map manager client, get the ids of all nodes in the map using (IMapClient mapClient = SchedulingClients.Core.ClientFactory.CreateTcpMapClient(endpointSettings)) { IServiceCallResult <NodeDto[]> nodeResults = mapClient.GetAllNodes(); if (!nodeResults.IsSuccessful()) { Console.WriteLine($"Failed to get nodes, serviceCode:{nodeResults.ServiceCode}"); } else { nodeIds = nodeResults.Value.Select(e => e.Id); } startNode = nodeResults.Value.First(); } // Now we create a fleet manager client using the client factory, and create a virtual vehicle at pose at the first node. // see: https://github.com/GuidanceAutomation/FleetClients using (IFleetManagerClient fleetManagerClient = FleetClients.Core.ClientFactory.CreateTcpFleetManagerClient(endpointSettings)) { IServiceCallResult result = fleetManagerClient.CreateVirtualVehicle(IPAddress.Parse("192.168.0.1"), startNode.Pose.X, startNode.Pose.Y, startNode.Pose.Heading); if (!result.IsSuccessful()) { Console.WriteLine($"Failed to create virtual vehicle serviceCode:{result.ServiceCode}"); } } Random random = new Random(); // Random number generator bool continueFlag = true; while (continueFlag) { Console.WriteLine("Press <any> key to create a random GoTo job, 'q' to quit"); switch (Console.ReadKey(true).Key) { case ConsoleKey.Q: { continueFlag = false; break; } default: { // Use the job builder client to create a new goto job. using (IJobBuilderClient jobBuilder = SchedulingClients.Core.ClientFactory.CreateTcpJobBuilderClient(endpointSettings)) { // Boiler plate code to pick a random node from the array of nodes. int index = random.Next(0, nodeIds.Count()); int nodeId = nodeIds.ElementAt(index); Console.WriteLine($"Sending to node:{nodeId}"); IServiceCallResult <JobDto> createResult = jobBuilder.CreateJob(); if (!createResult.IsSuccessful()) { Console.WriteLine($"Failed to create job, serviceCode:{createResult.ServiceCode}"); } IServiceCallResult <int> gotoResult = jobBuilder.CreateGoToNodeTask(createResult.Value.RootOrderedListTaskId, nodeId); if (!gotoResult.IsSuccessful()) { Console.WriteLine($"Failed to create goto task, serviceCode:{gotoResult.ServiceCode}"); } IServiceCallResult commitResult = jobBuilder.CommitJob(createResult.Value.JobId); if (!commitResult.IsSuccessful()) { Console.WriteLine($"Failed to commit job, serviceCode:{commitResult.ServiceCode}"); } } break; } } } }
public MapController(IMapClient _repo, UserManager<ApplicationUser> userManger) { _userManager = userManger; _context = _repo; }
public MapController(IMapClient _repo, UserManager <ApplicationUser> userManger) { _userManager = userManger; _context = _repo; }