Quintiq file version 2.0
|
#parent: #root
|
Function CalcY
|
{
|
TextBody:
|
[*
|
// Adhi Jan-29-2016 (created)
|
|
rcv := this.RoutingConfiguratorView();
|
top := 0;
|
inputgroupheight :=0;
|
if( not isnull( rcv ) )
|
{
|
//default draw after 1 routngstep distance
|
|
// if there is operationinputgroup, start in the middle of the last input group
|
nrofinputinlastgroup := guard( this.LastOperationInputPISPNode().GroupSize(), 0 );
|
|
nrofinput := this.OperationInputPISPNode( relsize );
|
middleofinput := nrofinputinlastgroup / 2 + maxvalue( nrofinput - nrofinputinlastgroup, 0 );
|
nrofgroup := counter( this, OperationInputPISPNode.OperationInput.OperationInputGroup, g,
|
guard( g.First().IsLead(), false )
|
and not g.IsSystem() );
|
|
if ( middleofinput > 0 )
|
{
|
inputgroupheight := [Number]( middleofinput * rcv.PISPHeight() + nrofgroup * rcv.OperationInputGroupThickness() * 2 ) ;
|
}
|
|
prevstep := this.PreviousStep();
|
if( not isnull( prevstep ) )
|
{
|
// routingstep y based on the maxvalue for previous step height, previous input and ouputput height
|
previousoutputheight := guard( prevstep.LastOperationOutputPISPNode().PISPNodeY() + rcv.PISPHeight(), 0 );
|
previousinputheight := guard( prevstep.LastOperationInputPISPNode().PISPNodeY() + rcv.PISPHeight(), 0 );
|
top := maxvalue( prevstep.Y() + prevstep.Height(), previousinputheight, previousoutputheight ) + rcv.RoutingStepDistance();
|
}
|
else
|
{
|
// at least keep half of routing step distance for the first routing step
|
inputgroupheight := maxvalue( rcv.OperationInputOutputHeight(), inputgroupheight ) + RoutingConfiguratorView::GetConstOffset();
|
}
|
top := top + inputgroupheight;
|
|
this.Y( top );
|
}
|
*]
|
}
|