cppmodel 0.9.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -69,8 +69,6 @@ export declare class Parameters {
69
69
  }
70
70
 
71
71
  export interface SimulationOptions<S extends Simulation = Simulation> {
72
- /** When true, run() doesn't reach the workspace and then throws: a run that skips the workspace verifies nothing. */
73
- offline?: boolean;
74
72
  init?: (simulation: S) => void;
75
73
  step?: (simulation: S, timeMs: number) => void;
76
74
  finalize?: (simulation: S) => void;
@@ -106,7 +104,6 @@ export declare class Simulation {
106
104
  name: string;
107
105
  totalTimeMs: number;
108
106
  stepMs: number;
109
- offline: boolean;
110
107
  /**
111
108
  * The file whose fingerprint is recorded as CppModel.BinaryFingerprint. Defaults to the file that
112
109
  * created the simulation; null means the Node.js executable's fingerprint.
package/index.js CHANGED
@@ -50,7 +50,6 @@ function load() {
50
50
  getName: f('int cm_simulation_get_name(void *simulation, _Out_ const char **out)'),
51
51
  setTiming: f('int cm_simulation_set_timing(void *simulation, uint64_t total_time_ms, uint64_t step_ms)'),
52
52
  getTiming: f('int cm_simulation_get_timing(void *simulation, _Out_ uint64_t *total_time_ms, _Out_ uint64_t *step_ms)'),
53
- setRunOffline: f('int cm_simulation_set_run_offline(void *simulation, int offline)'),
54
53
  setFingerprintFile: f('int cm_simulation_set_fingerprint_file(void *simulation, const char *path)'),
55
54
  setInitCallback: f('int cm_simulation_set_init_callback(void *simulation, cm_callback *callback, void *user_data)'),
56
55
  setStepCallback: f('int cm_simulation_set_step_callback(void *simulation, cm_callback *callback, void *user_data)'),
@@ -273,15 +272,13 @@ const finalizer = new FinalizationRegistry((handle) => c.destroy(handle));
273
272
  */
274
273
  class Simulation {
275
274
  #handle;
276
- #offline = false;
277
275
  #fingerprintFile = null;
278
276
  #functions;
279
277
 
280
- constructor(name, totalTimeMs, stepMs, { offline = false, init, step, finalize } = {}) {
278
+ constructor(name, totalTimeMs, stepMs, { init, step, finalize } = {}) {
281
279
  this.#handle = read(c.create, name, totalTimeMs, stepMs);
282
280
  finalizer.register(this, this.#handle, this);
283
281
  this.#functions = { init, step, finalize };
284
- this.offline = offline;
285
282
  const caller = callerFile();
286
283
  const file = caller ? path.resolve(caller) : null;
287
284
  if (file && c.setFingerprintFile(this.#handle, file) === Status.OK) this.#fingerprintFile = file;
@@ -393,19 +390,6 @@ class Simulation {
393
390
  check(c.setTiming(this._live(), this.totalTimeMs, value));
394
391
  }
395
392
 
396
- /**
397
- * When true, run() doesn't reach the workspace: nothing is fetched or submitted, and run() then
398
- * throws, because a run that skips the workspace verifies nothing.
399
- */
400
- get offline() {
401
- return this.#offline;
402
- }
403
-
404
- set offline(value) {
405
- check(c.setRunOffline(this._live(), value ? 1 : 0));
406
- this.#offline = Boolean(value);
407
- }
408
-
409
393
  /**
410
394
  * The file whose fingerprint is recorded as CppModel.BinaryFingerprint, so that runs of the same
411
395
  * code can be told apart from runs of changed code. Defaults to the file that created the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cppmodel",
3
- "version": "0.9.1",
3
+ "version": "0.10.0",
4
4
  "description": "Write CppModel simulations in Node.js",
5
5
  "keywords": ["cppmodel", "simulation", "plant model", "testing", "embedded"],
6
6
  "homepage": "https://cppmodel.com",
Binary file
Binary file
Binary file