Add AC/BC RTCP programs and 3D machine manager

This commit is contained in:
2026-09-20 12:31:12 +08:00
parent 1c1e5f9672
commit 8aab531b02
363 changed files with 53213 additions and 58 deletions

View File

@@ -0,0 +1,17 @@
import { pathToFileURL } from 'node:url';
const { chromium } = await import(pathToFileURL(process.env.PLAYWRIGHT_MODULE).href);
const output = new URL('../docs/teaching/rtcp-five-axis/assets/', import.meta.url);
const browser = await chromium.launch({ executablePath: '/usr/bin/google-chrome', headless: true, args: ['--no-sandbox', '--use-angle=swiftshader', '--enable-unsafe-swiftshader'] });
try {
const page = await browser.newPage({ viewport: { width: 1440, height: 1000 }, deviceScaleFactor: 2 });
await page.goto(process.env.XYZAC_PANEL_URL ?? 'http://127.0.0.1:5174/');
await page.waitForFunction(() => document.querySelector('main')?.dataset.axisProgramLoading === 'false');
await page.addStyleTag({ content: '.xyzac-machine-controller { display: none !important; }' });
for (const id of ['ac', 'bc']) {
await page.locator('[data-axis-control="machine-glb-settings"]').click();
await page.locator(`[data-axis-control="machine-glb-${id}-gantry"]`).click();
await page.waitForFunction(() => document.querySelector('main')?.dataset.axisProgramLoading === 'false');
await page.keyboard.press('Escape');
await page.locator('.xyzac-machine-view').screenshot({ path: new URL(`machine-${id}.png`, output).pathname });
}
} finally { await browser.close(); }