Skip to content

Commit

Permalink
feat: added elevator example
Browse files Browse the repository at this point in the history
  • Loading branch information
st-vi committed Jan 11, 2024
1 parent 4a85a35 commit a0396f0
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions WebSocketClient/assets/uvlExamples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export function initExamples(editor: editor.IStandaloneCodeEditor) {
initExample("Default", defaultExampleText);
initExample("Ice Cream", iceCreamExampleText);
initExample("Computer", computerExampleText);
initExample("Elevator", elevatorExampleText);
}

const defaultExampleText = `features
Expand Down Expand Up @@ -75,6 +76,45 @@ constraints
Dedicated => Liquid
sum(powerConsumption) > 300 => StrongPSU`

const elevatorExampleText = `//Example from FeatureIDE Book
features
Elevator {abstract}
mandatory
Behavior {abstract}
mandatory
Modes {abstract}
alternative
Sabbath
FIFO
ShortestPath
optional
Service
Priorities {abstract}
or
RushHour
FloorPriority
PersonPriority
optional
VoiceOutput
CallButtons {abstract}
alternative
DirectedCall
UndirectedCall
Security {abstract}
mandatory
Permission {abstract}
or
FloorPermission
PermissionControl
Safety {abstract}
optional
Overloaded
constraints
CallButtons | Sabbath
DirectedCall => ShortestPath
UndirectedCall => FIFO | ShortestPath`

function initExample(name: string, content: string){
const dropdown = document.getElementById("examples-dropdown");
const button = document.createElement("button");
Expand Down

0 comments on commit a0396f0

Please sign in to comment.