다른 jsl 스크립트의 다른 표현식 안에 있는 콤보 상자에서 선택한 값을 가져오는 방법은 무엇입니까?모두들 안녕,
스크립트가 2개 있습니다. ScriptA에는 동적 제한이 있는 이변량 차트를 작성하는 표현식이 있습니다. ScriptB는 기본적으로 사용자에게 x축 및 y축 열 이름을 선택하도록 요청하는 프런트 엔드 애플리케이션 코드입니다. 선택한 열에 대한 출력으로 이변량 차트를 가져오기 위해 ScriptB에서 사용자가 선택한 입력(예: 콤보 상자에서 선택)을 내 ScriptA 표현식 코드에 사용하고 싶습니다.
내 목표는 스크립트 B를 실행할 때 선택한 매개변수에 대한 슬라이더가 있는 그래프를 얻는 것입니다!!
</CODE></PRE>
<PRE><CODE class=" language-jsl">////////////////////////////////////SCRIPT A//////////////////////////////////////
DT = open("data.jmp", invisible);
//Getting the inputs
x = inputParameter << get Selected;
y = response << get Selected;
z = blocking << get Selected;
//Making graphs
myFinalDisplay = expr(
myGbDispObj = dt << Bivariate(
Size( 550, 400 ),
Y( Eval(y) ),
X( Eval(x) ),
Automatic Recalc( 1 ),
Histogram Borders( 1 ),
Summary Statistics( 1 ),
Fit Spline( 2, {Line Color( {212, 73, 88} )} ),
SendToReport(
Dispatch(
{},
"Bivar Plot",
FrameBox,
{Row Legend(
Eval(z),
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 1 ),
Marker Theme( "Solid" ),
Continuous Scale( 1 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
),
Dispatch( {}, "Summary Statistics", OutlineBox, {Close( 1 )} )
)
);
myLimitCol = column(DT, Eval(x));
myLimitMin = colMinimum(myLimitCol); show(myLimitMin);
myLimitMax = colMaximum(myLimitCol); show(myLimitMax);
myTbLo = textBox(Char(round(myLimitMin, 2)) || " (OOC = " || char(0.00, 10, 2) || "%)");
myTbHi = textBox(Char(round(myLimitMax, 2)) || " (OOC = " || char(0.00, 10, 2) || "%)");
mySbDispObj = rangeSliderBox(
myLimitMin,
myLimitMax,
32,
36,
//script
mySelectedLower = mySbDispObj << getLower;
mySelectedUpper = mySbDispObj << getUpper;
myGbDispObj << Dispatch( {}, "1", ScaleBox, {Add Ref Line( mySelectedLower, "Dashed", "blue", "LCL", 4 )} );
myGbDispObj << Dispatch( {}, "1", ScaleBox, {Add Ref Line( mySelectedUpper, "Dashed", "blue", "UCL", 4 )} );
rUpper = dt << Get Rows Where( myLimitCol[] > mySelectedUpper );
OOC_valUpper = (N Items(rUpper) / N rows(dt))*100;
myTbHi << setText(Char(round(mySelectedUpper, 1)) || " (OOC = " || char(OOC_valUpper, 10, 2) || "%)");
rLower = dt << Get Rows Where( myLimitCol[] < mySelectedLower );
OOC_valLower = (N Items(rLower) / N rows(dt))*100;
myTbLo << setText(Char(round(mySelectedLower, 1)) || " (OOC = " || char(OOC_valLower, 10, 2) || "%)");
);
mySbDispObj << Set Width( 275 );
myLayout = vListBox(
myGbDispObj,
hListBox(myTbLo, spacerBox(size(50,0)), myTbHi),
mySbDispObj
);
);
//PLATFORM = newWindow("TEST", vListBox(myFinalDisplay));
////////////////////////////////////SCRIPT A ENDS///////////////////////////////////////////////////////////////////////SCRIPT B///////////////////////////////////////////////////
include("ScriptA");
myStaticLibContainer = vListBox(); //Making a static container
//////Calling the expression "myFinalDisplay" from ScriptA and adding it to the static container//////
sliderGraph = buttonBox("Get Slider Graph", myStaticLibContainer << append(vListBox(myFinalDisplay)));
///Creating user input boxes///
inputParameter = comboBox("Parameter");
response = comboBox("Response");
blocking = comboBox("FAB");
myMainToolPanelBox = panelBox("myMainToolPanelBox",
vListBox(
spacerBox(size(1000,0)),
V List Box(Text Box("Predictor"), inputParameter),
V List Box(Text Box("Response"), response),
V List Box(Text Box("Block By"), blocking)),
H List Box(sliderGraph),
scrollBox(size(1000,550), myStaticLibContainer),
);
myPlatform = newWindow("Loss Curves", myMainToolPanelBox);
/////////////////////////////////SCRIPT B ENDS///////////////////////////////////////////////////
////////////////////////////////////////스크립트 끝////// //////////////////////////////////
데이터 테이블과 스크립트도 첨부했습니다 !!
미리 감사드립니다.
@txnelson
오후로즈
자동화 및 스크립팅대량 맞춤화품질 및 프로세스 엔지니어링Re: 다른 jsl 스크립트의 다른 표현식 안에 있는 콤보 상자에서 선택한 값을 가져오는 방법은 무엇입니까?감사합니다. 이것은 효과가 있었습니다. 변수가 겹쳐지고 있었습니다.
Re: 다른 jsl 스크립트의 다른 표현식 안에 있는 콤보 상자에서 선택한 값을 가져오는 방법은 무엇입니까?스크립트 A를 일부 수정했습니다. 기본적으로 변경 사항은 호출되는 변수가 호출되기 전에 정의되었는지 확인하는 것이었습니다.Clear Symbols()를 추가했습니다. 이는 변수가 주변에 머물지 않도록 하는 데 도움이 됩니다.
Clear Symbols();
DT = open("data.jmp", invisible);
//Making graphs
myFinalDisplay = Expr(
//Getting the inputs
x = inputParameter << get Selected;
y = response << get Selected;
z = blocking << get Selected;
myGbDispObj = dt << Bivariate(
Size( 550, 400 ),
Y( Eval( y ) ),
X( Eval( x ) ),
Automatic Recalc( 1 ),
Histogram Borders( 1 ),
Summary Statistics( 1 ),
Fit Spline( 2, {Line Color( {212, 73, 88} )} ),
SendToReport(
Dispatch(
{},
"Bivar Plot",
FrameBox,
{Row Legend(
Eval( z ),
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 1 ),
Marker Theme( "Solid" ),
Continuous Scale( 1 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
),
Dispatch( {}, "Summary Statistics", OutlineBox, {Close( 1 )} )
)
);
myLimitCol = Column( DT, Eval( x ) );
myLimitMin = Col Minimum( myLimitCol );
Show( myLimitMin );
myLimitMax = Col Maximum( myLimitCol );
Show( myLimitMax );
myTbLo = Text Box( Char( Round( myLimitMin, 2 ) ) || " (OOC = " || Char( 0.00, 10, 2 ) || "%)" );
myTbHi = Text Box( Char( Round( myLimitMax, 2 ) ) || " (OOC = " || Char( 0.00, 10, 2 ) || "%)" );
mySbDispObj = Range Slider Box(
myLimitMin,
myLimitMax,
mySelectedLower,
mySelectedUpper,
//script
//mySelectedLower = mySbDispObj << getLower;
//mySelectedUpper = mySbDispObj << getUpper;
myGbDispObj << Dispatch( {}, "1", ScaleBox, {Add Ref Line( mySelectedLower, "Dashed", "blue", "LCL", 4 )} );
myGbDispObj << Dispatch( {}, "1", ScaleBox, {Add Ref Line( mySelectedUpper, "Dashed", "blue", "UCL", 4 )} );
rUpper = dt << Get Rows Where( myLimitCol[] > mySelectedUpper );
OOC_valUpper = (N Items( rUpper ) / N Rows( dt )) * 100;
myTbHi << setText( Char( Round( mySelectedUpper, 1 ) ) || " (OOC = " || Char( OOC_valUpper, 10, 2 ) || "%)" );
rLower = dt << Get Rows Where( myLimitCol[] < mySelectedLower );
OOC_valLower = (N Items( rLower ) / N Rows( dt )) * 100;
myTbLo << setText( Char( Round( mySelectedLower, 1 ) ) || " (OOC = " || Char( OOC_valLower, 10, 2 ) || "%)" );
);
mySbDispObj << Set Width( 275 );
myLayout = V List Box( myGbDispObj, H List Box( myTbLo, Spacer Box( size( 50, 0 ) ), myTbHi ), mySbDispObj );
);
//PLATFORM = newWindow("TEST", vListBox(myFinalDisplay));
스크립트 B의 유일한 변경 사항은 "응답" 변수에 범위 지정 설명을 추가한 것입니다.스크립트에서 사용하고 있으며 열 이름이기도 합니다.JMP는 점점 혼란스러워지고 있었습니다.따라서 앞에 "::"를 추가하면 JMP는 메모리 변수의 용도에 대한 열이 아닌 메모리 변수를 찾게 됩니다.
myStaticLibContainer = vListBox(); //Making a static container
//////Calling the expression "myFinalDisplay" from ScriptA and adding it to the static container//////
sliderGraph = buttonBox("Get Slider Graph", myStaticLibContainer << append(vListBox(myFinalDisplay)));
///Creating user input boxes///
inputParameter = comboBox("Parameter");
::response = comboBox("Response");
blocking = comboBox("FAB");
myMainToolPanelBox = panelBox("myMainToolPanelBox",
vListBox(
spacerBox(size(1000,0)),
V List Box(Text Box("Predictor"), inputParameter),
V List Box(Text Box("Response"), response),
V List Box(Text Box("Block By"), blocking)),
H List Box(sliderGraph),
scrollBox(size(1000,550), myStaticLibContainer),
);
myPlatform = newWindow("Loss Curves", myMainToolPanelBox);