Пример #1
0
        public PeriodicRunnableInstance CreateRunnableInstance(PeriodicRunnableDefenition runnableDefenition)
        {
            PeriodicRunnableInstance runable = new PeriodicRunnableInstance();

            runable.Name           = runnableDefenition.Name;
            runable.DefenitionGuid = runnableDefenition.GUID;
            return(runable);
        }
 public OsTask GetRunnableTask(PeriodicRunnableInstance runnableInstance)
 {
     foreach (OsTask task in this.OsTasks)
     {
         if (task.Runnables.FindObject(runnableInstance.GUID) != null)
         {
             return(task);
         }
     }
     return(null);
 }
 public void OsTaskRunnableOrder_ButtonUp_Click()
 {
     if (currentTask != null)
     {
         int index = TasksRunnablesGrid.SelectedIndex;
         if ((index > 0) && (index < TasksRunnablesGrid.Items.Count))
         {
             PeriodicRunnableInstance runnableInstance = currentTask.Runnables[index];
             currentTask.Runnables.RemoveAt(index);
             currentTask.Runnables.Insert(index - 1, runnableInstance);
             ReenumerateRunnables();
             UpdateTaskRunnables();
         }
     }
 }
Пример #4
0
        public static String Generate_CallOfRunnable(PeriodicRunnableInstance runnable)
        {
            ComponentInstance compInstance = AutosarApplication.GetInstance().FindComponentInstanceByRunnableGuid(runnable.GUID);

            if (!compInstance.ComponentDefenition.MultipleInstantiation)
            {
                return(Generate_RunnableFunctionName(compInstance.ComponentDefenition, runnable.Defenition) + "();");
            }
            else
            {
                String funcName = Generate_RunnableFunctionName(compInstance.ComponentDefenition, runnable.Defenition);
                String compName = GenerateComponentName(compInstance.Name);

                return(funcName + "(" + LinkToTheComponentInstance(compInstance) + ");");
            }
        }
        public void SyncronizeRunnablesWithDefenition()
        {
            /* Delete non existing */
            for (int i = RunableInstances.Count - 1; i >= 0; i--)
            {
                if (ComponentDefenition.Runnables.FindObject(RunableInstances[i].DefenitionGuid) == null)
                {
                    RunableInstances.RemoveAt(i);
                }
            }

            /* Add new */
            foreach (PeriodicRunnableDefenition runnableDefenition in ComponentDefenition.Runnables)
            {
                if (this.RunableInstances.FindRunnable(runnableDefenition.GUID) == null)
                {
                    /* Create new runnable instance */
                    PeriodicRunnableInstance newRunableInstance = ComponentFabric.GetInstance().CreateRunnableInstance(runnableDefenition);
                    this.RunableInstances.Add(newRunableInstance);
                }
            }
        }