完善 working6 gmoccapy 页面诊断边界

This commit is contained in:
2026-06-27 00:01:01 -04:00
parent f964cedf66
commit 0e1e9d61a8
22 changed files with 2336 additions and 18 deletions

View File

@@ -115,17 +115,31 @@ export const gmoccapyHalModel = {
webSource: "gmoccapyGui ignoreLimits, optionalBlocks, optionalStop",
semanticBoundary: "native_ignore_limits_optional_stop_blockdelete_pin_reference_web_state_mapping",
},
{
group: "settings",
pins: [
"gmoccapy.unlock-settings",
],
webSource: "gmoccapyGui settingsUnlockPin and setupSensitive",
semanticBoundary: "native_settings_unlock_pin_reference_web_diagnostic_state",
},
{
group: "tool",
pins: [
"gmoccapy.tooloffset-x",
"gmoccapy.tooloffset-z",
"gmoccapy.tool-diameter",
"gmoccapy.probeheight",
"gmoccapy.blockheight",
"gmoccapy.toolmeasurement",
"gmoccapy.searchvel",
"gmoccapy.probevel",
"gmoccapy.toolchange-change",
"gmoccapy.toolchange-changed",
"gmoccapy.toolchange-number",
"gmoccapy.toolchange-confirm",
],
webSource: "toolPreview and disconnected manual tool-change diagnostics",
webSource: "toolPreview, disconnected manual tool-change diagnostics, and disabled XYZAB tool measurement outputs",
semanticBoundary: "native_tool_pin_reference_simulated_tool_loop",
},
{
@@ -347,16 +361,17 @@ export const gmoccapyHalModel = {
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",
webAction: "GMOCAPY_NATIVE_PAGE user-tabs",
webDispatch: { type: "GMOCAPY_NATIVE_PAGE", pageId: "user-tabs", nativeWidget: "tbtn_user_tabs" },
webSelector: null,
gate: "native user tabs page is diagnostic-only in the Web shell",
},
{
index: 6,
pin: "gmoccapy.v-button.button-6",
nativeWidget: "tbtn_setup",
webAction: "UI_CONTROL",
webAction: "GMOCAPY_NATIVE_PAGE setup",
webDispatch: { type: "GMOCAPY_NATIVE_PAGE", pageId: "setup", nativeWidget: "tbtn_setup" },
webSelector: null,
gate: "native setup page is diagnostic-only in the Web shell",
},
@@ -375,7 +390,8 @@ export const gmoccapyHalModel = {
index: 1,
pin: "gmoccapy.h-button.button-1",
nativeWidget: "btn_touch",
webAction: "UI_CONTROL",
webAction: "GMOCAPY_NATIVE_PAGE touch-off",
webDispatch: { type: "GMOCAPY_NATIVE_PAGE", pageId: "touch-off", nativeWidget: "btn_touch" },
webSelector: null,
gate: "touch-off page not implemented in Web shell",
},
@@ -383,7 +399,8 @@ export const gmoccapyHalModel = {
index: 3,
pin: "gmoccapy.h-button.button-3",
nativeWidget: "btn_tool",
webAction: "UI_CONTROL",
webAction: "GMOCAPY_NATIVE_PAGE tool-editor",
webDispatch: { type: "GMOCAPY_NATIVE_PAGE", pageId: "tool-editor", nativeWidget: "btn_tool" },
webSelector: null,
gate: "tool editor page not implemented in Web shell",
},
@@ -391,7 +408,8 @@ export const gmoccapyHalModel = {
index: 6,
pin: "gmoccapy.h-button.button-6",
nativeWidget: "tbtn_switch_mode",
webAction: "SET_KINS_TYPE identity",
webAction: "GMOCAPY_NATIVE_PAGE switchkins-mode",
webDispatch: { type: "GMOCAPY_NATIVE_PAGE", pageId: "switchkins-mode", nativeWidget: "tbtn_switch_mode" },
webSelector: null,
gate: "native joint/world switch page position is diagnostic-only in the Web shell",
},
@@ -411,6 +429,13 @@ export const gmoccapyHalModel = {
"_on_analog_value_changed",
"_reset_override",
"_del_message_changed",
"_on_unlock_settings_changed",
"_check_toolmeasurement",
"on_chk_use_tool_measurement_toggled",
"on_btn_block_height_clicked",
"_on_blockheight_value_changed",
"_init_user_messages",
"_show_user_message",
],
prefPath: "linuxcnc/configs/sim/gmoccapy/gmoccapy_XYZAB.pref",
},
@@ -461,6 +486,16 @@ export const gmoccapyHalModel = {
webState: "gmoccapyGui.optionalStop",
},
],
settingsPins: [
{
pin: "gmoccapy.unlock-settings",
nativeCallback: "_on_unlock_settings_changed",
nativeCommand: "rbt_hal_unlock active gates tbtn_setup sensitivity from pin level",
prefDefault: "unlock_way=use",
webDispatch: { type: "GMOCAPY_HAL_PIN", pin: "gmoccapy.unlock-settings" },
webState: "gmoccapyGui.settingsUnlockPin",
},
],
overridePins: [
{
target: "feed",
@@ -527,9 +562,64 @@ export const gmoccapyHalModel = {
webState: "gmoccapyGui.error",
},
],
toolMeasurementPins: {
toolsensorConfigured: false,
useToolMeasurementPref: false,
prefDefaults: {
useToolMeasurement: "use_toolmeasurement=False",
blockHeight: "blockheight=0.0",
},
disabledReason: "gmoccapy_XYZAB.ini has no [TOOLSENSOR] data, so _check_toolmeasurement disables the controls",
pins: [
{
pin: "gmoccapy.probeheight",
direction: "HAL_OUT",
nativeCallback: "on_spbtn_probe_height_value_changed / on_chk_use_tool_measurement_toggled / on_btn_block_height_clicked",
webState: "gmoccapyGui.probeHeight",
},
{
pin: "gmoccapy.blockheight",
direction: "HAL_OUT",
nativeCallback: "on_btn_block_height_clicked / _on_blockheight_value_changed",
webState: "gmoccapyGui.blockHeight",
},
{
pin: "gmoccapy.toolmeasurement",
direction: "HAL_OUT",
nativeCallback: "on_chk_use_tool_measurement_toggled",
webState: "gmoccapyGui.toolMeasurement",
},
{
pin: "gmoccapy.searchvel",
direction: "HAL_OUT",
nativeCallback: "on_spbtn_search_vel_value_changed / on_chk_use_tool_measurement_toggled",
webState: "gmoccapyGui.searchVelocity",
},
{
pin: "gmoccapy.probevel",
direction: "HAL_OUT",
nativeCallback: "on_spbtn_probe_vel_value_changed / on_chk_use_tool_measurement_toggled",
webState: "gmoccapyGui.probeVelocity",
},
],
},
userMessages: {
configured: false,
configuredMessageCount: 0,
pins: [],
source: "get_ini_info.get_user_messages()",
disabledReason: "gmoccapy_XYZAB.ini has no MESSAGE_* entries, so _init_user_messages() returns without creating messages.* pins",
dynamicPinPatterns: [
"gmoccapy.messages.<pinname>",
"gmoccapy.messages.<pinname>-waiting",
"gmoccapy.messages.<pinname>-response",
],
supportedTypes: ["status", "okdialog", "yesnodialog"],
},
behavior: {
optionalStopPinCrossesToBlockDelete: true,
blockdeletePinCrossesToOptionalStop: true,
unlockSettingsLevelDriven: true,
jogAxisPinsPressRelease: true,
jogPinsUseTaskPolicyGate: true,
jogIncrementPinsRisingEdgeOnly: true,
@@ -540,10 +630,124 @@ export const gmoccapyHalModel = {
resetPinsRisingEdgeOnly: true,
deleteMessageRisingEdgeOnly: true,
warningConfirmLevelPolled: true,
toolMeasurementPinsAreHalOut: true,
toolMeasurementDisabledWithoutToolsensor: true,
userMessagesDynamicIniOnly: true,
directValueRange: "0..1",
semanticBoundary: "native_gmoccapy_hal_pin_callbacks_to_web_store_actions",
},
},
nativePages: {
source: {
path: "linuxcnc/src/emc/usr_intf/gmoccapy/gmoccapy.py",
gladePath: "linuxcnc/src/emc/usr_intf/gmoccapy/gmoccapy.glade",
methods: [
"_init_IconFileSelection",
"_init_file_to_load",
"on_btn_load_clicked",
"on_IconFileSelection1_selected",
"on_hal_status_file_loaded",
"_make_macro_button",
"_on_btn_macro_pressed",
"_init_tooleditor",
"_show_tooledit_tab",
"on_btn_tool_clicked",
"on_btn_selected_tool_clicked",
"on_btn_select_tool_by_no_clicked",
"on_tbtn_setup_toggled",
"on_tbtn_user_tabs_toggled",
"on_btn_touch_clicked",
],
},
filePage: {
pageId: "file-load",
nativeNotebookPage: "_BB_LOAD_FILE / ntb_preview page 3",
nativeWidget: "IconFileSelection1",
programPrefix: "../../nc_files/",
defaultOpenPreference: "open_file",
fileExtensions: [
"*.ngc",
"*.png",
"*.gif",
"*.jpg",
"*.py",
],
nativeCallbacks: [
"on_btn_load_clicked -> _show_iconview_tab(True)",
"on_IconFileSelection1_selected -> hal_action_open.load_file(path)",
"on_hal_status_file_loaded -> gmoccapy.program.length",
"on_hal_status_line_changed -> gmoccapy.program.current-line/progress",
],
webSurface: "OPEN_FILE input, staged LinuxCNC G-code source selector and program preview",
webAction: "GMOCAPY_PAGE_ACTION file-load diagnostics",
implementation: "partial",
boundary: "native_GtkIconFileSelection_not_embedded_in_browser",
},
macroPage: {
pageId: "mdi-macros",
nativeContainer: "hbtb_MDI",
iniSection: "[MACROS]",
macroLimit: 14,
macros: [
{ name: "i_am_lost", args: [], file: "macros/i_am_lost.ngc", commandTemplate: "O<i_am_lost> call" },
{ name: "halo_world", args: [], file: "macros/halo_world.ngc", commandTemplate: "O<halo_world> call" },
{ name: "jog_around", args: [], file: "macros/jog_around.ngc", commandTemplate: "O<jog_around> call" },
{ name: "increment", args: ["xinc", "yinc"], file: "macros/increment.ngc", commandTemplate: "O<increment> call [xinc] [yinc]" },
{ name: "go_to_position", args: ["X-pos", "Y-pos", "Z-pos"], file: "macros/go_to_position.ngc", commandTemplate: "O<go_to_position> call [X-pos] [Y-pos] [Z-pos]" },
],
nativeCallbacks: [
"_make_macro_button -> get_ini_info.get_macros()",
"_on_btn_macro_pressed -> command.mdi(O<name> call [args])",
"on_hal_status_interp_idle enables macro buttons",
"on_hal_status_interp_run disables macro buttons",
],
webAction: "GMOCAPY_RUN_MACRO",
implementation: "partial",
boundary: "macro_buttons_map_to_MDI_command_without_native_entry_dialogs",
},
toolEditorPage: {
pageId: "tool-editor",
nativeNotebookPage: "ntb_preview page 2 / _BB_TOOL",
nativeWidget: "tooledit1",
toolTablePath: "linuxcnc/configs/sim/gmoccapy/tool.tbl",
visibleAxes: ["X", "Y", "Z", "A", "B"],
toolCount: 17,
nativeCallbacks: [
"_init_tooleditor -> tooledit1.set_filename(tool.tbl)",
"_show_tooledit_tab(True) -> tooledit1.reload()",
"on_btn_selected_tool_clicked -> M61 Q? or T? M6",
"on_btn_save_tool_changes_clicked -> tooledit1.save(None)",
"on_btn_reload_tooltable_clicked -> tooledit1.reload(None)",
],
webAction: "GMOCAPY_TOOL_EDITOR_ACTION diagnostics",
editableInWeb: false,
implementation: "diagnostic-only",
boundary: "tool_table_writeback_not_promoted_browser_keeps_iocontrol_loopback",
},
implementationMatrix: [
{ pageId: "main", nativeWidget: "ntb_main page 0", implementation: "implemented", webSurface: "DRO/G-code/preview/main controls", hardButton: null },
{ pageId: "manual-home", nativeWidget: "btn_homing / _BB_HOME", implementation: "partial", webSurface: "HOME action", hardButton: "gmoccapy.h-button.button-0" },
{ pageId: "mdi-macros", nativeWidget: "hbtb_MDI macro buttons", implementation: "partial", webSurface: "MDI macro diagnostics and dispatch", hardButton: null },
{ pageId: "auto-run", nativeWidget: "_BB_AUTO buttons", implementation: "partial", webSurface: "RUN/STOP/PAUSE/STEP controls", hardButton: null },
{ pageId: "file-load", nativeWidget: "IconFileSelection1 / _BB_LOAD_FILE", implementation: "partial", webSurface: "OPEN_FILE input and staged source selector", hardButton: null },
{ pageId: "tool-editor", nativeWidget: "btn_tool / tooledit1", implementation: "diagnostic-only", webSurface: "tool table summary and action diagnostics", hardButton: "gmoccapy.h-button.button-3" },
{ pageId: "touch-off", nativeWidget: "btn_touch / offsetpage1", implementation: "diagnostic-only", webSurface: "touch-off boundary diagnostics", hardButton: "gmoccapy.h-button.button-1" },
{ pageId: "setup", nativeWidget: "tbtn_setup / ntb_setup", implementation: "diagnostic-only", webSurface: "settings/unlock diagnostics", hardButton: "gmoccapy.v-button.button-6" },
{ pageId: "user-tabs", nativeWidget: "tbtn_user_tabs / ntb_user_tabs", implementation: "diagnostic-only", webSurface: "user tab boundary diagnostics", hardButton: "gmoccapy.v-button.button-5" },
{ pageId: "switchkins-mode", nativeWidget: "tbtn_switch_mode", implementation: "diagnostic-only", webSurface: "identity-only XYZAB switchkins diagnostic", hardButton: "gmoccapy.h-button.button-6" },
{ pageId: "edit", nativeWidget: "_BB_EDIT / gcode_view editable", implementation: "native-only", webSurface: "not promoted", hardButton: null },
{ pageId: "offset-editor", nativeWidget: "offsetpage1 edit offsets", implementation: "native-only", webSurface: "not promoted", hardButton: null },
],
behavior: {
unimplementedPagesDiagnosticOnly: true,
hardButtonsDoNotFakeNativePages: true,
fileChooserNotNativeGtk: true,
macroButtonsUseMdiGate: true,
toolEditorWritebackDisabled: true,
toolEditorKeepsIocontrolLoopback: true,
semanticBoundary: "native_gmoccapy_page_matrix_web_diagnostic_boundary",
},
},
toolChange: {
strategy: "iocontrol-loopback",
manualGmoccapyPinsConnected: false,
@@ -619,12 +823,19 @@ export function createGmoccapyHalSummary(model = gmoccapyHalModel) {
hardwareButtonEdge: model.hardwareButtons.behavior.edge,
hardwareButtonInsensitiveTarget: model.hardwareButtons.behavior.insensitiveTarget,
operatorInputPinCount: model.halPinActions.operatorPins.length,
settingsInputPinCount: model.halPinActions.settingsPins.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,
toolMeasurementPinCount: model.halPinActions.toolMeasurementPins.pins.length,
toolMeasurementEnabled: model.halPinActions.toolMeasurementPins.useToolMeasurementPref,
toolsensorConfigured: model.halPinActions.toolMeasurementPins.toolsensorConfigured,
userMessagePinCount: model.halPinActions.userMessages.pins.length,
userMessagesConfigured: model.halPinActions.userMessages.configured,
optionalStopPinCrossesToBlockDelete: model.halPinActions.behavior.optionalStopPinCrossesToBlockDelete,
blockdeletePinCrossesToOptionalStop: model.halPinActions.behavior.blockdeletePinCrossesToOptionalStop,
unlockSettingsLevelDriven: model.halPinActions.behavior.unlockSettingsLevelDriven,
jogAxisPinsPressRelease: model.halPinActions.behavior.jogAxisPinsPressRelease,
jogPinsUseTaskPolicyGate: model.halPinActions.behavior.jogPinsUseTaskPolicyGate,
jogIncrementPinsRisingEdgeOnly: model.halPinActions.behavior.jogIncrementPinsRisingEdgeOnly,
@@ -635,6 +846,27 @@ export function createGmoccapyHalSummary(model = gmoccapyHalModel) {
resetPinsRisingEdgeOnly: model.halPinActions.behavior.resetPinsRisingEdgeOnly,
deleteMessageRisingEdgeOnly: model.halPinActions.behavior.deleteMessageRisingEdgeOnly,
warningConfirmLevelPolled: model.halPinActions.behavior.warningConfirmLevelPolled,
toolMeasurementPinsAreHalOut: model.halPinActions.behavior.toolMeasurementPinsAreHalOut,
toolMeasurementDisabledWithoutToolsensor: model.halPinActions.behavior.toolMeasurementDisabledWithoutToolsensor,
userMessagesDynamicIniOnly: model.halPinActions.behavior.userMessagesDynamicIniOnly,
nativePageCount: model.nativePages.implementationMatrix.length,
implementedNativePageCount: model.nativePages.implementationMatrix
.filter((page) => page.implementation === "implemented").length,
partialNativePageCount: model.nativePages.implementationMatrix
.filter((page) => page.implementation === "partial").length,
diagnosticOnlyNativePageCount: model.nativePages.implementationMatrix
.filter((page) => page.implementation === "diagnostic-only").length,
nativeOnlyPageCount: model.nativePages.implementationMatrix
.filter((page) => page.implementation === "native-only").length,
filePageImplementation: model.nativePages.filePage.implementation,
filePageBoundary: model.nativePages.filePage.boundary,
macroCount: model.nativePages.macroPage.macros.length,
macroLimit: model.nativePages.macroPage.macroLimit,
macroButtonsUseMdiGate: model.nativePages.behavior.macroButtonsUseMdiGate,
toolEditorImplementation: model.nativePages.toolEditorPage.implementation,
toolEditorWritebackDisabled: model.nativePages.behavior.toolEditorWritebackDisabled,
hardButtonsDoNotFakeNativePages: model.nativePages.behavior.hardButtonsDoNotFakeNativePages,
unimplementedPagesDiagnosticOnly: model.nativePages.behavior.unimplementedPagesDiagnosticOnly,
semanticBoundary: model.semanticBoundary,
};
}