Пример #1
0
 public void LoadResults <TSimulation>(TSimulation simulation) where TSimulation : Simulation
 {
     if (simulation == null || simulation.HasResults)
     {
         return;
     }
     _simulationResultsLoader.LoadResultsFor(simulation);
 }
Пример #2
0
        public void Visit(IndividualSimulation individualSimulation)
        {
            convertSimulation(individualSimulation);
            if (!_simulationChartElementCache.Any())
            {
                return;
            }

            //load results is required so that charts can be loaded on the fly
            _simulationResultsLoader.LoadResultsFor(individualSimulation);

            var serializerRepository = _container.Resolve <IPKSimXmlSerializerRepository>();
            var serializer           = serializerRepository.SerializerFor <SimulationTimeProfileChart>();

            using (var serializationContext = SerializationTransaction.Create(dimensionFactory: _dimensionFactory))
            {
                var context = serializationContext;
                serializationContext.AddRepository(individualSimulation.DataRepository);
                _simulationChartElementCache.Each(e => individualSimulation.AddAnalysis(serializer.Deserialize <SimulationTimeProfileChart>(e, context)));
            }
            _simulationChartElementCache.Clear();
        }