Ejemplo n.º 1
0
        public void Check(CodeGeneratorContext context)
        {
            context.CurrentModel = __Model;

            DraggableElement cc = null;

            try
            {
                foreach (var element in __Elements)
                {
                    cc = element;
                    element.BackColor = BackColor;
                    element.Check(context);
                }
            }
            catch (Exception)
            {
                if (cc != null)
                {
                    cc.BackColor = Color.Red;
                }
                fmMain.Instance.ActivateTab(this);
                throw;
            }
        }
Ejemplo n.º 2
0
        public void PrepareChains(CodeGeneratorContext context)
        {
            context.CurrentModel = __Model;
            __Model.Generators.Clear();

            var panels = new List <DraggableElement>(__Elements);

            while (panels.Count > 0)
            {
                DraggableElement panel = panels.Find(pnl => pnl.Determined) ?? panels.Find(pnl => pnl.CheckDetermined());

                if (panel == null)
                {
                    fmMain.Instance.ActivateTab(this);

                    foreach (var epnl in panels)
                    {
                        epnl.BackColor = Color.Red;
                    }

                    throw new CompilationCheckException("Unable to fully determine all the code dependencies, check the links", CompilationCheckException.CompileIteration.Chaining);
                }

                panels.Remove(panel);
                __Model.Generators.Add(panel);
            }
        }
Ejemplo n.º 3
0
 public STMBlockInfo(DraggableElement el, ModelInfo model, IEnumerable <LinkPoint> links = null, IEnumerable <STMVariable> variables = null)
 {
     Name       = el.Title;
     ModelIndex = model.Index;
     Links      = (links ?? el.GetLinks()).Where(l => l.Direction == enLinkDirection.Output || l.LinkedTo != null).Select(l => new STMBlockInkInfo(l)).ToArray();
     Variables  = variables != null?variables.ToArray() : null;
 }
Ejemplo n.º 4
0
        private void LinkPanel(DraggableElement el, bool notMove = false)
        {
            if (!notMove)
            {
                el.Location = mainPanel.PointToClient(dragStart);
            }

            el.Parent        = mainPanel;
            el.Selected     += ElemSelectedChanged;
            el.Move         += ElemMove;
            el.LinkSelected += OnPanelLinkSelected;
            el.ModelPanel    = this;

            if (el is FMPPMOutDesignPanel)
            {
                ((FMPPMOutDesignPanel)el).OnModeNameChanged += (sender, args) => ModesUpdated();
            }

            __Elements.Add(el);

            el.Initialized();

            OnDataUpdated();
        }