public AttributePointSetting(FixtureAttribute attribute) { this.Attribute = attribute; this._value = 0; this.Snap = true; // TODO: Should snap be on by default? this._active = false; }
// TODO: Change name to ActivatePreset ? public void ActivateCurrentPreset(AttributePreset preset) { if (_active) { foreach (FixtureWrapperFAOverride fixtureWrapper in _fixtureWrappers) { if (fixtureWrapper.IsAffected) { foreach (AttributePresetSetting setting in preset.AttributePointSettings) { if (setting.Active) { FixtureAttribute containsSameType = null; foreach (FixtureAttribute attr in fixtureWrapper.Fixture.Attributes) { if (attr.Type == setting.Type) { containsSameType = attr; break; } } if (containsSameType != null) { containsSameType.SetOverride(true); containsSameType.SetLevel(setting.Value, "_FA_OVERRIDE_nohtp_"); } } } } } } }
public void AddAttribute(FixtureAttribute attr) { if (attr.Type == ATTRIBUTE_TYPE.PAN_COARSE || attr.Type == ATTRIBUTE_TYPE.PAN_FINE || attr.Type == ATTRIBUTE_TYPE.TILT_COARSE || attr.Type == ATTRIBUTE_TYPE.TILT_FINE) { MovingAttributes.Add(attr); } else { Attributes.Add(attr); } }
public void SaveFocusPoint(string Name) { // Save a focus point as a new attribute // (and also add it to _focusPoints) List <Photon> thePhotons = new List <Photon>(); int panCoarse = (int)currentPan / 256; int panFine = (int)currentPan % 256; int tiltCoarse = (int)currentTilt / 256; int tiltFine = (int)currentTilt % 256; thePhotons.Add(new Photon(startChannel + 4, panCoarse)); thePhotons.Add(new Photon(startChannel + 5, panFine)); thePhotons.Add(new Photon(startChannel + 6, tiltCoarse)); thePhotons.Add(new Photon(startChannel + 7, tiltFine)); thePhotons.Add(new Photon(startChannel + 2, currentColor)); thePhotons.Add(new Photon(startChannel + 3, currentGobo)); FixtureAttribute newFocusPoint = new FixtureAttribute(ATTRIBUTE_TYPE.OTHER, Name, thePhotons, this); attributes.Add(newFocusPoint); _focusPoints.Add(newFocusPoint); }
// To restore one from a file public BigPhoton(SerializationInfo info, StreamingContext ctxt) { _attribute = (FixtureAttribute)info.GetValue("FixtureAttribute", typeof(FixtureAttribute)); _level = info.GetInt32("Level"); }
// CONSTRUCTORS public BigPhoton(FixtureAttribute fixtureAttribute, int level) { _attribute = fixtureAttribute; _level = level; }
public void SaveFocusPoint(string Name) { // Save a focus point as a new attribute // (and also add it to _focusPoints) List<Photon> thePhotons = new List<Photon>(); int panCoarse = (int)currentPan / 256; int panFine = (int)currentPan % 256; int tiltCoarse = (int)currentTilt / 256; int tiltFine = (int)currentTilt % 256; thePhotons.Add(new Photon(startChannel + 4, panCoarse)); thePhotons.Add(new Photon(startChannel + 5, panFine)); thePhotons.Add(new Photon(startChannel + 6, tiltCoarse)); thePhotons.Add(new Photon(startChannel + 7, tiltFine)); thePhotons.Add(new Photon(startChannel + 2, currentColor)); thePhotons.Add(new Photon(startChannel + 3, currentGobo)); FixtureAttribute newFocusPoint = new FixtureAttribute(ATTRIBUTE_TYPE.OTHER, Name, thePhotons, this); attributes.Add(newFocusPoint); _focusPoints.Add(newFocusPoint); }