def getCustomToolPropertyContent(): # Create a Grid my_Grid = WPFControls.Grid() # Add 2 Rows and 1 Column my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) currRow = 0 # Create a button currRow += 1 actionButton = WPFControls.Button() actionButton.Content = "Generate studies" WPFControls.Grid.SetRow(actionButton, currRow) WPFControls.Grid.SetColumn(actionButton, 0) actionButton.Height = 30 WPFControls.Grid.SetColumnSpan(actionButton, 2) actionButton.Click += HandleApplyButton # Link a function to the Button "Click" event my_Grid.Children.Add(actionButton) # Return the Grid return my_Grid
def getCustomToolPropertyContent(): # Create a Grid my_Grid = WPFControls.Grid() # Add 2 Rows and 1 Column my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) currRow = 0 # Create input field currRow += 1 lbl01 = WPFControls.TextBlock() lbl01.Text = "Corner radius (mm):" WPFControls.Grid.SetRow(lbl01, currRow) WPFControls.Grid.SetColumn(lbl01, 0) global input01 input01 = WPFControls.TextBox() WPFControls.Grid.SetRow(input01, currRow) WPFControls.Grid.SetColumn(input01, 1) # Create a button currRow += 1 currRow += 1 goButton = WPFControls.Button() goButton.Content = "Round selected faces" WPFControls.Grid.SetRow(goButton, currRow) WPFControls.Grid.SetColumn(goButton, 0) goButton.Height = 30 WPFControls.Grid.SetColumnSpan(goButton, 3) # Link a function to the Button "Click" event # This function will be called every time the Button is clicked goButton.Click += HandleApplyButton my_Grid.Children.Add(lbl01) my_Grid.Children.Add(input01) my_Grid.Children.Add(goButton) # Return the Grid return my_Grid
def getCustomToolPropertyContent(): #Create a Grid my_Grid = WPFControls.Grid() #Add 2 Rows and 1 Column my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) #Create a button to suppress all vertices only cleanVertices = WPFControls.Button() cleanVertices.Content="Suppress vertices" WPFControls.Grid.SetRow(cleanVertices, 0) WPFControls.Grid.SetColumn(cleanVertices, 0) cleanVertices.Height = 30 cleanVertices.Click+=HandleCleanVertices #Create a button to suppress all edges only cleanEdges = WPFControls.Button() cleanEdges.Content="Suppress edges" WPFControls.Grid.SetRow(cleanEdges, 0) WPFControls.Grid.SetColumn(cleanEdges, 1) cleanEdges.Height = 30 cleanEdges.Click+=HandleCleanEdges #Create a button to suppress all vertices and edges cleanAll = WPFControls.Button() cleanAll.Content="Suppress all" WPFControls.Grid.SetRow(cleanAll, 1) WPFControls.Grid.SetColumn(cleanAll, 0) cleanAll.Click+=HandleCleanAll cleanAll.Height = 30 WPFControls.Grid.SetColumnSpan(cleanAll, 2) # Add the controls to the Grid my_Grid.Children.Add(cleanAll) my_Grid.Children.Add(cleanEdges) my_Grid.Children.Add(cleanVertices) #Return the Grid return my_Grid
def getCustomToolPropertyContent(): currRow = 0 # Create a Grid my_Grid = WPFControls.Grid() # Add 1 Row and One Column my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) # Create a DataGrid global myDataGrid myDataGrid = WPFControls.DataGrid() # Create a button currRow += 20 actionButton = WPFControls.Button() actionButton.Content = "Calculate selected" WPFControls.Grid.SetRow(actionButton, currRow) WPFControls.Grid.SetColumn(actionButton, 0) actionButton.Height = 30 WPFControls.Grid.SetColumnSpan(actionButton, 2) actionButton.Click += GetSelectionInfo # Link a function to the Button "Click" event # Add the DataGrid to the Grid my_Grid.Children.Add(myDataGrid) my_Grid.Children.Add(actionButton) # Return the Grid return my_Grid
def getCustomToolPropertyContent(): #Create a Grid my_Grid = WPFControls.Grid() #Add 2 Rows and 1 Column my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) #Row 0 #Create a label (TextBlock) #Set it's Text value #Assign it to Row 0, Column 0 refineTextBlock = WPFControls.TextBlock() refineTextBlock.Text = "Mesh size (mm):" WPFControls.Grid.SetRow(refineTextBlock, 0) WPFControls.Grid.SetColumn(refineTextBlock, 0) global refineSizeTextBox #Create an empty input TextBox assign it to Row 0, Column 1 refineSizeTextBox = WPFControls.TextBox() WPFControls.Grid.SetRow(refineSizeTextBox, 0) WPFControls.Grid.SetColumn(refineSizeTextBox, 1) #Create a button and set it's text to "Import" #Assign it to Row1, Column 0 importBtn = WPFControls.Button() importBtn.Content = "Mesh partitions" WPFControls.Grid.SetRow(importBtn, 1) WPFControls.Grid.SetColumn(importBtn, 0) WPFControls.Grid.SetColumnSpan(importBtn, 2) importBtn.Height = 30 #Link a function to the Button "Click" event #This function will be called every time the Button is clicked importBtn.Click += MeshPartitions # Add the controls to the Grid my_Grid.Children.Add(importBtn) my_Grid.Children.Add(refineTextBlock) my_Grid.Children.Add(refineSizeTextBox) #Return the Grid return my_Grid
def getCustomToolPropertyContent(): #Create a Grid my_Grid = WPFControls.Grid() #Add 2 Rows and 1 Column my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) currRow = 0 # -- Horizontal sheet definition horizLabel = WPFControls.TextBlock() horizLabel.Text = "Shape definition" WPFControls.Grid.SetRow(horizLabel, currRow) horizLabel.FontSize = 11 currRow += 1 horizWidthLbl = WPFControls.TextBlock() horizWidthLbl.Text = " Width (mm):" WPFControls.Grid.SetRow(horizWidthLbl, currRow) WPFControls.Grid.SetColumn(horizWidthLbl, 0) global horizWidthInput horizWidthInput = WPFControls.TextBox() WPFControls.Grid.SetRow(horizWidthInput, currRow) WPFControls.Grid.SetColumn(horizWidthInput, 1) currRow += 1 horizLengthLbl = WPFControls.TextBlock() horizLengthLbl.Text = " Length (mm):" WPFControls.Grid.SetRow(horizLengthLbl, currRow) WPFControls.Grid.SetColumn(horizLengthLbl, 0) global horizLengthInput horizLengthInput = WPFControls.TextBox() WPFControls.Grid.SetRow(horizLengthInput, currRow) WPFControls.Grid.SetColumn(horizLengthInput, 1) currRow += 1 horizThickLbl = WPFControls.TextBlock() horizThickLbl.Text = " Base thickness (mm):" WPFControls.Grid.SetRow(horizThickLbl, currRow) WPFControls.Grid.SetColumn(horizThickLbl, 0) global horizThickInput horizThickInput = WPFControls.TextBox() WPFControls.Grid.SetRow(horizThickInput, currRow) WPFControls.Grid.SetColumn(horizThickInput, 1) # -- Vertical sheet definition currRow += 1 vertLabel = WPFControls.TextBlock() vertLabel.Text = "Vertical sheet definition" WPFControls.Grid.SetRow(vertLabel, currRow) vertLabel.FontSize = 11 currRow += 1 vertHeightLbl = WPFControls.TextBlock() vertHeightLbl.Text = " Height (mm):" WPFControls.Grid.SetRow(vertHeightLbl, currRow) WPFControls.Grid.SetColumn(vertHeightLbl, 0) global vertHeightInput vertHeightInput = WPFControls.TextBox() WPFControls.Grid.SetRow(vertHeightInput, currRow) WPFControls.Grid.SetColumn(vertHeightInput, 1) currRow += 1 vertLengthLbl = WPFControls.TextBlock() vertLengthLbl.Text = " Length (mm):" WPFControls.Grid.SetRow(vertLengthLbl, currRow) WPFControls.Grid.SetColumn(vertLengthLbl, 0) global vertLengthInput vertLengthInput = WPFControls.TextBox() WPFControls.Grid.SetRow(vertLengthInput, currRow) WPFControls.Grid.SetColumn(vertLengthInput, 1) currRow += 1 vertThickLbl = WPFControls.TextBlock() vertThickLbl.Text = " Web thickness (mm):" WPFControls.Grid.SetRow(vertThickLbl, currRow) WPFControls.Grid.SetColumn(vertThickLbl, 0) global vertThickInput vertThickInput = WPFControls.TextBox() WPFControls.Grid.SetRow(vertThickInput, currRow) WPFControls.Grid.SetColumn(vertThickInput, 1) # Create checkbox to ask for mesh currRow += 1 global chkMesh chkMesh = WPFControls.CheckBox() chkMesh.Content = "Mesh the joint for me" chkMesh.Height = 20 WPFControls.Grid.SetRow(chkMesh, currRow) WPFControls.Grid.SetColumn(chkMesh, 0) WPFControls.Grid.SetColumnSpan(chkMesh, 3) #Create a button currRow += 1 buildJoint = WPFControls.Button() buildJoint.Content = "Build joint" WPFControls.Grid.SetRow(buildJoint, currRow) WPFControls.Grid.SetColumn(buildJoint, 0) buildJoint.Height = 30 WPFControls.Grid.SetColumnSpan(buildJoint, 3) #Link a function to the Button "Click" event #This function will be called every time the Button is clicked buildJoint.Click += BuildJoint # Add the controls to the Grid my_Grid.Children.Add(horizLabel) my_Grid.Children.Add(horizWidthLbl) my_Grid.Children.Add(horizWidthInput) my_Grid.Children.Add(horizLengthLbl) my_Grid.Children.Add(horizLengthInput) my_Grid.Children.Add(horizThickLbl) my_Grid.Children.Add(horizThickInput) #my_Grid.Children.Add(vertLabel) #my_Grid.Children.Add(vertHeightLbl) #my_Grid.Children.Add(vertHeightInput) #my_Grid.Children.Add(vertLengthLbl) #my_Grid.Children.Add(vertLengthInput) my_Grid.Children.Add(vertThickLbl) my_Grid.Children.Add(vertThickInput) my_Grid.Children.Add(chkMesh) my_Grid.Children.Add(buildJoint) #Return the Grid return my_Grid
def getCustomToolPropertyContent(): # Create a Grid my_Grid = WPFControls.Grid() # Add 2 Rows and 1 Column my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) currRow = 0 # -- Horizontal sheet definition IDLbl = WPFControls.TextBlock() IDLbl.Text = "Separate by distance" WPFControls.Grid.SetRow(IDLbl, currRow) IDLbl.FontSize = 11 # Create input field currRow += 1 lbl01 = WPFControls.TextBlock() lbl01.Text = "Distance (mm):" WPFControls.Grid.SetRow(lbl01, currRow) WPFControls.Grid.SetColumn(lbl01, 0) global input01 input01 = WPFControls.TextBox() WPFControls.Grid.SetRow(input01, currRow) WPFControls.Grid.SetColumn(input01, 1) input01.Text = "2.0" # Create checkbox to ask for mesh currRow += 1 global check01 check01 = WPFControls.CheckBox() check01.Content = "Separate in new assembly" check01.Height = 30 WPFControls.Grid.SetRow(check01, currRow) WPFControls.Grid.SetColumn(check01, 0) WPFControls.Grid.SetColumnSpan(check01, 3) check01.IsChecked = System.Nullable[System.Boolean](True) # Create a button currRow += 1 goButton = WPFControls.Button() goButton.Content = "Find close parts" WPFControls.Grid.SetRow(goButton, currRow) WPFControls.Grid.SetColumn(goButton, 0) goButton.Height = 30 WPFControls.Grid.SetColumnSpan(goButton, 3) # Link a function to the Button "Click" event # This function will be called every time the Button is clicked goButton.Click += HandleApplyButton # Add the controls to the Grid #my_Grid.Children.Add(IDLbl) my_Grid.Children.Add(lbl01) my_Grid.Children.Add(input01) my_Grid.Children.Add(check01) my_Grid.Children.Add(goButton) # Return the Grid return my_Grid
def getCustomToolPropertyContent(): # Create a Grid my_Grid = WPFControls.Grid() # Add 2 Rows and 1 Column my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) currRow = 0 # -- Horizontal sheet definition IDLbl = WPFControls.TextBlock() IDLbl.Text = "Slicing definition" WPFControls.Grid.SetRow(IDLbl, currRow) IDLbl.FontSize = 11 # Create input field currRow += 1 layerLbl = WPFControls.TextBlock() layerLbl.Text = " Layer height (mm):" WPFControls.Grid.SetRow(layerLbl, currRow) WPFControls.Grid.SetColumn(layerLbl, 0) global layerHeight layerHeight = WPFControls.TextBox() WPFControls.Grid.SetRow(layerHeight, currRow) WPFControls.Grid.SetColumn(layerHeight, 1) # Create checkbox to ask for mesh currRow += 1 global chkSplit chkSplit = WPFControls.CheckBox() chkSplit.Content = "Do not create multiple solids" chkSplit.Height = 20 WPFControls.Grid.SetRow(chkSplit, currRow) WPFControls.Grid.SetColumn(chkSplit, 0) WPFControls.Grid.SetColumnSpan(chkSplit, 3) # Create a button currRow += 1 goSlice = WPFControls.Button() goSlice.Content = "Slice geometry" WPFControls.Grid.SetRow(goSlice, currRow) WPFControls.Grid.SetColumn(goSlice, 0) goSlice.Height = 30 WPFControls.Grid.SetColumnSpan(goSlice, 3) # Link a function to the Button "Click" event # This function will be called every time the Button is clicked goSlice.Click += HandleApplyButton # Add the controls to the Grid my_Grid.Children.Add(IDLbl) my_Grid.Children.Add(layerLbl) my_Grid.Children.Add(layerHeight) my_Grid.Children.Add(chkSplit) my_Grid.Children.Add(goSlice) # Return the Grid return my_Grid
def getCustomToolPropertyContent(): # Create a Grid my_Grid = WPFControls.Grid() # Add 2 Rows and 1 Column my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) #my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) currRow = 0 # Create input field currRow += 1 lbl01 = WPFControls.TextBlock() lbl01.Text = "Region diam. (mm):" WPFControls.Grid.SetRow(lbl01, currRow) WPFControls.Grid.SetColumn(lbl01, 0) global input01 input01 = WPFControls.TextBox() WPFControls.Grid.SetRow(input01, currRow) WPFControls.Grid.SetColumn(input01, 1) # Create checkbox to extend the weld bead currRow += 1 global chkBox01 chkBox01 = WPFControls.CheckBox() chkBox01.Content = "Extend region" chkBox01.Height = 20 WPFControls.Grid.SetRow(chkBox01, currRow) WPFControls.Grid.SetColumn(chkBox01, 1) WPFControls.Grid.SetColumnSpan(chkBox01, 2) chkBox01.IsChecked = System.Nullable[System.Boolean](True) # Create a button currRow += 2 goButton = WPFControls.Button() goButton.Content = "Create regions" WPFControls.Grid.SetRow(goButton, currRow) WPFControls.Grid.SetColumn(goButton, 0) goButton.Height = 30 WPFControls.Grid.SetColumnSpan(goButton, 3) # Link a function to the Button "Click" event # This function will be called every time the Button is clicked goButton.Click += HandleApplyButton my_Grid.Children.Add(lbl01) my_Grid.Children.Add(input01) my_Grid.Children.Add(chkBox01) my_Grid.Children.Add(goButton) # Return the Grid return my_Grid
def getCustomToolPropertyContent(): # Create a Grid my_Grid = WPFControls.Grid() # Add 2 Rows and 1 Column my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) # Row 0 currRow = 0 # Create a label (TextBlock) # Set it's Text value # Assign it to Row 0, Column 0 refineTextBlock = WPFControls.TextBlock() refineTextBlock.Text = "Bead leg (mm):" WPFControls.Grid.SetRow(refineTextBlock, currRow) WPFControls.Grid.SetColumn(refineTextBlock, 0) global refineSizeTextBox # Create an empty input TextBox assign it to Row 0, Column 1 refineSizeTextBox = WPFControls.TextBox() WPFControls.Grid.SetRow(refineSizeTextBox, currRow) WPFControls.Grid.SetColumn(refineSizeTextBox, 1) # Create a button and set it's text to "Import" # Assign it to Row1, Column 0 currRow += 1 importBtn = WPFControls.Button() importBtn.Content = "Import CSV files" WPFControls.Grid.SetRow(importBtn, currRow) WPFControls.Grid.SetColumn(importBtn, 0) WPFControls.Grid.SetColumnSpan(importBtn, 2) importBtn.Height = 30 # Link a function to the Button "Click" event # This function will be called every time the Button is clicked importBtn.Click += HandleimportBtn # Create an empty input TextBox currRow += 1 global fileNameTextBox fileNameTextBox = WPFControls.TextBlock() WPFControls.Grid.SetRow(fileNameTextBox, currRow) WPFControls.Grid.SetColumn(fileNameTextBox, 1) fileNameTextBox.Text = "None" selectedFilesText = WPFControls.TextBlock() selectedFilesText.Text = "File(s) selected:" WPFControls.Grid.SetRow(selectedFilesText, currRow) WPFControls.Grid.SetColumn(selectedFilesText, 0) # Create a Combo box currRow += 1 UnitNameLbl = WPFControls.TextBlock() UnitNameLbl.Text = "Length unit in file(s):" WPFControls.Grid.SetRow(UnitNameLbl, currRow) WPFControls.Grid.SetColumn(UnitNameLbl, 0) global unitType unitType = WPFControls.ComboBox() item1 = WPFControls.ComboBoxItem() item1.Content = "Millimeters" unitType.Items.Add(item1) item2 = WPFControls.ComboBoxItem() item2.Content = "Meters" unitType.Items.Add(item2) item3 = WPFControls.ComboBoxItem() item3.Content = "Inches" unitType.Items.Add(item3) unitType.SelectedIndex = "0" WPFControls.Grid.SetRow(unitType, currRow) WPFControls.Grid.SetColumn(unitType, 1) # Create checkbox to extend the weld bead currRow += 1 extendLbl = WPFControls.TextBlock() WPFControls.Grid.SetRow(extendLbl, currRow) WPFControls.Grid.SetColumn(extendLbl, 0) extendLbl.Text = "Extend by diameter:" global extendBead extendBead = WPFControls.CheckBox() extendBead.Content = "Extend" extendBead.Height = 20 WPFControls.Grid.SetRow(extendBead, currRow) WPFControls.Grid.SetColumn(extendBead, 1) # WPFControls.Grid.SetColumnSpan(extendBead, 2) # Create a button and set it's text to "Create beads" # Assign it to Row1, Column 0 currRow += 1 createBeads = WPFControls.Button() createBeads.Content = "Create trajectories" WPFControls.Grid.SetRow(createBeads, currRow) WPFControls.Grid.SetColumn(createBeads, 0) WPFControls.Grid.SetColumnSpan(createBeads, 2) createBeads.Height = 30 # Link a function to the Button "Click" event # This function will be called every time the Butto is clicked createBeads.Click += CreateBeads # Add the controls to the Grid my_Grid.Children.Add(refineSizeTextBox) my_Grid.Children.Add(extendLbl) my_Grid.Children.Add(extendBead) my_Grid.Children.Add(importBtn) my_Grid.Children.Add(refineTextBlock) my_Grid.Children.Add(selectedFilesText) my_Grid.Children.Add(fileNameTextBox) my_Grid.Children.Add(UnitNameLbl) my_Grid.Children.Add(unitType) my_Grid.Children.Add(createBeads) # Return the Grid return my_Grid
def getCustomToolPropertyContent(): #Create a Grid my_Grid = WPFControls.Grid() #Add Rows and Columns my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) #Create a text label for the mesh refinement meshRefinementText = WPFControls.TextBlock() meshRefinementText.Text = "Finer mesh size (mm):" WPFControls.Grid.SetRow(meshRefinementText, 1) WPFControls.Grid.SetColumn(meshRefinementText, 0) #Create an empty input TextBox to input the mesh refinement global meshRefinementInput meshRefinementInput = WPFControls.TextBox() WPFControls.Grid.SetRow(meshRefinementInput, 1) WPFControls.Grid.SetColumn(meshRefinementInput, 1) #Create a text label for the coarse mesh meshCoarseText = WPFControls.TextBlock() meshCoarseText.Text = "Coarse mesh size (mm):" WPFControls.Grid.SetRow(meshCoarseText, 2) WPFControls.Grid.SetColumn(meshCoarseText, 0) #Create an empty input TextBox to input the coarse mesh global meshCoarseInput meshCoarseInput = WPFControls.TextBox() WPFControls.Grid.SetRow(meshCoarseInput, 2) WPFControls.Grid.SetColumn(meshCoarseInput, 1) #Create a text label for the refinement diameter refineDiamText = WPFControls.TextBlock() refineDiamText.Text = "Refinement diameter (mm):" WPFControls.Grid.SetRow(refineDiamText, 3) WPFControls.Grid.SetColumn(refineDiamText, 0) #Create an empty input TextBox to input the refinement diameter global refineDiamInput refineDiamInput = WPFControls.TextBox() WPFControls.Grid.SetRow(refineDiamInput, 3) WPFControls.Grid.SetColumn(refineDiamInput, 1) #Create a text label for the CSV trajectory import importCSVFiles = WPFControls.Button() importCSVFiles.Content = "Import trajectories" WPFControls.Grid.SetRow(importCSVFiles, 4) WPFControls.Grid.SetColumn(importCSVFiles, 0) importCSVFiles.Height = 30 #Link a function to the Button "Click" event #This function will be called every time the Button is clicked importCSVFiles.Click += HandleimportBtn #Create an empty input TextBox #Create a text label for the refinement diameter global numOfTrajectories numOfTrajectories = WPFControls.TextBlock() numOfTrajectories.Text = " 0 file(s)" WPFControls.Grid.SetRow(numOfTrajectories, 4) WPFControls.Grid.SetColumn(numOfTrajectories, 1) #Create a button to perform the Automesh goAutomesh = WPFControls.Button() goAutomesh.Content = "Automesh for arc welding" WPFControls.Grid.SetRow(goAutomesh, 7) WPFControls.Grid.SetColumn(goAutomesh, 0) WPFControls.Grid.SetColumnSpan(goAutomesh, 2) goAutomesh.Height = 30 #Link a function to the Button "Click" event goAutomesh.Click += GoAutoMesh # Add the controls to the Grid my_Grid.Children.Add(meshRefinementInput) my_Grid.Children.Add(meshCoarseInput) my_Grid.Children.Add(refineDiamInput) my_Grid.Children.Add(importCSVFiles) my_Grid.Children.Add(goAutomesh) my_Grid.Children.Add(numOfTrajectories) my_Grid.Children.Add(meshRefinementText) my_Grid.Children.Add(meshCoarseText) my_Grid.Children.Add(refineDiamText) #Return the Grid return my_Grid
def getCustomToolPropertyContent(): # Create a Grid my_Grid = WPFControls.Grid() # Add 2 Rows and 1 Column my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) currRow = 0 # Create input field currRow += 1 lbl01 = WPFControls.TextBlock() lbl01.Text = "Group name:" WPFControls.Grid.SetRow(lbl01, currRow) WPFControls.Grid.SetColumn(lbl01, 0) global input01 input01 = WPFControls.TextBox() WPFControls.Grid.SetRow(input01, currRow) WPFControls.Grid.SetColumn(input01, 1) # Create checkbox to extend the weld bead currRow += 1 global chkBox01 chkBox01 = WPFControls.CheckBox() chkBox01.Content = "Create under the same parent" chkBox01.Height = 20 WPFControls.Grid.SetRow(chkBox01, currRow) WPFControls.Grid.SetColumn(chkBox01, 1) # Create a button currRow += 1 currRow += 1 goButton = WPFControls.Button() goButton.Content = "Create assembly" WPFControls.Grid.SetRow(goButton, currRow) WPFControls.Grid.SetColumn(goButton, 0) goButton.Height = 30 WPFControls.Grid.SetColumnSpan(goButton, 3) # Link a function to the Button "Click" event # This function will be called every time the Button is clicked goButton.Click += HandleApplyButton my_Grid.Children.Add(lbl01) my_Grid.Children.Add(input01) my_Grid.Children.Add(chkBox01) my_Grid.Children.Add(goButton) # Return the Grid return my_Grid
def getCustomToolPropertyContent(): # Create a Grid my_Grid = WPFControls.Grid() # Add 2 Rows and 1 Column my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) #my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) currRow = 0 # Create input field currRow += 1 lbl01 = WPFControls.TextBlock() lbl01.Text = "Region diam. (mm):" WPFControls.Grid.SetRow(lbl01, currRow) WPFControls.Grid.SetColumn(lbl01, 0) global input01 input01 = WPFControls.TextBox() WPFControls.Grid.SetRow(input01, currRow) WPFControls.Grid.SetColumn(input01, 1) # Create checkbox to extend the weld bead currRow += 1 global chkBox01 chkBox01 = WPFControls.CheckBox() chkBox01.Content = "Calculate normal directions" chkBox01.Height = 20 WPFControls.Grid.SetRow(chkBox01, currRow) WPFControls.Grid.SetColumn(chkBox01, 0) chkBox01.IsChecked = System.Nullable[System.Boolean](True) #WPFControls.Grid.SetColumnSpan(chkBox01, 2) # Create a button currRow += 2 goButton = WPFControls.Button() goButton.Content = "Get trajectory from selected edge" WPFControls.Grid.SetRow(goButton, currRow) WPFControls.Grid.SetColumn(goButton, 0) goButton.Height = 30 WPFControls.Grid.SetColumnSpan(goButton, 2) # Link a function to the Button "Click" event # This function will be called every time the Button is clicked goButton.Click += HandleApplyButton global dialog dialog = FolderBrowserDialog() dialog.Description = "Directory where to save trajectories" dialog.ShowNewFolderButton = True #my_Grid.Children.Add(lbl01) #my_Grid.Children.Add(input01) my_Grid.Children.Add(chkBox01) my_Grid.Children.Add(goButton) # Return the Grid return my_Grid
def createLayout(parent, numRows, numCols): for k in range(numRows): parent.RowDefinitions.Add(WPFControls.RowDefinition()) for k in range(numCols): parent.ColumnDefinitions.Add(WPFControls.ColumnDefinition())
def getCustomToolPropertyContent(): #Create a Grid my_Grid = WPFControls.Grid() fontSize = 11 #Add Rows and Columns my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) #Create a text label for travel speed travelSpeedText = WPFControls.TextBlock() travelSpeedText.Text = "Travel speed (cm/min):" WPFControls.Grid.SetRow(travelSpeedText, 1) WPFControls.Grid.SetColumn(travelSpeedText, 0) #Create an empty input for travel speed global travelSpeedInput travelSpeedInput = WPFControls.TextBox() travelSpeedInput.Text = "45" WPFControls.Grid.SetRow(travelSpeedInput, 1) WPFControls.Grid.SetColumn(travelSpeedInput, 1) travelSpeedInput.TextChanged += HandelTextChange #Create a text label for electrical current elecCurrentText = WPFControls.TextBlock() elecCurrentText.Text = "Current (A):" WPFControls.Grid.SetRow(elecCurrentText, 2) WPFControls.Grid.SetColumn(elecCurrentText, 0) #Create an empty input for electrical current global elecCurrentInput elecCurrentInput = WPFControls.TextBox() elecCurrentInput.Text = "150" WPFControls.Grid.SetRow(elecCurrentInput, 2) WPFControls.Grid.SetColumn(elecCurrentInput, 1) elecCurrentInput.TextChanged += HandelTextChange #Create a text label for voltage elecVoltageText = WPFControls.TextBlock() elecVoltageText.Text = "Voltage (V):" WPFControls.Grid.SetRow(elecVoltageText, 3) WPFControls.Grid.SetColumn(elecVoltageText, 0) #Create an empty input for voltage global elecVoltageInput elecVoltageInput = WPFControls.TextBox() elecVoltageInput.Text = "17" WPFControls.Grid.SetRow(elecVoltageInput, 3) WPFControls.Grid.SetColumn(elecVoltageInput, 1) elecVoltageInput.TextChanged += HandelTextChange #Create a text label for efficiency effParam = WPFControls.TextBlock() effParam.Text = "Efficiency:" WPFControls.Grid.SetRow(effParam, 4) WPFControls.Grid.SetColumn(effParam, 0) #Create an empty input for efficiency global effParamInput effParamInput = WPFControls.TextBox() effParamInput.Text = "0.85" WPFControls.Grid.SetRow(effParamInput, 4) WPFControls.Grid.SetColumn(effParamInput, 1) effParamInput.TextChanged += HandelTextChange #Create an empty separator Separator04 = WPFControls.TextBlock() Separator04.Text = "" #Separator04.HorizontalAlignment = 1 WPFControls.Grid.SetRow(Separator04, 5) WPFControls.Grid.SetColumn(Separator04, 0) WPFControls.Grid.SetColumnSpan(Separator04, 2) #Create a text separator Separator01 = WPFControls.TextBlock() Separator01.Text = "Weld bead information" Separator01.FontSize = fontSize WPFControls.Grid.SetRow(Separator01, 6) WPFControls.Grid.SetColumn(Separator01, 0) WPFControls.Grid.SetColumnSpan(Separator01, 2) #Create a text label for energy per length EPLLabel = WPFControls.TextBlock() EPLLabel.Text = " Energy per length:" EPLLabel.FontSize = fontSize WPFControls.Grid.SetRow(EPLLabel, 7) WPFControls.Grid.SetColumn(EPLLabel, 0) #Create a text label for energy per length global EPLEstimate EPLEstimate = WPFControls.TextBlock() EPLEstimate.FontSize = fontSize EPLEstimate.Text = "-" WPFControls.Grid.SetRow(EPLEstimate, 7) WPFControls.Grid.SetColumn(EPLEstimate, 1) #Create a text label for estimated bead leg BeadLegLabel = WPFControls.TextBlock() BeadLegLabel.Text = " Estimated bead leg:" BeadLegLabel.FontSize = fontSize WPFControls.Grid.SetRow(BeadLegLabel, 8) WPFControls.Grid.SetColumn(BeadLegLabel, 0) #Create a text label for estimated bead leg global BeadLegEstimate BeadLegEstimate = WPFControls.TextBlock() BeadLegEstimate.Text = "-" BeadLegEstimate.FontSize = fontSize WPFControls.Grid.SetRow(BeadLegEstimate, 8) WPFControls.Grid.SetColumn(BeadLegEstimate, 1) #Create an empty separator Separator03 = WPFControls.TextBlock() Separator03.Text = "" WPFControls.Grid.SetRow(Separator03, 9) WPFControls.Grid.SetColumn(Separator03, 0) WPFControls.Grid.SetColumnSpan(Separator03, 2) #Create a text separator Separator02 = WPFControls.TextBlock() Separator02.Text = "Heat source size information" Separator02.FontSize = 12 #Separator02.HorizontalAlignment = 1 WPFControls.Grid.SetRow(Separator02, 10) WPFControls.Grid.SetColumn(Separator02, 0) WPFControls.Grid.SetColumnSpan(Separator02, 2) #Create a text label for front length heat source size FLLabel = WPFControls.TextBlock() FLLabel.Text = " Front (mm):" FLLabel.FontSize = fontSize WPFControls.Grid.SetRow(FLLabel, 11) WPFControls.Grid.SetColumn(FLLabel, 0) #Create a text label for front length heat source size global FLEstimate FLEstimate = WPFControls.TextBlock() FLEstimate.Text = "-" FLEstimate.FontSize = fontSize WPFControls.Grid.SetRow(FLEstimate, 11) WPFControls.Grid.SetColumn(FLEstimate, 1) #Create a text label for rear length heat source size RLLabel = WPFControls.TextBlock() RLLabel.Text = " Rear (mm):" RLLabel.FontSize = fontSize WPFControls.Grid.SetRow(RLLabel, 12) WPFControls.Grid.SetColumn(RLLabel, 0) #Create a text label for rear length heat source size global RLEstimate RLEstimate = WPFControls.TextBlock() RLEstimate.Text = "-" RLEstimate.FontSize = fontSize WPFControls.Grid.SetRow(RLEstimate, 12) WPFControls.Grid.SetColumn(RLEstimate, 1) #Create a text label for width length heat source size WidthLabel = WPFControls.TextBlock() WidthLabel.Text = " Width (mm):" WidthLabel.FontSize = fontSize WPFControls.Grid.SetRow(WidthLabel, 13) WPFControls.Grid.SetColumn(WidthLabel, 0) #Create a text label for width length heat source sizeer global WidthEstimate WidthEstimate = WPFControls.TextBlock() WidthEstimate.Text = "-" WidthEstimate.FontSize = fontSize WPFControls.Grid.SetRow(WidthEstimate, 13) WPFControls.Grid.SetColumn(WidthEstimate, 1) #Create a text label for depth length heat source size DepthLabel = WPFControls.TextBlock() DepthLabel.Text = " Depth (mm):" DepthLabel.FontSize = fontSize WPFControls.Grid.SetRow(DepthLabel, 14) WPFControls.Grid.SetColumn(DepthLabel, 0) #Create a text label for the refinement diameter global DepthEstimate DepthEstimate = WPFControls.TextBlock() DepthEstimate.Text = "-" DepthEstimate.FontSize = fontSize WPFControls.Grid.SetRow(DepthEstimate, 14) WPFControls.Grid.SetColumn(DepthEstimate, 1) #Create an empty separator Separator05 = WPFControls.TextBlock() Separator05.Text = "" #Separator05.HorizontalAlignment = 1 WPFControls.Grid.SetRow(Separator05, 15) WPFControls.Grid.SetColumn(Separator05, 0) WPFControls.Grid.SetColumnSpan(Separator05, 2) #Create a button to export the heat source in Simufact format exportHeatSource = WPFControls.Button() exportHeatSource.Content = "Export heat source" exportHeatSource.Height = 30 WPFControls.Grid.SetRow(exportHeatSource, 16) WPFControls.Grid.SetColumn(exportHeatSource, 0) WPFControls.Grid.SetColumnSpan(exportHeatSource, 2) #Link a function to the Button "Click" event exportHeatSource.Click += HandleExportHeatSource # Add the controls to the Grid my_Grid.Children.Add(exportHeatSource) my_Grid.Children.Add(elecVoltageText) my_Grid.Children.Add(elecVoltageInput) my_Grid.Children.Add(travelSpeedText) my_Grid.Children.Add(travelSpeedInput) my_Grid.Children.Add(elecCurrentText) my_Grid.Children.Add(elecCurrentInput) my_Grid.Children.Add(effParam) my_Grid.Children.Add(effParamInput) my_Grid.Children.Add(EPLLabel) my_Grid.Children.Add(EPLEstimate) my_Grid.Children.Add(BeadLegLabel) my_Grid.Children.Add(BeadLegEstimate) my_Grid.Children.Add(FLLabel) my_Grid.Children.Add(FLEstimate) my_Grid.Children.Add(RLLabel) my_Grid.Children.Add(RLEstimate) my_Grid.Children.Add(WidthLabel) my_Grid.Children.Add(WidthEstimate) my_Grid.Children.Add(DepthLabel) my_Grid.Children.Add(DepthEstimate) my_Grid.Children.Add(Separator01) my_Grid.Children.Add(Separator02) my_Grid.Children.Add(Separator03) my_Grid.Children.Add(Separator04) my_Grid.Children.Add(Separator05) #Return the Grid return my_Grid
def getCustomToolPropertyContent(): # Create a Grid my_Grid = WPFControls.Grid() # Add 6 Rows and One Column my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) currRow = 0 # Create a label for the first radio button array meshTextBlock = WPFControls.TextBlock() meshTextBlock.Text = "Vertical Array" WPFControls.Grid.SetRow(meshTextBlock, currRow) WPFControls.Grid.SetColumn(meshTextBlock, 0) currRow += 1 # Create a label for the second radio button array meshTextBlock2 = WPFControls.TextBlock() meshTextBlock2.Text = "Joint type" meshTextBlock2.FontSize = 11 WPFControls.Grid.SetRow(meshTextBlock2, currRow) WPFControls.Grid.SetColumn(meshTextBlock2, 0) # Create a horizontal array of three radio buttons # Create a WrapPanel hWrapPanel = WPFControls.WrapPanel() hWrapPanel.Orientation = WPFControls.Orientation.Horizontal # Create a List to hold the radio buttons in the first array # We'll use this later to make it easier to find which button is checked currRow += 1 global horizontal_radio_buttons horizontal_radio_buttons = [] # Create a first radio button and add to the WrapPanel horizontal_radio_buttons.append(WPFControls.RadioButton()) horizontal_radio_buttons[0].Content = "Lap joint" # Set the first radio button to be checked # Note the horrible notation required to define a Nullable Boolean True horizontal_radio_buttons[0].IsChecked = System.Nullable[System.Boolean]( True) hWrapPanel.Children.Add(horizontal_radio_buttons[0]) # Create a second radio button and add to the WrapPanel horizontal_radio_buttons.append(WPFControls.RadioButton()) horizontal_radio_buttons[1].Content = "T-joint" hWrapPanel.Children.Add(horizontal_radio_buttons[1]) # Create a third radio button and add to the WrapPanel horizontal_radio_buttons.append(WPFControls.RadioButton()) horizontal_radio_buttons[2].Content = "Flush corner" hWrapPanel.Children.Add(horizontal_radio_buttons[2]) # Position the WrapPanel in the first row, column of the Grid WPFControls.Grid.SetRow(hWrapPanel, 3) WPFControls.Grid.SetColumn(hWrapPanel, 0) WPFControls.Grid.SetColumnSpan(hWrapPanel, 2) # -- Horizontal sheet definition currRow += 1 currRow += 1 currRow += 1 horizLabel = WPFControls.TextBlock() horizLabel.Text = "Shape definition" WPFControls.Grid.SetRow(horizLabel, currRow) horizLabel.FontSize = 11 currRow += 1 horizWidthLbl = WPFControls.TextBlock() horizWidthLbl.Text = " Width (mm):" WPFControls.Grid.SetRow(horizWidthLbl, currRow) WPFControls.Grid.SetColumn(horizWidthLbl, 0) global horizWidthInput horizWidthInput = WPFControls.TextBox() WPFControls.Grid.SetRow(horizWidthInput, currRow) WPFControls.Grid.SetColumn(horizWidthInput, 1) WPFControls.Grid.SetColumnSpan(horizWidthInput, 2) currRow += 1 horizLengthLbl = WPFControls.TextBlock() horizLengthLbl.Text = " Length (mm):" WPFControls.Grid.SetRow(horizLengthLbl, currRow) WPFControls.Grid.SetColumn(horizLengthLbl, 0) global horizLengthInput horizLengthInput = WPFControls.TextBox() WPFControls.Grid.SetRow(horizLengthInput, currRow) WPFControls.Grid.SetColumn(horizLengthInput, 1) WPFControls.Grid.SetColumnSpan(horizLengthInput, 2) currRow += 1 horizThickLbl = WPFControls.TextBlock() horizThickLbl.Text = " Thickness 01 (mm):" WPFControls.Grid.SetRow(horizThickLbl, currRow) WPFControls.Grid.SetColumn(horizThickLbl, 0) global horizThickInput horizThickInput = WPFControls.TextBox() WPFControls.Grid.SetRow(horizThickInput, currRow) WPFControls.Grid.SetColumn(horizThickInput, 1) WPFControls.Grid.SetColumnSpan(horizThickInput, 2) currRow += 1 vertThickLbl = WPFControls.TextBlock() vertThickLbl.Text = " Thickness 02 (mm):" WPFControls.Grid.SetRow(vertThickLbl, currRow) WPFControls.Grid.SetColumn(vertThickLbl, 0) global vertThickInput vertThickInput = WPFControls.TextBox() WPFControls.Grid.SetRow(vertThickInput, currRow) WPFControls.Grid.SetColumn(vertThickInput, 1) WPFControls.Grid.SetColumnSpan(vertThickInput, 2) # Create checkbox to ask for mesh currRow += 1 global chkMesh chkMesh = WPFControls.CheckBox() chkMesh.Content = "Mesh the joint" chkMesh.Height = 20 WPFControls.Grid.SetRow(chkMesh, currRow) WPFControls.Grid.SetColumn(chkMesh, 0) WPFControls.Grid.SetColumnSpan(chkMesh, 3) # Create a button currRow += 1 buildJoint = WPFControls.Button() buildJoint.Content = "Build joint" WPFControls.Grid.SetRow(buildJoint, currRow) WPFControls.Grid.SetColumn(buildJoint, 0) buildJoint.Height = 30 WPFControls.Grid.SetColumnSpan(buildJoint, 3) # Link a function to the Button "Click" event # This function will be called every time the Button is clicked #buildJoint.Click += BuildJoint # Add the WrapPanel to the Grid my_Grid.Children.Add(meshTextBlock2) my_Grid.Children.Add(hWrapPanel) # Add the controls to the Grid my_Grid.Children.Add(horizLabel) my_Grid.Children.Add(horizWidthLbl) my_Grid.Children.Add(horizWidthInput) my_Grid.Children.Add(horizLengthLbl) my_Grid.Children.Add(horizLengthInput) my_Grid.Children.Add(horizThickLbl) my_Grid.Children.Add(horizThickInput) my_Grid.Children.Add(vertThickLbl) my_Grid.Children.Add(vertThickInput) my_Grid.Children.Add(chkMesh) my_Grid.Children.Add(buildJoint) # Return the Grid return my_Grid
def getCustomToolPropertyContent(): #Create a Grid my_Grid = WPFControls.Grid() fontSize = 11 #Add Rows and Columns my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) currLine = 0 #Create a text label for electrical current currLine += 1 beadSizeText = WPFControls.TextBlock() beadSizeText.Text = "Leg length (mm):" WPFControls.Grid.SetRow(beadSizeText, currLine) WPFControls.Grid.SetColumn(beadSizeText, 0) #Create an empty input for electrical current global beadSizeInput beadSizeInput = WPFControls.TextBox() beadSizeInput.Text = "3.1" WPFControls.Grid.SetRow(beadSizeInput, currLine) WPFControls.Grid.SetColumn(beadSizeInput, 1) beadSizeInput.TextChanged += HandelTextChange #Create a text label for travel speed currLine += 1 travelSpeedText = WPFControls.TextBlock() travelSpeedText.Text = "Travel speed (cm/min):" WPFControls.Grid.SetRow(travelSpeedText, currLine) WPFControls.Grid.SetColumn(travelSpeedText, 0) #Create an empty input for travel speed global travelSpeedInput travelSpeedInput = WPFControls.TextBox() travelSpeedInput.Text = "45" WPFControls.Grid.SetRow(travelSpeedInput, currLine) WPFControls.Grid.SetColumn(travelSpeedInput, 1) travelSpeedInput.TextChanged += HandelTextChange #Create a text label for efficiency currLine += 1 effParam = WPFControls.TextBlock() effParam.Text = "Efficiency:" WPFControls.Grid.SetRow(effParam, currLine) WPFControls.Grid.SetColumn(effParam, 0) #Create an empty input for efficiency global effParamInput effParamInput = WPFControls.TextBox() effParamInput.Text = "0.80" WPFControls.Grid.SetRow(effParamInput, currLine) WPFControls.Grid.SetColumn(effParamInput, 1) effParamInput.TextChanged += HandelTextChange #Create an empty separator currLine += 1 Separator04 = WPFControls.TextBlock() Separator04.Text = "" #Separator04.HorizontalAlignment = 1 WPFControls.Grid.SetRow(Separator04, currLine) WPFControls.Grid.SetColumn(Separator04, 0) WPFControls.Grid.SetColumnSpan(Separator04, 2) #Create a text separator currLine += 1 Separator01 = WPFControls.TextBlock() Separator01.Text = "Configuration:" Separator01.FontSize = fontSize WPFControls.Grid.SetRow(Separator01, currLine) WPFControls.Grid.SetColumn(Separator01, 0) WPFControls.Grid.SetColumnSpan(Separator01, 2) #Create a text label for energy per length currLine += 1 ReqPowerLbl = WPFControls.TextBlock() ReqPowerLbl.Text = " Req. power input:" ReqPowerLbl.FontSize = fontSize WPFControls.Grid.SetRow(ReqPowerLbl, currLine) WPFControls.Grid.SetColumn(ReqPowerLbl, 0) #Create a text label for energy per length global ReqPowerText ReqPowerText = WPFControls.TextBlock() ReqPowerText.FontSize = fontSize ReqPowerText.Text = "-" WPFControls.Grid.SetRow(ReqPowerText, currLine) WPFControls.Grid.SetColumn(ReqPowerText, 1) #Create a text label for estimated bead leg currLine += 1 EstThroatLbl = WPFControls.TextBlock() EstThroatLbl.Text = " Estimated throat:" EstThroatLbl.FontSize = fontSize WPFControls.Grid.SetRow(EstThroatLbl, currLine) WPFControls.Grid.SetColumn(EstThroatLbl, 0) #Create a text label for estimated bead leg global EstThroatText EstThroatText = WPFControls.TextBlock() EstThroatText.Text = "-" EstThroatText.FontSize = fontSize WPFControls.Grid.SetRow(EstThroatText, currLine) WPFControls.Grid.SetColumn(EstThroatText, 1) #Create an empty separator currLine += 1 Separator03 = WPFControls.TextBlock() Separator03.Text = "" WPFControls.Grid.SetRow(Separator03, currLine) WPFControls.Grid.SetColumn(Separator03, 0) WPFControls.Grid.SetColumnSpan(Separator03, 2) #Create a text separator currLine += 1 Separator02 = WPFControls.TextBlock() Separator02.Text = "Heat source size information" Separator02.FontSize = 12 #Separator02.HorizontalAlignment = 1 WPFControls.Grid.SetRow(Separator02, currLine) WPFControls.Grid.SetColumn(Separator02, 0) WPFControls.Grid.SetColumnSpan(Separator02, 2) #Create a text label for front length heat source size currLine += 1 FLLabel = WPFControls.TextBlock() FLLabel.Text = " Front:" FLLabel.FontSize = fontSize WPFControls.Grid.SetRow(FLLabel, currLine) WPFControls.Grid.SetColumn(FLLabel, 0) #Create a text label for front length heat source size global FLEstimate FLEstimate = WPFControls.TextBlock() FLEstimate.Text = "-" FLEstimate.FontSize = fontSize WPFControls.Grid.SetRow(FLEstimate, currLine) WPFControls.Grid.SetColumn(FLEstimate, 1) #Create a text label for rear length heat source size currLine += 1 RLLabel = WPFControls.TextBlock() RLLabel.Text = " Rear:" RLLabel.FontSize = fontSize WPFControls.Grid.SetRow(RLLabel, currLine) WPFControls.Grid.SetColumn(RLLabel, 0) #Create a text label for rear length heat source size global RLEstimate RLEstimate = WPFControls.TextBlock() RLEstimate.Text = "-" RLEstimate.FontSize = fontSize WPFControls.Grid.SetRow(RLEstimate, currLine) WPFControls.Grid.SetColumn(RLEstimate, 1) #Create a text label for width length heat source size currLine += 1 WidthLabel = WPFControls.TextBlock() WidthLabel.Text = " Width:" WidthLabel.FontSize = fontSize WPFControls.Grid.SetRow(WidthLabel, currLine) WPFControls.Grid.SetColumn(WidthLabel, 0) #Create a text label for width length heat source sizeer global WidthEstimate WidthEstimate = WPFControls.TextBlock() WidthEstimate.Text = "-" WidthEstimate.FontSize = fontSize WPFControls.Grid.SetRow(WidthEstimate, currLine) WPFControls.Grid.SetColumn(WidthEstimate, 1) #Create a text label for depth length heat source size currLine += 1 DepthLabel = WPFControls.TextBlock() DepthLabel.Text = " Depth:" DepthLabel.FontSize = fontSize WPFControls.Grid.SetRow(DepthLabel, currLine) WPFControls.Grid.SetColumn(DepthLabel, 0) #Create a text label for the refinement diameter global DepthEstimate DepthEstimate = WPFControls.TextBlock() DepthEstimate.Text = "-" DepthEstimate.FontSize = fontSize WPFControls.Grid.SetRow(DepthEstimate, currLine) WPFControls.Grid.SetColumn(DepthEstimate, 1) #Create an empty separator currLine += 1 Separator05 = WPFControls.TextBlock() Separator05.Text = "" #Separator05.HorizontalAlignment = 1 WPFControls.Grid.SetRow(Separator05, currLine) WPFControls.Grid.SetColumn(Separator05, 0) WPFControls.Grid.SetColumnSpan(Separator05, 2) #Create a button to export the heat source in Simufact format currLine += 1 exportHeatSource = WPFControls.Button() exportHeatSource.Content = "Export heat source" exportHeatSource.Height = 30 WPFControls.Grid.SetRow(exportHeatSource, currLine) WPFControls.Grid.SetColumn(exportHeatSource, 0) WPFControls.Grid.SetColumnSpan(exportHeatSource, 2) #Link a function to the Button "Click" event exportHeatSource.Click += HandleExportHeatSource # Add the controls to the Grid my_Grid.Children.Add(beadSizeText) my_Grid.Children.Add(beadSizeInput) my_Grid.Children.Add(travelSpeedText) my_Grid.Children.Add(travelSpeedInput) my_Grid.Children.Add(effParam) my_Grid.Children.Add(effParamInput) my_Grid.Children.Add(ReqPowerLbl) my_Grid.Children.Add(ReqPowerText) my_Grid.Children.Add(EstThroatLbl) my_Grid.Children.Add(EstThroatText) # Heat source my_Grid.Children.Add(FLLabel) my_Grid.Children.Add(FLEstimate) my_Grid.Children.Add(RLLabel) my_Grid.Children.Add(RLEstimate) my_Grid.Children.Add(WidthLabel) my_Grid.Children.Add(WidthEstimate) my_Grid.Children.Add(DepthLabel) my_Grid.Children.Add(DepthEstimate) my_Grid.Children.Add(Separator01) my_Grid.Children.Add(Separator02) my_Grid.Children.Add(Separator03) my_Grid.Children.Add(Separator04) my_Grid.Children.Add(Separator05) my_Grid.Children.Add(exportHeatSource) #Return the Grid return my_Grid
def getCustomToolPropertyContent(): # Create a Grid my_Grid = WPFControls.Grid() # Add 2 Rows and 1 Column my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) currRow = 0 # -- Horizontal sheet definition IDLbl = WPFControls.TextBlock() IDLbl.Text = "Hatching definition" WPFControls.Grid.SetRow(IDLbl, currRow) IDLbl.FontSize = 11 # Create label and input field currRow += 1 layerLbl = WPFControls.TextBlock() layerLbl.Text = " Trajec. spacing (mm): " WPFControls.Grid.SetRow(layerLbl, currRow) WPFControls.Grid.SetColumn(layerLbl, 0) global distanceLine distanceLine = WPFControls.TextBox() WPFControls.Grid.SetRow(distanceLine, currRow) WPFControls.Grid.SetColumn(distanceLine, 1) # Create label and input field currRow += 1 pointSpacing = WPFControls.TextBlock() pointSpacing.Text = " Point spacing (mm):" WPFControls.Grid.SetRow(pointSpacing, currRow) WPFControls.Grid.SetColumn(pointSpacing, 0) global pointSpacingValue pointSpacingValue = WPFControls.TextBox() WPFControls.Grid.SetRow(pointSpacingValue, currRow) WPFControls.Grid.SetColumn(pointSpacingValue, 1) # Type of angular cut currRow += 1 angleCutType = WPFControls.TextBlock() angleCutType.Text = " Angular cut:" WPFControls.Grid.SetRow(angleCutType, currRow) WPFControls.Grid.SetColumn(angleCutType, 0) # Create a Combo box global angleTypeSelection angleTypeSelection = WPFControls.ComboBox() item1 = WPFControls.ComboBoxItem() item1.Content = "Single angle" angleTypeSelection.Items.Add(item1) item2 = WPFControls.ComboBoxItem() item2.Content = "Incremental" angleTypeSelection.Items.Add(item2) item3 = WPFControls.ComboBoxItem() item3.Content = "Cycle through" angleTypeSelection.Items.Add(item3) angleTypeSelection.SelectedIndex = "0" WPFControls.Grid.SetRow(angleTypeSelection, currRow) WPFControls.Grid.SetColumn(angleTypeSelection, 1) #angleTypeSelection.SelectionChanged += HandleAngleSelection # Create label and input field currRow += 1 global angleLbl angleLbl = WPFControls.TextBlock() angleLbl.Text = " Angle (deg):" WPFControls.Grid.SetRow(angleLbl, currRow) WPFControls.Grid.SetColumn(angleLbl, 0) global angleValue angleValue = WPFControls.TextBox() WPFControls.Grid.SetRow(angleValue, currRow) WPFControls.Grid.SetColumn(angleValue, 1) # Create checkbox to ask for mesh currRow += 1 global meshCheck meshCheck = WPFControls.CheckBox() meshCheck.Content = "Mesh the layers for me" meshCheck.Height = 25 WPFControls.Grid.SetRow(meshCheck, currRow) WPFControls.Grid.SetColumn(meshCheck, 0) WPFControls.Grid.SetColumnSpan(meshCheck, 3) # Create a button currRow += 1 getDirectory = WPFControls.Button() getDirectory.Content = "Select directory to save" WPFControls.Grid.SetRow(getDirectory, currRow) WPFControls.Grid.SetColumn(getDirectory, 0) getDirectory.Height = 30 WPFControls.Grid.SetColumnSpan(getDirectory, 3) getDirectory.Click += HandleGetDir global dialog dialog = FolderBrowserDialog() dialog.Description = "Choose where to save trajectories" dialog.ShowNewFolderButton = True # Create a button currRow += 1 goSlice = WPFControls.Button() goSlice.Content = "Create hatching" WPFControls.Grid.SetRow(goSlice, currRow) WPFControls.Grid.SetColumn(goSlice, 0) goSlice.Height = 30 WPFControls.Grid.SetColumnSpan(goSlice, 3) # Link a function to the Button "Click" event # This function will be called every time the Button is clicked goSlice.Click += HandleApplyButton # Add the controls to the Grid my_Grid.Children.Add(IDLbl) my_Grid.Children.Add(layerLbl) my_Grid.Children.Add(distanceLine) my_Grid.Children.Add(pointSpacing) my_Grid.Children.Add(pointSpacingValue) my_Grid.Children.Add(angleCutType) my_Grid.Children.Add(angleTypeSelection) my_Grid.Children.Add(angleLbl) my_Grid.Children.Add(angleValue) my_Grid.Children.Add(getDirectory) my_Grid.Children.Add(meshCheck) my_Grid.Children.Add(goSlice) # Return the Grid return my_Grid
def getCustomToolPropertyContent(): #Create a Grid my_Grid = WPFControls.Grid() #Add 2 Rows and 1 Column my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) currRow = 0 # -- Horizontal sheet definition horizLabel = WPFControls.TextBlock() horizLabel.Text = "Shape definition" WPFControls.Grid.SetRow(horizLabel, currRow) horizLabel.FontSize = 11 currRow += 1 spotLbl = WPFControls.TextBlock() spotLbl.Text = " Spot diam. (mm):" WPFControls.Grid.SetRow(spotLbl, currRow) WPFControls.Grid.SetColumn(spotLbl, 0) global spotSize spotSize = WPFControls.TextBox() WPFControls.Grid.SetRow(spotSize, currRow) WPFControls.Grid.SetColumn(spotSize, 1) currRow += 1 horizThickLbl = WPFControls.TextBlock() horizThickLbl.Text = " Sheet 01 thickn. (mm):" WPFControls.Grid.SetRow(horizThickLbl, currRow) WPFControls.Grid.SetColumn(horizThickLbl, 0) global horizThickInput horizThickInput = WPFControls.TextBox() WPFControls.Grid.SetRow(horizThickInput, currRow) WPFControls.Grid.SetColumn(horizThickInput, 1) # -- Parameters definition currRow += 1 vertThickLbl = WPFControls.TextBlock() vertThickLbl.Text = " Sheet 02 thickn. (mm):" WPFControls.Grid.SetRow(vertThickLbl, currRow) WPFControls.Grid.SetColumn(vertThickLbl, 0) global vertThickInput vertThickInput = WPFControls.TextBox() WPFControls.Grid.SetRow(vertThickInput, currRow) WPFControls.Grid.SetColumn(vertThickInput, 1) # -- Parameters definition currRow += 1 gapLbl = WPFControls.TextBlock() gapLbl.Text = " Gap between sheets (mm):" WPFControls.Grid.SetRow(gapLbl, currRow) WPFControls.Grid.SetColumn(gapLbl, 0) global gapInput gapInput = WPFControls.TextBox() WPFControls.Grid.SetRow(gapInput, currRow) WPFControls.Grid.SetColumn(gapInput, 1) # Create grippers? currRow += 1 global chkCreateGrippers chkCreateGrippers = WPFControls.CheckBox() chkCreateGrippers.Content = "Create grippers" chkCreateGrippers.Height = 20 WPFControls.Grid.SetRow(chkCreateGrippers, currRow) WPFControls.Grid.SetColumn(chkCreateGrippers, 0) #WPFControls.Grid.SetColumnSpan(chkCreateGrippers, 3) # Create a horizontal array of three radio buttons # Create a WrapPanel hWrapPanel = WPFControls.WrapPanel() hWrapPanel.Orientation = WPFControls.Orientation.Horizontal # Second Button Array # Create a label for the second radio button array currRow += 1 lblMeshType = WPFControls.TextBlock() lblMeshType.Text = "Meshing" WPFControls.Grid.SetRow(lblMeshType, currRow) WPFControls.Grid.SetColumn(lblMeshType, 0) # Create a List to hold the radio buttons in the first array # We'll use this later to make it easier to find which button is checked global horizontal_radio_buttons horizontal_radio_buttons = [] # Create a first radio button and add to the WrapPanel horizontal_radio_buttons.append(WPFControls.RadioButton()) horizontal_radio_buttons[0].Content = "No mesh" # Set the first radio button to be checked # Note the horrible notation required to define a Nullable Boolean True horizontal_radio_buttons[0].IsChecked = System.Nullable[System.Boolean]( True) hWrapPanel.Children.Add(horizontal_radio_buttons[0]) # Create a second radio button and add to the WrapPanel horizontal_radio_buttons.append(WPFControls.RadioButton()) horizontal_radio_buttons[1].Content = "For weld" hWrapPanel.Children.Add(horizontal_radio_buttons[1]) # Create a third radio button and add to the WrapPanel horizontal_radio_buttons.append(WPFControls.RadioButton()) horizontal_radio_buttons[2].Content = "Pull test" hWrapPanel.Children.Add(horizontal_radio_buttons[2]) # Position the WrapPanel in the first row, column of the Grid currRow += 1 WPFControls.Grid.SetRow(hWrapPanel, currRow) WPFControls.Grid.SetColumn(hWrapPanel, 0) WPFControls.Grid.SetColumnSpan(hWrapPanel, 3) #Create a button currRow += 2 buildJoint = WPFControls.Button() buildJoint.Content = "Build joint" WPFControls.Grid.SetRow(buildJoint, currRow) WPFControls.Grid.SetColumn(buildJoint, 0) buildJoint.Height = 30 WPFControls.Grid.SetColumnSpan(buildJoint, 3) #Link a function to the Button "Click" event #This function will be called every time the Button is clicked buildJoint.Click += BuildJoint # Add the controls to the Grid my_Grid.Children.Add(spotLbl) my_Grid.Children.Add(spotSize) my_Grid.Children.Add(horizLabel) my_Grid.Children.Add(horizThickLbl) my_Grid.Children.Add(horizThickInput) my_Grid.Children.Add(vertThickLbl) my_Grid.Children.Add(vertThickInput) my_Grid.Children.Add(gapLbl) my_Grid.Children.Add(gapInput) my_Grid.Children.Add(chkCreateGrippers) my_Grid.Children.Add(lblMeshType) my_Grid.Children.Add(hWrapPanel) my_Grid.Children.Add(buildJoint) #Return the Grid return my_Grid
def getCustomToolPropertyContent(): # Create a Grid my_Grid = WPFControls.Grid() # Add 2 Rows and 1 Column my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) currRow = 0 # Create input field currRow += 1 lbl01 = WPFControls.TextBlock() lbl01.Text = "Distance (mm):" WPFControls.Grid.SetRow(lbl01, currRow) WPFControls.Grid.SetColumn(lbl01, 0) WPFControls.Grid.SetColumnSpan(lbl01, 1) global input01 input01 = WPFControls.TextBox() WPFControls.Grid.SetRow(input01, currRow) WPFControls.Grid.SetColumn(input01, 1) # Create checkbox currRow += 1 global chk01 chk01 = WPFControls.CheckBox() chk01.Content = "Split solids" chk01.Height = 20 WPFControls.Grid.SetRow(chk01, currRow) WPFControls.Grid.SetColumn(chk01, 0) WPFControls.Grid.SetColumnSpan(chk01, 1) # Create checkbox currRow += 1 global chk02 chk02 = WPFControls.CheckBox() chk02.Content = "Split surfaces" chk02.Height = 20 WPFControls.Grid.SetRow(chk02, currRow) WPFControls.Grid.SetColumn(chk02, 0) WPFControls.Grid.SetColumnSpan(chk02, 1) chk02.IsChecked = System.Nullable[System.Boolean](True) # Create checkbox currRow += 1 global chk03 chk03 = WPFControls.CheckBox() chk03.Content = "Suppress extra vertices" chk03.Height = 20 WPFControls.Grid.SetRow(chk03, currRow) WPFControls.Grid.SetColumn(chk03, 0) WPFControls.Grid.SetColumnSpan(chk03, 1) # Create a button currRow += 1 actionButton = WPFControls.Button() actionButton.Content = "Expand beads and split" WPFControls.Grid.SetRow(actionButton, currRow) WPFControls.Grid.SetColumn(actionButton, 0) actionButton.Height = 30 WPFControls.Grid.SetColumnSpan(actionButton, 2) actionButton.Click += HandleApplyButton # Link a function to the Button "Click" event # Add the controls to the Grid my_Grid.Children.Add(lbl01) my_Grid.Children.Add(input01) my_Grid.Children.Add(chk01) my_Grid.Children.Add(chk02) my_Grid.Children.Add(chk03) my_Grid.Children.Add(actionButton) # Return the Grid return my_Grid
def getCustomToolPropertyContent(): #Create a Grid my_Grid = WPFControls.Grid() #Add 2 Rows and 1 Column my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) currRow = 0 generalLbl = WPFControls.TextBlock() generalLbl.Text = "Shape definition" WPFControls.Grid.SetRow(generalLbl, currRow) generalLbl.FontSize = 11 # -- Sheet 01 definition currRow += 1 globalWidthLbl = WPFControls.TextBlock() globalWidthLbl.Text = " Width (mm):" WPFControls.Grid.SetRow(globalWidthLbl, currRow) WPFControls.Grid.SetColumn(globalWidthLbl, 0) global globalWidthInput globalWidthInput =WPFControls.TextBox() WPFControls.Grid.SetRow(globalWidthInput, currRow) WPFControls.Grid.SetColumn(globalWidthInput, 1) currRow += 1 globalLengthLbl = WPFControls.TextBlock() globalLengthLbl.Text = " Length (mm):" WPFControls.Grid.SetRow(globalLengthLbl, currRow) WPFControls.Grid.SetColumn(globalLengthLbl, 0) global globalLengthInput globalLengthInput =WPFControls.TextBox() WPFControls.Grid.SetRow(globalLengthInput, currRow) WPFControls.Grid.SetColumn(globalLengthInput, 1) currRow += 1 thick01Lbl = WPFControls.TextBlock() thick01Lbl.Text = " Thickness 01 (mm):" WPFControls.Grid.SetRow(thick01Lbl, currRow) WPFControls.Grid.SetColumn(thick01Lbl, 0) global thick01Input thick01Input =WPFControls.TextBox() WPFControls.Grid.SetRow(thick01Input, currRow) WPFControls.Grid.SetColumn(thick01Input, 1) # -- Vertical sheet definition currRow += 1 thick02Lbl = WPFControls.TextBlock() thick02Lbl.Text = " Thickness 02 (mm):" WPFControls.Grid.SetRow(thick02Lbl, currRow) WPFControls.Grid.SetColumn(thick02Lbl, 0) global thick02Input thick02Input = WPFControls.TextBox() WPFControls.Grid.SetRow(thick02Input, currRow) WPFControls.Grid.SetColumn(thick02Input, 1) # Create checkbox to ask for mesh currRow += 1 global chkMesh chkMesh = WPFControls.CheckBox() chkMesh.Content = "Mesh the joint for me" chkMesh.Height = 20 WPFControls.Grid.SetRow(chkMesh, currRow) WPFControls.Grid.SetColumn(chkMesh, 0) WPFControls.Grid.SetColumnSpan(chkMesh, 3) #Create a button currRow += 1 buildJoint = WPFControls.Button() buildJoint.Content="Build joint" WPFControls.Grid.SetRow(buildJoint, currRow) WPFControls.Grid.SetColumn(buildJoint, 0) buildJoint.Height = 30 WPFControls.Grid.SetColumnSpan(buildJoint, 3) #Link a function to the Button "Click" event #This function will be called every time the Button is clicked buildJoint.Click+=BuildJoint # Add the controls to the Grid my_Grid.Children.Add(generalLbl) my_Grid.Children.Add(globalWidthLbl) my_Grid.Children.Add(globalWidthInput) my_Grid.Children.Add(globalLengthLbl) my_Grid.Children.Add(globalLengthInput) my_Grid.Children.Add(thick01Lbl) my_Grid.Children.Add(thick01Input) my_Grid.Children.Add(thick02Lbl) my_Grid.Children.Add(thick02Input) my_Grid.Children.Add(chkMesh) my_Grid.Children.Add(buildJoint) #Return the Grid return my_Grid
def getCustomToolPropertyContent(): #Create a Grid my_Grid = WPFControls.Grid() #Add 2 Rows and 1 Column my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) #Row 0 #Create a label (TextBlock) #Set it's Text value #Assign it to Row 0, Column 0 refineTextBlock = WPFControls.TextBlock() refineTextBlock.Text = "Refinement diameter (mm):" WPFControls.Grid.SetRow(refineTextBlock, 0) WPFControls.Grid.SetColumn(refineTextBlock, 0) global refineSizeTextBox #Create an empty input TextBox assign it to Row 0, Column 1 refineSizeTextBox = WPFControls.TextBox() WPFControls.Grid.SetRow(refineSizeTextBox, 0) WPFControls.Grid.SetColumn(refineSizeTextBox, 1) #Create a button and set it's text to "Import" #Assign it to Row1, Column 0 importBtn = WPFControls.Button() importBtn.Content = "Import CSV files" WPFControls.Grid.SetRow(importBtn, 1) WPFControls.Grid.SetColumn(importBtn, 0) #Link a function to the Button "Click" event #This function will be called every time the Button is clicked importBtn.Click += HandleimportBtn #Create an empty input TextBox global fileNameTextBox fileNameTextBox = WPFControls.TextBox() WPFControls.Grid.SetRow(fileNameTextBox, 2) WPFControls.Grid.SetColumn(fileNameTextBox, 1) selectedFilesText = WPFControls.TextBlock() selectedFilesText.Text = "File(s) selected:" WPFControls.Grid.SetRow(selectedFilesText, 2) WPFControls.Grid.SetColumn(selectedFilesText, 0) #Create a button #Assign it to Row1, Column 0 goSpots = WPFControls.Button() goSpots.Content = "Create spot locations" WPFControls.Grid.SetRow(goSpots, 3) WPFControls.Grid.SetColumn(goSpots, 0) WPFControls.Grid.SetColumnSpan(goSpots, 2) goSpots.Height = 30 #Link a function to the Button "Click" event #This function will be called every time the Butto is clicked goSpots.Click += HandleCreateSpots # Add the controls to the Grid my_Grid.Children.Add(importBtn) my_Grid.Children.Add(goSpots) my_Grid.Children.Add(refineTextBlock) my_Grid.Children.Add(refineSizeTextBox) my_Grid.Children.Add(fileNameTextBox) my_Grid.Children.Add(selectedFilesText) #Return the Grid return my_Grid
def getCustomToolPropertyContent(): # Create a Grid my_Grid = WPFControls.Grid() # Add 2 Rows and 1 Column my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) currRow = 0 # -- IDLbl = WPFControls.TextBlock() IDLbl.Text = "Separate by distance" WPFControls.Grid.SetRow(IDLbl, currRow) IDLbl.FontSize = 11 # Create input field currRow += 1 lbl01 = WPFControls.TextBlock() lbl01.Text = "Max number of points:" WPFControls.Grid.SetRow(lbl01, currRow) WPFControls.Grid.SetColumn(lbl01, 0) global input01 input01 = WPFControls.TextBox() WPFControls.Grid.SetRow(input01, currRow) WPFControls.Grid.SetColumn(input01, 1) input01.Text = "4" # Create a button currRow += 1 goButton = WPFControls.Button() goButton.Content = "Run fixture designer" WPFControls.Grid.SetRow(goButton, currRow) WPFControls.Grid.SetColumn(goButton, 0) goButton.Height = 30 WPFControls.Grid.SetColumnSpan(goButton, 3) # Link a function to the Button "Click" event # This function will be called every time the Button is clicked goButton.Click += HandleApplyButton # Add the controls to the Grid # my_Grid.Children.Add(IDLbl) my_Grid.Children.Add(lbl01) my_Grid.Children.Add(input01) my_Grid.Children.Add(goButton) # Return the Grid return my_Grid