Exemple #1
0
        private void Run()
        {
            DirectoryPathAbsolute dp = new DirectoryPathAbsolute(Path.GetDirectoryName(models.First().DisplayName));

            ScenariosToRun = new ConcurrentStack <ScenarioRun>(Runs.Where(var => var.RunThis));
            foreach (var v in models)
            {
                v.ResultFileNames.Clear();
                DirectoryPathAbsolute dp2 = new DirectoryPathAbsolute(Path.GetDirectoryName(v.DisplayName));

                foreach (var file in FileNamesToCopy)
                {
                    FilePathAbsolute fp = new FilePathAbsolute(file);
                    var rp = fp.GetPathRelativeFrom(dp);
                    v.ResultFileNames.Add(rp.GetAbsolutePathFrom(dp2).Path);
                }

                if (v is PestModel)
                {
                    ((PestModel)v).MsheFileName       = mikeSheFileName.GetAbsolutePathFrom(dp2).Path;
                    ((PestModel)v).PostProcessBatFile = postProcessBat.GetAbsolutePathFrom(dp2).Path;
                }
                Thread.Sleep(TimeSpan.FromMinutes(1));
                RunNext(v);
            }
        }
Exemple #2
0
        private XElement ToXml()
        {
            XElement x = new XElement("ScenarioRuns");

            if (models != null && models.Count > 0)
            {
                var Elfile = new XElement("ModelFiles");

                foreach (var v in models)
                {
                    Elfile.Add(new XElement("FileName", v.DisplayName));
                }
                x.Add(Elfile);
            }

            x.Add(new XElement("OutputDirectory", OutputDirectory));

            x.Add(new XElement("Prefix", Prefix));

            if (mikeSheFileName != null)
            {
                x.Add(new XElement("MikeSheFileName", MikeSheFileName));
            }

            if (postProcessBat != null)
            {
                x.Add(new XElement("PostProcessBatFile", PostProcessBat));
            }

            if (slf != null)
            {
                x.Add(new XElement("SimlabFileName", slf.FileName));
            }


            if (Runs != null)
            {
                StringBuilder s = new StringBuilder();
                foreach (var r in Runs.Where(var => var.RunThis))
                {
                    s.Append(", " + r.Number);
                }
                x.Add(new XElement("ScenariosToRun", s.ToString()));
            }

            var file = new XElement("FilesToCopy");

            foreach (var v in this.FileNamesToCopy)
            {
                file.Add(new XElement("FileName", v));
            }
            x.Add(file);

            return(x);
        }
Exemple #3
0
 public WorkoutEvent FastestRun(decimal minimumDistance)
 {
     return(Runs.Where(r => r.Distance.ToMiles(r.Unit.Name) >= minimumDistance).OrderBy(r => r.Duration.ToMinutes()).FirstOrDefault());
 }