回复:使用數字編輯框更改列屬性和列公式中的規格限制我發現了幾個問題。
首先,在您的公式列中,您指定了 SE,而在您的數據表中,這些列具有 SD。同樣在公式中,有 n = 2,作為列名稱的一部分引用。我不知道那是從哪裡來的,所以我只是刪除了它,然後創建了列公式。
其次,在 Set Property 起作用之前,Spec Limits 列表中的值需要完全展開。使用 Substitute 將限制值傳遞到列表中是執行此操作的一種方法。
names default to here(1);
dt=new table("example",
// Just some code to create a test tableNew Table( "test",
Add Rows( 10 ),
New Column( "LA",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[4172.33500363846, 4003.0454164522, 5132.51142953179, 4254.16795732848,
4202.75172580535, 3574.47256743923, 3804.96534319603, 3915.70034276743,
4319.47567126139, 4094.59235385003]
),
Set Display Width( 73 )
),
New Column( "UA",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[59507.3313010261, 53541.4856212676, 71149.6162777807, 59578.8338627777,
56630.4195099436, 50900.019384575, 51479.1947874623, 53642.2158390849,
61673.2466126228, 56337.4407587715]
),
Set Display Width( 73 )
),
New Column( "95CIupr SD LA",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[1043.86456772353, 876.888513223994, 1136.27463369684, 970.028749878648,
954.598082854551, 941.489444193772, 846.345601078669, 801.488231630083,
973.917277695926, 934.431089864531]
),
Set Display Width( 81 )
),
New Column( "95CIupr SD UA",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[3068.69934323136, 2352.88265793793, 4263.23712733597, 2974.99490133574,
2684.01670727501, 2048.97811082407, 2128.8899692482, 2298.27809836615,
3264.19929423158, 2671.90896127954]
),
Set Display Width( 83 )
)
);
//define default values for number edit boxes
UA_LSL = 0.8; // numbers with default
UA_USL = 1.2; // number with default
UA_LA_LSL = 0.8; // number with default
UA_LA_USL = 1.2; // number with default
//code for the pop-up window
w = New Window( "SST simulation", <<MODAL> UA_USL | :"UA1-LA1/UA2-LA2"n < UA_LA_LSL | :"UA1-LA1/UA2-LA2"n > UA_LA_USL,
"Outside",
"Inside"
)
),
Set Selected,
Set Display Width( 50 )
);</MODAL>回复:使用數字編輯框更改列屬性和列公式中的規格限制@txnelson
多謝!!! 您的代碼很有魅力! 抱歉,“n=2”部分,這是我原始代碼的遺留問題;)
使用數字編輯框更改列屬性和列公式中的規格限大家好,
我想使用以下腳本在彈出窗口中定義規格上限和下限(LSL 和 USL),並使用這些值來設置規格限的列屬性。 最重要的是,我有一個名為“檢查”的公式列,我想在其中使用公式中的值來檢查行中的值是否在規格範圍內。
代碼正在運行,但沒有為規格限製或公式輸入值。
// Just some code to create a test tableNew Table( "test",
Add Rows( 10 ),
New Column( "LA",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[4172.33500363846, 4003.0454164522, 5132.51142953179, 4254.16795732848,
4202.75172580535, 3574.47256743923, 3804.96534319603, 3915.70034276743,
4319.47567126139, 4094.59235385003]
),
Set Display Width( 73 )
),
New Column( "UA",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[59507.3313010261, 53541.4856212676, 71149.6162777807, 59578.8338627777,
56630.4195099436, 50900.019384575, 51479.1947874623, 53642.2158390849,
61673.2466126228, 56337.4407587715]
),
Set Display Width( 73 )
),
New Column( "95CIupr SD LA",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[1043.86456772353, 876.888513223994, 1136.27463369684, 970.028749878648,
954.598082854551, 941.489444193772, 846.345601078669, 801.488231630083,
973.917277695926, 934.431089864531]
),
Set Display Width( 81 )
),
New Column( "95CIupr SD UA",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[3068.69934323136, 2352.88265793793, 4263.23712733597, 2974.99490133574,
2684.01670727501, 2048.97811082407, 2128.8899692482, 2298.27809836615,
3264.19929423158, 2671.90896127954]
),
Set Display Width( 83 )
)
)
//define default values for number edit boxes
UA_LSL = 0.8; // numbers with default
UA_USL = 1.2; // number with default
UA_LA_LSL = 0.8; // number with default
UA_LA_USL = 1.2; // number with default
//code for the pop-up window
w = New Window( "SST simulation", <<MODAL> UA_USL | :"UA1-LA1/UA2-LA2"n < UA_LA_LSL | :"UA1-LA1/UA2-LA2"n > UA_LA_USL,
"Outside",
"Inside"
)
),
Set Selected,
Set Display Width( 50 )
);
</MODAL>
問候
/馬可
高級統計建模自動化和腳本質量與工藝工程