コード例 #1
0
        public CompletionReport TestBehavior(Behavior b)
        {
            IOperationalBehavior operBehavior = null;

            try {
                testMode = true;
                Console.WriteLine("Testing behavior " + b.ToString() + " -- type " + b.GetType().Name);

                cachedCompletionReport = new SuccessCompletionReport(b.GetType());
                HandleDecorators(b.Decorators);
                operBehavior = MapBehavior(b);
                operBehavior.Initialize(b);
                operBehavior.Process(null);

                Console.WriteLine("Result: " + cachedCompletionReport.ToString());

                cachedCompletionReport.BehaviorId = b.UniqueId();

                return(cachedCompletionReport);
            }
            catch (Exception ex) {
                TraceSource.TraceEvent(TraceEventType.Error, 0, "error testing behavior {0}: {1}", b.GetType(), ex);
                throw;
            }
            finally {
                if (operBehavior != null && operBehavior is IDisposable)
                {
                    ((IDisposable)operBehavior).Dispose();
                }
            }
        }
コード例 #2
0
 internal void SendCompletionReport(string executionNodeID, CompletionReport report)
 {
     if (localOnly)
     {
         logger.Info("Completion Report");
         logger.Info(report);
     }
     else
     {
         logger.Info("Completion Report");
         logger.Info(report.ToString());
         Task.Run(() => {
             this.hubProxy.Invoke("CompletionReportResponse", executionNodeID, report);
         });
     }
 }
コード例 #3
0
 public void ForwardCompletionReport(CompletionReport report)
 {
     if (testMode)
     {
         cachedCompletionReport = report;
         Console.WriteLine("forward comp report: " + report.ToString());
     }
     else
     {
         if (report is TrajectoryBlockedReport)
         {
             ((TrajectoryBlockedReport)report).SAUDILevel = saudiLevel;
         }
         if (Services.Operational != null)
         {
             Services.Operational.SendCompletionReport(report);
         }
     }
 }