JSL zum Importieren von SpezifikationsgrenzenIch schreibe einen JSL-Code, um Spezifikationsgrenzen aus einer separaten Datentabelle in die Hauptdatentabelle zu importieren.
// 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 );Das Skript richtet die Spezifikationsgrenzwert-Eigenschaft an allen in der Spezifikationsgrenzwert-Tabelle angegebenen Stellen ein, importiert aber nicht die tatsächlichen Spezifikationsgrenzwerte. Irgendwelche Vorschläge?
Automatisierung und SkriptingBetreff: JSL zum Importieren von SpezifikationsgrenzenSie können hierfür die Manage Limit-Plattform verwenden, wenn Ihre Daten im richtigen Format vorliegen
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;
Wenn Sie Ihren Weg gehen möchten, müssen Sie die Grenzen bewerten
Eval(EvalExpr(
col << Set Property("Spec Limits", {LSL(Expr(LSL)), USL(Expr(USL)), Show Limits(Expr(showLimits)}))
));
Betreff: JSL zum Importieren von SpezifikationsgrenzenDanke @jthi , funktioniert einwandfrei!
Ich habe mein ursprüngliches Skript aktualisiert, um die Grenzen auszuwerten.
// 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 );Betreff: JSL zum Importieren von Spezifikationsgrenzen@jthi , wenn ich die Spezifikationsgrenzen mit der Funktion EvalExpr importiere, werden die Grenzen importiert, aber nicht als Grenzen angezeigt, bevor ich das Eigenschaftenfenster der Spezifikationsgrenze öffne und auf „Übernehmen“ drücke. Wissen Sie, warum und was getan werden kann, um dies zu vermeiden?
Betreff: JSL zum Importieren von SpezifikationsgrenzenSind Sie sicher, dass die Daten in Ihrer Spezifikationsgrenzwerttabelle numerisch und nicht aus Zeichen bestehen?
Betreff: JSL zum Importieren von SpezifikationsgrenzenJa, es ist numerisch. Es wurde von der Manage Limits-Plattform gespeichert.
Betreff: JSL zum Importieren von SpezifikationsgrenzenAh... jetzt ist mir aufgefallen, dass Sie eine falsche Syntax zum Festlegen der Grenzwerte verwenden. Ihnen fehlt die Liste (geschwungene Klammern).

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);Betreff: JSL zum Importieren von SpezifikationsgrenzenPerfekt, danke! Das hat geklappt!