Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11539


Ignore:
Timestamp:
11/12/14 03:02:33 (10 years ago)
Author:
swagner
Message:

#2205: Small UI tweaks and bug fixes

Location:
branches/OptimizationNetworks
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/MessagePortView.Designer.cs

    r11538 r11539  
    180180      // lastMessageView
    181181      //
     182      this.lastMessageView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     183            | System.Windows.Forms.AnchorStyles.Left)
     184            | System.Windows.Forms.AnchorStyles.Right)));
    182185      this.lastMessageView.Caption = "Message View";
    183186      this.lastMessageView.Content = null;
    184       this.lastMessageView.Dock = System.Windows.Forms.DockStyle.Fill;
    185       this.lastMessageView.Location = new System.Drawing.Point(3, 16);
     187      this.lastMessageView.Location = new System.Drawing.Point(6, 19);
    186188      this.lastMessageView.Name = "lastMessageView";
    187189      this.lastMessageView.ReadOnly = true;
    188       this.lastMessageView.Size = new System.Drawing.Size(639, 194);
     190      this.lastMessageView.Size = new System.Drawing.Size(633, 188);
    189191      this.lastMessageView.TabIndex = 0;
    190192      //
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/MessagePortView.cs

    r11538 r11539  
    8080      clearConnectedPortButton.Enabled = Content != null && Content.ConnectedPort != null && !ReadOnly;
    8181      portParameterCollectionView.Enabled = Content != null && !ReadOnly;
    82       cloneParametersFromPortButton.Enabled = Content != null && Content.ConnectedPort != null && !ReadOnly;
     82      cloneParametersFromPortButton.Enabled = Content != null && !Content.Parameters.IsReadOnly && !ReadOnly;
    8383      lastMessageView.Enabled = Content != null && !ReadOnly;
    8484    }
     
    8989      else {
    9090        clearConnectedPortButton.Enabled = Content.ConnectedPort != null && !ReadOnly;
    91         cloneParametersFromPortButton.Enabled = Content.ConnectedPort != null && !ReadOnly;
    9291        connectedPortView.Content = Content.ConnectedPort;
    9392      }
     
    163162      networkItemSelectorDialog.NetworkItemSelector.Configure(
    164163        root,
    165         null,
     164        Content,
    166165        typeof(IParameterizedPort)
    167166      );
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/UserDefinedMessagePortView.cs

    r11530 r11539  
    4141      portParameterCollectionView.Content = Content == null ? null : Content.Parameters;
    4242    }
     43
     44    protected override void SetEnabledStateOfControls() {
     45      base.SetEnabledStateOfControls();
     46      cloneParametersFromPortButton.Enabled = Content != null && !ReadOnly;
     47    }
    4348  }
    4449}
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/MessagePort.cs

    r11538 r11539  
    132132      var message = new Message();
    133133
    134       // collect parameters from local port
    135       message.Values.AddRange(Parameters.Select(p => p.CreateMessageValue()));
     134      // collect output parameters from local port
     135      message.Values.AddRange(
     136        Parameters
     137          .Where(p => p.Type.HasFlag(PortParameterType.Output))
     138          .Select(p => p.CreateMessageValue())
     139      );
    136140
    137141      // collect remaining parameters from connected port
     
    144148      }
    145149
     150      // collect remaining input parameters from local port
     151      message.Values.AddRange(
     152        Parameters
     153          .Where(p => p.Type.HasFlag(PortParameterType.Input) && !message.Values.ContainsKey(p.Name))
     154          .Select(p => p.CreateMessageValue())
     155      );
     156
    146157      return message;
    147158    }
     
    151162    public void SendMessage(IMessage message, CancellationToken token) {
    152163      if (!PortConnectionValid) throw new InvalidOperationException("Port connection is not valid");
     164      if (ConnectedPort != null) ConnectedPort.ReceiveMessage(message, token);
    153165      LastMessage = message;
    154       if (ConnectedPort != null) ConnectedPort.ReceiveMessage(message, token);
    155166      OnMessageSent(message, token);
    156167    }
Note: See TracChangeset for help on using the changeset viewer.