Beispiel #1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="emlfile"></param>
 /// <param name="output"></param>
 public static void Convert(string emlfile, string output)
 {
     if (!File.Exists(emlfile))
         throw new EcellException(string.Format(MessageResources.ErrFindFile, emlfile));
     WrappedSimulator sim = new WrappedSimulator(Util.GetDMDirs());
     EcellModel model = EmlReader.Parse(emlfile, sim);
     SaveSBML(model, output);
     sim.Dispose();
 }
Beispiel #2
0
        public void TestWrappedSimulator()
        {
            _unitUnderTest.UnloadSimulator();

            // When you do not carry out Initialize, Dispose is available.
            WrappedSimulator sim1 = new WrappedSimulator(_unitUnderTest.GetDMDirs());
            EmlReader.Parse(TestConstant.Model_RBC, sim1);
            Console.WriteLine(sim1.GetEntityProperty("System::/:Name"));
            sim1.Dispose();

            // when I carry out Initialize, Dispose returns error.
            WrappedSimulator sim2 = new WrappedSimulator(_unitUnderTest.GetDMDirs());
            EmlReader.Parse(TestConstant.Model_RBC, sim2);
            Console.WriteLine(sim2.GetEntityProperty("System::/:Name"));
            try
            {
                sim2.Initialize();
                sim2.Dispose();
            }
            catch (Exception e)
            {
                Trace.WriteLine(e.ToString());
                Assert.Fail(e.Message);
            }
        }