259 self.Description = None |
259 self.Description = None |
260 if self.ExecutionControl: |
260 if self.ExecutionControl: |
261 inputs.insert(0, ("EN","BOOL","none")) |
261 inputs.insert(0, ("EN","BOOL","none")) |
262 outputs.insert(0, ("ENO","BOOL","none")) |
262 outputs.insert(0, ("ENO","BOOL","none")) |
263 self.Pen = MiterPen(self.Colour) |
263 self.Pen = MiterPen(self.Colour) |
264 self.Clean() |
264 |
265 # Extract the inputs properties and create the corresponding connector |
265 # Extract the inputs properties and create or modify the corresponding connector |
266 self.Inputs = [] |
266 for idx, (input_name, input_type, input_modifier) in enumerate(inputs): |
267 for input_name, input_type, input_modifier in inputs: |
267 if idx < len(self.Inputs): |
268 connector = Connector(self, input_name, input_type, wx.Point(0, 0), WEST, onlyone = True) |
268 connector = self.Inputs[idx] |
|
269 connector.SetName(input_name) |
|
270 connector.SetType(input_type) |
|
271 else: |
|
272 connector = Connector(self, input_name, input_type, wx.Point(0, 0), WEST, onlyone = True) |
|
273 self.Inputs.append(connector) |
269 if input_modifier == "negated": |
274 if input_modifier == "negated": |
270 connector.SetNegated(True) |
275 connector.SetNegated(True) |
271 elif input_modifier != "none": |
276 elif input_modifier != "none": |
272 connector.SetEdge(input_modifier) |
277 connector.SetEdge(input_modifier) |
273 self.Inputs.append(connector) |
278 for i in xrange(idx + 1, len(self.Inputs)): |
274 # Extract the outputs properties and create the corresponding connector |
279 self.Inputs[i].UnConnect(delete = True) |
275 self.Outputs = [] |
280 self.Inputs = self.Inputs[:idx + 1] |
276 for output_name, output_type, output_modifier in outputs: |
281 |
277 connector = Connector(self, output_name, output_type, wx.Point(0, 0), EAST) |
282 # Extract the outputs properties and create or modify the corresponding connector |
|
283 for idx, (output_name, output_type, output_modifier) in enumerate(outputs): |
|
284 if idx < len(self.Outputs): |
|
285 connector = self.Outputs[idx] |
|
286 connector.SetName(output_name) |
|
287 connector.SetType(output_type) |
|
288 else: |
|
289 connector = Connector(self, output_name, output_type, wx.Point(0, 0), EAST) |
|
290 self.Outputs.append(connector) |
278 if output_modifier == "negated": |
291 if output_modifier == "negated": |
279 connector.SetNegated(True) |
292 connector.SetNegated(True) |
280 elif output_modifier != "none": |
293 elif output_modifier != "none": |
281 connector.SetEdge(output_modifier) |
294 connector.SetEdge(output_modifier) |
282 self.Outputs.append(connector) |
295 for i in xrange(idx + 1, len(self.Outputs)): |
|
296 self.Outputs[i].UnConnect(delete = True) |
|
297 self.Outputs = self.Outputs[:idx + 1] |
|
298 |
283 self.RefreshMinSize() |
299 self.RefreshMinSize() |
284 self.RefreshConnectors() |
300 self.RefreshConnectors() |
285 self.RefreshBoundingBox() |
301 self.RefreshBoundingBox() |
286 |
302 |
287 # Returns the block type |
303 # Returns the block type |