Ejemplo n.º 1
0
        private FormulaSlot AddSlot(int K, int N)
        {
            FormulaSlot slot = new FormulaSlot(this, K, N, elemPanel);

            Formulas.Add(slot);
            DependencyNode newNode = new DependencyNode($"P({K},{N})", slot.Input);

            newNode.ValueChanged += (value) => slot.Result.Text = ComplexUtils.ToNiceString(value);
            Dependencies.Add(newNode);
            return(slot);
        }
Ejemplo n.º 2
0
        public void Set(Complex[,] P)
        {
            int fullSize = P.GetLength(0);
            int size     = (fullSize - 1) / 2;

            sizeInput.Text = size.ToString(); // cause Update()
            if (Size != size)
            {
                Update(size);
            }
            foreach (UIElement elem in matrixPanel.Children)
            {
                int i = Grid.GetRow(elem) - 1;
                int j = Grid.GetColumn(elem) - 1;
                if (elem is TextBox &&
                    0 <= i && i < fullSize &&
                    0 <= j && j < fullSize)
                {
                    ((TextBox)elem).Text = ComplexUtils.ToNiceString(P[i, j]);
                }
            }
            Filter = new Filter(P);
        }