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; } }
/// <summary> /// Returns a shallow copy of this FixedPtSpace. /// </summary> /// <returns>a shallow copy of this FixedPtSpace</returns> public override object Clone() { FixedPtSpace clone = new FixedPtSpace(_pointpos); clone._ranged = _ranged; clone._min = _min; clone._max = _max; clone._incremented = _incremented; clone._increment = _increment; return(clone); }
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); }