private void generateDevice_btn_Click(object sender, EventArgs e) { /* * Arguments. * char* name, * double ref, int N, double padW, double padL, double padSpace, * double centeredSquarePad, * double cornerSquarePads_REF, double cornerSquarePads_DIM * * Definition for centeredSquarePad_DIM: * <=0: None. * >0: give me a centered squared pad with the dim. * * Definition for cornerSquarePads_DIM: * <=0: None. * >0, <10000: give me those corner pads with dim and ref given. * >=10000: give me those corner pads with dim and ref equal to the lateral pads. * * As is, how many args is this. This is 8 args. * * If we used rectangular instead of square, what would we have. */ //Under "Corner Pads": //If "Copy Lateral Pads" is checked: //cornerSquarePads_REF then follows REF_tb //cornerSquarePads_DIM then follows pad length and width..... but to communicate this in one variable //I'll need to agree on a value to set cornerSquarePads_DIM to. //Process of events. //When Copy Lateral Pads is checked under Corner pads, I now have event handlers to show the //user in an accurate manner what is happening. That is a good thing. //However on the backend what i'm doing is setting d_cornerSquarePads_DIM to be over 10000. //So i need a fn for that. double d_REF = Convert.ToDouble(REF_tb.Text); int d_N = Convert.ToInt32(N_tb.Text); double d_padW = Convert.ToDouble(lateralPads_width_tb.Text); double d_padL = Convert.ToDouble(lateralPads_length_tb.Text); double d_padSpace = Convert.ToDouble(padSpace_tb.Text); double d_centeredSquarePad_DIM = centeredPadX_tb.Text == "N/A" ? -1 : Convert.ToDouble(centeredPadX_tb.Text); double d_cornerSquarePads_REF = ccp_ref_tb.Text == "N/A" ? -1 : Convert.ToDouble(ccp_ref_tb.Text); double d_cornerSquarePads_DIM = calc_cornerSquarePads_DIM(); int numPads = calc_RA_numPads(d_N, d_cornerSquarePads_DIM, d_centeredSquarePad_DIM); char[] padNames = ELM_GUI.stringArrayToCharArray(ELM_GUI.textBoxToPadNamesList(padNames_tb, numPads)); int initialNumDevices = ELM_GUI.CurrentSession.currentDeviceNameList.Length; IntPtr newDeviceList_IntPtr = ELM_GUI.AddDevice_RA_GUI( ELM_GUI.stringToCharArray(ELM_GUI.CurrentSession.inputPath), //char[] inputPath, ELM_GUI.stringToCharArray(newDeviceName_tb.Text), //char[] d_name, padNames, //char[] padNames, d_REF, d_N, d_padW, d_padL, d_padSpace, d_centeredSquarePad_DIM, d_cornerSquarePads_REF, d_cornerSquarePads_DIM, ELM_GUI.stringToCharArray(ELM_GUI.CurrentSession.outputPath) //char[] outputPath ); ELM_GUI.postDeviceAdd(newDeviceList_IntPtr, initialNumDevices); foreach (string x in ELM_GUI.CurrentSession.currentDeviceNameList) { Debug.WriteLine(x); } Debug.WriteLine("New num devices: " + ELM_GUI.CurrentSession.currentDeviceNameList.Length + "\nOld num devices: " + initialNumDevices); }