Path: Several fixes suggested by wmayer
This commit is contained in:
parent
44ae0d7ae7
commit
9b476e140d
|
@ -109,7 +109,7 @@ Vector3d Command::getCenter (void)
|
|||
return vec;
|
||||
}
|
||||
|
||||
const double Command::getValue(const std::string attr)
|
||||
const double Command::getValue(const std::string& attr)
|
||||
{
|
||||
std::string a(attr);
|
||||
boost::to_upper(a);
|
||||
|
@ -119,11 +119,11 @@ const double Command::getValue(const std::string attr)
|
|||
return val;
|
||||
}
|
||||
|
||||
const bool Command::has(const std::string attr)
|
||||
const bool Command::has(const std::string& attr)
|
||||
{
|
||||
std::string a(attr);
|
||||
boost::to_upper(a);
|
||||
return (bool)Parameters.count(a);
|
||||
return Parameters.count(a) > 0;
|
||||
}
|
||||
|
||||
std::string Command::toGCode (void) const
|
||||
|
@ -139,7 +139,7 @@ std::string Command::toGCode (void) const
|
|||
return str.str();
|
||||
}
|
||||
|
||||
void Command::setFromGCode (std::string str)
|
||||
void Command::setFromGCode (const std::string& str)
|
||||
{
|
||||
Parameters.clear();
|
||||
std::string mode = "none";
|
||||
|
|
|
@ -53,11 +53,11 @@ namespace Path
|
|||
Base::Vector3d getCenter (void); // returns a 3d vector from the i,j,k parameters
|
||||
void setCenter(const Base::Vector3d&, bool clockwise=true); // sets the center coordinates and the command name
|
||||
std::string toGCode (void) const; // returns a GCode string representation of the command
|
||||
void setFromGCode (std::string); // sets the parameters from the contents of the given GCode string
|
||||
void setFromGCode (const std::string&); // sets the parameters from the contents of the given GCode string
|
||||
void setFromPlacement (const Base::Placement&); // sets the parameters from the contents of the given placement
|
||||
const bool has(const std::string); // returns true if the given string exists in the parameters
|
||||
const bool has(const std::string&); // returns true if the given string exists in the parameters
|
||||
Command transform(const Base::Placement); // returns a transformed copy of this command
|
||||
const double getValue(const std::string); // returns the value of a given parameter
|
||||
const double getValue(const std::string&); // returns the value of a given parameter
|
||||
|
||||
// attributes
|
||||
std::string Name;
|
||||
|
|
|
@ -58,7 +58,6 @@ PyObject *ToolPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Pytho
|
|||
// constructor method
|
||||
int ToolPy::PyInit(PyObject* args, PyObject* kwd)
|
||||
{
|
||||
PyObject *pos;
|
||||
char *name="Default tool";
|
||||
char *type = "Undefined";
|
||||
char *mat = "Undefined";
|
||||
|
|
|
@ -40,6 +40,8 @@
|
|||
|
||||
using namespace PathGui;
|
||||
|
||||
/* TRANSLATOR PathGui::DlgProcessorChooser */
|
||||
|
||||
DlgProcessorChooser::DlgProcessorChooser(std::vector<std::string> &scriptnames)
|
||||
: QDialog(Gui::getMainWindow()), ui(new Ui_DlgProcessorChooser)
|
||||
{
|
||||
|
@ -64,7 +66,7 @@ void DlgProcessorChooser::accept()
|
|||
if (ui->comboBox->currentText() == tr("None"))
|
||||
entry = "";
|
||||
else
|
||||
entry = ui->comboBox->currentText().toStdString();
|
||||
entry = ui->comboBox->currentText().toUtf8().data();
|
||||
QDialog::accept();
|
||||
}
|
||||
#include "moc_DlgProcessorChooser.cpp"
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
using namespace PathGui;
|
||||
|
||||
/* TRANSLATOR PartGui::DlgSettingsPathColor */
|
||||
/* TRANSLATOR PathGui::DlgSettingsPathColor */
|
||||
|
||||
/**
|
||||
* Constructs a DlgSettingsObjectColor which is a child of 'parent', with the
|
||||
|
|
|
@ -231,7 +231,7 @@ void ViewProviderPath::updateData(const App::Property* prop)
|
|||
bool absolute = true;
|
||||
bool first = true;
|
||||
|
||||
for (int i = 0; i < tp.getSize(); i++) {
|
||||
for (unsigned int i = 0; i < tp.getSize(); i++) {
|
||||
Path::Command cmd = tp.getCommand(i);
|
||||
std::string name = cmd.Name;
|
||||
Base::Vector3d next = cmd.getPlacement().getPosition();
|
||||
|
|
Loading…
Reference in New Issue
Block a user