@ospin/fct-graph
Advanced tools
Comparing version 3.0.2 to 4.0.0
{ | ||
"name": "@ospin/fct-graph", | ||
"author": "danielseehausen", | ||
"version": "3.0.2", | ||
"version": "4.0.0", | ||
"description": "Graph data structure with conditional edges via 'slots' on nodes. Intended to represent physical and virtual functionalities on a device.", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
@@ -31,3 +31,3 @@ const Joi = require('joi') | ||
static _collectUniqueDataStreamsDataFromFctData(functionalitiesData) { | ||
static collectUniqueDataStreamsDataFromFctData(functionalitiesData) { | ||
const uniqueDataStreamsDataById = {} | ||
@@ -68,3 +68,3 @@ | ||
_populateConnectionsFromFctData(functionalitiesData) { | ||
const dataStreamsData = FCTGraph._collectUniqueDataStreamsDataFromFctData(functionalitiesData) | ||
const dataStreamsData = FCTGraph.collectUniqueDataStreamsDataFromFctData(functionalitiesData) | ||
@@ -251,2 +251,7 @@ this._addManyConnectionsViaDataStreamsData(dataStreamsData) | ||
getDisconnectedIONodeFcts() { | ||
const fcts = this.getIONodeFcts() | ||
return fcts.filter(fct => !fct.isConnected) | ||
} | ||
} | ||
@@ -253,0 +258,0 @@ |
@@ -54,3 +54,3 @@ const { v4: uuidv4 } = require('uuid') | ||
displayType: outSlot.displayType, | ||
unit: outSlot.unit, | ||
unit: OutSlot.ANY_UNIT_STRING, | ||
dataStreams: [], | ||
@@ -57,0 +57,0 @@ } |
@@ -59,3 +59,3 @@ const { v4: uuidv4 } = require('uuid') | ||
displayType: inSlot.displayType, | ||
unit: inSlot.unit, | ||
unit: InSlot.ANY_UNIT_STRING, | ||
dataStreams: [], | ||
@@ -62,0 +62,0 @@ } |
@@ -199,2 +199,6 @@ const Joi = require('joi') | ||
get isConnected() { | ||
return this.connectedFcts.length > 0 | ||
} | ||
get sources() { | ||
@@ -201,0 +205,0 @@ return this._getConnectedFcts(this.inSlots) |
const OutputNodeSeeder = require('./OutputNodeSeeder') | ||
const { FloatInSlotSeeder } = require('../slots') | ||
const IntervalOut = require('../../functionalities/IntervalOut') | ||
const Slot = require('../../slots/Slot') | ||
@@ -9,3 +10,6 @@ class IntervalOutSeeder extends OutputNodeSeeder { | ||
return [ | ||
FloatInSlotSeeder.generate({ name: IntervalOut.SLOT_NAME }), | ||
FloatInSlotSeeder.generate({ | ||
name: IntervalOut.SLOT_NAME, | ||
unit: Slot.ANY_UNIT_STRING, | ||
}), | ||
] | ||
@@ -12,0 +16,0 @@ } |
const InputNodeSeeder = require('./InputNodeSeeder') | ||
const { | ||
RandomSlotSeeder, | ||
IntegerOutSlotSeeder, | ||
@@ -8,2 +7,3 @@ FloatOutSlotSeeder, | ||
const PushIn = require('../../functionalities/PushIn') | ||
const Slot = require('../../slots/Slot') | ||
@@ -14,3 +14,6 @@ class PushInSeeder extends InputNodeSeeder { | ||
return [ | ||
RandomSlotSeeder.generateRandomOutSlot({ name: PushIn.SLOT_NAME }), | ||
FloatOutSlotSeeder.generate({ | ||
name: PushIn.SLOT_NAME, | ||
unit: Slot.ANY_UNIT_STRING, | ||
}), | ||
] | ||
@@ -17,0 +20,0 @@ } |
const OutputNodeSeeder = require('./OutputNodeSeeder') | ||
const { | ||
FloatInSlotSeeder, | ||
RandomSlotSeeder, | ||
} = require('../slots') | ||
const PushOut = require('../../functionalities/PushOut') | ||
const Slot = require('../../slots/Slot') | ||
@@ -12,3 +12,6 @@ class PushOutSeeder extends OutputNodeSeeder { | ||
return [ | ||
RandomSlotSeeder.generateRandomInSlot({ name: PushOut.SLOT_NAME }), | ||
FloatInSlotSeeder.generate({ | ||
name: PushOut.SLOT_NAME, | ||
unit: Slot.ANY_UNIT_STRING, | ||
}), | ||
] | ||
@@ -15,0 +18,0 @@ } |
@@ -165,13 +165,8 @@ const Joi = require('joi') | ||
// safe - returns a public response | ||
connectTo(otherSlot, dataStreamData = {}) { | ||
try { | ||
Slot._assertConnectionBetweenIsPossible(this, otherSlot) | ||
const dataStream = this._createDataStreamTo(otherSlot, dataStreamData) | ||
this._connectTo(otherSlot, dataStream) | ||
Slot._assertConnectionBetweenIsPossible(this, otherSlot) | ||
const dataStream = this._createDataStreamTo(otherSlot, dataStreamData) | ||
this._connectTo(otherSlot, dataStream) | ||
return publicSuccessRes({ thisSlot: this, otherSlot, dataStream }) | ||
} catch (e) { | ||
return publicErrorRes({ errorMsg: e.message, thisSlot: this, otherSlot, dataStream: null }) | ||
} | ||
return { thisSlot: this, otherSlot, dataStream } | ||
} | ||
@@ -178,0 +173,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
149309
3051