完善 gmoccapy XYZAB 参考功能
This commit is contained in:
280
web-rtcp-5axis-sim-plan/app/src/runtime/gmoccapy-hal-model.js
Normal file
280
web-rtcp-5axis-sim-plan/app/src/runtime/gmoccapy-hal-model.js
Normal file
@@ -0,0 +1,280 @@
|
||||
export const gmoccapyHalModel = {
|
||||
apiName: "web-rtcp-5axis-gmoccapy-hal-model",
|
||||
profileId: "gmoccapy-xyzab",
|
||||
nativeConfigPath: "linuxcnc/configs/sim/gmoccapy/gmoccapy_XYZAB.ini",
|
||||
halFiles: [
|
||||
{
|
||||
path: "linuxcnc/configs/sim/gmoccapy/core_sim_XYZAB.hal",
|
||||
stage: "HALFILE",
|
||||
role: "trivkins and motmod simulation loopback",
|
||||
semanticBoundary: "native_hal_reference",
|
||||
},
|
||||
{
|
||||
path: "linuxcnc/configs/sim/gmoccapy/spindle_sim.hal",
|
||||
stage: "HALFILE",
|
||||
role: "spindle speed encoder and at-speed simulation",
|
||||
semanticBoundary: "native_hal_reference",
|
||||
},
|
||||
{
|
||||
path: "linuxcnc/configs/sim/gmoccapy/simulated_home.hal",
|
||||
stage: "HALFILE",
|
||||
role: "simulated X/Y/Z home switches",
|
||||
semanticBoundary: "native_hal_reference",
|
||||
},
|
||||
{
|
||||
path: "linuxcnc/configs/sim/gmoccapy/gmoccapy_postgui.hal",
|
||||
stage: "POSTGUI_HALFILE",
|
||||
role: "connections that require gmoccapy.* pins",
|
||||
requiresHalcompReady: true,
|
||||
semanticBoundary: "native_postgui_hal_reference",
|
||||
},
|
||||
],
|
||||
nativePins: [
|
||||
{
|
||||
group: "hard-buttons",
|
||||
pins: [
|
||||
"gmoccapy.h-button.button-0",
|
||||
"gmoccapy.h-button.button-1",
|
||||
"gmoccapy.h-button.button-2",
|
||||
"gmoccapy.h-button.button-3",
|
||||
"gmoccapy.h-button.button-4",
|
||||
"gmoccapy.h-button.button-5",
|
||||
"gmoccapy.h-button.button-6",
|
||||
"gmoccapy.h-button.button-7",
|
||||
"gmoccapy.h-button.button-8",
|
||||
"gmoccapy.h-button.button-9",
|
||||
"gmoccapy.v-button.button-0",
|
||||
"gmoccapy.v-button.button-1",
|
||||
"gmoccapy.v-button.button-2",
|
||||
"gmoccapy.v-button.button-3",
|
||||
"gmoccapy.v-button.button-4",
|
||||
"gmoccapy.v-button.button-5",
|
||||
"gmoccapy.v-button.button-6",
|
||||
],
|
||||
webSource: "current visible Web button set",
|
||||
semanticBoundary: "native_hardware_button_pin_reference",
|
||||
},
|
||||
{
|
||||
group: "jog",
|
||||
pins: [
|
||||
"gmoccapy.jog.axis.jog-x-plus",
|
||||
"gmoccapy.jog.axis.jog-x-minus",
|
||||
"gmoccapy.jog.axis.jog-y-plus",
|
||||
"gmoccapy.jog.axis.jog-y-minus",
|
||||
"gmoccapy.jog.axis.jog-z-plus",
|
||||
"gmoccapy.jog.axis.jog-z-minus",
|
||||
"gmoccapy.jog.axis.jog-a-plus",
|
||||
"gmoccapy.jog.axis.jog-a-minus",
|
||||
"gmoccapy.jog.axis.jog-b-plus",
|
||||
"gmoccapy.jog.axis.jog-b-minus",
|
||||
"gmoccapy.jog.jog-inc-0",
|
||||
"gmoccapy.jog.jog-increment",
|
||||
],
|
||||
webSource: "JOG dispatch and machine.jogIncrement",
|
||||
semanticBoundary: "native_jog_pin_reference_web_task_policy_gate",
|
||||
},
|
||||
{
|
||||
group: "override",
|
||||
pins: [
|
||||
"gmoccapy.feed.feed-override.counts",
|
||||
"gmoccapy.feed.feed-override.direct-value",
|
||||
"gmoccapy.spindle.spindle-override.counts",
|
||||
"gmoccapy.spindle.spindle-override.direct-value",
|
||||
"gmoccapy.jog.jog-velocity.counts",
|
||||
"gmoccapy.jog.jog-velocity.direct-value",
|
||||
"gmoccapy.rapid.rapid-override.counts",
|
||||
"gmoccapy.rapid.rapid-override.direct-value",
|
||||
],
|
||||
webSource: "feed/spindle override state",
|
||||
semanticBoundary: "native_override_pin_reference_web_state_mapping",
|
||||
},
|
||||
{
|
||||
group: "tool",
|
||||
pins: [
|
||||
"gmoccapy.tooloffset-x",
|
||||
"gmoccapy.tooloffset-z",
|
||||
"gmoccapy.tool-diameter",
|
||||
"gmoccapy.toolchange-change",
|
||||
"gmoccapy.toolchange-changed",
|
||||
"gmoccapy.toolchange-number",
|
||||
],
|
||||
webSource: "toolPreview and tool-change diagnostics",
|
||||
semanticBoundary: "native_tool_pin_reference_simulated_tool_loop",
|
||||
},
|
||||
{
|
||||
group: "program",
|
||||
pins: [
|
||||
"gmoccapy.program.length",
|
||||
"gmoccapy.program.current-line",
|
||||
"gmoccapy.program.progress",
|
||||
],
|
||||
webSource: "programLines, activeLine, programRuntimeFeedback",
|
||||
semanticBoundary: "native_program_pin_reference_web_execution_status",
|
||||
},
|
||||
{
|
||||
group: "message",
|
||||
pins: [
|
||||
"gmoccapy.error",
|
||||
"gmoccapy.delete-message",
|
||||
"gmoccapy.warning-confirm",
|
||||
],
|
||||
webSource: "operatorMessage and browser diagnostics",
|
||||
semanticBoundary: "native_message_pin_reference_web_operator_message",
|
||||
},
|
||||
{
|
||||
group: "spindle-postgui",
|
||||
pins: [
|
||||
"gmoccapy.spindle_feedback_bar",
|
||||
"gmoccapy.spindle_at_speed_led",
|
||||
],
|
||||
webSource: "spindle rpm/status panel",
|
||||
semanticBoundary: "postgui_spindle_feedback_reference",
|
||||
},
|
||||
],
|
||||
coreNets: [
|
||||
{
|
||||
signal: "Xpos",
|
||||
source: "joint.0.motor-pos-cmd",
|
||||
target: "joint.0.motor-pos-fb",
|
||||
role: "X command-to-feedback simulation loop",
|
||||
},
|
||||
{
|
||||
signal: "Ypos",
|
||||
source: "joint.1.motor-pos-cmd",
|
||||
target: "joint.1.motor-pos-fb",
|
||||
role: "Y command-to-feedback simulation loop",
|
||||
},
|
||||
{
|
||||
signal: "Zpos",
|
||||
source: "joint.2.motor-pos-cmd",
|
||||
target: "joint.2.motor-pos-fb",
|
||||
role: "Z command-to-feedback simulation loop",
|
||||
},
|
||||
{
|
||||
signal: "Apos",
|
||||
source: "joint.3.motor-pos-cmd",
|
||||
target: "joint.3.motor-pos-fb",
|
||||
role: "A command-to-feedback simulation loop",
|
||||
},
|
||||
{
|
||||
signal: "Bpos",
|
||||
source: "joint.4.motor-pos-cmd",
|
||||
target: "joint.4.motor-pos-fb",
|
||||
role: "B command-to-feedback simulation loop",
|
||||
},
|
||||
{
|
||||
signal: "estop-loop",
|
||||
source: "iocontrol.0.user-enable-out",
|
||||
target: "iocontrol.0.emc-enable-in",
|
||||
role: "simulated estop enable loop",
|
||||
},
|
||||
{
|
||||
signal: "tool-prep-loop",
|
||||
source: "iocontrol.0.tool-prepare",
|
||||
target: "iocontrol.0.tool-prepared",
|
||||
role: "simulated tool prepare completion",
|
||||
},
|
||||
{
|
||||
signal: "tool-change-loop",
|
||||
source: "iocontrol.0.tool-change",
|
||||
target: "iocontrol.0.tool-changed",
|
||||
role: "simulated automatic tool-change completion",
|
||||
},
|
||||
{
|
||||
signal: "flood",
|
||||
source: "iocontrol.0.coolant-flood",
|
||||
target: "gmoccapy coolant display via status",
|
||||
role: "coolant flood state",
|
||||
},
|
||||
{
|
||||
signal: "mist",
|
||||
source: "iocontrol.0.coolant-mist",
|
||||
target: "gmoccapy coolant display via status",
|
||||
role: "coolant mist state",
|
||||
},
|
||||
],
|
||||
spindleNets: [
|
||||
{
|
||||
signal: "spindle-speed-cmd",
|
||||
source: "spindle.0.speed-out",
|
||||
target: "limit_speed.in",
|
||||
role: "commanded spindle speed",
|
||||
},
|
||||
{
|
||||
signal: "spindle-speed-limited",
|
||||
source: "limit_speed.out",
|
||||
target: "sim_encoder_0.speed",
|
||||
role: "simulated spindle inertia",
|
||||
},
|
||||
{
|
||||
signal: "spindle-pos",
|
||||
source: "encoder_0.position",
|
||||
target: "spindle.0.revs",
|
||||
role: "encoder feedback position",
|
||||
},
|
||||
{
|
||||
signal: "spindle-at-speed",
|
||||
source: "near_speed.out",
|
||||
target: "spindle.0.at-speed",
|
||||
role: "at-speed comparator result",
|
||||
},
|
||||
],
|
||||
postguiNets: [
|
||||
{
|
||||
signal: "spindle-abs",
|
||||
source: "abs_spindle_feedback.out",
|
||||
target: "gmoccapy.spindle_feedback_bar",
|
||||
requiresHalcompReady: true,
|
||||
role: "spindle feedback bar",
|
||||
},
|
||||
{
|
||||
signal: "spindle-at-speed",
|
||||
source: "spindle.0.at-speed",
|
||||
target: "gmoccapy.spindle_at_speed_led",
|
||||
requiresHalcompReady: true,
|
||||
role: "spindle at-speed LED",
|
||||
},
|
||||
{
|
||||
signal: "tooloffset-x",
|
||||
source: "motion.tooloffset.x",
|
||||
target: "gmoccapy.tooloffset-x",
|
||||
requiresHalcompReady: true,
|
||||
role: "tool X offset display",
|
||||
},
|
||||
{
|
||||
signal: "tooloffset-z",
|
||||
source: "motion.tooloffset.z",
|
||||
target: "gmoccapy.tooloffset-z",
|
||||
requiresHalcompReady: true,
|
||||
role: "tool Z offset display",
|
||||
},
|
||||
{
|
||||
signal: "tool-change-loop",
|
||||
source: "iocontrol.0.tool-change",
|
||||
target: "iocontrol.0.tool-changed",
|
||||
requiresHalcompReady: true,
|
||||
simulationLoop: true,
|
||||
role: "automatic simulated tool-change completion",
|
||||
},
|
||||
],
|
||||
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");
|
||||
return {
|
||||
apiName: `${model.apiName}-summary`,
|
||||
profileId: model.profileId,
|
||||
halFileCount: model.halFiles.length,
|
||||
nativePinGroupCount: model.nativePins.length,
|
||||
nativePinCount: pinCount,
|
||||
coreNetCount: model.coreNets.length,
|
||||
spindleNetCount: model.spindleNets.length,
|
||||
postguiNetCount: model.postguiNets.length,
|
||||
postguiRequiresHalcompReady: Boolean(postguiFile?.requiresHalcompReady) &&
|
||||
model.postguiNets.every((net) => net.requiresHalcompReady),
|
||||
hasToolChangeSimulationLoop: model.postguiNets.some((net) => net.simulationLoop),
|
||||
semanticBoundary: model.semanticBoundary,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user