Inheritance: IInterpreterConfiguration, IInterpreterPreConfiguration
Beispiel #1
0
        public IInterpreterPreConfiguration PreConfig(IPreConfigParameters parameters)
        {
            var config = new CADAnalysisConfig();

            config.ProjectDirectory = parameters.ProjectDirectory;
            return(config);
        }
 public IInterpreterPreConfiguration PreConfig(IPreConfigParameters parameters)
 {
     var config = new CADAnalysisConfig();
     config.ProjectDirectory = parameters.ProjectDirectory;
     return config;
 }
Beispiel #3
0
        public IInterpreterResult Main(IInterpreterMainParameters parameters)
        {
            this.OutputDirectory      = parameters.OutputDirectory;
            this.ProjectRootDirectory = parameters.ProjectDirectory;
            if (this.result.Traceability == null)
            {
                this.result.Traceability = new META.MgaTraceability();
            }

            result.RunCommand = "CyPhyCADAnalysis.bat";
            result.Labels     = "Creo&&CADCreoParametricCreateAssembly.exev1.4";

            Dictionary <string, string> workflowParameters = new Dictionary <string, string>();

            MgaGateway.PerformInTransaction(() =>
            {
                string Parameters = parameters
                                    .CurrentFCO
                                    .ChildObjects
                                    .OfType <MgaReference>()
                                    .FirstOrDefault(x => x.Meta.Name == "WorkflowRef")
                                    .Referred
                                    .ChildObjects
                                    .OfType <MgaAtom>()
                                    .FirstOrDefault()
                                    .StrAttrByName["Parameters"];

                try
                {
                    workflowParameters = (Dictionary <string, string>)Newtonsoft.Json.JsonConvert.DeserializeObject(Parameters, typeof(Dictionary <string, string>));
                    if (workflowParameters == null)
                    {
                        workflowParameters = new Dictionary <string, string>();
                    }
                }
                catch (Newtonsoft.Json.JsonReaderException)
                {
                }
                META.AnalysisTool.ApplyToolSelection(this.ComponentProgID, workflowParameters, this.result, parameters, modifyLabels: false);
                this.result.Labels += " && CyPhyCADAnalysis" + JobManager.Job.LabelVersion; // META-2405
            }, abort: true);

            List <string> Inventor_Tests = new List <string>()
            {
                "closures", "field_of_view", "field_of_fire", "ergonomics", "ingress_egress", "transportability"
            };
            List <string> Leaf_Metrics = new List <string>()
            {
                "conceptual_mfg", "detailed_mfg", "completeness", "corrosion"
            };
            bool b = Inventor_Tests.Any(workflowParameters.Values.Contains);
            bool c = Leaf_Metrics.Any(workflowParameters.Values.Contains);

            CADAnalysisConfig config = (CADAnalysisConfig)parameters.config;

            cadSettings.AuxiliaryDirectory = config.AuxiliaryDirectory;
            cadSettings.StepFormats        = config.StepFormats;
            if (b)
            {
                cadSettings.OtherDataFormat.Inventor = true;
            }
            if (c)
            {
                cadSettings.SpecialInstructions.LeafAssembliesMetric = true;
            }
            InvokeEx(parameters.Project, parameters.CurrentFCO, parameters.SelectedFCOs, parameters.StartModeParam);

            result.Success = true;
            return(result);
        }