public void ImportBigTableWNamesFromFile(string _file_path, ref MultiValueFactory _factory, int _nr_data_rows = 0)
        {
            if (string.IsNullOrEmpty(_file_path) || _factory == null)
            {
                return;
            }
            int nr_rows_to_read = (_nr_data_rows == 0) ? ExcelStandardImporter.MAX_NR_TABLE_ENTRIES : _nr_data_rows + ExcelStandardImporter.ROW_OFFSET;

            List <List <string> > raw_record = this.ImportFromFile(_file_path, ExcelStandardImporter.TABLE_NAME,
                                                                   nr_rows_to_read);

            List <string>         names, units;
            List <List <double> > values;
            List <string>         row_names;

            ExcelStandardImporter.ParseDataNamedRows(raw_record, ExcelStandardImporter.MAX_NR_TABLE_ENTRIES,
                                                     out names, out units, out values, out row_names);

            // get the table name
            string[] file_path_comps = _file_path.Split(new string[] { "\\", "/", "." }, StringSplitOptions.RemoveEmptyEntries);
            int      nr_comps        = file_path_comps.Length;
            string   table_name      = "table";

            if (nr_comps > 1)
            {
                table_name = file_path_comps[nr_comps - 2];
            }
            else if (nr_comps > 0)
            {
                table_name = file_path_comps[0];
            }

            _factory.CreateBigTable(table_name, names, units, values, row_names);
        }
 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();
 }
 public void OpenEditValueTableWindow(ref MultiValueFactory _factory, MultiValueTable _to_edit)
 {
     this.create_MVTable_win           = new CreateMVTableWindow();
     this.create_MVTable_win.Loaded   += create_MVTable_win_Loaded;
     this.create_MVTable_win.MVFactory = _factory;
     this.value_table_in_edit_mode     = _to_edit;
     this.create_MVTable_win.ShowDialog();
 }
        public DXFDistributedDecoder(MultiValueFactory _mv_factory, ParameterFactory _p_factory, ComponentFactory _comp_factory,
                                     string _file_name, ComponentManagerType _user)
        {
            this.MV_Factory   = _mv_factory;
            this.P_Factory    = _p_factory;
            this.COMP_Factory = _comp_factory;

            this.SetFileManagementContent(_file_name, _user);
            this.nr_locks_record = new List <int>(ComponentUtils.MANAGER_TYPE_OPENING_SIGNATURE_NONE);
        }
        public DXFDecoder(MultiValueFactory _mv_factory)
        {
            this.N = new NumberFormatInfo();
            N.NumberDecimalSeparator = ".";
            N.NumberGroupSeparator   = " ";
            this.MV_Factory          = _mv_factory;

            this.for_deferred_loading   = new Dictionary <DXFEntity, bool>();
            this.for_deferred_addEntity = new Dictionary <DXFEntity, bool>();
        }
Example #6
0
        private void InitContent()
        {
            // data managers
            this.COMPFactory     = new ComponentFactory(ComponentManagerType.ADMINISTRATOR);
            this.PFactory        = new ParameterFactory();
            this.MVFactory       = new MultiValueFactory();
            this.MarkedForImport = new List <Component>();

            // commands: main function
            this.btn_import.Command = new RelayCommand((x) => ImportComponentsFromDXF(),
                                                       (x) => CanExecute_ImportComponentsFromDXF());
            this.btn_import_MV.Command = new RelayCommand((x) => ImportMultiValueFiledsFromDXF(),
                                                          (x) => CanExecute_ImportMultiValueFiledsFromDXF());
            this.btn_OK.Command = new RelayCommand((x) => PepareToExportToProject(),
                                                   (x) => CanExecute_PepareToExportToProject());
            // commands: display
            this.btn_unfold_all.Command = new RelayCommand((x) =>
            {
                this.COMPFactory.ExpandAll();
                this.tve_components.ItemsSource = new List <ParameterStructure.Component.Component>(this.COMPFactory.ComponentRecord);
            });
            this.btn_unfold_selected.Command = new RelayCommand((x) =>
            {
                Component selcomp = this.tve_components.SelectedItem_ as Component;
                this.COMPFactory.ExpandComp(selcomp);
                this.tve_components.ItemsSource = new List <ParameterStructure.Component.Component>(this.COMPFactory.ComponentRecord);
            },
                                                                (x) => this.tve_components.SelectedItem_ != null);
            this.btn_collapse.Command = new RelayCommand((x) =>
            {
                this.COMPFactory.CollapseAll();
                this.tve_components.ItemsSource = new List <ParameterStructure.Component.Component>(this.COMPFactory.ComponentRecord);
            });
            this.btn_mark_all.Command = new RelayCommand((x) => this.COMPFactory.MarkAll(true),
                                                         (x) => this.COMPFactory != null && this.COMPFactory.ComponentRecord.Count > 0);
            this.btn_unmarkall.Command = new RelayCommand((x) => this.COMPFactory.MarkAll(false),
                                                          (x) => this.COMPFactory != null && this.COMPFactory.ComponentRecord.Count > 0);
            this.btn_mark_w_refs.Command = new RelayCommand((x) =>
            {
                Component selcomp = this.tve_components.SelectedItem_ as Component;
                this.COMPFactory.MarkWReferences(selcomp);
            },
                                                            (x) => this.COMPFactory != null && this.tve_components.SelectedItem_ != null);
        }
 public void OpenCreateValueFunctionWindow(ref MultiValueFactory _factory)
 {
     this.create_MVFunct_win           = new CreateMVFunctionWindow();
     this.create_MVFunct_win.MVFactory = _factory;
     this.create_MVFunct_win.ShowDialog();
 }