Esempio n. 1
0
 public void SetUp()
 {
     _env = new ApplicationEnvironment();
     ProjectInfo info = ProjectInfoLoader.Load(TestConstant.Project_Drosophila);
     _unitUnderTest = new Project(info, _env);
     _unitUnderTest.UnLock();
     _unitUnderTest.LoadModel();
 }
Esempio n. 2
0
        public void SetUp()
        {
            _env = new ApplicationEnvironment();
            _unitUnderTest = _env.PluginManager;

            // Load plugins
            foreach (string pluginDir in Util.GetPluginDirs())
            {
                string[] files = Directory.GetFiles(
                    pluginDir,
                    Constants.delimiterWildcard + Constants.FileExtPlugin);
                foreach (string fileName in files)
                {
                    _env.PluginManager.LoadPlugin(fileName);
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Creates the new "DynamicModuleManager" instance with no argument.
        /// </summary>
        public DynamicModuleManager(ApplicationEnvironment env)
        {
            this.m_env = env;

            // ������DM����[�h����DM�̐���A�v���p�e�B����擾����
            // ���A���̂Ƃ���v���p�e�B����lj������Ƃ�s��
            DynamicModule tmp = null;
            tmp = new DynamicModule("ConstantFluxProcess", "", false, "ConstantFluxProcess");
            tmp.AddProperty("Activity", true, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("IsContinuous", false, true, false, false, 1, typeof(int));
            tmp.AddProperty("Name", true, true, true, true, "", typeof(string));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("StepperID", true, true, true, true, "", typeof(string));
            tmp.AddProperty("VariableReferenceList", true, true, true, true, "", typeof(List<EcellValue>));
            tmp.AddProperty("k", true, true, true, true, (double)0.0, typeof(double));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("DecayFluxProcess", "", false, "DecayFluxProcess");
            tmp.AddProperty("Activity", true, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("IsContinuous", false, true, false, false, 1, typeof(int));
            tmp.AddProperty("Name", true, true, true, true, "", typeof(string));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("StepperID", true, true, true, true, "", typeof(string));
            tmp.AddProperty("VariableReferenceList", true, true, true, true, "", typeof(List<EcellValue>));
            tmp.AddProperty("T", true, true, true, true, (double)1.0, typeof(double));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("ExpressionAlgebraicProcess", "", false, "ExpressionAlgebraicProcess");
            tmp.AddProperty("Activity", true, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("IsContinuous", false, true, false, false, 0, typeof(int));
            tmp.AddProperty("Name", true, true, true, true, "", typeof(string));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("StepperID", true, true, true, true, "", typeof(string));
            tmp.AddProperty("VariableReferenceList", true, true, true, true, "", typeof(List<EcellValue>));
            tmp.AddProperty("Expression", true, true, true, true, "self.getSuperSystem().SizeN_A", typeof(string));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("ExpressionFluxProcess", "", false, "ExpressionFluxProcess");
            tmp.AddProperty("Activity", true, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("IsContinuous", false, true, false, false, 1, typeof(int));
            tmp.AddProperty("Name", true, true, true, true, "", typeof(string));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("StepperID", true, true, true, true, "", typeof(string));
            tmp.AddProperty("VariableReferenceList", true, true, true, true, "", typeof(List<EcellValue>));
            tmp.AddProperty("Expression", true, true, true, true, "self.getSuperSystem().SizeN_A", typeof(string));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("GillespieProcess", "", false, "GillespieProcess");
            tmp.AddProperty("Activity", true, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("IsContinuous", false, true, false, false, 0, typeof(int));
            tmp.AddProperty("Name", true, true, true, true, "", typeof(string));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("StepperID", true, true, true, true, "", typeof(string));
            tmp.AddProperty("VariableReferenceList", true, true, true, true, "", typeof(List<EcellValue>));
            tmp.AddProperty("MuV", true, true, true, true, (double)0.0, typeof(double));
            tmp.AddProperty("DependentProcessList", false, true, false, true, "", typeof(List<EcellValue>));
            tmp.AddProperty("Order", false, true, false, false, 0, typeof(int));
            tmp.AddProperty("StepInterval", false, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("k", true, true, true, true, (double)1.0, typeof(double));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("GMAProcess", "", false, "GMAProcess");
            tmp.AddProperty("Activity", true, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("IsContinuous", false, true, false, false, 1, typeof(int));
            tmp.AddProperty("Name", true, true, true, true, "", typeof(string));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("StepperID", true, true, true, true, "", typeof(string));
            tmp.AddProperty("VariableReferenceList", true, true, true, true, "", typeof(List<EcellValue>));
            tmp.AddProperty("GMASystemMatrix", true, true, true, true, "", typeof(List<EcellValue>));
            tmp.AddProperty("Order", true, true, true, true, 0, typeof(int));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("MassActionFluxProcess", "", false, "MassActionFluxProcess");
            tmp.AddProperty("Activity", true, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("IsContinuous", false, true, false, false, 1, typeof(int));
            tmp.AddProperty("Name", true, true, true, true, "", typeof(string));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("StepperID", true, true, true, true, "", typeof(string));
            tmp.AddProperty("VariableReferenceList", true, true, true, true, "", typeof(List<EcellValue>));
            tmp.AddProperty("k", true, true, true, true, (double)1.0, typeof(double));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("MichaelisUniUniFluxProcess", "", false, "MichaelisUniUniFluxProcess");
            tmp.AddProperty("Activity", true, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("IsContinuous", false, true, false, false, 1, typeof(int));
            tmp.AddProperty("Name", true, true, true, true, "", typeof(string));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("StepperID", true, true, true, true, "", typeof(string));
            tmp.AddProperty("VariableReferenceList", true, true, true, true, "", typeof(List<EcellValue>));
            tmp.AddProperty("KcF", true, true, true, true, (double)0.0, typeof(double));
            tmp.AddProperty("KcR", true, true, true, true, (double)0.0, typeof(double));
            tmp.AddProperty("KmP", true, true, true, true, (double)0.0, typeof(double));
            tmp.AddProperty("KmS", true, true, true, true, (double)0.0, typeof(double));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("PythonFluxProcess", "", false, "PythonFluxProcess");
            tmp.AddProperty("Activity", true, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("IsContinuous", false, true, false, false, 1, typeof(int));
            tmp.AddProperty("Name", true, true, true, true, "", typeof(string));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("StepperID", true, true, true, true, "", typeof(string));
            tmp.AddProperty("VariableReferenceList", true, true, true, true, "", typeof(List<EcellValue>));
            tmp.AddProperty("Expression", true, true, true, true, "", typeof(string));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("PythonProcess", "", false, "PythonProcess");
            tmp.AddProperty("Activity", true, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("IsContinuous", false, true, false, false, 1, typeof(int));
            tmp.AddProperty("Name", true, true, true, true, "", typeof(string));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("StepperID", true, true, true, true, "", typeof(string));
            tmp.AddProperty("VariableReferenceList", true, true, true, true, "", typeof(List<EcellValue>));
            tmp.AddProperty("FireMethod", true, true, true, true, "", typeof(string));
            tmp.AddProperty("InitializeMethod", true, true, true, true, "", typeof(string));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("QuasiDynamicFluxProcess", "", false, "QuasiDynamicFluxProcess");
            tmp.AddProperty("Activity", true, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("IsContinuous", false, true, false, false, 0, typeof(int));
            tmp.AddProperty("Name", true, true, true, true, "", typeof(string));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("StepperID", true, true, true, true, "", typeof(string));
            tmp.AddProperty("VariableReferenceList", true, true, true, true, "", typeof(List<EcellValue>));
            tmp.AddProperty("Irreversible", true, true, true, true, 0, typeof(int));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("SSystemProcess", "", false, "SSystemProcess");
            tmp.AddProperty("Activity", true, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("IsContinuous", false, true, false, false, 0, typeof(int));
            tmp.AddProperty("Name", true, true, true, true, "", typeof(string));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("StepperID", true, true, true, true, "", typeof(string));
            tmp.AddProperty("VariableReferenceList", true, true, true, true, "", typeof(List<EcellValue>));
            tmp.AddProperty("SSystemMatrix", true, true, true, true, "", typeof(List<EcellValue>));
            this.m_moduleDic.Add(tmp.Name, tmp);

            //
            tmp = new DynamicModule("DAEStepper", "", false, "DAEStepper");
            tmp.AddProperty("AbsoluteTolerance", true, true, true, true, (double)1e-10, typeof(double));
            tmp.AddProperty("CurrentTime", false, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("DependentStepperList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("JacobianRecalculateTheta", true, true, true, true, (double)0.001, typeof(double));
            tmp.AddProperty("MaxIterationNumber", true, true, true, true, 7, typeof(int));
            tmp.AddProperty("MaxStepInterval", true, true, true, true, Double.Parse("+��"), typeof(double));
            tmp.AddProperty("MinStepInterval", true, true, true, true, Double.Parse("-��"), typeof(double));
            tmp.AddProperty("NextStepInterval", false, true, false, false, (double)0.001, typeof(double));
            tmp.AddProperty("OriginalStepInterval", true, true, false, false, (double)0.001, typeof(double));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("ProcessList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("ReadVariableList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("RelativeTolerance", true, true, true, true, (double)1e-10, typeof(double));
            tmp.AddProperty("RngSeed", true, false, true, false, "", typeof(string));
            tmp.AddProperty("SystemList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("Uround", true, true, true, true, (double)1e-16, typeof(double));
            tmp.AddProperty("WriteVariableList", false, true, false, false, "", typeof(List<EcellValue>));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("ESSYNSStepper", "", false, "ESSYNSStepper");
            tmp.AddProperty("AbsoluteEpsilon", true, true, true, true, (double)0.1, typeof(double));
            tmp.AddProperty("AbsoluteToleranceFactor", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("CurrentTime", false, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("DependentStepperList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("DerivativeToleranceFactor", true, true, true, true, (double)1.001, typeof(double));
            tmp.AddProperty("MaxErrorRatio", false, true, false, false, (double)1.0, typeof(double));
            tmp.AddProperty("MaxStepInterval", true, true, true, true, (double)1e+100, typeof(double));
            tmp.AddProperty("MinStepInterval", true, true, true, true, (double)1e-100, typeof(double));
            tmp.AddProperty("NextStepInterval", false, true, false, false, (double)0.001, typeof(double));
            tmp.AddProperty("Order", false, true, false, false, 1, typeof(int));
            tmp.AddProperty("OriginalStepInterval", true, true, false, false, (double)0.001, typeof(double));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("ProcessList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("ReadVariableList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("RelativeEpsilon", true, true, true, true, (double)0.1, typeof(double));
            tmp.AddProperty("RngSeed", true, false, true, false, "", typeof(string));
            tmp.AddProperty("StateToleranceFactor", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("StepInterval", true, true, true, true, (double)0.001, typeof(double));
            tmp.AddProperty("SystemList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("TaylorOrder", true, true, true, true, 1, typeof(int));
            tmp.AddProperty("Tolerance", true, true, true, true, (double)1e-6, typeof(double));
            tmp.AddProperty("WriteVariableList", false, true, false, false, "", typeof(List<EcellValue>));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("FixedDAE1Stepper", "", false, "FixedDAE1Stepper");
            tmp.AddProperty("CurrentTime", false, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("DependentStepperList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("MaxStepInterval", true, true, true, true, Double.Parse("+��"), typeof(double));
            tmp.AddProperty("MinStepInterval", true, true, true, true, Double.Parse("-��"), typeof(double));
            tmp.AddProperty("NextStepInterval", false, true, false, false, (double)0.001, typeof(double));
            tmp.AddProperty("OriginalStepInterval", true, true, false, false, (double)0.001, typeof(double));
            tmp.AddProperty("PerturbationRate", true, true, true, true, (double)1.0000000000000001e-09, typeof(double));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("ProcessList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("ReadVariableList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("RngSeed", true, true, true, true, "", typeof(string));
            tmp.AddProperty("StepInterval", true, true, true, true, (double)0.001, typeof(double));
            tmp.AddProperty("SystemList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("Tolerance", true, true, true, true, (double)1e-10, typeof(double));
            tmp.AddProperty("WriteVariableList", false, true, false, false, "", typeof(List<EcellValue>));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("FixedODE1Stepper", "", false, "FixedODE1Stepper");
            tmp.AddProperty("CurrentTime", false, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("DependentStepperList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("MaxStepInterval", true, true, true, true, Double.Parse("+��"), typeof(double));
            tmp.AddProperty("MinStepInterval", true, true, true, true, Double.Parse("-��"), typeof(double));
            tmp.AddProperty("NextStepInterval", false, true, false, false, (double)0.001, typeof(double));
            tmp.AddProperty("OriginalStepInterval", true, true, false, false, (double)0.001, typeof(double));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("ProcessList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("ReadVariableList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("RngSeed", true, false, true, false, "", typeof(string));
            tmp.AddProperty("StepInterval", true, true, true, true, (double)0.001, typeof(double));
            tmp.AddProperty("SystemList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("WriteVariableList", false, true, false, false, "", typeof(List<EcellValue>));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("FluxDistributionStepper", "", false, "FluxDistributionStepper");
            tmp.AddProperty("CurrentTime", false, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("DependentStepperList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("MaxStepInterval", true, true, true, true, Double.Parse("+��"), typeof(double));
            tmp.AddProperty("MinStepInterval", true, true, true, true, Double.Parse("-��"), typeof(double));
            tmp.AddProperty("OriginalStepInterval", true, true, false, false, (double)0.001, typeof(double));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("ProcessList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("ReadVariableList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("RngSeed", true, false, true, false, "", typeof(string));
            tmp.AddProperty("StepInterval", true, true, true, true, (double)0.001, typeof(double));
            tmp.AddProperty("SystemList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("WriteVariableList", false, true, false, false, "", typeof(List<EcellValue>));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("ODE23Stepper", "", false, "ODE23Stepper");
            tmp.AddProperty("AbsoluteEpsilon", true, true, true, true, (double)0.1, typeof(double));
            tmp.AddProperty("AbsoluteToleranceFactor", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("CurrentTime", false, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("DependentStepperList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("DerivativeToleranceFactor", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("MaxErrorRatio", false, true, false, false, (double)1.0, typeof(double));
            tmp.AddProperty("MaxStepInterval", true, true, true, true, (double)1e+100, typeof(double));
            tmp.AddProperty("MinStepInterval", true, true, true, true, (double)1e-100, typeof(double));
            tmp.AddProperty("NextStepInterval", false, true, false, false, (double)0.001, typeof(double));
            tmp.AddProperty("Order", false, true, false, false, 2, typeof(int));
            tmp.AddProperty("OriginalStepInterval", true, true, false, false, (double)0.001, typeof(double));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("ProcessList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("ReadVariableList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("RngSeed", true, false, true, false, "", typeof(string));
            tmp.AddProperty("StateToleranceFactor", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("StepInterval", true, true, true, true, (double)0.001, typeof(double));
            tmp.AddProperty("SystemList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("Tolerance", true, true, true, true, (double)1e-6, typeof(double));
            tmp.AddProperty("WriteVariableList", false, true, false, false, "", typeof(List<EcellValue>));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("ODE45Stepper", "", false, "ODE45Stepper");
            tmp.AddProperty("AbsoluteEpsilon", true, true, true, true, (double)0.1, typeof(double));
            tmp.AddProperty("AbsoluteToleranceFactor", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("CurrentTime", false, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("DependentStepperList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("DerivativeToleranceFactor", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("MaxErrorRatio", false, true, false, false, (double)1.0, typeof(double));
            tmp.AddProperty("MaxStepInterval", true, true, true, true, (double)1e+100, typeof(double));
            tmp.AddProperty("MinStepInterval", true, true, true, true, (double)1e-100, typeof(double));
            tmp.AddProperty("NextStepInterval", false, true, false, false, (double)0.001, typeof(double));
            tmp.AddProperty("Order", false, true, false, false, 5, typeof(int));
            tmp.AddProperty("OriginalStepInterval", true, true, false, false, (double)0.001, typeof(double));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("ProcessList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("ReadVariableList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("RngSeed", true, false, true, false, "", typeof(string));
            tmp.AddProperty("SpectralRadius", false, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("StateToleranceFactor", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("StepInterval", true, true, true, true, (double)0.01, typeof(double));
            tmp.AddProperty("SystemList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("Tolerance", true, true, true, true, (double)1e-6, typeof(double));
            tmp.AddProperty("WriteVariableList", false, true, false, false, "", typeof(List<EcellValue>));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("ODEStepper", "", false, "ODEStepper");
            tmp.AddProperty("AbsoluteEpsilon", true, true, true, true, (double)0.1, typeof(double));
            tmp.AddProperty("AbsoluteToleranceFactor", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("CurrentTime", false, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("DependentStepperList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("DerivativeToleranceFactor", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("IsEpsilonChecked", true, true, true, true, 1, typeof(int));
            tmp.AddProperty("JacobianRecalculateTheta", true, true, true, true, (double)0.001, typeof(double));
            tmp.AddProperty("MaxErrorRatio", false, true, false, false, (double)1.0, typeof(double));
            tmp.AddProperty("MaxStepInterval", true, true, true, true, (double)1e+100, typeof(double));
            tmp.AddProperty("MinStepInterval", true, true, true, true, (double)1e-100, typeof(double));
            tmp.AddProperty("NextStepInterval", false, true, false, false, (double)0.001, typeof(double));
            tmp.AddProperty("Order", false, true, false, false, 1, typeof(int));
            tmp.AddProperty("OriginalStepInterval", true, true, false, false, (double)0.001, typeof(double));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("ProcessList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("ReadVariableList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("RelativeEpsilon", true, true, true, true, (double)0.1, typeof(double));
            tmp.AddProperty("SpectralRadius", false, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("StateToleranceFactor", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("StepInterval", true, true, true, true, (double)0.01, typeof(double));
            tmp.AddProperty("SystemList", false, true, false, false, "", typeof(List<EcellValue>));
            // ,�������Ă��Ȃ�
            tmp.AddProperty("TolerableStepInterval", true, true, true, true, (double)0.001, typeof(double));
            tmp.AddProperty("Tolerance", true, true, true, true, (double)1e-6, typeof(double));
            tmp.AddProperty("Uround", true, true, true, true, (double)1e-6, typeof(double));
            tmp.AddProperty("WriteVariableList", false, true, false, false, "", typeof(List<EcellValue>));
            this.m_moduleDic.Add(tmp.Name, tmp);

            // ��������description���Ȃ�����
            tmp = new DynamicModule("TauLeapProcess", "", false, "TauLeapProcess");
            tmp.AddProperty("Activity", true, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("IsContinuous", false, true, false, false, 1, typeof(int));
            tmp.AddProperty("Name", true, true, true, true, "", typeof(string));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("StepperID", true, true, true, true, "", typeof(string));
            tmp.AddProperty("VariableReferenceList", true, true, true, true, "", typeof(List<EcellValue>));
            tmp.AddProperty("Order", false, true, false, false, 0, typeof(int));
            tmp.AddProperty("Propensity", false, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("k", true, true, true, true, (double)0.0, typeof(double));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("PingPongBiBiFluxProcess", "", false, "PingPongBiBiFluxProcess");
            tmp.AddProperty("Activity", true, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("IsContinuous", false, true, false, false, 1, typeof(int));
            tmp.AddProperty("Name", true, true, true, true, "", typeof(string));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("StepperID", true, true, true, true, "", typeof(string));
            tmp.AddProperty("VariableReferenceList", true, true, true, true, "", typeof(List<EcellValue>));
            tmp.AddProperty("KcF", true, true, true, true, (double)0.0, typeof(double));
            tmp.AddProperty("KcR", true, true, true, true, (double)0.0, typeof(double));
            tmp.AddProperty("Keq", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("KmS0", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("KmS1", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("KmP0", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("KmP1", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("KiS0", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("KiP1", true, true, true, true, (double)1.0, typeof(double));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("ExpressionAssignmentProcess", "", false, "ExpressionAssignmentProcess");
            tmp.AddProperty("Activity", true, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("IsContinuous", false, true, false, false, 1, typeof(int));
            tmp.AddProperty("Name", true, true, true, true, "", typeof(string));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("StepperID", true, true, true, true, "", typeof(string));
            tmp.AddProperty("VariableReferenceList", true, true, true, true, "", typeof(List<EcellValue>));
            tmp.AddProperty("Expression", true, true, true, true, "self.getSuperSystem().SizeN_A", typeof(string));
            tmp.AddProperty("Variable", true, true, true, true, "", typeof(string));
            this.m_moduleDic.Add(tmp.Name, tmp);

            tmp = new DynamicModule("TauLeapStepper", "", false, "TauLeapStepper");
            tmp.AddProperty("AbsoluteEpsilon", true, true, true, true, (double)0.1, typeof(double));
            tmp.AddProperty("AbsoluteToleranceFactor", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("CurrentTime", false, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("DependentStepperList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("DerivativeToleranceFactor", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("Epsilon", true, true, true, true, (double)0.03, typeof(double));
            tmp.AddProperty("MaxErrorRatio", false, true, false, false, (double)1.0, typeof(double));
            tmp.AddProperty("MaxStepInterval", true, true, true, true, (double)1e+100, typeof(double));
            tmp.AddProperty("MinStepInterval", true, true, true, true, (double)1e-100, typeof(double));
            tmp.AddProperty("NextStepInterval", false, true, false, false, (double)0.001, typeof(double));
            tmp.AddProperty("Order", false, true, false, false, 1, typeof(int));
            tmp.AddProperty("OriginalStepInterval", true, true, false, false, (double)0.001, typeof(double));
            tmp.AddProperty("Priority", true, true, true, true, 0, typeof(int));
            tmp.AddProperty("ProcessList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("ReadVariableList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("RelativeEpsilon", true, true, true, true, (double)0.1, typeof(double));
            tmp.AddProperty("SpectralRadius", false, true, false, false, (double)0.0, typeof(double));
            tmp.AddProperty("Stage", false, true, false, false, 1, typeof(int));
            tmp.AddProperty("StateToleranceFactor", true, true, true, true, (double)1.0, typeof(double));
            tmp.AddProperty("StepInterval", true, true, true, true, (double)0.01, typeof(double));
            tmp.AddProperty("SystemList", false, true, false, false, "", typeof(List<EcellValue>));
            tmp.AddProperty("Tau", false, true, false, false, Double.PositiveInfinity, typeof(double));
            tmp.AddProperty("TolerableStepInterval", true, true, false, false, (double)0.001, typeof(double));
            tmp.AddProperty("Tolerance", true, true, true, true, (double)1e-6, typeof(double));
            tmp.AddProperty("Uround", true, true, true, true, (double)1e-6, typeof(double));
            tmp.AddProperty("WriteVariableList", false, true, false, false, "", typeof(List<EcellValue>));
            this.m_moduleDic.Add(tmp.Name, tmp);
        }
Esempio n. 4
0
 public void TearDown()
 {
     _env = null;
     _manager = null;
 }
Esempio n. 5
0
 public void TearDown()
 {
     _env = null;
 }
Esempio n. 6
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public JobManager(ApplicationEnvironment env)
        {
            m_env = env;
            m_timer = new Timer();
            m_timer.Enabled = false;
            m_timer.Interval = m_updateInterval;
            m_timer.Tick += new EventHandler(UpdateTimeFire);

            LocalJobProxy p = new LocalJobProxy();
            p.Manager = this;
            m_proxyList.Add(p.Name, p);

            string cog_home = System.Environment.GetEnvironmentVariable("COG_HOME");
            if (!string.IsNullOrEmpty(cog_home))
            {
                GlobusJobProxy g = new GlobusJobProxy();
                g.Manager = this;
                m_proxyList.Add(g.Name, g);
            }

            SetCurrentEnvironment(p.Name);
            TmpRootDir = Util.GetTmpDir();
        }
Esempio n. 7
0
 public void TestFixtureSetUp()
 {
     _env = new ApplicationEnvironment();
     _unitUnderTest = _env.DataManager;
 }
Esempio n. 8
0
 /// <summary>
 /// Creates the stepper stub with the current simulation parameter and the stepper ID.
 /// </summary>
 /// <param name="cManager">CommandManager</param>
 /// <param name="ID">Job ID.</param>
 public StepperStub(CommandManager cManager, string ID)
 {
     this.m_cManager = cManager;
     this.m_env = cManager.Environment;
     this.m_ID = ID;
 }
Esempio n. 9
0
        /// <summary>
        /// Compile the source of DM.
        /// </summary>
        /// <param name="env">Application Environmant object.</param>
        /// <param name="showDialog">ShowDialog or not.</param>
        private void Compile(ApplicationEnvironment env, bool showDialog)
        {
            // Check error.
            if (m_sourceFile == null || !File.Exists(m_sourceFile))
                return;
            string stageHome = System.Environment.GetEnvironmentVariable("ECELL_STAGING_HOME");
            if (string.IsNullOrEmpty(stageHome) )
            {
                string errmes = string.Format(MessageResources.ErrNotInstall, "E-Cell SDK");
                throw new EcellException(errmes);
            }

            // Set up compile environment.
            string VS90 = System.Environment.GetEnvironmentVariable("VS90COMNTOOLS");
            if (string.IsNullOrEmpty(VS90))
            {
                string errmes = string.Format(MessageResources.ErrNotInstall, "Visual Studio 2008");
                throw new EcellException(errmes);
            }
            string VSPATH = VS90;

            string groupname = Constants.groupCompile + ":" + m_sourceFile;
            int maxCount = 10;
            int count = 0;
            ReportingSession rs = null;
            while (rs == null)
            {
                try
                {
                    rs = env.ReportManager.GetReportingSession(groupname);
                }
                catch (Exception)
                {
                    string errmes = string.Format(MessageResources.ErrCompile, m_sourceFile);
                    System.Threading.Thread.Sleep(100);
                    if (maxCount < count)
                    {
                        throw new EcellException(errmes);
                    }
                    count++;
                }
            }

            // Compile
            using (rs)
            {
                ProcessStartInfo psi = new ProcessStartInfo();
                psi.FileName = "cmd.exe";
                psi.UseShellExecute = false;
                psi.CreateNoWindow = true;
                psi.WorkingDirectory = Path.GetDirectoryName(m_sourceFile);
                psi.RedirectStandardError = true;
                psi.RedirectStandardOutput = true;
                psi.RedirectStandardInput = true;

                string arch1 = "Win32";
                string arch2 = "X86";
                string arch3 = "x86";
                if (IntPtr.Size == 8)
                {
                    arch1 = "X64";
                    arch2 = "X64";
                    arch3 = "amd64";
                }

                Process p = Process.Start(psi);
                p.StandardInput.WriteLine("call \"" + VSPATH + "..\\..\\VC\\vcvarsall.bat\" " + arch3);

                // Set INCLUDE path
                string INCLUDEPATH = "";
                string path1 = Path.Combine(stageHome, "include");
                string path2 = string.Format("{0}\\{1}\\Release\\include", stageHome, arch1);
                if (Directory.Exists(path1))
                    INCLUDEPATH = path1;
                else if (Directory.Exists(path2))
                    INCLUDEPATH = path2;
                else
                    throw new EcellException(string.Format("Can not find INCLUDE path, {0}, {1}", path1, path2));

                // Set LIB path
                string LIBPATH = "";
                string libpath1 = Path.Combine(stageHome, "lib");
                string libpath2 = string.Format("{0}\\{1}\\Release\\lib", stageHome, arch1);
                if (Directory.Exists(libpath1))
                    LIBPATH = libpath1;
                else if (Directory.Exists(libpath2))
                    LIBPATH = libpath2;
                else
                    throw new EcellException(string.Format("Can not find LIB path, {0}, {1}", path1, path2));

                // construct compile option.
                string opt = "cl.exe /O2 /GL /I \"{0}\" /I \"{0}\\ecell-3.2\" /I \"{0}\\ecell-3.2\\libecs\" /I \"{0}\\ecell-3.2\\libemc\" /D \"WIN32\" /D\"NODEBUG\" /D \"_WINDOWS\" /D \"_USRDLL\" /D \"GSL_DLL\" /D \"__STDC__=1\" /D \"_WINDLL\" /D \"_WIN32_WINNT=0x500\" /D \"_SECURE_SCL=0\" /D \"_MBCS\" /FD /EHsc /MD /W3 /nologo /Wp64 /Zi /TP /errorReport:prompt \"{1}\" /link /OUT:\"{2}\" /LIBPATH:\"{5}\" /INCREMENTAL:NO /NOLOGO  /DLL /MANIFEST /MANIFESTFILE:\"{2}.intermediate.manifest \" /DEBUG /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /LTCG /MACHINE:{4} ecs.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib";
                string cmd = string.Format(opt, new object[] {
                    INCLUDEPATH, m_sourceFile, m_outputFile, arch1, arch2, LIBPATH });

                // Compile.
                p.StandardInput.WriteLine(cmd);
                p.StandardInput.WriteLine("exit");
                p.StandardInput.Close();

                string mes = p.StandardOutput.ReadToEnd();
                env.Console.Write(mes);
                p.StandardOutput.Close();
                p.WaitForExit();
                p.Close();

                // Check Error.
                if (mes.Contains(" error"))
                {
                    string[] ele = mes.Split(new char[] { '\n' });
                    for (int i = 0; i < ele.Length; i++)
                    {
                        if (ele[i].Contains(" error"))
                        {
                            rs.Add(new CompileReport(MessageType.Error, ele[i], groupname));
                            env.LogManager.Append(new ApplicationLogEntry(MessageType.Error, ele[i], this));
                        }
                    }

                    string errmes = string.Format(MessageResources.ErrCompile, m_sourceFile);
                    throw new EcellException(errmes);
                }

                p = Process.Start(psi);
                p.StandardInput.WriteLine("call \"" + VSPATH + "\\vsvars32.bat\"");

                string mopt = "mt.exe /outputresource:\"{0};#2\" /manifest \"{0}.intermediate.manifest\" /nologo";
                cmd = string.Format(mopt, m_outputFile);
                p.StandardInput.WriteLine(cmd);
                p.StandardInput.WriteLine("exit");
                p.StandardInput.Close();

                mes = p.StandardOutput.ReadToEnd();
                env.Console.WriteLine(mes);
                Console.WriteLine(mes);
                p.StandardOutput.Close();
                p.WaitForExit();
                p.Close();

                // error
                if (mes.Contains(" error"))
                {
                    string[] ele = mes.Split(new char[] { '\n' });
                    for (int i = 0; i < ele.Length; i++)
                    {
                        if (ele[i].Contains(" error"))
                        {
                            rs.Add(new CompileReport(MessageType.Error, ele[i], groupname));
                            env.LogManager.Append(new ApplicationLogEntry(MessageType.Error, ele[i], this));
                        }
                    }
                    string errmes = string.Format(MessageResources.ErrCompile, m_sourceFile);
                    throw new EcellException(errmes);
                }

                // Reload DMs.
                try
                {
                    File.Copy(OutputFile, DMFile, true);
                    string msg = string.Format(MessageResources.InfoCompile,
                            Path.GetFileNameWithoutExtension(DMFile));
                    env.Console.WriteLine(msg);
                    env.Console.Flush();
                }
                catch (Exception e)
                {
                    // �ړ����DM�����[�h����Ă��邽�߈ړ��ł��Ȃ������B
                    // ����Ă��̗�O�͖��������̂Ƃ���B
                    string errmsg = string.Format(MessageResources.WarnMoveDM, DMFile, OutputFile);
                    if (showDialog)
                    {
                        Util.ShowNoticeDialog(errmsg);
                    }
                    env.Console.WriteLine(e.ToString());
                    env.Console.Flush();
                }
            }
        }
Esempio n. 10
0
 /// <summary>
 /// Set the plugin settings.
 /// </summary>
 /// <param name="env">the application environment.</param>
 /// <param name="settings">XMLNode.</param>
 private static void SetPluginSettings(ApplicationEnvironment env, XmlNode settings)
 {
     if (settings == null)
         return;
     foreach (XmlElement plugin in settings.ChildNodes)
     {
         env.PluginManager.SetPluginStatus(plugin.Name, plugin);
     }
 }
Esempio n. 11
0
        /// <summary>
        /// Set the logger to XML node.
        /// </summary>
        /// <param name="env">ApplicationEnvironment</param>
        /// <param name="model">the model object.</param>
        /// <param name="loggers">Logger XML node.</param>
        private static void SetLogger(ApplicationEnvironment env, EcellModel model, XmlNode loggers)
        {
            if (loggers == null || loggers.ChildNodes.Count <= 0)
                return;

            foreach (XmlNode node in loggers.ChildNodes)
            {
                if (!node.Name.Equals(LemlConstants.xPathLogger))
                    continue;

                string modelID = GetStringAttribute(node, LemlConstants.xPathModelID);
                string key = GetStringAttribute(node, LemlConstants.xPathKey);
                string type = GetStringAttribute(node, LemlConstants.xPathType);
                EcellObject eo = GetEcellObject(model, type, key);

                if (eo == null)
                    continue;

                string fullPN = GetStringAttribute(node, LemlConstants.xpathFullPN);
                LoggerEntry entry = new LoggerEntry(modelID, key, type, fullPN);
                entry.Color = Color.FromName(GetStringAttribute(node, LemlConstants.xpathColor));
                entry.LineStyleInt = Int32.Parse(GetStringAttribute(node, LemlConstants.xpathLineStyle));
                entry.LineWidth = Int32.Parse(GetStringAttribute(node, LemlConstants.xpathLineWidth));
                entry.IsShowInt = Int32.Parse(GetStringAttribute(node, LemlConstants.xpathIsShown));
                entry.IsY2AxisInt = Int32.Parse(GetStringAttribute(node, LemlConstants.xpathIsY2));

                foreach (EcellData d in eo.Value)
                {
                    if (!d.EntityPath.Equals(fullPN))
                        continue;
                    d.Logged = true;
                    env.LoggerManager.AddLoggerEntry(entry);
                }
            }
        }
Esempio n. 12
0
        /// <summary>
        /// Save EcellObjects in LEML format.
        /// </summary>
        /// <param name="env">ApplicationEnvironment</param>
        /// <param name="model">The model object.</param>
        /// <param name="filename">the file name.</param>
        public static void SaveLEML(ApplicationEnvironment env, EcellModel model, string filename)
        {
            CheckFilePath(filename);

            FileStream fs = null;
            XmlTextWriter xmlOut = null;
            try
            {
                // Create xml file
                fs = new FileStream(filename, FileMode.Create);
                xmlOut = new XmlTextWriter(fs, Encoding.UTF8);

                // Use indenting for readability
                xmlOut.Formatting = Formatting.Indented;
                xmlOut.WriteStartDocument();

                // Always begin file with identification and warning
                xmlOut.WriteComment(LemlConstants.xPathFileHeader1);
                xmlOut.WriteComment(LemlConstants.xPathFileHeader2);

                // Application settings
                xmlOut.WriteStartElement(LemlConstants.xPathApplication);
                xmlOut.WriteAttributeString(LemlConstants.xPathName, Application.ProductName);
                xmlOut.WriteAttributeString(LemlConstants.xPathApplicationVersion, Application.ProductVersion);
                xmlOut.WriteAttributeString(LemlConstants.xPathConfigFileVersion, CONFIG_FILE_VERSION);

                // Layer settings
                xmlOut.WriteStartElement(LemlConstants.xPathLayerList);
                foreach (EcellLayer layer in model.Layers)
                {
                    xmlOut.WriteStartElement(LemlConstants.xPathLayer);
                    xmlOut.WriteAttributeString(LemlConstants.xPathName, layer.Name);
                    xmlOut.WriteAttributeString(LemlConstants.xPathVisible, layer.Visible.ToString());
                    xmlOut.WriteEndElement();
                }
                xmlOut.WriteEndElement();

                // Alias
                xmlOut.WriteStartElement(LemlConstants.xPathAliasList);
                foreach (EcellObject eo in model.Children)
                {
                    foreach (EcellObject child in eo.Children)
                    {
                        if (!(child is EcellVariable))
                            continue;
                        WriteAliases(xmlOut, child);
                    }
                }
                xmlOut.WriteEndElement();

                // Object settings
                xmlOut.WriteStartElement(LemlConstants.xPathEcellObjectList);
                foreach (EcellObject stepper in model.Steppers)
                {
                    WriteObjectElement(xmlOut, stepper);
                }
                foreach (EcellObject eo in model.Children)
                {
                    WriteObjectElement(xmlOut, eo);
                    foreach (EcellObject child in eo.Children)
                    {
                        WriteObjectElement(xmlOut, child);
                    }
                }
                xmlOut.WriteEndElement();

                // Logger
                xmlOut.WriteStartElement(LemlConstants.xPathLoggerList);
                foreach (string name in env.LoggerManager.GetLoggerList())
                {
                    LoggerEntry entry = env.LoggerManager.GetLoggerEntryForFullPN(name);
                    WriteLoggerElement(xmlOut, entry);
                }
                xmlOut.WriteEndElement();

                // Plugin settings.
                xmlOut.WriteStartElement(LemlConstants.xPathPluginSettings);
                foreach (XmlNode status in env.PluginManager.GetPluginStatus())
                {
                    status.WriteTo(xmlOut);
                }
                xmlOut.WriteEndElement();

                xmlOut.WriteEndElement();
                xmlOut.WriteEndDocument();
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex);
                Util.ShowErrorDialog(string.Format(MessageResources.ErrSaveFile, filename) + Environment.NewLine + ex.Message);
            }
            finally
            {
                if (xmlOut != null) xmlOut.Close();
                if (fs != null) fs.Close();
            }
        }
Esempio n. 13
0
        /// <summary>
        /// LoadLEML
        /// </summary>
        /// <param name="env">ApplicationEnvironment.</param>
        /// <param name="model">the model ID.</param>
        /// <param name="filename">the filename.</param>
        public static void LoadLEML(ApplicationEnvironment env, EcellModel model,string filename)
        {
            if (!File.Exists(filename))
                return;

            XmlDocument xmlD = new XmlDocument();
            try
            {
                xmlD.Load(filename);
                XmlNode applicationData = GetNodeByKey(xmlD, LemlConstants.xPathApplication);

                // Load Layers
                XmlNode layers = GetNodeByKey(applicationData, LemlConstants.xPathLayerList);
                SetLayers(model, layers);

                // Load Aliases
                XmlNode aliases = GetNodeByKey(applicationData, LemlConstants.xPathAliasList);
                SetAliases(model, aliases);

                // Load EcellObjects
                XmlNode ecellObjects = GetNodeByKey(applicationData, LemlConstants.xPathEcellObjectList);
                SetEcellObjects(model, ecellObjects);

                // Load Logger
                XmlNode loggers = GetNodeByKey(applicationData, LemlConstants.xPathLoggerList);
                SetLogger(env, model, loggers);

                // Load plugin settings
                XmlNode settings = GetNodeByKey(applicationData, LemlConstants.xPathPluginSettings);
                SetPluginSettings(env, settings);
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex);
                Util.ShowErrorDialog(string.Format(MessageResources.ErrLoadFile, filename) + Environment.NewLine + ex.Message);
            }
        }
Esempio n. 14
0
 public void SetUp()
 {
     _env = new ApplicationEnvironment();
     _unitUnderTest = new ConsoleManager(_env);
 }
Esempio n. 15
0
        /// <summary>
        /// Comile the source of DM.
        /// </summary>
        /// <param name="fileName">the file name of source.</param>
        /// <param name="env">Application Environment object.</param>
        public static void Compile(string fileName, ApplicationEnvironment env)
        {
            if (fileName == null || !File.Exists(fileName))
                return;
            DMCompiler cm = new DMCompiler();
            cm.SourceFile = fileName;
            string outdir = Path.Combine(Path.GetDirectoryName(fileName), Constants.TmpDirName);
            if (!Directory.Exists(outdir))
                Directory.CreateDirectory(outdir);
            string outfile = Path.Combine(outdir, Path.GetFileNameWithoutExtension(fileName) + Constants.FileExtDM);
            string dmfile = Path.Combine(Path.GetDirectoryName(fileName), Path.GetFileNameWithoutExtension(fileName) + Constants.FileExtDM);
            cm.OutputFile = outfile;
            cm.DMFile = dmfile;
            try
            {
                env.DataManager.CurrentProject.UnloadSimulator();
                cm.Compile(env, true);
                string msg = string.Format(MessageResources.InfoCompile,
                    Path.GetFileNameWithoutExtension(dmfile));
                env.DMDescriptorKeeper.Load(env.DataManager.CurrentProject.GetDMDirs());
                env.DataManager.CurrentProject.ReloadSimulator();

                Util.ShowNoticeDialog(msg);

            }
            catch (Exception e)
            {
                env.Console.WriteLine(e.ToString());
                env.Console.Flush();
                Util.ShowErrorDialog(e.Message);
            }
        }
Esempio n. 16
0
 /// <summary>
 /// Compile DMs.
 /// </summary>
 /// <param name="files">source files.</param>
 /// <param name="env">Application Environment</param>
 public static void Compile(List<string> files, ApplicationEnvironment env)
 {
     if (files == null || files.Count == 0)
         return;
     DMCompiler cm = new DMCompiler();
     string errmes = "";
     string finished = "";
     try
     {
         env.DataManager.CurrentProject.UnloadSimulator();
     }
     catch (Exception e)
     {
         env.Console.WriteLine(e.ToString());
         env.Console.Flush();
         Util.ShowErrorDialog(e.Message);
     }
     foreach (string filename in files)
     {
         cm.SourceFile = filename;
         string outdir = Path.Combine(Path.GetDirectoryName(filename), Constants.TmpDirName);
         if (!Directory.Exists(outdir))
             Directory.CreateDirectory(outdir);
         string dmname = Path.GetFileNameWithoutExtension(filename);
         string outfile = Path.Combine(outdir, dmname + Constants.FileExtDM);
         string dmfile = Path.Combine(Path.GetDirectoryName(filename), dmname + Constants.FileExtDM);
         cm.OutputFile = outfile;
         cm.DMFile = dmfile;
         try
         {
             cm.Compile(env, true);
             finished += " " + dmname;
         }
         catch (Exception e)
         {
             errmes += e.Message + "\n";
             env.Console.WriteLine(e.ToString());
             env.Console.Flush();
         }
     }
     env.DMDescriptorKeeper.Load(env.DataManager.CurrentProject.GetDMDirs());
     env.DataManager.CurrentProject.ReloadSimulator();
     // Error
     if (!string.IsNullOrEmpty(errmes))
     {
         Util.ShowErrorDialog(errmes);
     }
     // Finished
     if (!string.IsNullOrEmpty(finished))
     {
         string msg = string.Format(MessageResources.InfoCompile,
             Path.GetFileNameWithoutExtension(finished));
         Util.ShowNoticeDialog(msg);
     }
 }
Esempio n. 17
0
 /// <summary>
 /// Constructors.
 /// </summary>
 /// <param name="env">application environment.</param>
 public ConsoleManager(ApplicationEnvironment env)
 {
     m_env = env;
     m_buf = new StringBuilder();
     m_state = 0;
 }
Esempio n. 18
0
 /// <summary>
 /// Creates the new "DataManager" instance with no argument.
 /// </summary>
 public DataManager(ApplicationEnvironment env)
 {
     this.m_env = env;
     this.m_observedList = new Dictionary<string, EcellObservedData>();
     this.m_parameterList = new Dictionary<string, EcellParameterData>();
     SetDefaultDir();
 }
 public void SetUp()
 {
     _unitUnderTest = new ApplicationEnvironment();
 }
Esempio n. 20
0
 /// <summary>
 /// Constructor with the initial parameters.
 /// </summary>
 /// <param name="env">the environment object.</param>
 public CommandManager(ApplicationEnvironment env)
 {
     m_env = env;
     s_instance = this;
 }
 public void TearDown()
 {
     _unitUnderTest = null;
 }
Esempio n. 22
0
 public void TestFixtureTearDown()
 {
     _unitUnderTest = null;
     _env = null;
 }
Esempio n. 23
0
 public void SetUp()
 {
     _env = new ApplicationEnvironment();
     _manager = _env.ActionManager;
 }
Esempio n. 24
0
        /// <summary>
        /// Creates the new "Project" instance with ProjectInfo.
        /// </summary>
        /// <param name="info">the project information object.</param>
        /// <param name="env">ApplicationEnvironment</param>
        public Project(ProjectInfo info, ApplicationEnvironment env)
        {
            if (info == null)
                throw new EcellException(string.Format(MessageResources.ErrInvalidParam, "ProjectInfo"));
            if (env == null)
                throw new EcellException(string.Format(MessageResources.ErrInvalidParam, "ApplicationEnvironment"));

            m_info = info;
            m_env = env;
            m_stepperDic = new Dictionary<string, List<EcellObject>>();
            m_modelList = new List<EcellModel>();
            m_systemDic = new Dictionary<string, List<EcellObject>>();
            m_logableEntityPathDic = new Dictionary<string, string>();
            m_loggerPolicyDic = new Dictionary<string, LoggerPolicy>();

            // Loads the model.
            if (info.Type != ProjectType.Model)
                info.FindModels();

            SetDMList();
            m_simulator = CreateSimulatorInstance();
            //
            Lock();
        }
Esempio n. 25
0
 public void SetUp()
 {
     _env = new ApplicationEnvironment();
 }