ToolsCalculatorsPrefGroupUI.py 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. from PyQt5 import QtWidgets
  2. from flatcamGUI.GUIElements import FCDoubleSpinner
  3. from flatcamGUI.preferences.OptionsGroupUI import OptionsGroupUI
  4. class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
  5. def __init__(self, decimals=4, parent=None):
  6. # OptionsGroupUI.__init__(self, "Calculators Tool Options", parent=parent)
  7. super(ToolsCalculatorsPrefGroupUI, self).__init__(self)
  8. self.setTitle(str(_("Calculators Tool Options")))
  9. self.decimals = decimals
  10. # ## V-shape Calculator Tool
  11. self.vshape_tool_label = QtWidgets.QLabel("<b>%s:</b>" % _("V-Shape Tool Calculator"))
  12. self.vshape_tool_label.setToolTip(
  13. _("Calculate the tool diameter for a given V-shape tool,\n"
  14. "having the tip diameter, tip angle and\n"
  15. "depth-of-cut as parameters.")
  16. )
  17. self.layout.addWidget(self.vshape_tool_label)
  18. grid0 = QtWidgets.QGridLayout()
  19. grid0.setColumnStretch(0, 0)
  20. grid0.setColumnStretch(1, 1)
  21. self.layout.addLayout(grid0)
  22. # ## Tip Diameter
  23. self.tip_dia_entry = FCDoubleSpinner()
  24. self.tip_dia_entry.set_range(0.000001, 9999.9999)
  25. self.tip_dia_entry.set_precision(self.decimals)
  26. self.tip_dia_entry.setSingleStep(0.1)
  27. self.tip_dia_label = QtWidgets.QLabel('%s:' % _("Tip Diameter"))
  28. self.tip_dia_label.setToolTip(
  29. _("This is the tool tip diameter.\n"
  30. "It is specified by manufacturer.")
  31. )
  32. grid0.addWidget(self.tip_dia_label, 0, 0)
  33. grid0.addWidget(self.tip_dia_entry, 0, 1)
  34. # ## Tip angle
  35. self.tip_angle_entry = FCDoubleSpinner()
  36. self.tip_angle_entry.set_range(0.0, 180.0)
  37. self.tip_angle_entry.set_precision(self.decimals)
  38. self.tip_angle_entry.setSingleStep(5)
  39. self.tip_angle_label = QtWidgets.QLabel('%s:' % _("Tip Angle"))
  40. self.tip_angle_label.setToolTip(
  41. _("This is the angle on the tip of the tool.\n"
  42. "It is specified by manufacturer.")
  43. )
  44. grid0.addWidget(self.tip_angle_label, 1, 0)
  45. grid0.addWidget(self.tip_angle_entry, 1, 1)
  46. # ## Depth-of-cut Cut Z
  47. self.cut_z_entry = FCDoubleSpinner()
  48. self.cut_z_entry.set_range(-9999.9999, 0.0000)
  49. self.cut_z_entry.set_precision(self.decimals)
  50. self.cut_z_entry.setSingleStep(0.01)
  51. self.cut_z_label = QtWidgets.QLabel('%s:' % _("Cut Z"))
  52. self.cut_z_label.setToolTip(
  53. _("This is depth to cut into material.\n"
  54. "In the CNCJob object it is the CutZ parameter.")
  55. )
  56. grid0.addWidget(self.cut_z_label, 2, 0)
  57. grid0.addWidget(self.cut_z_entry, 2, 1)
  58. # ## Electroplating Calculator Tool
  59. self.plate_title_label = QtWidgets.QLabel("<b>%s:</b>" % _("ElectroPlating Calculator"))
  60. self.plate_title_label.setToolTip(
  61. _("This calculator is useful for those who plate the via/pad/drill holes,\n"
  62. "using a method like grahite ink or calcium hypophosphite ink or palladium chloride.")
  63. )
  64. grid0.addWidget(self.plate_title_label, 3, 0, 1, 2)
  65. # ## PCB Length
  66. self.pcblength_entry = FCDoubleSpinner()
  67. self.pcblength_entry.set_range(0.000001, 9999.9999)
  68. self.pcblength_entry.set_precision(self.decimals)
  69. self.pcblength_entry.setSingleStep(0.1)
  70. self.pcblengthlabel = QtWidgets.QLabel('%s:' % _("Board Length"))
  71. self.pcblengthlabel.setToolTip(_('This is the board length. In centimeters.'))
  72. grid0.addWidget(self.pcblengthlabel, 4, 0)
  73. grid0.addWidget(self.pcblength_entry, 4, 1)
  74. # ## PCB Width
  75. self.pcbwidth_entry = FCDoubleSpinner()
  76. self.pcbwidth_entry.set_range(0.000001, 9999.9999)
  77. self.pcbwidth_entry.set_precision(self.decimals)
  78. self.pcbwidth_entry.setSingleStep(0.1)
  79. self.pcbwidthlabel = QtWidgets.QLabel('%s:' % _("Board Width"))
  80. self.pcbwidthlabel.setToolTip(_('This is the board width.In centimeters.'))
  81. grid0.addWidget(self.pcbwidthlabel, 5, 0)
  82. grid0.addWidget(self.pcbwidth_entry, 5, 1)
  83. # ## Current Density
  84. self.cdensity_label = QtWidgets.QLabel('%s:' % _("Current Density"))
  85. self.cdensity_entry = FCDoubleSpinner()
  86. self.cdensity_entry.set_range(0.000001, 9999.9999)
  87. self.cdensity_entry.set_precision(self.decimals)
  88. self.cdensity_entry.setSingleStep(0.1)
  89. self.cdensity_label.setToolTip(_("Current density to pass through the board. \n"
  90. "In Amps per Square Feet ASF."))
  91. grid0.addWidget(self.cdensity_label, 6, 0)
  92. grid0.addWidget(self.cdensity_entry, 6, 1)
  93. # ## PCB Copper Growth
  94. self.growth_label = QtWidgets.QLabel('%s:' % _("Copper Growth"))
  95. self.growth_entry = FCDoubleSpinner()
  96. self.growth_entry.set_range(0.000001, 9999.9999)
  97. self.growth_entry.set_precision(self.decimals)
  98. self.growth_entry.setSingleStep(0.01)
  99. self.growth_label.setToolTip(_("How thick the copper growth is intended to be.\n"
  100. "In microns."))
  101. grid0.addWidget(self.growth_label, 7, 0)
  102. grid0.addWidget(self.growth_entry, 7, 1)
  103. self.layout.addStretch()