shibosoftwaredev/f1c100s-linux-nema17-stepper-controller
A four-layer NEMA 17 motor-controller PCB combining an Allwinner F1C100S Linux computer, USB‑PD/buck power system, W5500 Ethernet, STM32 real-time motion control, DRV8825 stepper driver, protection/temperature/current telemetry, USB interfaces, and local LED/buzzer diagnostics.
- Version
- 0.4.56
- License
- unset
- Stars
- 0
scripts/analyze-schematic-review.mjs
import fs from "node:fs"
import path from "node:path"
import crypto from "node:crypto"
import assert from "node:assert/strict"
import { pathToFileURL } from "node:url"
const analyzerPath = process.env.SCHEMATIC_STYLE_ANALYZER
assert.ok(analyzerPath, "Set SCHEMATIC_STYLE_ANALYZER to the standalone 0.0.82 browser.js bundle")
assert.equal(crypto.createHash("sha256").update(fs.readFileSync(analyzerPath)).digest("hex"),
"1dbf67eb1325c53ce5804bd551a6c48995bd57a940cbd5a38a987567ee1261ef", "verified 0.0.82 analyzer bundle")
const analyzer = await import(pathToFileURL(analyzerPath).href)
const input = process.argv[2] ?? "dist/index/circuit.json"
const directory = process.argv[3] ?? "reports/schematic-review"
const bytes = fs.readFileSync(input)
const circuit = JSON.parse(bytes)
const artifacts = analyzer.createSchematicPlacementIssueArtifacts(circuit)
fs.mkdirSync(directory, { recursive: true })
for (const a of artifacts) fs.writeFileSync(path.join(directory, `issue-${a.issueIndex + 1}.svg`), a.content)
const report = { checkedAt: new Date().toISOString(), analyzerVersion: "0.0.82",
analyzerSha256: crypto.createHash("sha256").update(fs.readFileSync(analyzerPath)).digest("hex"),
circuitSha256: crypto.createHash("sha256").update(bytes).digest("hex"),
issueCount: artifacts.length, issues: artifacts.map(({ issueIndex, issue, schematicSheetId, descriptionXml }) =>
({ issueIndex, issue, schematicSheetId, descriptionXml })) }
fs.writeFileSync(path.join(directory, "analysis.json"), JSON.stringify(report, null, 2) + "\n")
console.log(JSON.stringify(report))
if (process.argv.includes("--require-clean")) assert.equal(artifacts.length, 0, "Resolve all current schematic style issues")