Rozdziały kursu
Szkolenia · Ścieżka 9. Podstawy SysML v2 · Rozdział 9.3 z 8
9.3 Akcje i przepływy 4:31
Zapisywanie funkcji i cyklu jazdy jako akcji oraz oglądanie ich w Widoku przepływu akcji i na FFBD.
Pokazuje Holarch 2.22.
Czego się nauczysz
- Definiowanie akcji z parametrami wejściowymi i wyjściowymi oraz numerem funkcji jako nazwą skróconą
- Zapisywanie akcji z rozwidleniem, złączeniem, następstwami i przepływami obiektów
- Uzyskiwanie torów w Widoku przepływu akcji z `perform`
- Wybór funkcji najwyższego poziomu w Analizie funkcjonalnej
- Budowanie kroków akcji na FFBD i odnajdywanie ich w tekście
Zapisuj akcje SysML v2 w Holarch zgodnie z samouczkiem SysML v2 Akcje i przepływy na małym projekcie Hybrid Car: definicje akcji z parametrami i nazwami skróconymi, cykl jazdy z rozwidleniem, przepływami i złączeniem, Widok przepływu akcji z torami z perform, Analiza funkcjonalna na modelu oraz kroki zbudowane na FFBD, które Holarch zapisuje w tekście. SysML jest zastrzeżonym znakiem towarowym Object Management Group, Inc.
Pliki projektu
- Projekt ukończony (.holarch.json; Zarządzaj projektami → Pliki projektu ▾ → Importuj projekt (.json)…)
Film jest odtwarzany z holarch.app; zobacz Politykę prywatności.
Ćwiczenie
Wykonaj to samodzielnie w Holarch na projekcie demonstracyjnym Hybrid Car (SysML v2).
- Otwórz swój projekt demonstracyjny Hybrid Car (w razie potrzeby utwórz go: Zarządzaj projektami → Pliki projektu ▾ → Nowy projekt demonstracyjny → Hybrid Car (SysML v2)), otwórz Model → Edytor i pakiet
VehicleBehavior. - Pod
action def <'F.3'> DriveWheelsdodajaction def <'F.4'> Refuel { in attribute fuelDemand : Real; out item fuel : Fuel; }. - Otwórz Zachowanie → FFBD, kliknij + Nowy diagram, wybierz
Refueli kliknij Utwórz. W panelu Dodaj wpiszOpen Filler Doori naciśnij Enter, a następniePump FueliClose Filler Door. - Otwórz Model → Edytor i znajdź
Refuel: FFBD zapisał jego trzy kroki i następstwa między nimi. - Otwórz Zachowanie → Przepływy akcji i widok
driveCycleFlow. Znajdź tor, w którym jestbrake, a następnie znajdź wDrivenCarwierszperform, który go tam umieszcza. - Otwórz Zachowanie → Analiza funkcjonalna, kliknij Wybierz… i wybierz
DriveCycle. Sprawdź, czy jego funkcje są numerowane według nazw skróconych.
Gotowe, gdy Refuel pokazuje w Edytorze swoje parametry, trzy kroki i ich następstwa, a ty umiesz wskazać część, w której torze jest brake.
Sprawdź się
- Które kroki w
first start then split; fork split; then supply; then produce;działają równolegle i co je ponownie łączy? - Czym różni się
first supply then ready;odflow of Fuel from supply.fuel to produce.fuel;? - Skąd pochodzą tory Widoku przepływu akcji?
Pokaż odpowiedzi
Które kroki w
first start then split; fork split; then supply; then produce;działają równolegle i co je ponownie łączy?Po rozwidleniu
splitkrokisupplyiproducestartują jako równoległe gałęzie; każdethenpo rozwidleniu rozpoczyna gałąź. Złączeniereadyczeka na obie przed następnym krokiem.Czym różni się
first supply then ready;odflow of Fuel from supply.fuel to produce.fuel;?Pierwsze to następstwo: porządkuje kroki w czasie. Drugie to przepływ: przenosi obiekt Fuel z parametru wyjściowego jednego kroku do wejścia innego kroku i samo nie porządkuje kroków.
Skąd pochodzą tory Widoku przepływu akcji?
Z
perform: każda część wykonująca krok, np.part redefines tank { perform trip.supply; }, otrzymuje tor z krokami, które wykonuje.
Więcej informacji
Transkrypcja
Pokaż transkrypcję (narracja i to, co widać na ekranie)
Introduction
Chapter three: actions and flows. Actions describe what the system does, in what order, and what passes between the steps.
In this chapter you define functions with parameters, write a drive cycle with a fork, flows and a join, see it as an Action Flow View with swim lanes, and build steps in the FFBD.
Start the tutorial
Start the tutorial Actions and Flows from Project Files, Start a Tutorial. Its starter project holds the fuel and torque items, two of the car's three functions, and the parts that will perform them.
On screen: Project Files ▾ → Start a Tutorial… → SysML v2: Actions and Flows → Start; Model → Editor.
Functions
An action definition describes something the system does, and its parameters say what goes in and out. Below the torque item, define Supply Fuel. The short name in angle brackets, F one, is its function number.
On screen: Below item def Torque; type action def <'F.1'> SupplyFuel.
The drive cycle
Now the drive cycle, at the end of the package. Its action usages are the steps, each typed by a function. First start, then split, begins with a fork, and each then after the fork starts a parallel branch.
On screen: After DriveWheels; type action def <'F'> DriveCycle with the fork and two steps.
A flow carries an item from one step's output to another step's input. After the two steps, add a flow that carries the fuel from the supply step to the torque step.
On screen: After action produce: flow of Fuel from supply.fuel to produce.fuel;
Both branches end at a join named ready. Then the car drives the wheels, and the trip is done. A second flow carries the torque to the drive step.
On screen: After the flow: successions to the join ready, then action drive, then done; flow of torque.
The Action Flow View
Now see the drive cycle as a view. Open Behavior, then Action Flows, and click New Diagram. Keep Action Flow View, choose the drive cycle under Shows, and click Create.
On screen: Behavior → Action Flows → + New Diagram; Shows: VehicleBehavior::DriveCycle; Create.
Steps are rounded boxes, with their parameters as pins. The fork and the join are bars, and the flows are arrows between pins.
On screen: The view.
Swim lanes come from perform. Back in the Editor, at the end of the package, add a driven car. It performs the drive cycle as its trip, and its parts perform the steps.
On screen: Model → Editor; after DriveCycle: part def DrivenCar with perform.
Open the Action Flow View again. It now has a lane for each part that performs a step.
On screen: Behavior → Action Flows → the view; lanes tank, engine, transmission.
Functional Analysis and the FFBD
The same model drives Functional Analysis. Open it under Behavior, click Choose, and pick the drive cycle. Its functions are the steps, numbered by their short names.
On screen: Behavior → Functional Analysis; Choose… → DriveCycle.
Back in the Editor, at the end of the package, declare one more action: emergency shutdown. You build its steps in the FFBD.
On screen: Model → Editor; after DrivenCar: action def EmergencyShutdown;
Open Behavior, then FFBD, and click New Diagram. Type the start of emergency shutdown, pick it from the list, and click Create.
On screen: Behavior → FFBD → + New Diagram; Diagram of: EmergencyShutdown; Create.
In the Add panel, type Open Contactors and press Enter, then Cut Fuel. Each step is written into the model with its succession, one undo step each.
On screen: Add panel: Open Contactors ↵, Cut Fuel ↵.
Open the Editor and find emergency shutdown. The FFBD wrote its steps, and the successions between them.
On screen: Model → Editor: EmergencyShutdown with two steps and successions.
Recap
Every step is ticked off. Click Mark as Done.
On screen: Step panel → Mark as Done.
Let's recap. You defined functions with parameters and short names, wrote a drive cycle with a fork, flows and a join, saw it as an Action Flow View with lanes from perform, and built steps in the FFBD that Holarch wrote into the text.
Next, states and transitions describe how the car reacts to events.