Ejemplo n.º 1
0
        public void SetSliderFromFloat()
        {
            ApplianceState state = (ApplianceState)_objects[SINGLE_STATE];

            PUC.Types.FloatingPtSpace space = (PUC.Types.FloatingPtSpace)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;
            }
        }
Ejemplo n.º 2
0
        public override bool IsSameSpace(ValueSpace space)
        {
            if (space is FloatingPtSpace)
            {
                FloatingPtSpace fs = (FloatingPtSpace)space;

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

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

                return(true);
            }

            return(false);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns a shallow copy of this FloatingPtSpace.
        /// </summary>
        /// <returns>a shallow copy of this FloatingPtSpace</returns>
        public override object Clone()
        {
            FloatingPtSpace clone = new FloatingPtSpace();

            clone._ranged = _ranged;
            clone._min    = _min;
            clone._max    = _max;

            return(clone);
        }