我知道这是一个非常基本的请求,但我是编码的新手,在最后的讨论中有点难过。
我正在为我们的质量工程师编写一个插件,以在一个表中获取数据、拆分表、从另一个表添加规格和控制限制,然后我希望他们为他们创建控制图——他们要么只是有一个对话框来选择列或绘制所有数字/连续列。
问题是名称和列数每次都会有所不同,因为它取决于产品,我想要一个通用插件。
这是让我感到困扰的最后一段代码——我可以让它使用规定数量的列(在本例中为 13),但希望它是任何数字。我知道我需要几行简单的代码,但就是无法理解它。任何帮助表示赞赏。
/* Query the user for X and Y columns */
cdlg = Column Dialog(
yCol = ColList( "Y, Response", MinCol( 1 ), MaxCol( 25 ), Data Type( "Numeric" ) ),
xCol = ColList( "X, Factor", MinCol( 1 ), MaxCol( 1 ) )
);
/* Unload the values from the Column Dialog */
my_Y1 = cdlg["yCol"][1];
my_Y2 = cdlg["yCol"][2];
my_Y3 = cdlg["yCol"][3];
my_Y4 = cdlg["yCol"][4];
my_Y5 = cdlg["yCol"][5];
my_Y6 = cdlg["yCol"][6];
my_Y7 = cdlg["yCol"][7];
my_Y8 = cdlg["yCol"][8];
my_Y9 = cdlg["yCol"][9];
my_Y10 = cdlg["yCol"][10];
my_Y11 = cdlg["yCol"][11];
my_Y12 = cdlg["yCol"][12];
my_Y13 = cdlg["yCol"][13];
my_X = cdlg["xCol"][1];
/* Use the column selections in an analysis */
Control Chart Builder(
Show Two Shewhart Charts( 0 ),
Sort by Row Order( 1 ),
Connect Thru Missing( 1 ),
Variables(
Subgroup(my_X ),
Y(my_Y1,my_Y2,my_Y3,my_Y4,my_Y5,my_Y6,my_Y7,my_Y8,my_Y9,my_Y10,my_Y11,my_Y12,my_Y13)),
Chart(
Points( Statistic( "Individual" ) ),
Limits( Sigma( "Levey Jennings" ) ),
Process Capability Analysis(
Within Sigma Capability( 0 ),
Histogram( 1, Show Within Sigma Density( 0 ) )
)
));