jmp 脚本中的对象引用大家好,JMP社区,
我对 jmp 脚本中的对象引用有疑问。下面的代码运行(JMP pro 17.2),但过程筛选会弹出到另一个窗口,而不是 Make_Win 函数中,按钮也位于该窗口中。我知道如果我复制粘贴
PS = dt << 流程筛选(...);部分在V 列表框内,则行为变得如预期,但代码变得更难阅读且更加混乱。
有没有办法在其他地方定义PS并仅在函数内部包含其引用(如下例所示),或者如何使下面的代码按预期工作。
Cols = {"NPN1", "PNP1", "PNP2", "NPN2", "PNP3", "IVP1", "PNP4", "NPN3", "IVP2", "NPN4", "SIT1", "INM1", "INM2",
"VPM1", "VPM2"};
dt = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
PS = dt << Process Screening(
Y( Eval(Cols)),
Control Chart Type( "Indiv and MR" ),
Minimum Process Length( 1 ),
Use Medians instead of Means( 1 ),
Show tests( 0 ),
Test 1( 0 ),
Cp( 1 ),
Spec Limits( 1 ),
);
Make_Win = Expr(
New Window( "ProcessScreening",
Vlist_box = V List Box(
PS,
MyButton = Button Box( "SelectedRows", SendRows ),
),
),
);
SendRows = Expr(
print_cols = Report( PS )[Table Box( 1 )][String Col Box( 1 )] << getselectedrows();
Print( Report( PS )[Table Box( 1 )][String Col Box( 1 )][print_cols] );
);
Make_Win();谢谢,
JNS
自动化和脚本回复:jmp 脚本中的对象引用您想使用平台(...) 功能。
Scripting Index is in the Help menu脚本索引位于帮助菜单中
当平台启动时,如果平台是在新窗口构造中创建的,它将自身附加到新窗口,如果平台是在显示框构造中创建的,它将自身附加到显示框。否则,它将创建一个新窗口。platform() 函数返回根显示框,而不将其附加到任何内容。过去,我还建议使用 borderbox 包装器来包装 dt<
脚本索引示例像这样更有意义:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
p=Platform(
dt,
Bubble Plot(
X( :weight ),
Y( :age ),
Sizes( :height ),
Title Position( 0, 0 )
)
);
New Window( "Platform example",
H List Box(
Platform(
dt,
Bubble Plot(
X( :weight ),
Y( :height ),
Sizes( :age ),
Title Position( 0, 0 )
)
),
p
)
);
回复:jmp 脚本中的对象引用有很多不同的选择,下面是其中一种
Names Default To Here(1);
Cols = {"NPN1", "PNP1", "PNP2", "NPN2", "PNP3", "IVP1", "PNP4", "NPN3", "IVP2", "NPN4", "SIT1", "INM1", "INM2",
"VPM1", "VPM2"};
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
ps_collector = V List Box(
PS = dt << Process Screening(
Y(Eval(Cols)),
Control Chart Type("Indiv and MR"),
Minimum Process Length(1),
Use Medians instead of Means(1),
Show tests(0),
Test 1(0),
Cp(1),
Spec Limits(1),
)
);
SendRows = Expr(
print_cols = Report(PS)[Table Box(1)][String Col Box(1)] << getselectedrows();
Print(Report(PS)[Table Box(1)][String Col Box(1)][print_cols]);
);
nw = New Window("ProcessScreening", Vlist_box = V List Box(ps_collector),
Button Box("OK", sendrows);
);