Exemplo n.º 1
0
        public void PreMoveIt(SMPathOut pathOut)
        {
            if (pathOut != null && !(pathOut is SMPathOutPlug))
            {
                PointF endGridPt = MoveSegment(pathOut, _flowItem.GridLoc);
                // Add the arrow. Either at the beginning or end
                MoveArrow(pathOut);

                if (pathOut is SMPathOutBool)
                {
                    SMPathOutBool pathOutBool = pathOut as SMPathOutBool;
                    MoveYesNo(_flowItem[pathOut], BuildLabelName(pathOutBool.True));
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Runs this flow item
        /// </summary>
        /// <returns>Returns the path to take from here</returns>
        public override SMPathOut Run()
        {
            lock (this)
            {
                // If is a flow container
                if (HasChildren)
                {
                    // Run as a container
                    return(base.Run());
                }
                DoRebuild();
                // Evaluate
                if (_propWrapper == null)
                {
                    return(null);
                }

                //Comment Out by Kasem 15-May-2019
                //bool value = (bool)_propWrapper.Invoke();

                bool value = false;
                //Implement Dry Run Signal
                if (UseDryRunLogic && CompMachine.s_machine.IsDryRun)
                {
                    value = this.DryRunLogic;
                }
                else
                {
                    value = (bool)_propWrapper.Invoke();
                }

                foreach (SMPathOut pathOut in _pathList)
                {
                    SMPathOutBool pathOutBool = (pathOut as SMPathOutBool);
                    if (pathOutBool != null)
                    {
                        pathOutBool.ApplyPathDelay(ParentContainer);
                        if (pathOutBool.True == value)
                        {
                            return(pathOut);
                        }
                    }
                }
            }

            return(null);
        }
Exemplo n.º 3
0
        public DecisionEditorForm(SMContainerPanel containerPanel, SMDecision decisionItem)
        {
            _containerPanel = containerPanel;
            _decisionItem   = decisionItem;
            InitializeComponent();
            tbText.Text        = _decisionItem.Text;
            Text               = decisionItem.Name;
            tbWaitTimeOut.Text = decisionItem.WaitTimeoutMS.ToString();

            foreach (SMPathOut path in _decisionItem.PathArray)
            {
                SMPathOutBool pathOutBool = path as SMPathOutBool;
                if (pathOutBool != null)
                {
                    if (pathOutBool.True)
                    {
                        tbTrueDelay.Text = pathOutBool.PathOutDelayMS.ToString();
                    }
                    else
                    {
                        tbFalseDelay.Text = pathOutBool.PathOutDelayMS.ToString();
                    }
                }
            }

            cbNested.Checked            = _decisionItem.HasChildren;
            cbFlowTimeouttoStop.Checked = _decisionItem.FlowTimeoutToStopPath;
            DummyID           = _decisionItem.ConditionID;
            booleanID.ScopeID = _decisionItem.ParentContainer.ScopeID;


            try
            {
                booleanID.BindTwoWay(() => DummyID);
            }
            catch
            {
                DummyID = "";
                booleanID.BindTwoWay(() => DummyID);
            }


            cbUseDryRunLogic.Checked     = _decisionItem.UseDryRunLogic;
            bcbDryRunLogic.SelectedIndex = _decisionItem.DryRunLogic ? 1 : 0;
        }
Exemplo n.º 4
0
 protected override void Build(SMPathOut pathOut)
 {
     base.Build(pathOut);
     if (pathOut is SMPathOutBool)
     {
         SMPathOutBool pathOutBool = pathOut as SMPathOutBool;
         YesNoLabel    tbYesNo     = new YesNoLabel(this, pathOutBool);
         tbYesNo.BackColor  = System.Drawing.Color.Transparent;
         tbYesNo.Name       = BuildLabelName((pathOutBool).True);
         tbYesNo.Size       = new System.Drawing.Size(16, 16);
         tbYesNo.TabIndex   = 0;
         tbYesNo.Text       = pathOutBool.Text;
         tbYesNo.TextAlign  = System.Drawing.ContentAlignment.MiddleCenter;
         tbYesNo.Click     += new EventHandler(tbYesNo_Click);
         tbYesNo.MouseMove += new MouseEventHandler(OnMouseMove);
         _containerPanel.Controls.Add(tbYesNo);
     }
 }
Exemplo n.º 5
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (_decisionItem.Text != tbText.Text)
            {
                U.LogChange(string.Format("{0}.Label", _decisionItem.Nickname), _decisionItem.Text, tbText.Text);
                _decisionItem.Text = tbText.Text;
            }
            if (_decisionItem.ConditionID != DummyID)
            {
                U.LogChange(string.Format("{0}.ID", _decisionItem.Nickname), _decisionItem.ConditionID, DummyID);
                _decisionItem.ConditionID = DummyID;
            }

            _decisionItem.WaitTimeoutMS = Convert.ToInt32(tbWaitTimeOut.Text);
            foreach (SMPathOut path in _decisionItem.PathArray)
            {
                SMPathOutBool pathOutBool = path as SMPathOutBool;
                if (pathOutBool != null)
                {
                    try
                    {
                        if (pathOutBool.True)
                        {
                            pathOutBool.PathOutDelayMS = Convert.ToInt32(tbTrueDelay.Text);
                        }
                        else
                        {
                            pathOutBool.PathOutDelayMS = Convert.ToInt32(tbFalseDelay.Text);
                        }
                    }
                    catch
                    {
                        MessageBox.Show("Invalid entry");
                        return;
                    }
                }
            }
            _containerPanel.Redraw(_decisionItem);
            Close();
        }
Exemplo n.º 6
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="pathSegmentBool"></param>
 public YesNoLabel(SMCtlBase smCrlBase, SMPathOutBool pathSegmentBool)
 {
     _smCrlBase                  = smCrlBase;
     PathSegmentBool             = pathSegmentBool;
     _smCrlBase.LocationChanged += new EventHandler(smCrlBase_OnLocationChanged);
 }