Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/11/20 17:35:28 (5 years ago)
Author:
dpiringe
Message:

#3026:

  • set read-only to false for name input (in JsonItemBaseControl)
  • result items now can be selected/deselected in export dialog
  • removed metadata.problem property and renamed metadata.optimizer property to TemplateName in json template
  • fixed bug with wrong description for result items in AlgorithmConverter
  • refactored a lot of code in JCGenerator and added the need for a directory path (location for the template files)
  • fixed a null reference bug in JsonItemValidator (cannot try to iterate through possible null referenced collections)
Location:
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/JsonItemBaseControl.Designer.cs

    r17433 r17435  
    7979      this.textBoxName.Location = new System.Drawing.Point(92, 23);
    8080      this.textBoxName.Name = "textBoxName";
    81       this.textBoxName.ReadOnly = true;
    8281      this.textBoxName.Size = new System.Drawing.Size(404, 20);
    8382      this.textBoxName.TabIndex = 10;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.Designer.cs

    r17406 r17435  
    3131      this.panel = new System.Windows.Forms.Panel();
    3232      this.jsonItemBindingSource = new System.Windows.Forms.BindingSource(this.components);
     33      this.resultItems = new System.Windows.Forms.CheckedListBox();
     34      this.groupBox2 = new System.Windows.Forms.GroupBox();
     35      this.groupBox3 = new System.Windows.Forms.GroupBox();
     36      this.splitContainer1 = new System.Windows.Forms.SplitContainer();
     37      this.splitContainer2 = new System.Windows.Forms.SplitContainer();
    3338      this.groupBoxDetails.SuspendLayout();
    3439      ((System.ComponentModel.ISupportInitialize)(this.jsonItemBindingSource)).BeginInit();
     40      this.groupBox2.SuspendLayout();
     41      this.groupBox3.SuspendLayout();
     42      ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
     43      this.splitContainer1.Panel1.SuspendLayout();
     44      this.splitContainer1.Panel2.SuspendLayout();
     45      this.splitContainer1.SuspendLayout();
     46      ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
     47      this.splitContainer2.Panel1.SuspendLayout();
     48      this.splitContainer2.Panel2.SuspendLayout();
     49      this.splitContainer2.SuspendLayout();
    3550      this.SuspendLayout();
    3651      //
     
    4358      // exportButton
    4459      //
    45       this.exportButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    46       this.exportButton.Location = new System.Drawing.Point(801, 687);
     60      this.exportButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
     61            | System.Windows.Forms.AnchorStyles.Right)));
     62      this.exportButton.Location = new System.Drawing.Point(3, 570);
    4763      this.exportButton.Name = "exportButton";
    48       this.exportButton.Size = new System.Drawing.Size(121, 34);
     64      this.exportButton.Size = new System.Drawing.Size(422, 29);
    4965      this.exportButton.TabIndex = 1;
    5066      this.exportButton.Text = "Export";
     
    5470      // treeView
    5571      //
    56       this.treeView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    57             | System.Windows.Forms.AnchorStyles.Left)));
    58       this.treeView.Location = new System.Drawing.Point(12, 12);
     72      this.treeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     73            | System.Windows.Forms.AnchorStyles.Left)
     74            | System.Windows.Forms.AnchorStyles.Right)));
     75      this.treeView.Location = new System.Drawing.Point(6, 19);
    5976      this.treeView.Name = "treeView";
    60       this.treeView.Size = new System.Drawing.Size(342, 669);
     77      this.treeView.Size = new System.Drawing.Size(353, 327);
    6178      this.treeView.TabIndex = 3;
    6279      this.treeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView_AfterSelect);
     
    6885            | System.Windows.Forms.AnchorStyles.Right)));
    6986      this.groupBoxDetails.Controls.Add(this.panel);
    70       this.groupBoxDetails.Location = new System.Drawing.Point(360, 12);
     87      this.groupBoxDetails.Location = new System.Drawing.Point(3, 3);
    7188      this.groupBoxDetails.Name = "groupBoxDetails";
    72       this.groupBoxDetails.Size = new System.Drawing.Size(562, 669);
     89      this.groupBoxDetails.Size = new System.Drawing.Size(422, 561);
    7390      this.groupBoxDetails.TabIndex = 4;
    7491      this.groupBoxDetails.TabStop = false;
     
    83100      this.panel.Location = new System.Drawing.Point(7, 20);
    84101      this.panel.Name = "panel";
    85       this.panel.Size = new System.Drawing.Size(549, 643);
     102      this.panel.Size = new System.Drawing.Size(409, 535);
    86103      this.panel.TabIndex = 0;
    87104      //
     
    89106      //
    90107      this.jsonItemBindingSource.DataSource = typeof(HeuristicLab.JsonInterface.IJsonItem);
     108      //
     109      // resultItems
     110      //
     111      this.resultItems.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     112            | System.Windows.Forms.AnchorStyles.Left)
     113            | System.Windows.Forms.AnchorStyles.Right)));
     114      this.resultItems.FormattingEnabled = true;
     115      this.resultItems.Location = new System.Drawing.Point(6, 19);
     116      this.resultItems.Name = "resultItems";
     117      this.resultItems.Size = new System.Drawing.Size(353, 199);
     118      this.resultItems.TabIndex = 5;
     119      //
     120      // groupBox2
     121      //
     122      this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     123            | System.Windows.Forms.AnchorStyles.Left)
     124            | System.Windows.Forms.AnchorStyles.Right)));
     125      this.groupBox2.Controls.Add(this.treeView);
     126      this.groupBox2.Location = new System.Drawing.Point(3, 3);
     127      this.groupBox2.Name = "groupBox2";
     128      this.groupBox2.Size = new System.Drawing.Size(365, 352);
     129      this.groupBox2.TabIndex = 6;
     130      this.groupBox2.TabStop = false;
     131      this.groupBox2.Text = "Elements";
     132      //
     133      // groupBox3
     134      //
     135      this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     136            | System.Windows.Forms.AnchorStyles.Left)
     137            | System.Windows.Forms.AnchorStyles.Right)));
     138      this.groupBox3.Controls.Add(this.resultItems);
     139      this.groupBox3.Location = new System.Drawing.Point(3, 3);
     140      this.groupBox3.Name = "groupBox3";
     141      this.groupBox3.Size = new System.Drawing.Size(365, 231);
     142      this.groupBox3.TabIndex = 7;
     143      this.groupBox3.TabStop = false;
     144      this.groupBox3.Text = "Result Elements";
     145      //
     146      // splitContainer1
     147      //
     148      this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     149            | System.Windows.Forms.AnchorStyles.Left)
     150            | System.Windows.Forms.AnchorStyles.Right)));
     151      this.splitContainer1.Location = new System.Drawing.Point(3, 3);
     152      this.splitContainer1.Name = "splitContainer1";
     153      this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
     154      //
     155      // splitContainer1.Panel1
     156      //
     157      this.splitContainer1.Panel1.Controls.Add(this.groupBox2);
     158      //
     159      // splitContainer1.Panel2
     160      //
     161      this.splitContainer1.Panel2.Controls.Add(this.groupBox3);
     162      this.splitContainer1.Size = new System.Drawing.Size(371, 599);
     163      this.splitContainer1.SplitterDistance = 358;
     164      this.splitContainer1.TabIndex = 8;
     165      //
     166      // splitContainer2
     167      //
     168      this.splitContainer2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     169            | System.Windows.Forms.AnchorStyles.Left)
     170            | System.Windows.Forms.AnchorStyles.Right)));
     171      this.splitContainer2.Location = new System.Drawing.Point(12, 12);
     172      this.splitContainer2.Name = "splitContainer2";
     173      //
     174      // splitContainer2.Panel1
     175      //
     176      this.splitContainer2.Panel1.Controls.Add(this.splitContainer1);
     177      //
     178      // splitContainer2.Panel2
     179      //
     180      this.splitContainer2.Panel2.Controls.Add(this.groupBoxDetails);
     181      this.splitContainer2.Panel2.Controls.Add(this.exportButton);
     182      this.splitContainer2.Size = new System.Drawing.Size(809, 605);
     183      this.splitContainer2.SplitterDistance = 377;
     184      this.splitContainer2.TabIndex = 9;
    91185      //
    92186      // ExportJsonDialog
     
    94188      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    95189      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    96       this.ClientSize = new System.Drawing.Size(934, 733);
    97       this.Controls.Add(this.groupBoxDetails);
    98       this.Controls.Add(this.treeView);
    99       this.Controls.Add(this.exportButton);
     190      this.ClientSize = new System.Drawing.Size(833, 629);
     191      this.Controls.Add(this.splitContainer2);
    100192      this.Name = "ExportJsonDialog";
    101193      this.RightToLeft = System.Windows.Forms.RightToLeft.No;
     
    104196      this.groupBoxDetails.ResumeLayout(false);
    105197      ((System.ComponentModel.ISupportInitialize)(this.jsonItemBindingSource)).EndInit();
     198      this.groupBox2.ResumeLayout(false);
     199      this.groupBox3.ResumeLayout(false);
     200      this.splitContainer1.Panel1.ResumeLayout(false);
     201      this.splitContainer1.Panel2.ResumeLayout(false);
     202      ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
     203      this.splitContainer1.ResumeLayout(false);
     204      this.splitContainer2.Panel1.ResumeLayout(false);
     205      this.splitContainer2.Panel2.ResumeLayout(false);
     206      ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
     207      this.splitContainer2.ResumeLayout(false);
    106208      this.ResumeLayout(false);
    107209
     
    117219    private System.Windows.Forms.GroupBox groupBoxDetails;
    118220    private System.Windows.Forms.Panel panel;
     221    private System.Windows.Forms.CheckedListBox resultItems;
     222    private System.Windows.Forms.GroupBox groupBox2;
     223    private System.Windows.Forms.GroupBox groupBox3;
     224    private System.Windows.Forms.SplitContainer splitContainer1;
     225    private System.Windows.Forms.SplitContainer splitContainer2;
    119226  }
    120227}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.cs

    r17432 r17435  
    2222    private IList<JsonItemVMBase> VMs { get; set; }
    2323    private JCGenerator Generator { get; set; } = new JCGenerator();
     24    private IDictionary<string, IJsonItem> ResultItems = new Dictionary<string, IJsonItem>();
    2425
    2526    private IContent content;
     
    3132        VMs = new List<JsonItemVMBase>();
    3233        treeView.Nodes.Clear();
     34        ResultItems.Clear();
    3335       
    3436        Optimizer = content as IOptimizer;
    3537        Root = JsonItemConverter.Extract(Optimizer);
    3638        TreeNode parent = new TreeNode(Root.Name);
    37      
     39
    3840        BuildTreeNode(parent, Root);
    3941        treeView.Nodes.Add(parent);
     
    6365          x.Item.Parent.Children.Remove(x.Item);
    6466        }
     67      }
     68
     69      foreach(var x in ResultItems.Values) {
     70        x.Parent.Children.Remove(x);
     71      }
     72
     73      foreach(var x in resultItems.CheckedItems) {
     74        if(ResultItems.TryGetValue((string)x, out IJsonItem item)) {
     75          Root.AddChildren(item);
     76        }
     77      }
     78
     79      IList<IJsonItem> faultyItems = new List<IJsonItem>();
     80      if(!Root.GetValidator().Validate(ref faultyItems)) {
     81        //print faultyItems
    6582      }
    6683
     
    95112            if (IsDrawableItem(c)) {
    96113              if (c is ResultItem) {
    97 
     114                resultItems.Items.Add(c.Name, true);
     115                ResultItems.Add(c.Name, c);
    98116              } else {
    99117                TreeNode childNode = new TreeNode(c.Name);
Note: See TracChangeset for help on using the changeset viewer.