public ProcessComponentFrame(DiagramModel model, TestAppForm appForm)
 {
     _AppForm = appForm;
     _Model   = model;
     Prepare();
     Process();
 }
示例#2
0
        protected void ExecuteHsm(string modelName, qf4net.ILQHsm hsm)
        {
            TestAppForm appForm = _Context.AppForm();

            try
            {
                qf4net.ModelInformation modelInformation = hsm.ModelInformation;

                StateDiagramView sd = new StateDiagramView(false);
                sd.StateControl.SetStateMachine(_LastFileName, hsm);

#warning Cleanup this code - this control uses knowledge of its parent - below (TestAppForm) and above (StateDiagramView)
                // find Top level form

                if (appForm != null)
                {
                    appForm.AddChild(modelName, modelName, sd);
                    appForm.RegisterHsm(hsm);
                }
                else
                {
                    Form frm = new Form();
                    frm.Text = modelName;
                    frm.Controls.Add(sd);
                    sd.Dock = DockStyle.Fill;
                    frm.Show();
                }
            }
            catch {}
        }
 public ProcessComponentFrame(DiagramModel model, TestAppForm appForm)
 {
     _AppForm = appForm;
     _Model = model;
     Prepare ();
     Process ();
 }
 public void SetMachineModel(DiagramModel model, TestAppForm appForm)
 {
     CodeCompiler compiler = new CodeCompiler ();
     System.CodeDom.Compiler.CompilerResults results = compiler.Compile (model);
     if (!results.Errors.HasErrors)
     {
         string typeName = model.Header.NameSpace + "." + model.Header.Name;
         Type type = results.CompiledAssembly.GetType (typeName);
         qf4net.ILQHsm hsm = HsmUtil.CreateHsm (type);
         Controller.Execute (hsm);
     }
     else
     {
         foreach (string msg in results.Output)
         {
             appForm.Log (Color.Red, msg + "\n");
         }
     }
 }
示例#5
0
        public void SetMachineModel(DiagramModel model, TestAppForm appForm)
        {
            CodeCompiler compiler = new CodeCompiler();

            System.CodeDom.Compiler.CompilerResults results = compiler.Compile(model);
            if (!results.Errors.HasErrors)
            {
                string        typeName = model.Header.NameSpace + "." + model.Header.Name;
                Type          type     = results.CompiledAssembly.GetType(typeName);
                qf4net.ILQHsm hsm      = HsmUtil.CreateHsm(type);
                Controller.Execute(hsm);
            }
            else
            {
                foreach (string msg in results.Output)
                {
                    appForm.Log(Color.Red, msg + "\n");
                }
            }
        }
示例#6
0
        protected void ExecuteHsm(string typeName)
        {
            /*
             * ExecutionControllerView view = new ExecutionControllerView ();
             * view.Controller = new ExecutionController (_Glyphs);
             * view.Controller.Refresh += new EventHandler(Controller_Refresh);
             * view.Show ();
             */
            QHsmExecutionControllerView view = new QHsmExecutionControllerView();

            view.Controller          = new QHsmExecutionController(_Model);
            view.Controller.Refresh += new EventHandler(_Context.RefreshView);
            view.SetMachineName(typeName);
            //view.SetMachineModel (_Model, AppForm ());
#warning Cleanup this code - this control uses knowledge of its parent
            StateDiagramView dv = _Context.ParentStateDiagramView;
            dv.SetExecutionWindow(view);
            view.Show();


            qf4net.ILQHsm hsm = view.Controller.Hsm;

            TestAppForm appForm = _Context.AppForm();
            if (appForm != null)
            {
                appForm.RegisterHsm(hsm);
            }

            qf4net.IQSupportsSubMachines supportsSubMachines = hsm as qf4net.IQSupportsSubMachines;
            if (supportsSubMachines != null)
            {
                foreach (DictionaryEntry de in supportsSubMachines.SubMachines)
                {
                    qf4net.ILQHsm subMachine = de.Value as qf4net.ILQHsm;
                    ExecuteHsm(de.Key.ToString(), subMachine);
                }
            }
        }