回复:使用数字编辑框更改列属性和列公式中的规格限制我发现了几个问题。
首先,在您的公式列中,您指定了 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>
问候
/马可
高级统计建模自动化和脚本质量与工艺工程