Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/emc/nml_intf/emc_nml.hh
Original file line number Diff line number Diff line change
Expand Up @@ -1638,7 +1638,7 @@ class EMC_TOOL_STAT:public EMC_TOOL_STAT_MSG {
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
EMC_TOOL_STAT& operator =(const EMC_TOOL_STAT &s); // need this for [] members
EMC_TOOL_STAT& operator =(const EMC_TOOL_STAT &) = delete; // No copy assignment

int pocketPrepped; // idx ready for loading from
int toolInSpindle; // tool loaded, 0 is no tool
Expand Down
36 changes: 3 additions & 33 deletions src/emc/nml_intf/emcops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
* Last change:
********************************************************************/

#include "libnml/rcs/rcs_print.hh"
#include "emc.hh"
#include "emc_nml.hh"
#include "tooldata/tooldata.hh"

EMC_AXIS_STAT::EMC_AXIS_STAT()
: EMC_AXIS_STAT_MSG(EMC_AXIS_STAT_TYPE, sizeof(EMC_AXIS_STAT)),
Expand Down Expand Up @@ -159,13 +157,14 @@ EMC_TOOL_STAT::EMC_TOOL_STAT()
toolInSpindle(0), // toolno
toolFromPocket(0) // tool_from_pocket
#ifndef TOOL_NML // {
, toolTableCurrent(tooldata_entry_init())
, toolTableCurrent CANON_TOOL_TABLE_INIT
#endif
{
#ifdef TOOL_NML //{
const struct CANON_TOOL_TABLE tdata = CANON_TOOL_TABLE_INIT;
int idx;
for (idx = 0; idx < CANON_POCKETS_MAX; idx++) {
toolTable[idx] = tooldata_entry_init();
toolTable[idx] = tdata;
}
#endif //}
}
Expand Down Expand Up @@ -201,35 +200,6 @@ EMC_COOLANT_STAT::EMC_COOLANT_STAT()
{
}

// overload = , since class has array elements
EMC_TOOL_STAT& EMC_TOOL_STAT::operator =(const EMC_TOOL_STAT& s)
{
pocketPrepped = s.pocketPrepped; // idx
toolInSpindle = s.toolInSpindle; // toolno
toolFromPocket = s.toolFromPocket; // tool_from_pocket

#ifdef TOOL_NML //{
int idx;
for (idx = 0; idx < CANON_POCKETS_MAX; idx++) {
toolTable[idx].toolno = s.toolTable[idx].toolno;
toolTable[idx].pocketno = s.toolTable[idx].pocketno;
toolTable[idx].offset = s.toolTable[idx].offset;
toolTable[idx].diameter = s.toolTable[idx].diameter;
toolTable[idx].frontangle = s.toolTable[idx].frontangle;
toolTable[idx].backangle = s.toolTable[idx].backangle;
toolTable[idx].orientation = s.toolTable[idx].orientation;
}
#else //}{
struct CANON_TOOL_TABLE tdata;
if (tooldata_get(&tdata,0) != IDX_OK) {
rcs_print_error("UNEXPECTED idx %s %d\n",__FILE__,__LINE__);
}
toolTableCurrent = tdata;
#endif //}

return *this;
}

EMC_STAT::EMC_STAT()
: EMC_STAT_MSG(EMC_STAT_TYPE, sizeof(EMC_STAT)),
debug(0)
Expand Down
4 changes: 4 additions & 0 deletions src/emc/nml_intf/emctool.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ struct CANON_TOOL_TABLE {
char comment[CANON_TOOL_COMMENT_SIZE];
};

/* default state of an entry: no tool, no pocket, zero geometry */
#define CANON_TOOL_TABLE_INIT \
{ -1, -1, { { 0, 0, 0 }, 0, 0, 0, 0, 0, 0 }, 0, 0, 0, 0, { 0 } }

#endif
11 changes: 1 addition & 10 deletions src/emc/tooldata/tooldata_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,7 @@ void tooldata_init(bool random_toolchanger)

struct CANON_TOOL_TABLE tooldata_entry_init()
{
struct CANON_TOOL_TABLE tdata;
tdata.toolno = -1;
tdata.pocketno = -1;
tdata.diameter = 0;
tdata.frontangle = 0;
tdata.backangle = 0;
tdata.orientation = 0;
ZERO_EMC_POSE(tdata.offset);
tdata.comment[0] = 0;

struct CANON_TOOL_TABLE tdata = CANON_TOOL_TABLE_INIT;
return tdata;
} // tooldata_entry_init()

Expand Down