Esempio n. 1
0
        public void ApplySettings(AxisSettings settings)
        {
            m_zeroDeadZone   = settings.ZeroDeadZoneRaw;
            m_oneDeadZone    = settings.OneDeadZoneRaw;
            m_truncate       = ((settings.Flags & (byte)AxisSettingsFlags.Truncate) > 0);
            m_invert         = ((settings.Flags & (byte)AxisSettingsFlags.Invert) > 0);
            m_interpretation = Global.Interpretations.FirstOrDefault(x => x.Type == settings.Interpretation);
            if (m_interpretation == null)
            {
                m_interpretation = Global.InterpretationNull;
            }

            RaiseAllSettingsChanged();
        }
Esempio n. 2
0
        public AxisSettings ToAxisSettings()
        {
            AxisSettings result = new AxisSettings();

            result.ZeroDeadZoneRaw = (byte)m_zeroDeadZone;
            result.OneDeadZoneRaw  = (byte)m_oneDeadZone;
            if (m_truncate)
            {
                result.Flags |= (byte)AxisSettingsFlags.Truncate;
            }
            if (m_invert)
            {
                result.Flags |= (byte)AxisSettingsFlags.Invert;
            }
            result.Interpretation = m_interpretation.Type;

            return(result);
        }
 private void ReloadSettings(object e)
 {
     try
     {
         foreach (var axis in m_axes)
         {
             m_device.SelectAxis(axis.Type);
             AxisSettings sett = m_device.GetSettings().Settings;
             axis.ApplySettings(sett);
         }
     }
     catch
     {
         OnErrorOccurred();
     }
     finally
     {
         ClearIsChanged();
     }
 }
Esempio n. 4
0
 public AxisViewModel(AxisType type, AxisSettings settings)
 {
     m_type = type;
     ApplySettings(settings);
 }