Skip to content

Commit

Permalink
add conical option
Browse files Browse the repository at this point in the history
  • Loading branch information
5axes committed Jan 21, 2021
1 parent a2f26c6 commit 1b8af68
Show file tree
Hide file tree
Showing 5 changed files with 420 additions and 140 deletions.
43 changes: 39 additions & 4 deletions CustomSupport.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//
// proterties values
// "SSize" : Support Size in mm
// "MSize" : Support Maximum Size in mm
// "ISize" : Support Interior Size in mm
// "AAngle" : Support Angle in °
// "YDirection" : Support Y direction (Abutment)
Expand All @@ -22,7 +23,8 @@ Item
height: childrenRect.height
UM.I18nCatalog { id: catalog; name: "cura"}

property var maximum: UM.ActiveTool.properties.getValue("SSize")
property var s_size: UM.ActiveTool.properties.getValue("SSize")
property var m_size: UM.ActiveTool.properties.getValue("MSize")
property var currentSType: UM.ActiveTool.properties.getValue("SType")

function setSType(type)
Expand Down Expand Up @@ -135,7 +137,18 @@ Item
renderType: Text.NativeRendering
width: Math.ceil(contentWidth) //Make sure that the grid cells have an integer width.
}


Label
{
height: UM.Theme.getSize("setting_control").height;
text: catalog.i18nc("@label","Max Size");
font: UM.Theme.getFont("default");
color: UM.Theme.getColor("text");
verticalAlignment: Text.AlignVCenter;
renderType: Text.NativeRendering
width: Math.ceil(contentWidth) //Make sure that the grid cells have an integer width.
}

Label
{
height: UM.Theme.getSize("setting_control").height;
Expand Down Expand Up @@ -181,6 +194,28 @@ Item
}
}

TextField
{
id: maxTextField
width: UM.Theme.getSize("setting_control").width;
height: UM.Theme.getSize("setting_control").height;
property string unit: "mm";
style: UM.Theme.styles.text_field;
text: UM.ActiveTool.properties.getValue("MSize")
validator: DoubleValidator
{
decimals: 2
bottom: 0
locale: "en_US"
}

onEditingFinished:
{
var modified_text = text.replace(",", ".") // User convenience. We use dots for decimal values
UM.ActiveTool.setProperty("MSize", modified_text);
}
}

TextField
{
id: sizeInteriorTextField
Expand All @@ -193,15 +228,15 @@ Item
validator: DoubleValidator
{
decimals: 2
top: maximum
top: s_size
bottom: 0.1
locale: "en_US"
}

onEditingFinished:
{
var cur_text = parseFloat(text)
if ( cur_text >= maximum )
if ( cur_text >= s_size )
{
}
var modified_text = text.replace(",", ".") // User convenience. We use dots for decimal values
Expand Down
Loading

0 comments on commit 1b8af68

Please sign in to comment.