예제 #1
0
 void Start()
 {
     myplayer      = PlayersList.GetMyPlayer();
     killtrigger   = myplayer.GetComponent <KillTrigger>();
     reportTrigger = myplayer.GetComponent <ReportTrigger>();
     ventTrigger   = myplayer.GetComponent <VentTrigger>();
 }
예제 #2
0
        public ReportFileWriterTemplate WithReportTrigger(ReportTrigger reportTrigger)
        {
            this.ReportTriggerTypeName   = reportTrigger.GetType().GetDisplayName();
            this.ReportTriggerParameters = reportTrigger.GetParameterSnapshotWithInnerObjects();

            return(this);
        }
        public ExperimentBase ToExperiment()
        {
            Component environment = EnvironmentRegistry
                                    .GetEnvironments()
                                    .Single(t => t.FullName.Equals(this.EnvironmentTypeName))
                                    .InstantiateWithDefaultConstructor <Component>();

            Component presentationEnvironment = environment.Clone();

            Component agent = AgentRegistry
                              .GetAgents(environment.ComponentType)
                              .Single(t => t.FullName.Equals(this.AgentTypeName))
                              .InstantiateWithDefaultConstructor <Component>();

            ExperimentBase result = ExperimentBase.Instantiate(environment, presentationEnvironment, agent);

            result.SetParametersFromSnapshot(this.ExperimentParameters);
            environment.SetParametersFromSnapshotWithInnerObjects(this.EnvironmentParameters);
            presentationEnvironment.SetParametersFromSnapshotWithInnerObjects(this.EnvironmentParameters);
            agent.SetParametersFromSnapshotWithInnerObjects(this.AgentParameters);

            result.Reporter = this.ReporterTemplate.ToReporter(
                ReportTrigger.GetReportTriggers().ToArray(),
                DataSource.GetDataSources(result).ToArray(),
                DataAccumulator.GetDataAccumulators().ToArray());

            return(result);
        }
예제 #4
0
        public ReportFileWriter ToReportFileWriter(Type[] reportTriggers, DataSource[] dataSources, Type[] dataAccumulators)
        {
            ReportTrigger rt = reportTriggers
                               .Single(t => t.GetDisplayName().Equals(this.ReportTriggerTypeName))
                               .InstantiateWithDefaultConstructor <ReportTrigger>();

            rt.SetParametersFromSnapshotWithInnerObjects(this.ReportTriggerParameters);

            ReportFileWriter result = new ReportFileWriter(rt, this.FileName);

            result.AddReportElements(this.ReportElements.Select(re => re.ToReportElement(dataSources, dataAccumulators)));

            return(result);
        }
예제 #5
0
        private TabPageInfo AddReportFile(string fileName, bool editable)
        {
            TabPage newTabPage = new TabPage(Path.GetFileName(fileName));

            this.reportFilesTabControl.TabPages.Add(newTabPage);

            Button removeReportFileButton = new Button();

            removeReportFileButton.Text     = "Remove this report file";
            removeReportFileButton.AutoSize = true;

            removeReportFileButton.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;

            int rightOffset  = removeReportFileButton.Margin.Right + newTabPage.Padding.Right;
            int bottomOffset = removeReportFileButton.Margin.Bottom + newTabPage.Padding.Bottom;

            removeReportFileButton.Location = new Point(
                newTabPage.Width - removeReportFileButton.Width - rightOffset,
                newTabPage.Height - removeReportFileButton.Height - bottomOffset);

            removeReportFileButton.Tag    = newTabPage;
            removeReportFileButton.Click += new EventHandler(RemoveReportFileButtonClick);

            newTabPage.Controls.Add(removeReportFileButton);

            ReportWriterConfigurationControl reportWriterControl = new ReportWriterConfigurationControl(
                ReportTrigger.GetReportTriggers().ToArray(),
                DataAccumulator.GetDataAccumulators().ToArray(),
                this.Experiment,
                editable);

            reportWriterControl.Dock = DockStyle.Top;

            newTabPage.Controls.Add(reportWriterControl);

            TabPageInfo tabPageInfo = new TabPageInfo()
            {
                FileName            = fileName,
                ReportWriterControl = reportWriterControl
            };

            newTabPage.Tag = tabPageInfo;

            newTabPage.Select();

            return(tabPageInfo);
        }
예제 #6
0
 public ReportFileWriter(ReportTrigger reportTrigger, string fileName)
     : base(reportTrigger)
 {
     this.FileName  = fileName;
     this.LineCount = 0;
 }
예제 #7
0
 void Start()
 {
     myplayer      = PlayersList.GetMyPlayer();
     reportTrigger = myplayer.GetComponent <ReportTrigger>();
 }
 public ReportTextBoxWriter(ReportTrigger reportTrigger, TextBox textBox)
     : base(reportTrigger)
 {
     this.textBox = textBox;
 }
예제 #9
0
 public ReportWriter(ReportTrigger reportTrigger)
 {
     this.ReportTrigger  = reportTrigger;
     this.reportElements = new List <ReportElement>();
     Separator           = ";";
 }