// 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_");
                         }
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 // 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_");
                         }
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
        private void lbxPresets_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (lbxPresets.SelectedIndex != -1)
            {
                foreach (AttributePreset preset in Controller.AttributePresets)
                {
                    if (lbxPresets.SelectedItems.Contains(preset))
                    {
                        ActivateCurrentPreset(preset);
                    }
                    else
                    {
                        DeactivateCurrentPreset(preset);
                    }
                }

                _preset = (AttributePreset)lbxPresets.SelectedItem;
                lbxAttributeSettings.ItemsSource = _preset.AttributePointSettings;

                //Change save button into "new"
                btnSavePreset.Content   = "New Preset";
                tbxPresetName.IsEnabled = false;
                _createNew = true;
            }
        }
Exemplo n.º 4
0
 //TODO: Change name to DeactivatePreset ?
 public void DeactivateCurrentPreset(AttributePreset preset)
 {
     foreach (FixtureWrapperFAOverride fixtureWrapper in _fixtureWrappers)
     {
         //Not checking if IsAffected cause we are still using HTP.  IF we stop using HTP, change this.
         foreach (FixtureAttribute attr in fixtureWrapper.Fixture.Attributes)
         {
             attr.SetOverride(false);
             attr.SetLevel(0, "_FA_OVERRIDE_nohtp_");
         }
     }
 }
Exemplo n.º 5
0
 //FA OVERRIDE
 private void GenerateFreshPreset()
 {
     _preset = new AttributePreset();
     foreach (ATTRIBUTE_TYPE type in (ATTRIBUTE_TYPE[])Enum.GetValues(typeof(ATTRIBUTE_TYPE)))
     {
         if (!(type == ATTRIBUTE_TYPE.PAN_COARSE || type == ATTRIBUTE_TYPE.PAN_FINE || type == ATTRIBUTE_TYPE.TILT_COARSE || type == ATTRIBUTE_TYPE.TILT_FINE))
         {
             _preset.AttributePointSettings.Add(new AttributePresetSetting(type));
         }
     }
     lbxAttributeSettings.ItemsSource = _preset.AttributePointSettings;
 }
Exemplo n.º 6
0
        private void DeletePreset_MouseUp(object sender, MouseButtonEventArgs e)
        {
            Image img = (Image)sender;

            if (img.DataContext.GetType() == typeof(AttributePreset))
            {
                AttributePreset preset = (AttributePreset)img.DataContext;
                AttributePreset temp   = _preset;
                _preset = preset;
                DeactivateCurrentPreset(_preset);
                Controller.AttributePresets.Remove(preset);
                _preset = temp;
                ActivateCurrentPreset(_preset);
            }
        }
        private void lbxPresets_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (lbxPresets.SelectedIndex != -1)
            {
                foreach (AttributePreset preset in Controller.AttributePresets)
                {
                    if(lbxPresets.SelectedItems.Contains(preset))
                    {
                        ActivateCurrentPreset(preset);
                    }
                    else
                    {
                        DeactivateCurrentPreset(preset);
                    }
                }

                _preset = (AttributePreset)lbxPresets.SelectedItem;
                lbxAttributeSettings.ItemsSource = _preset.AttributePointSettings;

                //Change save button into "new"
                btnSavePreset.Content = "New Preset";
                tbxPresetName.IsEnabled = false;
                _createNew = true;
            }
        }
 //FA OVERRIDE
 private void GenerateFreshPreset()
 {
     _preset = new AttributePreset();
     foreach (ATTRIBUTE_TYPE type in (ATTRIBUTE_TYPE[])Enum.GetValues(typeof(ATTRIBUTE_TYPE)))
     {
         if (!(type == ATTRIBUTE_TYPE.PAN_COARSE || type == ATTRIBUTE_TYPE.PAN_FINE || type == ATTRIBUTE_TYPE.TILT_COARSE || type == ATTRIBUTE_TYPE.TILT_FINE))
         {
             _preset.AttributePointSettings.Add(new AttributePresetSetting(type));
         }
     }
     lbxAttributeSettings.ItemsSource = _preset.AttributePointSettings;
 }
 private void DeletePreset_MouseUp(object sender, MouseButtonEventArgs e)
 {
     Image img = (Image)sender;
     if (img.DataContext.GetType() == typeof(AttributePreset))
     {
         AttributePreset preset = (AttributePreset)img.DataContext;
         AttributePreset temp = _preset;
         _preset = preset;
         DeactivateCurrentPreset(_preset);
         Controller.AttributePresets.Remove(preset);
         _preset = temp;
         ActivateCurrentPreset(_preset);
     }
 }
 //TODO: Change name to DeactivatePreset ?
 public void DeactivateCurrentPreset(AttributePreset preset)
 {
     foreach (FixtureWrapperFAOverride fixtureWrapper in _fixtureWrappers)
     {
         //Not checking if IsAffected cause we are still using HTP.  IF we stop using HTP, change this.
         foreach (FixtureAttribute attr in fixtureWrapper.Fixture.Attributes)
         {
             attr.SetOverride(false);
             attr.SetLevel(0, "_FA_OVERRIDE_nohtp_");
         }
     }
 }