コード例 #1
0
        private void btn_OK_Click(object sender, RoutedEventArgs e)
        {
            // get the data from the containers
            Point4D                bounds;
            List <double>          zs;
            List <List <Point3D> > functions;
            List <string>          fct_names;

            if (this.MVFactory != null && this.funct_field != null)
            {
                this.funct_field.AssembleFieldInfo(out bounds, out zs, out functions, out fct_names);
                if (this.in_edit_mode && this.to_edit != null)
                {
                    // TODO: save after edit
                    this.MVFactory.UpdateFunction(this.to_edit, this.in_unitX.Text, this.in_unitY.Text, this.in_unitZ.Text,
                                                  bounds, zs, functions, fct_names, this.in_Name.Text);
                    this.in_edit_mode = false;
                }
                else
                {
                    MultiValueFunction created = this.MVFactory.CreateFunction(this.in_unitX.Text, this.in_unitY.Text, this.in_unitZ.Text,
                                                                               bounds, zs, functions, fct_names, this.in_Name.Text);
                }
            }

            this.DialogResult = true;
            this.Close();
        }
コード例 #2
0
        internal void FillInput(MultiValueFunction _to_edit)
        {
            if (_to_edit == null)
            {
                return;
            }
            this.to_edit      = _to_edit;
            this.in_edit_mode = true;

            // general info and structure
            this.in_unitX.Text = _to_edit.MVUnitX;
            this.in_unitY.Text = _to_edit.MVUnitY;
            this.in_unitZ.Text = _to_edit.MVUnitZ;

            int nr_z = (_to_edit.NrZ < 1) ? 1 : _to_edit.NrZ;

            this.in_nrZ.Text = nr_z.ToString();
            BindingExpression in_nrZ_be = this.in_nrZ.GetBindingExpression(TextBox.TextProperty);

            if (in_nrZ_be != null)
            {
                in_nrZ_be.UpdateSource();
            }

            this.in_Name.Text = _to_edit.MVName;

            // fill in the info cells (along the axes) and draw the function graphs (inside each table)
            this.funct_field.FillInGraphInfoFromExisting(_to_edit.MinX, _to_edit.MaxX, _to_edit.MinY, _to_edit.MaxY,
                                                         _to_edit.Zs, _to_edit.Graphs, _to_edit.Graph_Names);
        }
コード例 #3
0
        public void UpdateFunction(MultiValueFunction _to_update,
                                   string _unit_x, string _unit_y, string _unit_z, Point4D _bounds,
                                   List <double> _Zs, List <List <Point3D> > _Functions, List <string> _Fct_Names, string _name)
        {
            if (_to_update == null)
            {
                return;
            }
            if (_bounds == null || _Zs == null || _Functions == null || _Fct_Names == null)
            {
                return;
            }
            if (!this.value_record.Contains(_to_update))
            {
                return;
            }

            // remove old
            bool successful_delete = this.DeleteRecord(_to_update.MVID);

            if (!successful_delete)
            {
                return;
            }

            // create new
            MultiValueFunction created = this.ReconstructFunction(_to_update.MVID, _name, _to_update.MVCanInterpolate, _to_update.MVDisplayVector,
                                                                  _unit_x, _unit_y, _unit_z, _bounds, _Zs, _Functions, _Fct_Names);
        }
コード例 #4
0
 public void OpenEditValueFunctionWindow(ref MultiValueFactory _factory, MultiValueFunction _to_edit)
 {
     this.create_MVFunct_win           = new CreateMVFunctionWindow();
     this.create_MVFunct_win.Loaded   += create_MVFunct_win_Loaded;
     this.create_MVFunct_win.MVFactory = _factory;
     this.function_in_edit_mode        = _to_edit;
     this.create_MVFunct_win.ShowDialog();
 }
コード例 #5
0
        public void OpenShowFunctionWindow(MultiValueFunction _to_show)
        {
            if (_to_show == null)
            {
                return;
            }

            this.show_MVFunction_win      = new ShowMVFunctionWindow();
            this.show_MVFunction_win.Data = _to_show;
            this.show_MVFunction_win.ShowDialog();
        }
コード例 #6
0
 internal MultiValueFunctionND(MultiValueFunction _original)
     : base(_original)
 {
 }