-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16eafa1
commit 9a1ba5f
Showing
3 changed files
with
26 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,7 @@ | ||
import { | ||
type FdsFile, | ||
verifyInput, | ||
} from "jsr:@smoke-cloud/[email protected]"; | ||
import * as fdsInspect from "jsr:@smoke-cloud/[email protected]"; | ||
import * as fdsInspectCore from "jsr:@smoke-cloud/[email protected]"; | ||
import * as fdsInspect from "jsr:@smoke-cloud/[email protected]"; | ||
import { Command } from "jsr:@cliffy/[email protected]"; | ||
import { open } from "./open.ts"; | ||
import { | ||
getJson, | ||
getJsonTemp, | ||
renderTypstPdf, | ||
renderVerificationTypst, | ||
} from "jsr:@smoke-cloud/[email protected]"; | ||
|
||
await new Command() | ||
.name("tway-server-manager") | ||
|
@@ -28,10 +19,10 @@ await new Command() | |
.command("count-cells", "Count the total number of cells") | ||
// .option("-f, --foo", "Foo option.") | ||
.arguments("<input-path:string>") | ||
.action(async (_options, ...args) => { | ||
const fdsFile = await getJson(args[0]); | ||
const nCells = fdsInspect.summary.countCells(fdsFile); | ||
console.log(nCells); | ||
.action(async () => { | ||
// const fdsData = await getJsonTemp(args[0]); | ||
// const nCells = fdsInspect.summary.countCells(fdsData); | ||
// console.log(nCells); | ||
}) | ||
// Get Threadway Send | ||
.command("meshes", "Display information on each mesh") | ||
|
@@ -130,16 +121,22 @@ await new Command() | |
.arguments("<input-path:string>") | ||
.action(async (_options, ...args) => { | ||
const inputPath = args[0]; | ||
const fdsFile: FdsFile = await getJsonTemp(inputPath); | ||
const verificationSummary = verifyInput(fdsFile); | ||
const inputSummary = fdsInspect.summary.summarise_input(fdsFile); | ||
const typst = renderVerificationTypst(inputSummary, verificationSummary); | ||
const fdsData = await fdsInspect.getJsonTemp(inputPath); | ||
const verificationSummary = fdsInspectCore.verifyInput( | ||
fdsData, | ||
fdsInspectCore.stdTestList, | ||
); | ||
const inputSummary = fdsInspectCore.summary.summarise_input(fdsData); | ||
const typst = fdsInspect.renderVerificationTypst( | ||
inputSummary, | ||
verificationSummary, | ||
); | ||
const tempFile = await Deno.makeTempFile({ | ||
prefix: fdsFile.chid, | ||
prefix: fdsData.chid, | ||
suffix: "_Verification.pdf", | ||
}); | ||
try { | ||
await renderTypstPdf(tempFile, typst); | ||
await fdsInspect.renderTypstPdf(tempFile, typst); | ||
await open(tempFile); | ||
} catch (e) { | ||
console.error(e.message); | ||
|