May I ask you a question? I adapted several operating units I needed according to the source code of the CPP Mixer Splitter example provided by you. The first few were ok.I've also tried to add some of my own methods to the unit operation. But when I first tried to adapt an operating unit with more than 2 feed products (the unit operation in the figure is 3), the following bugs occurred. To connect the stream to the second product port,drag the material stream to the product port of the unit operation, select the port name, and the material stream origin somehow flies away. Although the Aspen Plus interface shows the connection flow, the actual operation is equivalent to the port having no connection flow. In the codes, If you check port number normally, you will report a warning when you run.And the results summary is the case of “esle(not numberOfConnectedProductPorts==2 or numberOfConnectedProductPorts==3) ”.if you verify one less, you also will report a warning when you run. And the results summary is the case of “numberOfConnectedProductPorts==2”
I can't find where the number of product port is limited in the codes.I need some help.
Code: Select all
for (i=2;i<5;i++)
{port=(MaterialPortObject *)portCollection->items[i];
if (port->IsConnected()) numberOfConnectedProductPorts++;
}