Estoy usando una función para crear múltiples trazados basados en diferentes condiciones. A veces me pide que excluya filas (valores extremos) para ajustar mejor el gráfico al presentarlo a nuestros clientes. Intenté usar un indicador global para establecer si ese cuadro debe eliminarse o no, pero como descubrí ayer hay posibilidades cuando la bandera será = 1, sin embargo, la condición de prueba no tiene Textbox (5).
El cuadro de texto obtiene automáticamente su propia diapositiva, así que necesito eliminarla.
Cualquier ayuda sería apreciada
GraphPlot = Function(
{dt, Yaxis },
Eval(
Substitute(
Expr(
gb = dt << Graph Builder(
Invisible,
Where( dt:chnl == chan & dt:astate == attn & dt:pstate == phas ),
// Size( 1440, 1040 ),
show control panel( 0 ),
show legend( 0 ),
Subtitle Alignment( "Left" ),
Show Subtitle( 1 ),
Variables(
Y( Eval( Yaxis ) ),
X( :FREQ_GHz ),
Group X( :wafer_number ),
Overlay( :RowCol )
),
Elements( Smoother( X, Y, legend( 19 ), lambda( 0.0001 ) ) ),
)
),
Expr( plot ), plot,
Expr( chan ), chan,
Expr( attn ), attn,
Expr( phas ), phas,
Expr( mode ), mode,
Expr( tst ), tst
)
);
Report( gb )[Axisbox( 1 )] << Min( 7 ) << Inc( 1 ) << Add Ref Line( 8, "Solid", "Black", "m106", 1 ) << Add Ref Line( 17.5, "Solid", "Black", "m105", 1 ) << Label Row( Show Major Grid( 1 ) );
Report( gb )[Axisbox( 2 )] << Inc( 2 ) << Minor Ticks( 1 ) << Label Row( Show Major Grid( 1 ) );
(gb << Top Report)[Text Box( 1 )] << Delete;
// This may or may not happen on every condition
// I tried creating a flag when i actually exclude parts however
// The flag is global and not specific on a test condition
If( excludeFlag == 1, Report( gb )[Text Box( 5 )] << Delete );
Report( gb )[Framebox( 1 )] << Frame Size( 781, 655 );
Report( gb )[Outline Box( 1 )] << Set Title( Eval Insert( WaferListSQLString || " ^tst^" ) );
Report( gb )[Text Edit Box( 2 )] << Set Font Size( 15 ) << Set Font Style( "Bold" );
Report( gb )[Text Edit Box( 1 )] << Set Font Size( 25 ) << Set Font Style( "Bold" );
);No estoy exactamente seguro de cuál es tu pregunta. Pero si está diciendo que a veces el cuadro de texto (5) no está allí cuando ha detectado un excludeFlag == 1 y que está causando un problema, puede resolverlo utilizando una función Try ()
If( excludeFlag == 1, Try( Report( gb )[Text Box( 5 )] << Delete) );
Si no está seguro de si la eliminación será exitosa pero en su lugar causa una condición de error, puede usarla como argumento para la función Try (). Es posible que no haya objetos de cuadro de texto o que haya más de uno. Verificaría el texto si encuentra el primero para asegurarse de que es el que desea eliminar.
Try(
text = (gb << Top Report)[Text Box( 1 )] << Get Text;
If( Contains( text, "what I am looking for" ),
(gb << Top Report)[Text Box( 1 )] << Delete;
),
Throw( "No text box found." );
);