Holarch
فصول الدورة

التدريب · المسار 3. السلوك والمعمارية · الفصل 3.2 من 6

3.2 مخططات الإجراءات 2:55

قسّم وظيفة إلى خطوات بفروع متوازية وقرار والعنصر الذي يشغّل خطوة.

يعرض Holarch 1.27.

→ 3.1 الوظائف وFFBD · كل الفصول · 3.3 التخصيص ←

ما ستتعلمه

  • افتح وظيفة بوصفها مخطط إجراءات وأضف خطوات بسحب Action إلى الخط
  • أضف فروعًا متوازية وقرارًا باحتمالات فروع مجموعها 100%
  • أنشئ Input/Output تولّده خطوة وتتلقاه خطوة أخرى بوصفه مشغِّلًا
  • اشرح كيف تصبح الخطوات في المخطط عناصر Action في النموذج

افتح Rent a Bike بوصفه مخطط إجراءات وابنِ خطواته على اللوحة: إجراءات متتالية، وفرع متوازٍ، وقرار باحتمالات فروع، وعنصر إدخال/إخراج تنتجه خطوة وتتلقاه خطوة أخرى.

ملفات المشاريع

  • مشروع البداية (.holarch.json؛ إدارة المشاريع ← ملفات المشروع ▾ ← استيراد مشروع (.json)…)
  • المشروع المكتمل (.holarch.json؛ إدارة المشاريع ← ملفات المشروع ▾ ← استيراد مشروع (.json)…)

يُشغَّل الفيديو من holarch.app؛ راجع سياسة الخصوصية.

التطبيق العملي

نفّذ هذا بنفسك في Holarch، على المشروع التوضيحي CubeSat EO-1.

  1. افتح مشروع EO-1 التوضيحي الخاص بك، أو أنشئه: إدارة المشاريع ← ملفات المشروع ▾ ← مشروع توضيحي جديد ← CubeSat (هندسة أنظمة موجّهة).
  2. في قاعدة البيانات، حدّد F10 Enter Safe Mode واختر فتح في ▾ ← مخطط Action.
  3. اسحب الإجراء من لوحة إضافة إلى الخط وسمّه Detect Undervoltage. ثم اسحب Parallel إلى الخط بعده، مع Shed Payload Loads في أحد الفرعين وPoint Arrays to Sun في الآخر.
  4. اسحب أو إلى الخط بعد Parallel وسمّه Battery recovered?. وفي لوحة الخصائص، اضبط احتمالات الفروع على 80 و20، وضع Resume Nominal Mode في الفرع الأول وKeep Charging في الثاني.
  5. اسحب Input/Output إلى Detect Undervoltage وسمّه Undervoltage Flag. ثم اسحب المقبض الموجود أسفل I/O إلى Shed Payload Loads واختر Input (مشغِّل).

تنتهي حين يعرض مخطط F10 الخطوات الخمس، والفروع المتوازية، وOR بإجمالي 100%، وUndervoltage Flag منتقلًا من Detect Undervoltage إلى Shed Payload Loads.

اختبر نفسك

  1. ماذا يضيف إسقاط Action على الخط إلى النموذج؟
  2. ما الفرق بين مدخل مشغِّل ومدخل اختياري؟
  3. لماذا يجب أن يكون مجموع احتمالات فروع OR مساويًا لـ 100%؟
إظهار الإجابات
  1. ماذا يضيف إسقاط Action على الخط إلى النموذج؟

    Action جديد، مفكَّك تحت الوظيفة التي ينتمي إليها المخطط، في ذلك الموضع من تدفقها. ويظهر في قاعدة البيانات وفي كل طريقة عرض تعرضه.

  2. ما الفرق بين مدخل مشغِّل ومدخل اختياري؟

    الخطوة ذات المدخل المشغِّل لا تبدأ حتى يصل ذلك العنصر. أما المدخل الاختياري فيُستقبل لكنه لا يؤخر الخطوة.

  3. لماذا يجب أن يكون مجموع احتمالات فروع OR مساويًا لـ 100%؟

    يختار المحاكي فرعًا بحسب احتماله. وإذا لم يكن مجموع الأرقام 100%، تحذّرك لوحة الخصائص. وإذا كانت الاحتمالات مجهولة، فاختر «لا شيء»: عندئذ يسأل المحاكي أثناء التشغيل، ويستخدم Monte Carlo احتمالات متساوية.

قراءة المزيد

النص المكتوب

إظهار النص المكتوب (التعليق الصوتي وما يظهر على الشاشة)

Introduction

Welcome back. This chapter takes one function, Rent a Bike, and draws what happens inside it, step by step.

You will build an action diagram on the canvas, from the Add panel.

The canvas

Open the Database, select Rent a Bike, and choose Open in, then Action Diagram. The canvas starts with a start, an end, and the line between them. The Add panel on the left holds the building blocks.

On screen: Database → F.1 → Open in ▾ → Action Diagram.

Steps in order

Drag an Action onto the line, and name it Identify Rider. The rider taps a card or a phone at the kiosk.

On screen: Action → line → Identify Rider.

The next step drops onto the line after it: Check Account. The back office confirms the rider can rent. Each new step is joined to the last for you.

On screen: Action → Check Account.

Parallel branches and a decision

Two things happen at once next: the bay unlocks, and the kiosk shows the rider which bay it is. Drag a Parallel onto the line. It opens two branches that start together and join when both finish.

On screen: Parallel → line.

Drop an action onto each branch: Unlock Bay on the first, Show Bay Number on the second.

On screen: An action on each branch.

Then a decision: does the rider take the bike within thirty seconds? Drag an Or onto the line, and put the question in its name.

On screen: Or → line → name.

Each branch of a decision has a probability, for simulation later. Most riders take the bike: ninety-five percent for yes, five for no. The panel checks that they add up to one hundred.

On screen: Branch probabilities 95 / 5.

On the yes branch the rental starts: Start Rental. On the no branch the bay locks again: Relock Bay.

On screen: An action on each branch.

Inputs and outputs

Steps also pass items to each other. Drag an Input/Output onto Check Account: the step now produces it. Name it Unlock Code, the approval the back office sends.

On screen: I/O → Check Account → Unlock Code.

Unlock Bay receives the code, and receiving it is what starts that step. Drag from the handle on Unlock Code onto Unlock Bay, and choose Input, trigger. An optional input would not start the step.

On screen: Handle on Unlock Code → Unlock Bay → Input (trigger).

The diagram is part of the model. The steps are actions under Rent a Bike, and the item and its links appear in the Database and on every view that shows them.

On screen: The completed action diagram.

Recap

Let's recap. You opened a function as an action diagram, dropped steps onto the line, added parallel branches and a decision with probabilities, and connected an item that triggers a step.

Next, you decide which part of the dock performs each function: allocation.