دليل استخدام برنامج CourseLab المقطع السابقالمقطع التالي  
الأحداث والأفعال

الأحداث والأفعال

كل التفاعلات بين الكائنات في برنامج الكورس لاب تعتمد على آلية " Event -Action "

Event إشارة نشأت إما عن طريق الكائن أو أثناء الكورس من قبل المستخدم. عموماً ,تتولد أحداث عند تغير حالة الكائن (على سبيل المثال، في لحظة ظهور الكائن) وإلا تتولد الأحداث خارجياً (كمثال : عند نقرة الفأرة على الكائن). تستخدم الأحداث لقدح الأفعال عند إنشاء علاقات داخل الموديول

Actions هي تغيرات معرفة مسبقاً لحالة الكائن أو /و متحولات الموديول التي تستخدم من أجل إنشاء سلوك الكائن المعقد

تستخدم الأحداث لقدح تنفيذ الأفعال

مصدر الحدث ممكن أن يكون :

  1. إطار أو شريحة
  2. أحد الكائنات في الإطار

في الحالة الأولى كل الأحدات تتولد بواسطة مشغل الكورس لاب .في الحالة الثانية فإن الأحداث الشائعة لكل الكائنات ننولد بواسطة مشغل الكورس لاب وكل أحداث الكائنات المخصصة تتولد مباشرة ضمن كود الكائن.

For illustration purposes, and to better understand the “Event – Action” mechanism, let us review the following example: Picture a street with a pedestrian crosswalk equipped with two traffic lights - one for pedestrians, and another one for vehicles. At the red signal of the vehicle traffic light the traffic stops, and starts again when red signal switches its color to green. Respectively, the pedestrians start crossing the crosswalk on the green signal and stop at red. In the example described above in the Event of “red signal of the traffic light for vehicles”, the “Car” type of Objects performed the Action “Stop”. In the Event of “green signal of the traffic light for vehicles” , the “Car” type of Objects performed the Action “Start”. “Pedestrians” type of Objects performs similar Actions but using Events of its own traffic light. The source for the Events in both cases is the two traffic lights.