- Timestamp:
- 11/12/14 03:02:33 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/MessagePort.cs
r11538 r11539 132 132 var message = new Message(); 133 133 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 ); 136 140 137 141 // collect remaining parameters from connected port … … 144 148 } 145 149 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 146 157 return message; 147 158 } … … 151 162 public void SendMessage(IMessage message, CancellationToken token) { 152 163 if (!PortConnectionValid) throw new InvalidOperationException("Port connection is not valid"); 164 if (ConnectedPort != null) ConnectedPort.ReceiveMessage(message, token); 153 165 LastMessage = message; 154 if (ConnectedPort != null) ConnectedPort.ReceiveMessage(message, token);155 166 OnMessageSent(message, token); 156 167 }
Note: See TracChangeset
for help on using the changeset viewer.