Eliminate many "doing what you told me to" messages

These messages were perhaps originally intended as a debuggin aid but now add clutter to the output panes. Remaining messges are mostly the result of methods to display attributes of an object (which one could call from the Python console) or actually provide some information which would not be obvious from the circumstances
This commit is contained in:
Kevin Martin
2024-02-01 00:42:15 -05:00
parent 9dafb71ca5
commit 02ebb17558
35 changed files with 53 additions and 280 deletions

View File

@@ -191,7 +191,6 @@ class TaskPanelCircularArray:
if self.valid_input:
self.create_object()
# The internal function already displays messages
# self.print_messages()
self.finish()
def validate_input(self, selection,
@@ -326,10 +325,6 @@ class TaskPanelCircularArray:
self.form.input_c_z.setProperty('rawValue', 0)
self.center = self.get_center()
_msg(translate("draft","Center reset:")
+ " ({0}, {1}, {2})".format(self.center.x,
self.center.y,
self.center.z))
def print_fuse_state(self, fuse):
"""Print the fuse state translated."""
@@ -342,7 +337,6 @@ class TaskPanelCircularArray:
def set_fuse(self):
"""Execute as a callback when the fuse checkbox changes."""
self.fuse = self.form.checkbox_fuse.isChecked()
self.print_fuse_state(self.fuse)
params.set_param("Draft_array_fuse", self.fuse)
def print_link_state(self, use_link):
@@ -356,9 +350,9 @@ class TaskPanelCircularArray:
def set_link(self):
"""Execute as a callback when the link checkbox changes."""
self.use_link = self.form.checkbox_link.isChecked()
self.print_link_state(self.use_link)
params.set_param("Draft_array_Link", self.use_link)
def print_messages(self):
"""Print messages about the operation."""
if len(self.selection) == 1:
@@ -475,7 +469,6 @@ class TaskPanelCircularArray:
def reject(self):
"""Execute when clicking the Cancel button or pressing Escape."""
_msg(translate("draft","Aborted:") + " {}".format(translate("draft","Circular array")))
self.finish()
def finish(self):

View File

@@ -185,7 +185,6 @@ class TaskPanelOrthoArray:
if self.valid_input:
self.create_object()
# The internal function already displays messages
# self.print_messages()
self.finish()
def validate_input(self, selection,
@@ -311,28 +310,16 @@ class TaskPanelOrthoArray:
self.form.input_X_y.setProperty('rawValue', 0)
self.form.input_X_z.setProperty('rawValue', 0)
self.v_x, self.v_y, self.v_z = self.get_intervals()
_msg(translate("draft","Interval X reset:")
+ " ({0}, {1}, {2})".format(self.v_x.x,
self.v_x.y,
self.v_x.z))
elif interval == "Y":
self.form.input_Y_x.setProperty('rawValue', 0)
self.form.input_Y_y.setProperty('rawValue', 100)
self.form.input_Y_z.setProperty('rawValue', 0)
self.v_x, self.v_y, self.v_z = self.get_intervals()
_msg(translate("draft","Interval Y reset:")
+ " ({0}, {1}, {2})".format(self.v_y.x,
self.v_y.y,
self.v_y.z))
elif interval == "Z":
self.form.input_Z_x.setProperty('rawValue', 0)
self.form.input_Z_y.setProperty('rawValue', 0)
self.form.input_Z_z.setProperty('rawValue', 100)
self.v_x, self.v_y, self.v_z = self.get_intervals()
_msg(translate("draft","Interval Z reset:")
+ " ({0}, {1}, {2})".format(self.v_z.x,
self.v_z.y,
self.v_z.z))
def print_fuse_state(self, fuse):
"""Print the fuse state translated."""
@@ -345,7 +332,6 @@ class TaskPanelOrthoArray:
def set_fuse(self):
"""Execute as a callback when the fuse checkbox changes."""
self.fuse = self.form.checkbox_fuse.isChecked()
self.print_fuse_state(self.fuse)
params.set_param("Draft_array_fuse", self.fuse)
def print_link_state(self, use_link):
@@ -359,7 +345,6 @@ class TaskPanelOrthoArray:
def set_link(self):
"""Execute as a callback when the link checkbox changes."""
self.use_link = self.form.checkbox_link.isChecked()
self.print_link_state(self.use_link)
params.set_param("Draft_array_Link", self.use_link)
def print_messages(self):
@@ -392,7 +377,6 @@ class TaskPanelOrthoArray:
def reject(self):
"""Execute when clicking the Cancel button or pressing Escape."""
_msg(translate("draft","Aborted:") + " {}".format(translate("draft","Orthogonal array")))
self.finish()
def finish(self):

View File

@@ -281,10 +281,6 @@ class TaskPanelPolarArray:
self.form.input_c_z.setProperty('rawValue', 0)
self.center = self.get_center()
_msg(translate("draft","Center reset:")
+ " ({0}, {1}, {2})".format(self.center.x,
self.center.y,
self.center.z))
def print_fuse_state(self, fuse):
"""Print the fuse state translated."""
@@ -297,7 +293,6 @@ class TaskPanelPolarArray:
def set_fuse(self):
"""Execute as a callback when the fuse checkbox changes."""
self.fuse = self.form.checkbox_fuse.isChecked()
self.print_fuse_state(self.fuse)
params.set_param("Draft_array_fuse", self.fuse)
def print_link_state(self, use_link):
@@ -311,7 +306,6 @@ class TaskPanelPolarArray:
def set_link(self):
"""Execute as a callback when the link checkbox changes."""
self.use_link = self.form.checkbox_link.isChecked()
self.print_link_state(self.use_link)
params.set_param("Draft_array_Link", self.use_link)
def print_messages(self):
@@ -428,7 +422,6 @@ class TaskPanelPolarArray:
def reject(self):
"""Execute when clicking the Cancel button or pressing Escape."""
_msg(translate("draft","Aborted:") + " {}".format(translate("draft","Polar array")))
self.finish()
def finish(self):

View File

@@ -35,7 +35,7 @@ import FreeCAD as App
import FreeCADGui as Gui
import Draft_rc
from draftguitools import gui_tool_utils
from draftutils.messages import _err, _msg
from draftutils.messages import _err
from draftutils.params import get_param
from draftutils.translate import translate
from DraftVecUtils import toString