Ejemplo n.º 1
0
        private void RestoreDocumentLayersProcess(Layer[] layers, UndoLayer[] data, object[] args)
        {
            int oldWidth  = Width;
            int oldHeight = Height;

            Width  = (int)args[0];
            Height = (int)args[1];
            DocumentSizeChanged?.Invoke(
                this,
                new DocumentSizeChangedEventArgs(oldWidth, oldHeight, Width, Height));
            Layers.Clear();
            Layers.AddRange(layers);
        }
        private void EditorStateHandler(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName != "SelectedProfile")
            {
                return;
            }

            // Update editor enabled state
            NotifyOfPropertyChange(() => EditorEnabled);
            // Update interface
            Layers.Clear();

            if (SelectedProfile != null)
            {
                Layers.AddRange(SelectedProfile.Layers);
            }

            NotifyOfPropertyChange(() => ProfileSelected);
        }
Ejemplo n.º 3
0
        private void UpdateLayerList(LayerModel selectModel)
        {
            // Update the UI
            Layers.Clear();
            if (SelectedProfile != null)
            {
                Layers.AddRange(SelectedProfile.Layers);
            }

            if (selectModel == null)
            {
                return;
            }

            // A small delay to allow the profile list to rebuild
            Task.Factory.StartNew(() =>
            {
                Thread.Sleep(20);
                ProfileViewModel.SelectedLayer = selectModel;
            });
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     Handles refreshing the layer preview
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void PropertyChangeHandler(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "KeyboardPreview")
            {
                return;
            }

            if (e.PropertyName == "SelectedLayer")
            {
                NotifyOfPropertyChange(() => LayerSelected);
                return;
            }

            if (SelectedProfile != null)
            {
                ProfileProvider.AddOrUpdate(SelectedProfile);
            }

            if (e.PropertyName != "SelectedProfile")
            {
                return;
            }

            // Update editor enabled state
            NotifyOfPropertyChange(() => EditorEnabled);
            // Update ProfileViewModel
            ProfileViewModel.SelectedProfile = SelectedProfile;
            // Update interface
            Layers.Clear();
            if (SelectedProfile != null)
            {
                Layers.AddRange(SelectedProfile.Layers);
            }

            NotifyOfPropertyChange(() => ProfileSelected);
        }
Ejemplo n.º 5
0
 public NN_MultiLayerPerceptron(int inputCount, int hiddenLayerCount, int hiddenNeuronCount, int outputCount)
 {
     NetworkType = NetworkTypes.MultiLayerPerceptron;
     for (var i = 0; i < inputCount; i++)
     {
         InputLayer.Neurons.Add(new Neuron());
     }
     for (var i = 0; i < hiddenLayerCount; i++)
     {
         var hiddenLayer = new HiddenLayer();
         for (var j = 0; j < hiddenNeuronCount; j++)
         {
             hiddenLayer.Neurons.Add(new Neuron());
         }
         HiddenLayers.Add(new HiddenLayer());
     }
     for (var i = 0; i < outputCount; i++)
     {
         OutputLayer.Neurons.Add(new Neuron());
     }
     Layers.Add(InputLayer);
     Layers.AddRange(HiddenLayers);
     Layers.Add(OutputLayer);
 }