Пример #1
0
        public override bool SaveTestBench(AVM.DDP.MetaAvmProject project)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            this.ThrowIfNotExpanded();

            this.EnsureOutputDirectory();

            var success = true;

            // NOTE: saving the original design space test benches
            foreach (var testbenchRef in this.parametricExploration.Children.TestBenchRefCollection)
            {
                var thisSuccess = project.SaveTestBench(testbenchRef.Referred.TestBenchType);
                success = success && thisSuccess;
            }

            return(success);
        }
Пример #2
0
        public override bool SaveTestBench(AVM.DDP.MetaAvmProject project)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            this.ThrowIfNotExpanded();

            this.EnsureOutputDirectory();

            bool success = false;

            try
            {
                success = project.SaveTestBench(this.testBenchType);
            }
            catch (System.IO.IOException ex)
            {
                // ignore sharing violation:
                // if another process is writing the same testbench file, it will have the same contents
                int       HResult          = System.Runtime.InteropServices.Marshal.GetHRForException(ex);
                const int SharingViolation = 32;
                if ((HResult & 0xFFFF) == SharingViolation)
                {
                }
                else
                {
                    throw new AnalysisModelProcessorException("Saving test bench failed.", ex);
                }
            }
            catch (Exception ex)
            {
                throw new AnalysisModelProcessorException("Saving test bench failed.", ex);
            }

            return(success);
        }