Exemplo n.º 1
0
 public ProcessingWindow(SubjectiveSystem system, ObserverData observerData, ProcessingMethod processingMethod)
 {
     this.system = system;
     this.observerData = observerData;
     this.processingMethod = processingMethod;
     InitializeComponent();
 }
Exemplo n.º 2
0
        public virtual ProcessingMethod ToProcessingMethod()
        {
            ProcessingMethod pm = new ProcessingMethod();

            pm.set(CVID);
            return(pm);
        }
Exemplo n.º 3
0
 public ProcessingWindow(SubjectiveSystem system, ObserverData observerData, ProcessingMethod processingMethod)
 {
     this.system           = system;
     this.observerData     = observerData;
     this.processingMethod = processingMethod;
     InitializeComponent();
 }
Exemplo n.º 4
0
        public SpectrumList_Thresholder_ListViewItem(ProcessingMethod method)
            : base("Thresholder")
        {
            initializeComponents();

            // parse type, orientation, and threshold from method
            UserParam param = method.userParam("threshold");

            if (param.type == "SeeMS")
            {
                thresholdTextBox.Text = param.value;
            }

            param = method.userParam("type");
            if (param.type == "SeeMS")
            {
                thresholdingTypeComboBox.SelectedIndex = (int)param.value;
            }

            param = method.userParam("orientation");
            if (param.type == "SeeMS")
            {
                thresholdingOrientationComboBox.SelectedIndex = (int)param.value;
            }
        }
Exemplo n.º 5
0
        public override ProcessingMethod ToProcessingMethod()
        {
            ProcessingMethod pm = new ProcessingMethod();

            pm.userParams.Add(new UserParam("mz", mz.ToString(), "SeeMS"));
            pm.userParams.Add(new UserParam("tolerance", tolerance.ToString(), "SeeMS"));
            return(pm);
        }
Exemplo n.º 6
0
 /// <inheritdoc/>
 public override void InitializeLinks()
 {
     base.InitializeLinks();
     // Initialize links for the helper methods.
     _helperFocalSurfaces.InitializeLinks();
     // Define the scene representation methods.
     sceneRepresentationMethods = new ProcessingMethod[] { PMColorTextureArray, PMPerViewMeshesFS };
 }
 /// <inheritdoc/>
 public override void InitializeLinks()
 {
     base.InitializeLinks();
     // Initialize links for the helper methods.
     _helperCommandBuffer.InitializeLinks();
     _helperDiskBlending.InitializeLinks();
     // Define the scene representation methods.
     sceneRepresentationMethods = new ProcessingMethod[] { PMColorTextureArray, PMPerViewMeshesQSTR };
 }
Exemplo n.º 8
0
        public override ProcessingMethod ToProcessingMethod()
        {
            ProcessingMethod pm = new ProcessingMethod();

            pm.userParams.Add(new UserParam("threshold", threshold.ToString(), "SeeMS"));
            pm.userParams.Add(new UserParam("type", type.ToString(), "SeeMS"));
            pm.userParams.Add(new UserParam("orientation", orientation.ToString(), "SeeMS"));
            return(pm);
        }
Exemplo n.º 9
0
        public override ProcessingMethod ToProcessingMethod()
        {
            ProcessingMethod pm = base.ToProcessingMethod();

            pm.userParams.Add(new UserParam("threshold", thresholdTextBox.Text, "SeeMS"));
            pm.userParams.Add(new UserParam("type", thresholdingTypeComboBox.SelectedIndex.ToString(), "SeeMS"));
            pm.userParams.Add(new UserParam("orientation", thresholdingOrientationComboBox.SelectedIndex.ToString(), "SeeMS"));
            return(pm);
        }
Exemplo n.º 10
0
        public SpectrumList_ECD_ETD_PrecursorFilter(SpectrumList inner)
            : base(inner)
        {
            ProcessingMethod method = new ProcessingMethod();

            method.order = this.dataProcessing().processingMethods.Count;
            method.set(CVID.MS_charge_stripping);
            this.dataProcessing().processingMethods.Add(method);
        }
Exemplo n.º 11
0
        public override ProcessingMethod ToProcessingMethod()
        {
            ProcessingMethod pm = new ProcessingMethod();

            if (algorithm is LocalMaximumPeakDetector)
            {
                pm.userParams.Add(new UserParam("algorithm", "Local Maximum", "SeeMS"));
            }
            return(pm);
        }
Exemplo n.º 12
0
 public void DoSomething(ProcessingMethod method)
 {
     if (method == ProcessingMethod.Sequential)
     {
         // do something sequential
     }
     else if (method == ProcessingMethod.Random)
     {
         // do something random
     }
 }
Exemplo n.º 13
0
        public override ProcessingMethod ToProcessingMethod()
        {
            ProcessingMethod pm = new ProcessingMethod();

            if (algorithm is SavitzkyGolaySmoother)
            {
                pm.userParams.Add(new UserParam("algorithm", "Savitzky-Golay", "SeeMS"));
            }
            else if (algorithm is WhittakerSmoother)
            {
                pm.userParams.Add(new UserParam("algorithm", "Whittaker", "SeeMS"));
            }
            return(pm);
        }
Exemplo n.º 14
0
        public Bitmap ProcessImage(Bitmap image, ObserverData observerData, ProcessingMethod processingMethod)
        {
            if (processingMethod == ProcessingMethod.UseAlgorithmWithHighestScore)
            {
                string bestAlgorithm =
                    observerData.EvaluationResults.OrderByDescending(x => x.AlgorithScore).First().AlgorithCustomName;
                AlgorithmInfo algorithmInfo = this.Algorithms.Where(x => x.CustomName == bestAlgorithm).Single();
                var           algorithm     = AppFacade.DI.Container.Resolve <IAlgorithm>(algorithmInfo.AlgorithName);
                algorithm.SetParameters(algorithmInfo.Parameters);
                return(SimpleProcessing(image, algorithm));
            }
            if (processingMethod == ProcessingMethod.AlgorithmsFusion)
            {
                return(FusionProcessing(image, this.Algorithms, observerData.EvaluationResults));
            }

            throw new NotSupportedException();
        }
Exemplo n.º 15
0
        public ThresholdingProcessor(ProcessingMethod method)
        {
            // parse type, orientation, and threshold from method
            UserParam param = method.userParam("threshold");

            if (param.type == "SeeMS")
            {
                threshold = (double)param.value;
            }

            param = method.userParam("type");
            if (param.type == "SeeMS")
            {
                type = (ThresholdFilter.ThresholdingBy_Type)(int) param.value;
            }

            param = method.userParam("orientation");
            if (param.type == "SeeMS")
            {
                orientation = (ThresholdFilter.ThresholdingOrientation)(int) param.value;
            }
        }
Exemplo n.º 16
0
 public SpectrumList_Preexisting_ListViewItem(ProcessingMethod method)
     : base(method.cvParamChild(CVID.MS_data_processing_action).name)
 {
     methodParam = method.cvParamChild(CVID.MS_data_processing_action);
 }
Exemplo n.º 17
0
 public static IProcessing GetProcessingMethod(ProcessingMethod method)
 {
     return(lsProcessing[(int)method]);
 }
 /// <inheritdoc/>
 public override void InitializeLinks()
 {
     base.InitializeLinks();
     sceneRepresentationMethods = new ProcessingMethod[] { PMGlobalMeshEF, PMGlobalTextureMap };
 }
Exemplo n.º 19
0
        public Bitmap ProcessImage(Bitmap image, ObserverData observerData, ProcessingMethod processingMethod)
        {
            if (processingMethod == ProcessingMethod.UseAlgorithmWithHighestScore)
            {
                string bestAlgorithm =
                    observerData.EvaluationResults.OrderByDescending(x => x.AlgorithScore).First().AlgorithCustomName;
                AlgorithmInfo algorithmInfo = this.Algorithms.Where(x => x.CustomName == bestAlgorithm).Single();
                var algorithm = AppFacade.DI.Container.Resolve<IAlgorithm>(algorithmInfo.AlgorithName);
                algorithm.SetParameters(algorithmInfo.Parameters);
                return SimpleProcessing(image, algorithm);
            }
            if (processingMethod == ProcessingMethod.AlgorithmsFusion)
            {
                return FusionProcessing(image, this.Algorithms, observerData.EvaluationResults);
            }

            throw new NotSupportedException();
        }
 /// <inheritdoc/>
 public override void InitializeLinks()
 {
     base.InitializeLinks();
     sceneRepresentationMethods = new ProcessingMethod[] {  };
 }
Exemplo n.º 21
0
 /// <inheritdoc/>
 public override void InitializeLinks()
 {
     base.InitializeLinks();
     // Define the scene representation methods.
     sceneRepresentationMethods = new ProcessingMethod[] { PMColorTextureArray, PMPerViewMeshesQSTR };
 }
 protected void SetMethod(ProcessingMethod method)
 {
     this.method = method;
 }
Exemplo n.º 23
0
        public static void ProcessLocation(GameLocation location, ProcessingMethod method)
        {
            if (location == null)
            {
                return;
            }

            monitor.Log("VoidshroomTree.ProcessLocation(" + location.Name + ", " + method + ")", StardewModdingAPI.LogLevel.Trace);

            if (processedLocations.Contains(location))
            {
                monitor.Log("VoidshroomTree.ProcessLocation(" + location.Name + ", " + method + "): Already processed this location (infinite recursion?), aborting!", StardewModdingAPI.LogLevel.Warn);
                return;
            }

            processedLocations.Add(location);

            bool itemsToRemove = false;

            if (VoidshroomSpore.IsValidLocation(location))
            {
                String locationName = location.Name.ToString();
                if (method.Equals(ProcessingMethod.Remove))
                {
                    foreach (Vector2 featureSpot in location.terrainFeatures.Keys)
                    {
                        if (location.terrainFeatures[featureSpot] is VoidshroomTree)
                        {
                            StringWriter writer = new StringWriter();

                            if (!ModState.voidshroomTreeLocations.ContainsKey(locationName))
                            {
                                ModState.voidshroomTreeLocations.Add(locationName, new Dictionary <Vector2, VoidshroomtreeSaveData>());
                            }

                            VoidshroomTree tree = (VoidshroomTree)location.terrainFeatures[featureSpot];

                            ModState.voidshroomTreeLocations[locationName].Add(featureSpot, tree.GetSaveData());
                            itemsToRemove = true;
                        }
                    }

                    //data is stored, but if we're removing we need to actually clear stuff out of the list now.
                    if (itemsToRemove)
                    {
                        foreach (Vector2 locationData in ModState.voidshroomTreeLocations[location.Name.ToString()].Keys)
                        {
                            location.terrainFeatures.Remove(locationData);
                        }
                    }
                }
                else if (method.Equals(ProcessingMethod.Restore))
                {
                    if (ModState.voidshroomTreeLocations.ContainsKey(location.Name.ToString()))
                    {
                        foreach (KeyValuePair <Vector2, VoidshroomtreeSaveData> locationData in ModState.voidshroomTreeLocations[location.Name.ToString()])
                        {
                            location.terrainFeatures.Add(locationData.Key, new VoidshroomTree(locationData.Value));
                        }
                    }
                }
            }
        }
Exemplo n.º 24
0
        public override ProcessingMethod ToProcessingMethod()
        {
            ProcessingMethod pm = new ProcessingMethod();

            return(pm);
        }