我知道這是一個非常基本的請求,但我是編碼的新手,在最後的討論中有點難過。
我正在為我們的質量工程師編寫一個插件,以在一個表中獲取數據、拆分錶、從另一個表添加規格和控制限制,然後我希望他們為他們創建控製圖——他們要么只是有一個對話框來選擇列或繪製所有數字/連續列。
問題是名稱和列數每次都會有所不同,因為它取決於產品,我想要一個通用插件。
這是讓我感到困擾的最後一段代碼——我可以讓它使用規定數量的列(在本例中為 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 ) )
)
));