JSL pour l'importation des limites de spécificationsJ'écris un code JSL pour importer les limites de spécification d'une table de données distincte dans la table de données principale.
// Open the Spec Limits table
specTable = Open("C:\Trending Tool Spec Limits.jmp");
// Open data table for analysis
dataTable = Data Table( "Trending data" );
// Extract Spec Limits and Show Limits from Spec Table
For Each Row(
specName = specTable:Variable[];
LSL = specTable:LSL[];
USL = specTable:USL[];
showLimits = specTable:Show Limits[]; // Assume Show Limits column has 1 for "show" and 0 for "hide"
// Get the corresponding column in the data table
col = Column( dataTable, specName );
// Set the Spec Limits property as an associative array
col << Set Property( "Spec Limits", {LSL( LSL ), USL( USL ), "Show Limits"( showLimits )}
);
);
// Close the Spec Limits table
Close( specTable, NoSave );Le script configure la propriété spec. limit à tous les emplacements corrects indiqués par la table spec. limit, mais il n'importe pas les limites de spécification réelles. Des suggestions ?
Automatisation et scriptsRe: JSL pour l'importation des limites de spécificationsVous pouvez utiliser la plateforme Manage Limit pour cela si vos données sont au bon format
Names Default To Here(1);
dtLimits = New Table("Cities Limits",
Add Rows(4),
New Column("Process", Character, Set Values({"OZONE", "CO", "SO2", "NO"})),
New Column("LSL", Numeric, Set Values([0, 0, 0, 0])),
New Column("Target", Numeric, Set Values([0.2, 15, 0.05, 0.035])),
New Column("USL", Numeric, Set Values([0.4, 30, 0.1, 0.07])),
Set Label Columns(:Process)
);
dt = Open("$SAMPLE_DATA/Cities.jmp");
obj = dt << Manage Limits(
Process Variables(:OZONE, :CO, :SO2, :NO),
Load From Limits Table(dtLimits)
);
obj << Save to Column Properties;
Si vous souhaitez suivre votre itinéraire, vous devez évaluer les limites
Eval(EvalExpr(
col << Set Property("Spec Limits", {LSL(Expr(LSL)), USL(Expr(USL)), Show Limits(Expr(showLimits)}))
));
Re: JSL pour l'importation des limites de spécificationsMerci @jthi , ça marche à merveille !
J'ai mis à jour mon script original pour évaluer les limites.
// Open the Spec Limits table
specTable = Open("C:\Trending Tool Spec Limits.jmp");
// Open data table for analysis
dataTable = Data Table( "Trending data" );
// Extract Spec Limits and Show Limits from Spec Table
For Each Row(
specName = specTable:Variable[];
LSL = specTable:LSL[];
USL = specTable:USL[];
showLimits = specTable:Show Limits[]; // Assume Show Limits column has 1 for "show" and 0 for "hide"
// Get the corresponding column in the data table
col = Column( dataTable, specName );
// Set the Spec Limits property as an associative array
Eval(EvalExpr(
col << Set Property("Spec Limits", {LSL(Expr(LSL)), USL(Expr(USL)), "Show Limits"n(Expr(showLimits)))})
);
);
// Close the Spec Limits table
Close( specTable, NoSave );Re: JSL pour l'importation des limites de spécifications@jthi , lors de l'importation des limites de spécification avec la fonction EvalExpr, les limites sont importées mais ne s'affichent pas comme limites avant d'ouvrir la fenêtre de propriétés spec. limit et d'appuyer sur Appliquer. Savez-vous pourquoi et ce qui peut être fait pour éviter cela ?
Re: JSL pour l'importation des limites de spécificationsÊtes-vous sûr que vos données dans votre tableau des limites de spécifications sont numériques et non des caractères ?
Re: JSL pour l'importation des limites de spécificationsOui, il s'agit d'un nombre. Il a été enregistré à partir de la plateforme Gérer les limites.
Re: JSL pour l'importation des limites de spécificationsAh... maintenant j'ai remarqué que vous utilisez une syntaxe incorrecte pour définir les limites, il vous manque la liste (crochets ondulés)

Names Default To Here(1);
dtLimits = New Table("Cities Limits",
Add Rows(4),
New Column("Variable", Character, Set Values({"OZONE", "CO", "SO2", "NO"})),
New Column("LSL", Numeric, Set Values([0, 0, 0, 0])),
New Column("USL", Numeric, Set Values([0.4, 30, 0.1, 0.07])),
New Column("Show Limits", Numeric, Set Values([1, 1, 1, 1]))
);
dt = Open("$SAMPLE_DATA/Cities.jmp");
For Each Row(dtLimits,
specName = dtLimits:Variable[];
low = dtLimits:LSL[];
high = dtLimits:USL[];
showLimits = dtLimits:Show Limits[];
Eval(Eval Expr(
Column(dt, specName) << Set Property("Spec Limits", {LSL(Expr(low)), USL(Expr(high)), Show Limits(Expr(showLimits))})
));
);
Close(dtLimits, NoSave);Re: JSL pour l'importation des limites de spécificationsParfait, merci ! Ça a fait l'affaire !