| Quintiq file version 2.0 | 
| #parent: #root | 
| Function CalcX | 
| { | 
|   TextBody: | 
|   [* | 
|     rcv := this.RoutingConfiguratorView(); | 
|     routing := guard( this.Routing(), null( Routing ) ); | 
|     step := guard( this.Routing().FirstStep(), null( RoutingStep ) ); | 
|      | 
|     value := 0; | 
|      | 
|     if( not isnull( rcv ) and not isnull( routing ) and not isnull( step ) ) | 
|     { | 
|       x := 0; | 
|      | 
|       // An input PISPNode | 
|       if( not isnull( this.AsInputPISPNodeInRouting() ) ) | 
|       { | 
|         x := this.OffSetX(); | 
|       } | 
|       // An output PISPNode | 
|       else if( not isnull( this.AsOutputPISPNodeInRouting() ) ) | 
|       { | 
|         x := this.Routing().MinXOutputPISP(); | 
|       } | 
|      | 
|       value := maxvalue( x, 0 ); | 
|     } | 
|      | 
|     this.X( value ); | 
|   *] | 
| } |