Esempio n. 1
0
        public static void AddInputsFromParamsXML(IEnumerable <string> pathsToParamsXMLFile, bool append = false)
        {
            var applicationDataService = ApplicationData.Service;

            uint count = append ? (uint)applicationDataService.Inputs.Count() : 0;

            var newInputs = pathsToParamsXMLFile.Select(pathToParamsXMLFile => (XMLManager.GetDocument(pathToParamsXMLFile) ?? new XDocument()).Descendants("CCCall")
                                                        .Select(ccCallElement => new { ccCallObject = CreateCCCall(ccCallElement), ccCallElement })
                                                        .Where(pair => pair.ccCallObject != null)
                                                        .Select(pair =>
            {
                var ccCallObject = pair.ccCallObject;

                var ccCommandParameters = new CCCommandParameters(ccCallObject.ProjectId, ccCallObject.NodeExternalId, ccCallObject?.CheckInOptions.Version)
                {
                    Incremental   = ccCallObject.Incremental,
                    ThreeDMapping = ccCallObject.Skip3Dmapping == null ? null : !ccCallObject.Skip3Dmapping,
                    Comment       = ccCallObject?.CheckInOptions.Comment
                };

                var ccCallElement = pair.ccCallElement;

                XMLManager.GetAttributeValue(ccCallElement, "chunkName", null, (string)null, out string chunkName, true);

                var input = new Input(++count, pathToParamsXMLFile, ccCommandParameters)
                {
                    ChunkName  = chunkName,
                    XMLElement = ccCallElement
                };

                input.AddIteration();

                return(input);
            })).SelectMany(s => s).ToArray();

            if (append)
            {
                applicationDataService.Inputs = applicationDataService.Inputs.Concat(newInputs).ToArray();
            }

            else
            {
                applicationDataService.Inputs = newInputs;
            }

            var statsService = applicationDataService.Stats;

            statsService.Reset();

            statsService.InputsTotal = count;
        }
Esempio n. 2
0
 public Input(uint sequenceNumber, string pathToSourceFile, CCCommandParameters ccCommandParameters)
 {
     SequenceNumber      = sequenceNumber;
     PathToSourceFile    = pathToSourceFile;
     CCCommandParameters = ccCommandParameters;
 }