diff --git a/public/base_stations.soil b/public/base_stations.soil index fe3aa45f49bf785804c6df9fd29eed13c59db211..792042b3298778c08970227a6b489436b8e1201f 100644 --- a/public/base_stations.soil +++ b/public/base_stations.soil @@ -1,39 +1,41 @@ +@prefix quantitykind: <http://qudt.org/vocab/quantitykind/> ; +@prefix unit: <http://qudt.org/vocab/unit/> ; + import utils; -measurement Azimuth { +variable Azimuth defines <quantitykind:Angle> { name: "Azimuth" description: "Current position of azimuth rotation encoder in Radian." datatype: float dimension: [] - unit: Radian - range: (0, 3.14) + unit: <unit:RAD> + range: (-5.59, 5.59) # ~ (-320, 320) degrees } -measurement Elevation { +variable Elevation defines <quantitykind:Angle> { name: "Elevation" description: "Current position of elevation rotation encoder in Radian." datatype: float dimension: [] - unit: Radian - range: (0, 3.14) + unit: <unit:RAD> + range: (-1.03, 1.38) # ~ (-59, 79) degrees } -measurement Distance { +variable Distance defines <quantitykind:Distance> { name: "Distance" description: "Measured distance to the currently activate target." datatype: float dimension: [] - unit: metre + unit: <unit:M> range: (0, 100) } -parameter Interval { +variable Interval defines <quantitykind:Time> { name: "Interval" description: "Interval in seconds." datatype: float dimension: [] - default: 10 - unit: seconds + unit: <unit:SEC> range: (0, 360) } @@ -59,14 +61,14 @@ component Base { Jog jog PointTo point_to parameters: - utils.State state - Interval interval + utils.State state = OK + Interval interval = 10 measurements: - utils.Position position - utils.Quaternion quaternion - Azimuth azimuth - Elevation elevation - Distance distance + internal utils.Position position + internal utils.Quaternion quaternion + internal Azimuth azimuth + internal Elevation elevation + internal Distance distance streams: position: update diff --git a/public/lasertracker.soil b/public/lasertracker.soil index babc89c3b96d284f7ee76f66c562fb17d1fa6e9b..bde0816e135ac972626ff3ba696b58ae494d5e1c 100644 --- a/public/lasertracker.soil +++ b/public/lasertracker.soil @@ -1,29 +1,31 @@ +@prefix schema: <http://schema.org/> ; +@prefix unit: <http://qudt.org/vocab/unit/> ; + +import mobile_entities; import utils; import base_stations; -import mobile_entities; -parameter Time { + +variable Time defines <schema:DateTime> { name: "Time" description: "Current system time." datatype: time dimension: [] } -parameter Version { +variable Version defines <schema:version> { name: "Version" description: "Incremental API-Version." datatype: int - default: 1 range: (0, 100) dimension: [] - unit: UNITLESS + unit: <unit:UNITLESS> } -parameter Manufacturer { +variable Manufacturer defines <schema:manufacturer> { name: "Manufacturer" description: "Name of manufacturing company." datatype: string - default: "Laboratory for Machine Tools and Production Engineering WZL of RWTH Aachen" dimension: [] } @@ -48,7 +50,7 @@ component Lasertracker { Shutdown shutdown parameters: utils.State state = OK - constant Manufacturer manufacturer = "Laboratory for Machine Tools and Production Engineering WZL of RWTH Aachen" + constant Manufacturer manufacturer = "API" constant Version version = 1 Time time diff --git a/public/mobile_entities.soil b/public/mobile_entities.soil index 82215adc511e68333d62cdc03bd307a30e386aa4..3eaa17636b451b09e4bd5d57127f00f42c370011 100644 --- a/public/mobile_entities.soil +++ b/public/mobile_entities.soil @@ -1,4 +1,5 @@ import utils; +@prefix unit: <http://qudt.org/vocab/unit/> ; enum Mode { CONTINUOUS @@ -7,26 +8,24 @@ enum Mode { IDLE } -parameter Mode { +variable Mode { name: "Mode" description: "Current state of the entity. In CONTINUOUS mode, values are dispatched as fast as possible. In TRIGGERED mode, values are only dispatches after a software trigger. In EXTERNAL mode, values are dispatched in accordance to an external trigger, e.g. probe or TTL. IDLE means the entity is currently not used." - default: CONTINUOUS datatype: enum range: Mode dimension: [] } -parameter Type { +variable Type { name: "Type" description: "System specific identifier of the target Type, e.g. SMR or Active SMR." datatype: string dimension: [] - default: "SMR" } -measurement Locked { +variable Locked { name: "Locked" - description: "Boolean flag scpecifing whether the target is locked in." + description: "Boolean flag specifying whether the target is locked in." datatype: boolean dimension: [] } @@ -36,9 +35,31 @@ function Reset { description: "Starts the search routine around the current direction." } -function Trigger { +variable Counter { + name: "Counter" + description: "Natural numeric value." + datatype: int + dimension: [] + range: (1,1000) + unit: <unit:UNITLESS> +} + +variable Label { + name: "Label" + description: "A string serving as comment." + datatype: string + dimension: [] +} + +function Trigger streaming { name: "Trigger" - description: "Trigger count measurements and set the resulting label. This function is only allowed in triggered acquisition mode." + description: "Trigger count variables and set the resulting label. This function is only allowed in triggered acquisition mode." + arguments: + Counter counter = 100 + Label label = "test" + returns: + utils.Position position + Label outputLabel } component Target { @@ -50,11 +71,11 @@ component Target { measurements: utils.Position position utils.Quaternion quaternion - Locked locked + internal Locked locked parameters: - utils.State state - Mode mode - Type type + utils.State state = OK + Mode mode = CONTINUOUS + Type type = "SMR" streams: position: update @@ -68,4 +89,6 @@ component MobileEntities { description: "Object acting as a list of mobile entities in the metrology system." components: dynamic Target target -} \ No newline at end of file +} + +interface Target myTarget{} \ No newline at end of file diff --git a/public/environment_monitoring.soil b/public/monitoring.soil similarity index 67% rename from public/environment_monitoring.soil rename to public/monitoring.soil index f1689d203c79ad343de8e6d9ab173f437e84fc13..14380adc72be9856da97892ac31bcb050ec42b04 100644 --- a/public/environment_monitoring.soil +++ b/public/monitoring.soil @@ -1,53 +1,56 @@ -parameter Location { +@prefix quantitykind: <http://qudt.org/vocab/quantitykind/> ; +@prefix unit: <http://qudt.org/vocab/unit/> ; + +variable Location { name: "Location" description: "Human interpretable description of the current location of sensor." datatype: string dimension: [] } -measurement BatteryLevel { +variable BatteryLevel { name: "Battery level" description: "Battery level" datatype: float range: (0, 100) dimension: [] - unit: Percent + unit: <unit:PERCENT> } -measurement SignalStrength { +variable SignalStrength defines <quantitykind:SignalStrength> { name: "Signal strength" description: "Strength of the signal of the wireless environmental sensor." - datatype: float + datatype: int range: (0, 100) dimension: [] - unit: Percent + unit: <unit:PERCENT> } -measurement Temperature { +variable Temperature defines <quantitykind:Temperature> { name: "Ambient temperature" description: "The current ambient temperature." datatype: float range: (-20, 50) dimension: [] - unit: Celsius + unit: <unit:DEG_C> } -measurement Pressure { - name: "Relative air pressure" - description: "The current air pressure." +variable Pressure defines <quantitykind:AtmosphericPressure> { + name: "Atmospheric pressure" + description: "The current atmospheric pressure." datatype: float range: (900, 1200) dimension: [] - unit: hPA + unit: <unit:HectoPA> } -measurement Humidity { +variable Humidity defines <quantitykind:RelativeHumidity> { name: "Relative humidity" description: "Relative humidity." datatype: float range: (0, 100) dimension: [] - unit: Percent + unit: <unit:PERCENT> } component EnvironmentalSensor { @@ -57,8 +60,8 @@ component EnvironmentalSensor { Temperature temperature Pressure pressure Humidity humidity - SignalStrength signalStrength - BatteryLevel batteryLevel + internal SignalStrength signalStrength + internal BatteryLevel batteryLevel parameters: Location location @@ -80,4 +83,4 @@ component EnvironmentalSensorManager { dynamic EnvironmentalSensor sensor(location="Pillar A") } -interface EnvironmentalSensorManager sensorManager {} \ No newline at end of file +interface EnvironmentalSensorManager monitoring {} \ No newline at end of file diff --git a/public/robot.soil b/public/robot.soil index b7432e99b77301c7473a6ce59c8076cb1e7f620a..5f9f26f766b6570a8af667d1bddf3e2a7993eee6 100644 --- a/public/robot.soil +++ b/public/robot.soil @@ -1,51 +1,54 @@ -measurement Position { +@prefix quantitykind: <http://qudt.org/vocab/quantitykind/> ; +@prefix unit: <http://qudt.org/vocab/unit/> ; +@prefix dbo: <http://dbpedia.org/ontology/> ; +@prefix schema: <http://schema.org/> ; + +variable Position defines <quantitykind:CartesianCoordinates> { name: "Position" description: "Position in Cartesian coordinates given in metre." datatype: float range: (-50, 50) dimension: [3] - unit: Metre + unit: <unit:M> } -measurement TCP { +variable TCP defines <quantitykind:CartesianCoordinates> { name: "Tool Center Point" - description: "Tool center point of a six-arm robot." + description: "Tool center point of a six-joint robot." datatype: float range: (-0.5,0.5) dimension: [3] - unit: Metre + unit: <unit:M> } -measurement BatteryLevel { +variable BatteryLevel { name: "Battery level" description: "Battery level" datatype: int range: (0, 100) dimension: [] - unit: Percent + unit: <unit:PERCENT> } -parameter Open { +variable Open { name: "Open" description: "Flag to specify if something is open." datatype: boolean dimension: [] - default: true } -parameter AutoMovement { +variable AutoMovement { name: "Autonomous Movement" description: "If true, the robot moves around freely autonomously." datatype: boolean dimension: [] - default: true } component Gripper { name: "Gripper" description: "Gripper of a robot" parameters: - Open open + Open open = true } function GoTo { @@ -62,11 +65,16 @@ function Step { Position position } -component Robot { +component Thing { + name: "A thing" + description: "Some thing." +} + +component Robot defines <dbo:Robot> extends Thing{ name: "Robot" description: "A robot arm with six axes." measurements: - TCP tcp + internal TCP tcp components: Gripper gripper functions: @@ -77,17 +85,17 @@ component Robot { tcp: fixed(10) } -component MobileRobot extends Robot { +component MobileRobot defines <schema:Vehicle> extends Robot { name: "Mobile Robot" - description: "A robot arm with six axis mounted on a movable platform." + description: "A robot arm with six axes mounted on a movable platform." measurements: - Position position - BatteryLevel batteryLevel + internal Position position + internal BatteryLevel batteryLevel functions: GoTo gotoRobot Step stepRobot parameters: - AutoMovement auto + AutoMovement auto = true streams: position: update diff --git a/public/utils.soil b/public/utils.soil index 25a39eebd758a43be85c5456433a474a92568f91..9305f9dfffd4fe6e488ab824b50c5dc1fdf6b7e5 100644 --- a/public/utils.soil +++ b/public/utils.soil @@ -1,3 +1,7 @@ +@prefix dbo: <http://dbpedia.org/ontology/> ; +@prefix quantitykind: <http://qudt.org/vocab/quantitykind/> ; +@prefix unit: <http://qudt.org/vocab/unit/> ; + enum State { OK WARNING @@ -5,29 +9,28 @@ enum State { MAINTENANCE } -parameter State { +variable State defines <dbo:status> { name: "State" description: "The current state of the device." datatype: enum - default: OK range: State dimension: [] } -measurement Position { +variable Position defines <quantitykind:CartesianCoordinates> { name: "Position" description: "Most recently dispatched measured position." datatype: float dimension: [3] - range: (0, 80) - unit: METRE + range: (-100, 100) + unit: <unit:M> } -measurement Quaternion { +variable Quaternion defines <quantitykind:Angle> { name: "Quaternion" description: "Most recently dispatched measured orientation as quaternion, if available." datatype: float dimension: [4] range: (0, 1) - unit: UNITLESS + unit: <unit:UNITLESS> } \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index 48675aa6c6e728e488c626938445f16d762041e8..2bce84fda4eda380df63f37bf10f7390cbbc4eac 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -23,7 +23,7 @@ function App(): JSX.Element { useEffect(() => { if (Object.keys(projects).length === 0 && DEMO_MODE) { fetch("/soil/robot.soil").then(e => e.text()).then(e => dispatch(addTextModel(["Robot", "Robot", e]))) - fetch("/soil/environment_monitoring.soil").then(e => e.text()).then(e => dispatch(addTextModel(["Monitoring", "Monitoring", e]))) + fetch("/soil/monitoring.soil").then(e => e.text()).then(e => dispatch(addTextModel(["Monitoring", "Monitoring", e]))) fetch("/soil/lasertracker.soil").then(file => file.text()).then(lasertracker => { fetch("/soil/base_stations.soil").then(file2 => file2.text()).then(base_stations => { fetch("/soil/mobile_entities.soil").then(file3 => file3.text()).then(mobile_entities => { diff --git a/src/features/soil-editor/SoilTextEditor/SoilHighlight.ts b/src/features/soil-editor/SoilTextEditor/SoilHighlight.ts index f7476538ffd29d7bc13a877a1b34a7fb762c90ac..1deb49ca77e4957d7bca01cc129a37657361dbad 100644 --- a/src/features/soil-editor/SoilTextEditor/SoilHighlight.ts +++ b/src/features/soil-editor/SoilTextEditor/SoilHighlight.ts @@ -22,10 +22,13 @@ export const soilHighlight = { alias: 'keyword' }, 'keyword': { - pattern: /\b(component|enum|extends|function|import|interface|variable|defines)\s/ + pattern: /\b(component|enum|extends|function|import|interface|variable|defines)\s\b/ }, - "symbol": { - pattern: /\b(boolean|constant|dynamic|enum|fixed|float|int|string|time|update)\b/ + "modifier": { + pattern: /\b(constant|dynamic|fixed|update)\b/ + }, + "datatype": { + pattern: /\b(boolean|enum|float|int|string|time)\b/ }, "event": { pattern: /\b(critical|debug|error|if|info|warning)\b/ @@ -45,15 +48,15 @@ export const soilHighlight = { }, "prefix-link": { pattern: /<.*>/, - greedy: true, - lookbehind: true + // greedy: true, + // lookbehind: true } } }, - "semantics": { - pattern: /<\w+:\w+>/, - greedy: true, - lookbehind: true - } + // "semantics": { + // pattern: /<\w+:\w+>/, + // greedy: true, + // lookbehind: true + // } }; \ No newline at end of file diff --git a/src/features/soil-editor/SoilTextEditor/styles.css b/src/features/soil-editor/SoilTextEditor/styles.css index 75ba6282496c72a97613e1f37fd35a4d6676940f..532fa4c229cf00a43b31f33c12025849cd0a5154 100644 --- a/src/features/soil-editor/SoilTextEditor/styles.css +++ b/src/features/soil-editor/SoilTextEditor/styles.css @@ -98,11 +98,13 @@ body { color: rgb(152, 98, 162); } -.dark-theme .token.symbol { +.dark-theme .token.modifier, +.dark-theme .token.datatype { color: #32c5b6 } -.light-theme .token.symbol { +.light-theme .token.modifier, +.light-theme .token.datatype { color: #32c5b6 }