Skip to content

web-backend


Class: QuantifyService ​

Defined in: packages/web-backend/src/quantify/quantify.service.ts:18

Service for executing external solver quantification flows (e.g., SCRAM). Writes input files, runs the solver, and collects output reports.

Constructors ​

Constructor ​

new QuantifyService(): QuantifyService

Returns ​

QuantifyService

Methods ​

constructCommandLineOptions() ​

constructCommandLineOptions(options): string

Defined in: packages/web-backend/src/quantify/quantify.service.ts:122

Constructs a command-line options string from the given CommandLineOptions object. This method transforms the options object into a string of command-line flags suitable for the scram command. Boolean flags are included directly if true, while options with values are included with their respective values.

Parameters ​

options ​

CommandLineOptions

The command-line options object.

Returns ​

string

string - The constructed command-line options string.


executeScramCommand() ​

executeScramCommand(optionsString, modelFilePaths): Promise<string>

Defined in: packages/web-backend/src/quantify/quantify.service.ts:148

Executes the scram command with the given options and model file paths. Captures the output and errors, writing them to respective files.

Parameters ​

optionsString ​

string

The command-line options as a string.

modelFilePaths ​

string[]

An array of paths to the model files.

Returns ​

Promise<string>

A promise that resolves with the path to the output report file.


readReportFile() ​

readReportFile(filePath): Promise<string>

Defined in: packages/web-backend/src/quantify/quantify.service.ts:188

Reads the content of a report file.

Parameters ​

filePath ​

string

Path to the generated report file

Returns ​

Promise<string>

Report file contents as a string

Throws ​

Error when the file cannot be read


usingScramBinary() ​

usingScramBinary(modelsWithConfig): Promise<BinaryQuantifyReport>

Defined in: packages/web-backend/src/quantify/quantify.service.ts:69

Performs the quantification process by executing the scram command with the provided models and options.

Parameters ​

modelsWithConfig ​

QuantifyRequest

The quantification request containing models and command-line options.

Returns ​

Promise<BinaryQuantifyReport>

A promise that resolves with the quantification report.


writeModelFilesBase64() ​

writeModelFilesBase64(models): Promise<string[]>

Defined in: packages/web-backend/src/quantify/quantify.service.ts:95

Writes base64-encoded XML models to temporary files and returns their paths.

Parameters ​

models ​

string[]

Array of base64-encoded XML model strings

Returns ​

Promise<string[]>

Paths to the created temporary model files