完善 working5 gmoccapy HAL 输入对标
This commit is contained in:
@@ -68,7 +68,13 @@ export const gmoccapyHalModel = {
|
||||
"gmoccapy.jog.axis.jog-b-plus",
|
||||
"gmoccapy.jog.axis.jog-b-minus",
|
||||
"gmoccapy.jog.jog-inc-0",
|
||||
"gmoccapy.jog.jog-inc-1",
|
||||
"gmoccapy.jog.jog-inc-2",
|
||||
"gmoccapy.jog.jog-inc-3",
|
||||
"gmoccapy.jog.jog-inc-4",
|
||||
"gmoccapy.jog.jog-inc-5",
|
||||
"gmoccapy.jog.jog-increment",
|
||||
"gmoccapy.jog.turtle-jog",
|
||||
],
|
||||
webSource: "JOG dispatch and machine.jogIncrement",
|
||||
semanticBoundary: "native_jog_pin_reference_web_task_policy_gate",
|
||||
@@ -77,17 +83,38 @@ export const gmoccapyHalModel = {
|
||||
group: "override",
|
||||
pins: [
|
||||
"gmoccapy.feed.feed-override.counts",
|
||||
"gmoccapy.feed.feed-override.count-enable",
|
||||
"gmoccapy.feed.feed-override.analog-enable",
|
||||
"gmoccapy.feed.feed-override.direct-value",
|
||||
"gmoccapy.feed.reset-feed-override",
|
||||
"gmoccapy.spindle.spindle-override.counts",
|
||||
"gmoccapy.spindle.spindle-override.count-enable",
|
||||
"gmoccapy.spindle.spindle-override.analog-enable",
|
||||
"gmoccapy.spindle.spindle-override.direct-value",
|
||||
"gmoccapy.spindle.reset-spindle-override",
|
||||
"gmoccapy.jog.jog-velocity.counts",
|
||||
"gmoccapy.jog.jog-velocity.count-enable",
|
||||
"gmoccapy.jog.jog-velocity.analog-enable",
|
||||
"gmoccapy.jog.jog-velocity.direct-value",
|
||||
"gmoccapy.rapid.rapid-override.counts",
|
||||
"gmoccapy.rapid.rapid-override.count-enable",
|
||||
"gmoccapy.rapid.rapid-override.analog-enable",
|
||||
"gmoccapy.rapid.rapid-override.direct-value",
|
||||
"gmoccapy.rapid.reset-rapid-override",
|
||||
],
|
||||
webSource: "feed/spindle override state",
|
||||
semanticBoundary: "native_override_pin_reference_web_state_mapping",
|
||||
},
|
||||
{
|
||||
group: "operator-inputs",
|
||||
pins: [
|
||||
"gmoccapy.ignore-limits",
|
||||
"gmoccapy.optional-stop",
|
||||
"gmoccapy.blockdelete",
|
||||
],
|
||||
webSource: "gmoccapyGui ignoreLimits, optionalBlocks, optionalStop",
|
||||
semanticBoundary: "native_ignore_limits_optional_stop_blockdelete_pin_reference_web_state_mapping",
|
||||
},
|
||||
{
|
||||
group: "tool",
|
||||
pins: [
|
||||
@@ -98,7 +125,7 @@ export const gmoccapyHalModel = {
|
||||
"gmoccapy.toolchange-changed",
|
||||
"gmoccapy.toolchange-number",
|
||||
],
|
||||
webSource: "toolPreview and tool-change diagnostics",
|
||||
webSource: "toolPreview and disconnected manual tool-change diagnostics",
|
||||
semanticBoundary: "native_tool_pin_reference_simulated_tool_loop",
|
||||
},
|
||||
{
|
||||
@@ -257,12 +284,319 @@ export const gmoccapyHalModel = {
|
||||
role: "automatic simulated tool-change completion",
|
||||
},
|
||||
],
|
||||
hardwareButtons: {
|
||||
source: {
|
||||
path: "linuxcnc/src/emc/usr_intf/gmoccapy/gmoccapy.py",
|
||||
methods: ["_button_pin_changed", "_get_child_button", "_make_hal_pins"],
|
||||
},
|
||||
behavior: {
|
||||
edge: "rising-edge-only",
|
||||
hButtonContainer: "current ntb_button page visible children",
|
||||
vButtonContainer: "vbtb_main visible children",
|
||||
insensitiveTarget: "ignored",
|
||||
hiddenLabelsSkipped: true,
|
||||
semanticBoundary: "native_gmoccapy_hardware_button_pin_to_visible_sensitive_button",
|
||||
},
|
||||
verticalMain: [
|
||||
{
|
||||
index: 0,
|
||||
pin: "gmoccapy.v-button.button-0",
|
||||
nativeWidget: "tbtn_estop",
|
||||
webAction: "ESTOP",
|
||||
webDispatch: { type: "ESTOP" },
|
||||
webSelector: '[data-action="estop"]',
|
||||
gate: "always clickable safety action",
|
||||
},
|
||||
{
|
||||
index: 1,
|
||||
pin: "gmoccapy.v-button.button-1",
|
||||
nativeWidget: "tbtn_on",
|
||||
webAction: "TOGGLE_POWER",
|
||||
webDispatch: { type: "TOGGLE_POWER" },
|
||||
webSelector: '[data-action="power"]',
|
||||
gate: "blocked while STATE_ESTOP",
|
||||
},
|
||||
{
|
||||
index: 2,
|
||||
pin: "gmoccapy.v-button.button-2",
|
||||
nativeWidget: "rbt_manual",
|
||||
webAction: "SET_MODE manual",
|
||||
webDispatch: { type: "SET_MODE", mode: "manual" },
|
||||
webSelector: '[data-action="mode-manual"]',
|
||||
gate: "machine on and AUTO interpreter idle",
|
||||
},
|
||||
{
|
||||
index: 3,
|
||||
pin: "gmoccapy.v-button.button-3",
|
||||
nativeWidget: "rbt_mdi",
|
||||
webAction: "SET_MODE mdi",
|
||||
webDispatch: { type: "SET_MODE", mode: "mdi" },
|
||||
webSelector: '[data-action="mode-mdi"]',
|
||||
gate: "machine on and homed when NO_FORCE_HOMING=0",
|
||||
},
|
||||
{
|
||||
index: 4,
|
||||
pin: "gmoccapy.v-button.button-4",
|
||||
nativeWidget: "rbt_auto",
|
||||
webAction: "SET_MODE auto",
|
||||
webDispatch: { type: "SET_MODE", mode: "auto" },
|
||||
webSelector: '[data-action="mode-auto"]',
|
||||
gate: "machine on and homed when NO_FORCE_HOMING=0",
|
||||
},
|
||||
{
|
||||
index: 5,
|
||||
pin: "gmoccapy.v-button.button-5",
|
||||
nativeWidget: "tbtn_user_tabs",
|
||||
webAction: "SET_MODE manual",
|
||||
webDispatch: { type: "SET_MODE", mode: "jog" },
|
||||
webSelector: '[data-action="mode-jog"]',
|
||||
gate: "machine on and manual page available",
|
||||
},
|
||||
{
|
||||
index: 6,
|
||||
pin: "gmoccapy.v-button.button-6",
|
||||
nativeWidget: "tbtn_setup",
|
||||
webAction: "UI_CONTROL",
|
||||
webSelector: null,
|
||||
gate: "native setup page is diagnostic-only in the Web shell",
|
||||
},
|
||||
],
|
||||
bottomMain: [
|
||||
{
|
||||
index: 0,
|
||||
pin: "gmoccapy.h-button.button-0",
|
||||
nativeWidget: "btn_homing",
|
||||
webAction: "HOME",
|
||||
webDispatch: { type: "HOME" },
|
||||
webSelector: '[data-action="HOME"]',
|
||||
gate: "machine on and manual mode",
|
||||
},
|
||||
{
|
||||
index: 1,
|
||||
pin: "gmoccapy.h-button.button-1",
|
||||
nativeWidget: "btn_touch",
|
||||
webAction: "UI_CONTROL",
|
||||
webSelector: null,
|
||||
gate: "touch-off page not implemented in Web shell",
|
||||
},
|
||||
{
|
||||
index: 3,
|
||||
pin: "gmoccapy.h-button.button-3",
|
||||
nativeWidget: "btn_tool",
|
||||
webAction: "UI_CONTROL",
|
||||
webSelector: null,
|
||||
gate: "tool editor page not implemented in Web shell",
|
||||
},
|
||||
{
|
||||
index: 6,
|
||||
pin: "gmoccapy.h-button.button-6",
|
||||
nativeWidget: "tbtn_switch_mode",
|
||||
webAction: "SET_KINS_TYPE identity",
|
||||
webSelector: null,
|
||||
gate: "native joint/world switch page position is diagnostic-only in the Web shell",
|
||||
},
|
||||
],
|
||||
},
|
||||
halPinActions: {
|
||||
source: {
|
||||
path: "linuxcnc/src/emc/usr_intf/gmoccapy/gmoccapy.py",
|
||||
methods: [
|
||||
"_ignore_limits",
|
||||
"_optional_blocks",
|
||||
"_blockdelete",
|
||||
"_on_pin_jog_changed",
|
||||
"_on_pin_incr_changed",
|
||||
"_on_counts_changed",
|
||||
"_on_analog_enable_changed",
|
||||
"_on_analog_value_changed",
|
||||
"_reset_override",
|
||||
"_del_message_changed",
|
||||
],
|
||||
prefPath: "linuxcnc/configs/sim/gmoccapy/gmoccapy_XYZAB.pref",
|
||||
},
|
||||
jogPins: {
|
||||
axes: [
|
||||
{ axis: "x", plus: "gmoccapy.jog.axis.jog-x-plus", minus: "gmoccapy.jog.axis.jog-x-minus" },
|
||||
{ axis: "y", plus: "gmoccapy.jog.axis.jog-y-plus", minus: "gmoccapy.jog.axis.jog-y-minus" },
|
||||
{ axis: "z", plus: "gmoccapy.jog.axis.jog-z-plus", minus: "gmoccapy.jog.axis.jog-z-minus" },
|
||||
{ axis: "a", plus: "gmoccapy.jog.axis.jog-a-plus", minus: "gmoccapy.jog.axis.jog-a-minus" },
|
||||
{ axis: "b", plus: "gmoccapy.jog.axis.jog-b-plus", minus: "gmoccapy.jog.axis.jog-b-minus" },
|
||||
],
|
||||
increments: [
|
||||
{ index: 0, pin: "gmoccapy.jog.jog-inc-0", label: "Continuous", distance: 0 },
|
||||
{ index: 1, pin: "gmoccapy.jog.jog-inc-1", label: "1.000 mm", distance: 1 },
|
||||
{ index: 2, pin: "gmoccapy.jog.jog-inc-2", label: "0.100 mm", distance: 0.1 },
|
||||
{ index: 3, pin: "gmoccapy.jog.jog-inc-3", label: "0.010 mm", distance: 0.01 },
|
||||
{ index: 4, pin: "gmoccapy.jog.jog-inc-4", label: "0.001 mm", distance: 0.001 },
|
||||
{ index: 5, pin: "gmoccapy.jog.jog-inc-5", label: "1.2345 in", distance: 31.3563 },
|
||||
],
|
||||
outputPin: "gmoccapy.jog.jog-increment",
|
||||
turtlePin: "gmoccapy.jog.turtle-jog",
|
||||
nativeCallbacks: {
|
||||
axis: "_on_pin_jog_changed -> _on_btn_jog_pressed/_on_btn_jog_released",
|
||||
increment: "_on_pin_incr_changed -> _jog_increment_changed",
|
||||
turtle: "_on_pin_turtle_jog -> tbtn_turtle_jog.set_active",
|
||||
},
|
||||
},
|
||||
operatorPins: [
|
||||
{
|
||||
pin: "gmoccapy.ignore-limits",
|
||||
nativeCallback: "_ignore_limits -> chk_ignore_limits.set_active",
|
||||
nativeCommand: "on_chk_ignore_limits_toggled -> command.override_limits() when active",
|
||||
webDispatch: { type: "GMOCAPY_HAL_PIN", pin: "gmoccapy.ignore-limits" },
|
||||
webState: "gmoccapyGui.ignoreLimits",
|
||||
},
|
||||
{
|
||||
pin: "gmoccapy.optional-stop",
|
||||
nativeCallback: "_optional_blocks",
|
||||
nativeCommand: "tbtn_optional_blocks -> command.set_block_delete(state)",
|
||||
webDispatch: { type: "GMOCAPY_HAL_PIN", pin: "gmoccapy.optional-stop" },
|
||||
webState: "gmoccapyGui.optionalBlocks",
|
||||
},
|
||||
{
|
||||
pin: "gmoccapy.blockdelete",
|
||||
nativeCallback: "_blockdelete",
|
||||
nativeCommand: "command.set_optional_stop(state)",
|
||||
webDispatch: { type: "GMOCAPY_HAL_PIN", pin: "gmoccapy.blockdelete" },
|
||||
webState: "gmoccapyGui.optionalStop",
|
||||
},
|
||||
],
|
||||
overridePins: [
|
||||
{
|
||||
target: "feed",
|
||||
counts: "gmoccapy.feed.feed-override.counts",
|
||||
countEnable: "gmoccapy.feed.feed-override.count-enable",
|
||||
analogEnable: "gmoccapy.feed.feed-override.analog-enable",
|
||||
directValue: "gmoccapy.feed.feed-override.direct-value",
|
||||
reset: "gmoccapy.feed.reset-feed-override",
|
||||
nativeWidget: "spc_feed",
|
||||
scalePref: "scale_feed_override=1",
|
||||
webState: "feed.feedOverride",
|
||||
},
|
||||
{
|
||||
target: "rapid",
|
||||
counts: "gmoccapy.rapid.rapid-override.counts",
|
||||
countEnable: "gmoccapy.rapid.rapid-override.count-enable",
|
||||
analogEnable: "gmoccapy.rapid.rapid-override.analog-enable",
|
||||
directValue: "gmoccapy.rapid.rapid-override.direct-value",
|
||||
reset: "gmoccapy.rapid.reset-rapid-override",
|
||||
nativeWidget: "spc_rapid",
|
||||
scalePref: "scale_rapid_override=1",
|
||||
webState: "feed.rapidOverride",
|
||||
},
|
||||
{
|
||||
target: "spindle",
|
||||
counts: "gmoccapy.spindle.spindle-override.counts",
|
||||
countEnable: "gmoccapy.spindle.spindle-override.count-enable",
|
||||
analogEnable: "gmoccapy.spindle.spindle-override.analog-enable",
|
||||
directValue: "gmoccapy.spindle.spindle-override.direct-value",
|
||||
reset: "gmoccapy.spindle.reset-spindle-override",
|
||||
nativeWidget: "spc_spindle",
|
||||
scalePref: "scale_spindle_override=1",
|
||||
webState: "spindle.override",
|
||||
},
|
||||
{
|
||||
target: "jogVelocity",
|
||||
counts: "gmoccapy.jog.jog-velocity.counts",
|
||||
countEnable: "gmoccapy.jog.jog-velocity.count-enable",
|
||||
analogEnable: "gmoccapy.jog.jog-velocity.analog-enable",
|
||||
directValue: "gmoccapy.jog.jog-velocity.direct-value",
|
||||
reset: null,
|
||||
nativeWidget: "spc_lin_jog_vel",
|
||||
scalePref: "scale_jog_vel=140.4",
|
||||
webState: "gmoccapyGui.jogVelocity",
|
||||
},
|
||||
],
|
||||
messagePins: [
|
||||
{
|
||||
pin: "gmoccapy.delete-message",
|
||||
nativeCallback: "_del_message_changed",
|
||||
nativeCommand: "pin true deletes first alert message when gmoccapy.error is set, otherwise del_last()",
|
||||
webState: "operatorMessage",
|
||||
},
|
||||
{
|
||||
pin: "gmoccapy.warning-confirm",
|
||||
nativeCallback: "dialogs.warning_dialog periodic confirm_pin poll",
|
||||
nativeCommand: "pin true responds OK to active warning dialog",
|
||||
webState: "gmoccapyGui.warningConfirm",
|
||||
},
|
||||
{
|
||||
pin: "gmoccapy.error",
|
||||
nativeCallback: "_show_error/_on_message_deleted",
|
||||
nativeCommand: "HAL OUT bit tracks alert messages",
|
||||
webState: "gmoccapyGui.error",
|
||||
},
|
||||
],
|
||||
behavior: {
|
||||
optionalStopPinCrossesToBlockDelete: true,
|
||||
blockdeletePinCrossesToOptionalStop: true,
|
||||
jogAxisPinsPressRelease: true,
|
||||
jogPinsUseTaskPolicyGate: true,
|
||||
jogIncrementPinsRisingEdgeOnly: true,
|
||||
jogIncrementZeroIsContinuous: true,
|
||||
turtleJogLevelDriven: true,
|
||||
countInputRequiresEnable: true,
|
||||
directValueRequiresAnalogEnable: true,
|
||||
resetPinsRisingEdgeOnly: true,
|
||||
deleteMessageRisingEdgeOnly: true,
|
||||
warningConfirmLevelPolled: true,
|
||||
directValueRange: "0..1",
|
||||
semanticBoundary: "native_gmoccapy_hal_pin_callbacks_to_web_store_actions",
|
||||
},
|
||||
},
|
||||
toolChange: {
|
||||
strategy: "iocontrol-loopback",
|
||||
manualGmoccapyPinsConnected: false,
|
||||
remapCodes: ["M6", "M61"],
|
||||
postguiUnlinks: [
|
||||
{
|
||||
pin: "iocontrol.0.tool-change",
|
||||
reason: "gmoccapy_postgui.hal removes the core_sim connection before applying the final loopback",
|
||||
},
|
||||
{
|
||||
pin: "iocontrol.0.tool-changed",
|
||||
reason: "gmoccapy_postgui.hal removes the core_sim connection before applying the final loopback",
|
||||
},
|
||||
{
|
||||
pin: "iocontrol.0.tool-prep-number",
|
||||
reason: "manual gmoccapy tool-change number net is not active in this simulation",
|
||||
},
|
||||
],
|
||||
commentedManualGuiNets: [
|
||||
{
|
||||
signal: "tool-change",
|
||||
source: "iocontrol.0.tool-change",
|
||||
target: "gmoccapy.toolchange-change",
|
||||
},
|
||||
{
|
||||
signal: "tool-changed",
|
||||
source: "gmoccapy.toolchange-changed",
|
||||
target: "iocontrol.0.tool-changed",
|
||||
},
|
||||
{
|
||||
signal: "tool-prep-number",
|
||||
source: "iocontrol.0.tool-prep-number",
|
||||
target: "gmoccapy.toolchange-number",
|
||||
},
|
||||
],
|
||||
activeLoop: {
|
||||
signal: "tool-change-loop",
|
||||
source: "iocontrol.0.tool-change",
|
||||
target: "iocontrol.0.tool-changed",
|
||||
stage: "POSTGUI_HALFILE",
|
||||
},
|
||||
semanticBoundary: "gmoccapy_xyzab_iocontrol_tool_change_loop_no_manual_gui_dialog",
|
||||
},
|
||||
semanticBoundary: "gmoccapy_hal_pin_postgui_reference_web_diagnostic_only",
|
||||
};
|
||||
|
||||
export function createGmoccapyHalSummary(model = gmoccapyHalModel) {
|
||||
const pinCount = model.nativePins.reduce((total, group) => total + group.pins.length, 0);
|
||||
const postguiFile = model.halFiles.find((file) => file.stage === "POSTGUI_HALFILE");
|
||||
const mappedHardwareButtonCount = [
|
||||
...(model.hardwareButtons?.verticalMain || []),
|
||||
...(model.hardwareButtons?.bottomMain || []),
|
||||
].filter((button) => button.webSelector).length;
|
||||
return {
|
||||
apiName: `${model.apiName}-summary`,
|
||||
profileId: model.profileId,
|
||||
@@ -275,6 +609,48 @@ export function createGmoccapyHalSummary(model = gmoccapyHalModel) {
|
||||
postguiRequiresHalcompReady: Boolean(postguiFile?.requiresHalcompReady) &&
|
||||
model.postguiNets.every((net) => net.requiresHalcompReady),
|
||||
hasToolChangeSimulationLoop: model.postguiNets.some((net) => net.simulationLoop),
|
||||
toolChangeStrategy: model.toolChange.strategy,
|
||||
manualToolChangeGuiConnected: model.toolChange.manualGmoccapyPinsConnected,
|
||||
postguiToolUnlinkCount: model.toolChange.postguiUnlinks.length,
|
||||
commentedManualToolChangeNetCount: model.toolChange.commentedManualGuiNets.length,
|
||||
hardwareButtonVerticalCount: model.hardwareButtons.verticalMain.length,
|
||||
hardwareButtonBottomMainCount: model.hardwareButtons.bottomMain.length,
|
||||
mappedHardwareButtonCount,
|
||||
hardwareButtonEdge: model.hardwareButtons.behavior.edge,
|
||||
hardwareButtonInsensitiveTarget: model.hardwareButtons.behavior.insensitiveTarget,
|
||||
operatorInputPinCount: model.halPinActions.operatorPins.length,
|
||||
overridePinTargetCount: model.halPinActions.overridePins.length,
|
||||
jogAxisPinCount: (model.halPinActions.jogPins?.axes || []).length * 2,
|
||||
jogIncrementPinCount: model.halPinActions.jogPins?.increments?.length || 0,
|
||||
messageInputPinCount: model.halPinActions.messagePins.length,
|
||||
optionalStopPinCrossesToBlockDelete: model.halPinActions.behavior.optionalStopPinCrossesToBlockDelete,
|
||||
blockdeletePinCrossesToOptionalStop: model.halPinActions.behavior.blockdeletePinCrossesToOptionalStop,
|
||||
jogAxisPinsPressRelease: model.halPinActions.behavior.jogAxisPinsPressRelease,
|
||||
jogPinsUseTaskPolicyGate: model.halPinActions.behavior.jogPinsUseTaskPolicyGate,
|
||||
jogIncrementPinsRisingEdgeOnly: model.halPinActions.behavior.jogIncrementPinsRisingEdgeOnly,
|
||||
jogIncrementZeroIsContinuous: model.halPinActions.behavior.jogIncrementZeroIsContinuous,
|
||||
turtleJogLevelDriven: model.halPinActions.behavior.turtleJogLevelDriven,
|
||||
countInputRequiresEnable: model.halPinActions.behavior.countInputRequiresEnable,
|
||||
directValueRequiresAnalogEnable: model.halPinActions.behavior.directValueRequiresAnalogEnable,
|
||||
resetPinsRisingEdgeOnly: model.halPinActions.behavior.resetPinsRisingEdgeOnly,
|
||||
deleteMessageRisingEdgeOnly: model.halPinActions.behavior.deleteMessageRisingEdgeOnly,
|
||||
warningConfirmLevelPolled: model.halPinActions.behavior.warningConfirmLevelPolled,
|
||||
semanticBoundary: model.semanticBoundary,
|
||||
};
|
||||
}
|
||||
|
||||
export function resolveGmoccapyHardwareButton(input, model = gmoccapyHalModel) {
|
||||
const pin = typeof input === "string" ? input : input?.pin;
|
||||
const location = typeof input === "object" ? input?.location || input?.panel : null;
|
||||
const index = typeof input === "object" && input?.index !== undefined ? Number(input.index) : null;
|
||||
const allButtons = [
|
||||
...(model.hardwareButtons?.verticalMain || []).map((button) => ({ ...button, panel: "right", location: "v" })),
|
||||
...(model.hardwareButtons?.bottomMain || []).map((button) => ({ ...button, panel: "bottom", location: "h" })),
|
||||
];
|
||||
if (pin) return allButtons.find((button) => button.pin === pin) || null;
|
||||
if (!Number.isFinite(index)) return null;
|
||||
const normalizedLocation = location === "right" || location === "v" || location === "vertical" ? "v"
|
||||
: location === "bottom" || location === "h" || location === "horizontal" ? "h"
|
||||
: null;
|
||||
return allButtons.find((button) => button.location === normalizedLocation && button.index === index) || null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user