예제 #1
0
        public void SetSliderFromFixed()
        {
            ApplianceState state = (ApplianceState)_objects[SINGLE_STATE];

            PUC.Types.FixedPtSpace space = (PUC.Types.FixedPtSpace)state.Type.ValueSpace;

            if (state.Defined)
            {
                string val = state.Value.ToString();

                if (_sentValues[val] != null &&
                    ((int)_sentValues[val]) > 0)
                {
                    int cnt = (int)_sentValues[val];
                    _sentValues[val] = --cnt;
                    return;
                }

                ((TimeSlider)_timeControl).Time    = (double)state.Value;
                ((TimeSlider)_timeControl).Maximum = space.GetMaximum().GetDoubleValue();
            }
            else
            {
                ((TimeSlider)_timeControl).Time    = 0;
                ((TimeSlider)_timeControl).Maximum = 0;
            }
        }
예제 #2
0
        public override bool IsSameSpace(ValueSpace space)
        {
            if (space is FixedPtSpace)
            {
                FixedPtSpace fs = (FixedPtSpace)space;

                if (fs.GetPointPosition() != this.GetPointPosition())
                {
                    return(false);
                }

                if (fs.IsRanged() && this.IsRanged())
                {
                    if (fs.IsIncremented() && this.IsIncremented())
                    {
                        if (!fs.GetIncrement().IsSameValue(this.GetIncrement()))
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        return(false);
                    }

                    if (!fs.GetMinimum().IsSameValue(this.GetMinimum()))
                    {
                        return(false);
                    }

                    if (!fs.GetMaximum().IsSameValue(this.GetMaximum()))
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }

                return(true);
            }

            return(false);
        }