コード例 #1
0
 public override bool TryLoad(Type viewModelType, IMvxBundle parameterValues, IMvxBundle savedState, out IMvxViewModel viewModel)
 {
     if (AVM.TryLoadFromBundle(parameterValues, out viewModel))
     {
         return(true);
     }
     return(base.TryLoad(viewModelType, parameterValues, savedState, out viewModel));
 }
コード例 #2
0
        public void UpdateAVM(AVM avm)
        {
            foreach (var item in db.Resim.Where(i => i.AVM.Any(r => r.Id == avm.Id)).ToList())
            {
                db.Resim.Remove(item);
            }

            db.AVM.Find(avm.Id).Ad      = avm.Ad;
            db.AVM.Find(avm.Id).Adres   = avm.Adres;
            db.AVM.Find(avm.Id).cordX   = avm.cordX;
            db.AVM.Find(avm.Id).cordY   = avm.cordY;
            db.AVM.Find(avm.Id).Telefon = avm.Telefon;
            db.AVM.Find(avm.Id).SehirId = avm.SehirId;
            db.AVM.Find(avm.Id).Resim   = avm.Resim;
            db.SaveChanges();
        }
コード例 #3
0
        public ActionResult AVMDuzenle(AVM avm, List <HttpPostedFileBase> image)
        {
            Resim _resim;

            foreach (var item in image)
            {
                _resim = new Resim();
                var extension = Path.GetExtension(item.FileName);
                if (image != null && (extension == ".jpg" || extension == ".png" || extension == ".jpeg"))
                {
                    var path           = Server.MapPath("~/UploadImages");
                    var RandomFileName = Path.GetRandomFileName();
                    var Name           = Path.ChangeExtension(RandomFileName, ".jpg");
                    var final          = Path.Combine(path, Name);
                    item.SaveAs(final);
                    _resim.Ad = Name;
                    avm.Resim.Add(_resim);
                }
            }
            _avm.UpdateAVM(avm);
            ViewBag.Duzenleme = "true";
            return(View("AVMIslem", _avm.GetAVMs()));
        }
コード例 #4
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.testBenchSuite.Children.TestBenchRefCollection)
            {
                var thisSuccess = project.SaveTestBench(testbenchRef.Referred.TestBenchType);
                success = success && thisSuccess;
            }

            return success;
        }
コード例 #5
0
        public override bool SaveTestBenchManifest(AVM.DDP.MetaAvmProject project, string configurationName, DateTime analysisStartTime)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            // TODO: implement this method!

            // FIXME: return fake true for now.
            return true;
        }
        public override bool SaveTestBenchManifest(AVM.DDP.MetaAvmProject project)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            this.ThrowIfNotExpanded();

            this.EnsureOutputDirectory();


            //TODO: review this method - are we doing the right thing? are we doing the thing right?
            var originalTestBench = this.parametricExploration
                .Children
                .TestBenchRefCollection
                .FirstOrDefault()
                .Referred
                .TestBenchType;


            var expandedTestBench = this.expandedParametricExploration
                .Children
                .TestBenchRefCollection
                .FirstOrDefault()
                .Referred
                .TestBenchType;


            var success = project.SaveTestBenchManifest(
                this.Configuration.Name,
                expandedTestBench,
                this.OutputDirectory,
                originalTestBench);


            return success;
        }
コード例 #7
0
        public override bool UpdateTestBenchManifestExecutionSteps(AVM.DDP.MetaTBManifest manifest)
        {
            this.ExecuteInTransaction(() =>
            {
                    try
                    {
                        manifest.AddAllTasks(this.testBenchType, this.Interpreters);
                    }
                    catch (Exception ex)
                    {
                        throw new AnalysisModelProcessorException("Updating test bench execution steps failed.", ex);
                    }
            });

            return true;
        }
コード例 #8
0
 public IHttpActionResult PutAVM(AVM avm)
 {
     avmRep.UpdateAVM(avm);
     return(Ok("Değiştirme İşlemi Başarılı"));
 }
コード例 #9
0
        /// <summary>
        /// Exports the design space into design interchange format AVM Design Model and indexes the file
        /// in the project manifest.
        /// </summary>
        /// <param name="projectManifest">Given project manifest object.</param>
        /// <returns>True if exporting and indexing are successful, otherwise false.</returns>
        public bool SaveDesignSpace(AVM.DDP.MetaAvmProject projectManifest)
        {
            if (projectManifest == null)
            {
                throw new ArgumentNullException("projectManifest");
            }

            this.ThrowIfNotExpanded();

            if (this.OriginalSystemUnderTest.AllReferred is CyPhy.DesignContainer)
            {
                bool success = false;
                try
                {
                    success = projectManifest.SaveDesign(this.OriginalSystemUnderTest.Referred.DesignEntity);
                }
                catch (Exception ex)
                {
                    throw new AnalysisModelProcessorException("Saving design space model failed.", ex);
                }

                return success;
            }
            else
            {
                return false;
            }
        }
コード例 #10
0
 /// <summary>
 /// Updates the execution steps in the test bench manifest file based on the Tasks and Execution tasks in the
 /// workflow.
 /// </summary>
 /// <returns>True if all Tasks were successfully added, false otherwise.</returns>
 public abstract bool UpdateTestBenchManifestExecutionSteps(AVM.DDP.MetaTBManifest manifest);
コード例 #11
0
 public void PostAVM(AVM avm)
 {
     db.AVM.Add(avm);
     db.SaveChanges();
 }
コード例 #12
0
        public override bool SaveTestBenchManifest(AVM.DDP.MetaAvmProject project)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            // TODO: implement this method!

            // FIXME: return fake true for now.
            return true;
        }
コード例 #13
0
 public override bool UpdateTestBenchManifestExecutionSteps(AVM.DDP.MetaTBManifest manifest)
 {
     manifest.Steps.Add(new AVM.DDP.MetaTBManifest.Step()
     {
         Invocation = String.Format("\"{0}\" -E -m run_mdao", VersionInfo.PythonVEnvExe),
         Description = "ParametricExploration",
         // Type = "Parametric Study",
         Status = AVM.DDP.MetaTBManifest.StatusEnum.UNEXECUTED
     });
     return true;
 }
コード例 #14
0
        private static int ParseArgs(string[] args, out MfgBom.CostEstimation.CostEstimationRequest Request, out AVM.DDP.MetaTBManifest Manifest, out String pathResultsFolder)
        {
            Request = null;
            Manifest = null;
            pathResultsFolder = "";

            var pathManifest = args[0];
            if (false == File.Exists(pathManifest))
            {
                Console.Error.WriteLine("No file found at location: {0}",
                                        pathManifest);
                return -2;
            }

            pathResultsFolder = Path.GetDirectoryName(pathManifest);
            Manifest = AVM.DDP.MetaTBManifest.OpenForUpdate(pathResultsFolder);
            if (null == Manifest)
            {
                Console.Error.WriteLine("Manifest is empty or didn't load correctly: {0}",
                                        pathManifest);
                return -3;
            }

            var artifactRequest = Manifest.Artifacts.FirstOrDefault(a => a.Tag == "CyPhy2MfgBom::CostEstimationRequest");
            if (null == artifactRequest)
            {
                Console.Error.WriteLine("Didn't find any artifacts in the manifest with the tag \"CyPhy2MfgBom::CostEstimationRequest\": {0}",
                                        pathManifest);
                return -4;
            }

            var pathRequest = Path.Combine(pathResultsFolder,
                                           artifactRequest.Location);
            if (false == File.Exists(pathRequest))
            {
                Console.Error.WriteLine("Couldn't find the file tagged with \"CyPhy2MfgBom::CostEstimationRequest\" at given path: {0}",
                                        pathRequest);
                return -5;
            }

            String jsonRequest;

            try
            {
                jsonRequest = File.ReadAllText(pathRequest);
                Request = MfgBom.CostEstimation.CostEstimationRequest.Deserialize(jsonRequest);
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine("Exception loading the cost estimation request at \"{0}\": {1}",
                                        pathRequest,
                                        ex);
                return -6;
            }
            return 0;
        }
コード例 #15
0
 public override bool UpdateTestBenchManifestExecutionSteps(AVM.DDP.MetaTBManifest manifest)
 {
     // FIXME: return fake true for now.
     return true;
 }
コード例 #16
0
        public override bool SaveTestBenchManifest(AVM.DDP.MetaAvmProject project, string configurationName, DateTime analysisStartTime)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            this.ThrowIfNotExpanded();

            this.EnsureOutputDirectory();

            bool success = false;
            try
            {
                success = project.SaveTestBenchManifest(
                this.Configuration.Name,
                configurationName,
                this.expandedTestBenchType,
                this.OutputDirectory,
                this.testBenchType,
                analysisStartTime);
            }
            catch (Exception ex)
            {
                throw new AnalysisModelProcessorException("Saving test bench manifest failed.", ex);
            }

            return success;
        }
コード例 #17
0
 /// <summary>
 /// Saves the test bench manifest file to interpreter's output directory and indexes the newly generated file 
 /// in the project manifest.
 /// </summary>
 /// <param name="projectManifest">Manifest object of the project.</param>
 /// <returns>True if the manifest was saved and indexed successfully, otherwise false.</returns>
 public abstract bool SaveTestBenchManifest(AVM.DDP.MetaAvmProject projectManifest, string configurationName, DateTime analysisStartTime);
コード例 #18
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;
        }
コード例 #19
0
 /// <summary>
 /// Saves the test bench descriptor file to the test bench directory and indexes the newly generated file 
 /// in the project manifest.
 /// </summary>
 /// <param name="projectManifest">Manifest object of the project.</param>
 /// <returns>True if the manifest was saved and indexed successfully, otherwise false.</returns>
 public abstract bool SaveTestBench(AVM.DDP.MetaAvmProject projectManifest);
コード例 #20
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 (Exception ex)
            {
                throw new AnalysisModelProcessorException("Saving test bench failed.", ex);
            }

            return success;
        }
コード例 #21
0
        /// <summary>
        /// Exports the design into design interchange format AVM Design Model and indexes the file
        /// in the project manifest.
        /// </summary>
        /// <param name="projectManifest">Given project manifest object.</param>
        /// <returns>True if exporting and indexing are successful, otherwise false.</returns>
        public bool SaveDesign(AVM.DDP.MetaAvmProject projectManifest)
        {
            if (projectManifest == null)
            {
                throw new ArgumentNullException("projectManifest");
            }

            this.ThrowIfNotExpanded();

            bool success = false;
            try
            {
                success = projectManifest.SaveDesign(this.Configuration);
            }
            catch (Exception ex)
            {
                throw new AnalysisModelProcessorException("Saving design model failed.", ex);
            }

            return success;
        }
コード例 #22
0
 public IHttpActionResult PostAVM(AVM avm)
 {
     avmRep.PostAVM(avm);
     return(Ok("Ekleme İşlemi Başarılı"));
 }