예제 #1
0
        public override async Task <ProcessListResponse> GetProcessList(ProcessListRequest request, ServerCallContext context)
        {
            var results = await InteropService.GetProcessList();

            var processListResponse = new ProcessListResponse();

            processListResponse.Results.AddRange(results);
            return(processListResponse);
        }
        public override Task <ProcessListResponse> GetProcessList(ProcessListRequest request, ServerCallContext context)
        {
            Log.Info("Executing [{Name}]", nameof(GetProcessList));
            var result   = ProcessHelper.TryGetProcessList(out var processList);
            var response = new ProcessListResponse();

            if (result)
            {
                response.Results.AddRange(processList);
            }

            return(Task.FromResult(response));
        }
예제 #3
0
        public ProcessListResponse Execute(ProcessListRequest request)
        {
            ProcessListResponse processListResponse = new ProcessListResponse();
            IList <IFactory.Domain.Entities.ProcessInfo> processes = ServiceHelper.LoadService <IProductionService>().GetProcesses(request.CraftDID);
            Dictionary <int, int> processStates = ServiceHelper.LoadService <IProductionService>().GetProcessStates(request.CraftDID);
            List <ProcessModel>   list          = processes.Select(m => m.ToModel()).ToList <ProcessModel>();

            foreach (ProcessModel processModel in list)
            {
                processModel.State = processStates.ContainsKey(processModel.ProcessDID) ? processStates[processModel.ProcessDID] : 2;
            }
            processListResponse.Processes = list;
            return(processListResponse);
        }