按规划继续工作
结论:接入 vendored LinuxCNC tooldata_common.cc 负责刀具表解析与保存,WASM/SDK/OPFS/UI 仅做运行时边界搬运;native、WASM、OPFS 和浏览器 smoke 验证已通过。
This commit is contained in:
50
wasm-port/runtime/core/shims/tooldata.hh
Normal file
50
wasm-port/runtime/core/shims/tooldata.hh
Normal file
@@ -0,0 +1,50 @@
|
||||
#pragma once
|
||||
|
||||
#include "emc/nml_intf/canon.hh"
|
||||
|
||||
extern "C" {
|
||||
|
||||
typedef enum {
|
||||
IDX_OK = 0,
|
||||
IDX_NEW,
|
||||
IDX_FAIL,
|
||||
} toolidx_t;
|
||||
|
||||
typedef enum {
|
||||
DB_NOTUSED = 0,
|
||||
DB_ACTIVE,
|
||||
} tooldb_t;
|
||||
|
||||
typedef enum {
|
||||
SPINDLE_LOAD,
|
||||
SPINDLE_UNLOAD,
|
||||
TOOL_OFFSET,
|
||||
} tool_notify_t;
|
||||
|
||||
struct CANON_TOOL_TABLE tooldata_entry_init(void);
|
||||
toolidx_t tooldata_put(struct CANON_TOOL_TABLE tdata, int idx);
|
||||
toolidx_t tooldata_get(CANON_TOOL_TABLE *pdata, int idx);
|
||||
|
||||
void tooldata_init(bool random_tool_changer);
|
||||
void tooldata_reset(void);
|
||||
void tooldata_last_index_set(int idx);
|
||||
int tooldata_last_index_get(void);
|
||||
int tooldata_find_index_for_tool(int toolno);
|
||||
|
||||
void tooldata_format_toolline(int idx,
|
||||
bool ignore_zero_values,
|
||||
CANON_TOOL_TABLE tdata,
|
||||
char formatted_line[CANON_TOOL_ENTRY_LEN]);
|
||||
|
||||
void tooldata_add_init(int nonrandom_start_idx);
|
||||
int tooldata_read_entry(const char *input_line);
|
||||
|
||||
void tooldata_set_db(tooldb_t mode);
|
||||
int tooldata_load(const char *filename);
|
||||
int tooldata_save(const char *filename);
|
||||
|
||||
#define DB_SPINDLE_SAVE "./db_spindle.tbl"
|
||||
|
||||
int tooldata_db_getall(void);
|
||||
|
||||
}
|
||||
@@ -1,23 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#include "emc/nml_intf/emctool.h"
|
||||
#include "linuxcnc_tool_adapter.hh"
|
||||
|
||||
enum {
|
||||
IDX_OK = 0,
|
||||
};
|
||||
|
||||
inline CANON_TOOL_TABLE tooldata_entry_init()
|
||||
{
|
||||
return standalone::tool_entry_init();
|
||||
}
|
||||
|
||||
inline int tooldata_find_index_for_tool(int toolno)
|
||||
{
|
||||
return standalone::find_tool_index_for_tool(toolno);
|
||||
}
|
||||
|
||||
inline int tooldata_get(CANON_TOOL_TABLE *tool, int index)
|
||||
{
|
||||
return standalone::get_tool_entry(tool, index) == 0 ? IDX_OK : -1;
|
||||
}
|
||||
#include "../tooldata.hh"
|
||||
|
||||
Reference in New Issue
Block a user