Пример #1
0
        public Experiment(XmlNode configNode, string baseDirectory, LoadOptions loadOptions)
        {
            XmlAttributeCollection attrs = configNode.Attributes;

            if (attrs != null)
            {
                if (attrs.GetNamedItem(XMLTags.nameAttribute) != null)
                {
                    Name = attrs[XMLTags.nameAttribute].Value;
                }
            }

            foreach (XmlNode child in configNode.ChildNodes)
            {
                switch (child.Name)
                {
                case XMLTags.forkTag:
                    Fork newFork = new Fork(child);
                    Forks.Add(newFork);
                    break;

                case XmlTags.Version:
                    AppVersion appVersion = new AppVersion(child);
                    AppVersions.Add(appVersion);
                    break;

                case XMLTags.ExperimentalUnitNodeTag:
                    if (loadOptions.Selection == LoadOptions.ExpUnitSelection.All ||
                        (ExperimentalUnit.LogFileExists(child.Attributes[XMLTags.pathAttribute].Value, baseDirectory)
                         == (loadOptions.Selection == LoadOptions.ExpUnitSelection.OnlyFinished)))
                    {
                        ExperimentalUnit newExpUnit = new ExperimentalUnit(child, baseDirectory, loadOptions);
                        if (loadOptions.LoadVariablesInLog)
                        {
                            //We load the list of variables from the log descriptor and add them to the global list
                            newExpUnit.Variables = Log.LoadLogDescriptor(newExpUnit.LogDescriptorFileName);
                            foreach (string variable in newExpUnit.Variables)
                            {
                                AddVariable(variable);
                            }
                        }
                        ExperimentalUnits.Add(newExpUnit);
                    }
                    break;
                }
            }

            //set the children's AppVersions
            foreach (ExperimentalUnit expUnit in ExperimentalUnits)
            {
                expUnit.AppVersions = AppVersions;
            }

            //update progress
            loadOptions.OnExpLoaded?.Invoke(this);
        }
Пример #2
0
        public ForkValue(XmlNode configNode)
        {
            if (configNode.Attributes.GetNamedItem(XMLTags.valueAttribute) != null)
            {
                Value = configNode.Attributes[XMLTags.valueAttribute].Value;
            }
            else
            {
                Value = configNode.InnerText;
            }

            foreach (XmlNode child in configNode.ChildNodes)
            {
                if (child.Name == XMLTags.forkTag)
                {
                    Fork newFork = new Fork(child);
                    Forks.Add(newFork);
                }
            }
        }
Пример #3
0
        public Fork(XmlNode configNode)
        {
            if (configNode.Attributes.GetNamedItem(XMLTags.aliasAttribute) != null)
            {
                Name = configNode.Attributes[XMLTags.aliasAttribute].Value;
            }

            foreach (XmlNode child in configNode.ChildNodes)
            {
                if (child.Name == XMLTags.forkTag)
                {
                    Fork newFork = new Fork(child);
                    Forks.Add(newFork);
                }
                else if (child.Name == XMLTags.forkValueTag)
                {
                    ForkValue newValue = new ForkValue(child);
                    Values.Add(newValue);
                }
            }
        }