//Handle the tabs ============================================================================================// public void ModuleTab(EarlabModule theEarlabModule) { //This class creates tab on the form //1.) Create the Module Grid ModuleGrid myModuleGrid = new ModuleGrid(); //takes the module and creates the SPG myModuleGrid.Initialize(theEarlabModule); // //A.) Need to get a TITLE to push into it. //B.) You want to update the item with a "*" to say it has changed since last saved? // use "HasChanged" at the module level. HasChanged doesn't work :/ string ModuleTitle; //[change] //if (theEarlabModule.HasChanged == true) //{ // ModuleTitle = theEarlabModule.theEarlabModuleInformation.InstanceName + "*"; //} //else //{ ModuleTitle = theEarlabModule.theEarlabModuleInformation.InstanceName; //} //2.) Add Module Grid to Tab TabPage tabPage = new TabPage(ModuleTitle); tabPage.Controls.Add(myModuleGrid); //3.) Tab location and size settings tabPage.Location = new System.Drawing.Point(4, 22); tabPage.Padding = new System.Windows.Forms.Padding(3); tabPage.Size = new System.Drawing.Size(831, 392); tabPage.TabIndex = 1; tabPage.UseVisualStyleBackColor = true; //4.) Add tab to control tabControl1.TabPages.Add(tabPage); }
//initialize a module public void Initialize(EarlabModule theEarlabModule) { //[Display Event] //this.Clear(); //Information directly from the Module //This just mirrors everything else. int propertyID = 0; //int parameterNumber = 1; PropertyEnumerator catEnum; //There is a problem with the "PropertyEnumerator for the propEnum!" //testing something -- earlab class knows what prop grid it is displayed on. //theEarlabModule.DisplayGrid = this; //[Display Event] //if module has params if (theEarlabModule.EarlabParameters.Count > 0) { //start param, this works! catEnum = AppendRootCategory(propertyID++, "Parameters"); //A method to make the ALL the parameters. MakeParameters(theEarlabModule.EarlabParameters, catEnum, ref propertyID); } else { catEnum = AppendRootCategory(propertyID++, "No Parameters in this Module"); } //if module has inputs // same code if (theEarlabModule.EarlabInputs.Count > 0) { //start param catEnum = AppendRootCategory(propertyID++, "Inputs"); //A method of all the inputs //MakeInputs(theEarlabModule.EarlabInputs, catEnum, ref propertyID); } else { catEnum = AppendRootCategory(propertyID++, "No Inputs in this Module"); } //if module has outputs //same code, you can't use "null" as a conditional b/c there is something in there. if (theEarlabModule.EarlabOutputs.Count > 0) { //start param catEnum = AppendRootCategory(propertyID++, "Outputs"); //A method of all the outputs //MakeOutputs(theEarlabModule.EarlabOutputs, catEnum, ref propertyID); } else { catEnum = AppendRootCategory(propertyID++, "No Outputs in this Module"); } //Get some update stuff in another method //set standards for the SPG standardSettings(); }