Example #1
0
        /*
         * Member Methods
         */
        public override PUC.CIO.ConcreteInteractionObject ChooseWidget(
            ApplianceObject ao)
        {
            Decision d = null;

            if (ao.State)
            {
                d = (Decision)_choices[STATE];
            }
            else if (ao.Explanation)
            {
                d = (Decision)_choices[EXPLANATION];
            }
            else
            {
                d = (Decision)_choices[COMMAND];
            }

            if (d == null)
            {
                d = (Decision)_choices[DEFAULT];
            }

            if (d != null)
            {
                return(d.ChooseWidget(ao));
            }
            else
            {
                return(null);
            }
        }
Example #2
0
        /*
         * Member Methods
         */
        public override PUC.CIO.ConcreteInteractionObject ChooseWidget(
            ApplianceObject ao)
        {
            ApplianceState state = (ApplianceState)ao;
            Decision       d     = null;

            switch (state.Type.ValueSpace.Space)
            {
            case PUC.Types.ValueSpace.BOOLEAN_SPACE:
                if (state.Type.ValueLabels != null &&
                    state.Type.ValueLabels.Count == 2)
                {
                    d = (Decision)_choices[TRUE];
                }
                else
                {
                    d = (Decision)_choices[FALSE];
                }
                break;

            default:
                d = (Decision)_choices[FALSE];
                break;
            }

            if (d != null)
            {
                return(d.ChooseWidget(ao));
            }
            else
            {
                return(null);
            }
        }
Example #3
0
        /*
         * Member Methods
         */
        public override PUC.CIO.ConcreteInteractionObject ChooseWidget(
            ApplianceObject ao)
        {
            Decision d = (Decision)_choices[FALSE];

            if (d != null)
            {
                return(d.ChooseWidget(ao));
            }
            else
            {
                return(null);
            }
        }
Example #4
0
        /*
         * Member Methods
         */
        public override PUC.CIO.ConcreteInteractionObject ChooseWidget(
            ApplianceObject ao)
        {
            ApplianceState state = (ApplianceState)ao;

            PUC.Types.ValueSpace vs = state.Type.ValueSpace;

            Decision d = null;

            if (vs.Space == PUC.Types.ValueSpace.INTEGER_SPACE &&
                ((PUC.Types.IntegerSpace)vs).IsRanged())
            {
                d = (Decision)_choices[TRUE];
            }

            else if (vs.Space == PUC.Types.ValueSpace.FIXED_PT_SPACE &&
                     ((PUC.Types.FixedPtSpace)vs).IsRanged())
            {
                d = (Decision)_choices[TRUE];
            }

            else if (vs.Space == PUC.Types.ValueSpace.FLOATING_PT_SPACE &&
                     ((PUC.Types.FloatingPtSpace)vs).IsRanged())
            {
                d = (Decision)_choices[TRUE];
            }

            else
            {
                d = (Decision)_choices[FALSE];
            }

            if (d != null)
            {
                return(d.ChooseWidget(ao));
            }
            else
            {
                return(null);
            }
        }
Example #5
0
        /*
         * Member Methods
         */
        public override PUC.CIO.ConcreteInteractionObject ChooseWidget(
            ApplianceObject ao)
        {
            ApplianceState state = (ApplianceState)ao;

            Decision d = (Decision)_choices[state.Type.ValueSpace.Name];

            if (d == null)
            {
                d = (Decision)_choices[DEFAULT];
            }

            if (d != null)
            {
                return(d.ChooseWidget(ao));
            }
            else
            {
                return(null);
            }
        }
Example #6
0
        public override PUC.CIO.ConcreteInteractionObject ChooseWidget(GroupNode g)
        {
            Decision d = null;

            if (readonlyHelper((BranchGroupNode)g))
            {
                d = (Decision)_choices[TRUE];
            }
            else
            {
                d = (Decision)_choices[FALSE];
            }

            if (d != null)
            {
                return(d.ChooseWidget(g));
            }
            else
            {
                return(null);
            }
        }
Example #7
0
        public override PUC.CIO.ConcreteInteractionObject ChooseWidget(GroupNode g)
        {
            Decision d = null;

            if (g.IsList())
            {
                d = (Decision)_choices[TRUE];
            }
            else
            {
                d = (Decision)_choices[FALSE];
            }

            if (d != null)
            {
                return(d.ChooseWidget(g));
            }
            else
            {
                return(null);
            }
        }
Example #8
0
        public override PUC.CIO.ConcreteInteractionObject ChooseWidget(GroupNode g)
        {
            Decision d = null;

            PUC.Rules.SpecScan.ListDecision ld =
                (PUC.Rules.SpecScan.ListDecision)
                g.Decorations[PUC.Rules.SpecScan.ListDecision.DECISION_KEY];

            if (ld == null)
            {
                return(null);
            }

            d = (Decision)_choices[ld.Dimensions.ToString()];

            if (d != null)
            {
                return(d.ChooseWidget(g));
            }
            else
            {
                return(null);
            }
        }
Example #9
0
        /*
         * Member Methods
         */
        public override PUC.CIO.ConcreteInteractionObject ChooseWidget(
            ApplianceObject ao)
        {
            ApplianceState state = (ApplianceState)ao;
            Decision       d     = null;

            if (state.ReadOnly)
            {
                d = (Decision)_choices[TRUE];
            }
            else
            {
                d = (Decision)_choices[FALSE];
            }

            if (d != null)
            {
                return(d.ChooseWidget(ao));
            }
            else
            {
                return(null);
            }
        }
Example #10
0
 public PUC.CIO.ConcreteInteractionObject ChooseWidget(PUC.ApplianceObject ao)
 {
     return(_decisionTree.ChooseWidget(ao));
 }