예제 #1
0
        public int getAxisState(AxisName axis)
        {
            switch (axis)
            {
            case AxisName.X:
                return(device.GetCurrentState().X);

            case AxisName.Y:
                return(device.GetCurrentState().Y);

            case AxisName.Z:
                return(device.GetCurrentState().Z);

            case AxisName.RotationX:
                return(device.GetCurrentState().RotationX);

            case AxisName.RotationY:
                return(device.GetCurrentState().RotationY);

            case AxisName.RotationZ:
                return(device.GetCurrentState().RotationZ);

            case AxisName.Slider:
                return(device.GetCurrentState().Sliders[0]);
            }
            return(0);
        }
예제 #2
0
        public void setAxisState(AxisName axis, int value)
        {
            value = Math.Min(Math.Max(value, 1), 32767);

            switch (axis)
            {
            case AxisName.X:
                state.AxisX = value;
                break;

            case AxisName.Y:
                state.AxisY = value;
                break;

            case AxisName.Z:
                state.AxisZ = value;
                break;

            case AxisName.RotationX:
                state.AxisXRot = value;
                break;

            case AxisName.RotationY:
                state.AxisYRot = value;
                break;

            case AxisName.RotationZ:
                state.AxisZRot = value;
                break;

            case AxisName.Slider:
                state.Slider = value;
                break;
            }
        }
예제 #3
0
        public void AddTicks(Dictionary <string, double> labelValues, int axis = 0)
        {
            AxisName  axisName = (AxisName)axis;
            AxisTicks axisTicks;

            switch (axisName)
            {
            case AxisName.X:
                axisTicks = _xTicks;
                break;

            case AxisName.Y:
                axisTicks = _yTicks;
                break;

            case AxisName.Z:
                axisTicks = _zTicks;
                break;

            default:
                throw new ArgumentException($"axis={axis} is not a valid axis number");
            }

            _addTicks(labelValues: labelValues, axisTicks: axisTicks);
        }
예제 #4
0
        private static string GetAxisName(AxisName axisName)
        {
            switch (axisName)
            {
            case AxisName.AnalogLeft_X:
                return("Left Stick X-Axis");

            case AxisName.AnalogLeft_Y:
                return("Left Stick Y-Axis");

            case AxisName.AnalogRight_X:
                return("Right Stick X-Axis");

            case AxisName.AnalogRight_Y:
                return("Right Stick Y-Axis");

            case AxisName.DPad_X:
                return("DPAD X-Axis");

            case AxisName.DPad_Y:
                return("DPAD Y-Axis");

            case AxisName.R2:
                return("R2 as Axis");

            case AxisName.L2:
                return("L2 as Axis");

            default:
                return("");
            }
        }
예제 #5
0
        /// <summary>
        /// Initialize cursor class.
        /// </summary>
        /// <param name="chartArea">Chart area the cursor belongs to.</param>
        /// <param name="attachedToXAxis">Indicates which axes should be used X or Y.</param>
        internal void Initialize(ChartArea chartArea, AxisName attachedToXAxis)
        {
            // Set chart are reference
            _chartArea = chartArea;

            // Attach cursor to specified axis
            _attachedToXAxis = attachedToXAxis;
        }
예제 #6
0
 public AxisName Name()
 {
     if (name == null)
     {
         name = new AxisName();
     }
     return(name);
 }
예제 #7
0
    public override int GetHashCode()
    {
        var hash = IsAxis.GetHashCode();

        hash = (hash * 7) + KeyName.GetHashCode();
        hash = AxisName != null ? (hash * 7) + AxisName.GetHashCode() : (hash * 7);

        return(hash);
    }
예제 #8
0
 public Axis(DeviceReader leftDeviceReader, DeviceReader rightDeviceReader, VJoyDevice vJoyDevice, AxisName axisInput, AxisName axisOutput, bool centered)
 {
     this.leftDeviceReader  = leftDeviceReader;
     this.rightDeviceReader = rightDeviceReader;
     this.vJoyDevice        = vJoyDevice;
     this.axisInput         = axisInput;
     this.axisOutput        = axisOutput;
     this.centered          = centered;
 }
예제 #9
0
        public bool SeriesDateTimeType(AxisName axisName, string subAxisName)
        {
            foreach (string item in this.series)
            {
                Series series = base.Common.DataManager.Series[item];
                switch (axisName)
                {
                case AxisName.X:
                    if (series.XAxisType != 0)
                    {
                        break;
                    }
                    if (series.XValueType != ChartValueTypes.Date && series.XValueType != ChartValueTypes.DateTime && series.XValueType != ChartValueTypes.Time && series.XValueType != ChartValueTypes.DateTimeOffset)
                    {
                        return(false);
                    }
                    return(true);

                case AxisName.X2:
                    if (series.XAxisType != AxisType.Secondary)
                    {
                        break;
                    }
                    if (series.XValueType != ChartValueTypes.Date && series.XValueType != ChartValueTypes.DateTime && series.XValueType != ChartValueTypes.Time && series.XValueType != ChartValueTypes.DateTimeOffset)
                    {
                        return(false);
                    }
                    return(true);

                case AxisName.Y:
                    if (series.YAxisType != 0)
                    {
                        break;
                    }
                    if (series.YValueType != ChartValueTypes.Date && series.YValueType != ChartValueTypes.DateTime && series.YValueType != ChartValueTypes.Time && series.YValueType != ChartValueTypes.DateTimeOffset)
                    {
                        return(false);
                    }
                    return(true);

                case AxisName.Y2:
                    if (series.YAxisType != AxisType.Secondary)
                    {
                        break;
                    }
                    if (series.YValueType != ChartValueTypes.Date && series.YValueType != ChartValueTypes.DateTime && series.YValueType != ChartValueTypes.Time && series.YValueType != ChartValueTypes.DateTimeOffset)
                    {
                        return(false);
                    }
                    return(true);
                }
            }
            return(false);
        }
예제 #10
0
        internal bool SeriesIntegerType(AxisName axisName, string subAxisName)
        {
            foreach (string item in this.series)
            {
                Series series = base.Common.DataManager.Series[item];
                switch (axisName)
                {
                case AxisName.X:
                    if (series.XAxisType == AxisType.Primary)
                    {
                        if (series.XValueType != ChartValueTypes.Int && series.XValueType != ChartValueTypes.UInt && series.XValueType != ChartValueTypes.ULong && series.XValueType != ChartValueTypes.Long)
                        {
                            return(false);
                        }
                        return(true);
                    }
                    break;

                case AxisName.X2:
                    if (series.XAxisType == AxisType.Secondary)
                    {
                        if (series.XValueType != ChartValueTypes.Int && series.XValueType != ChartValueTypes.UInt && series.XValueType != ChartValueTypes.ULong && series.XValueType != ChartValueTypes.Long)
                        {
                            return(false);
                        }
                        return(true);
                    }
                    break;

                case AxisName.Y:
                    if (series.YAxisType == AxisType.Primary)
                    {
                        if (series.YValueType != ChartValueTypes.Int && series.YValueType != ChartValueTypes.UInt && series.YValueType != ChartValueTypes.ULong && series.YValueType != ChartValueTypes.Long)
                        {
                            return(false);
                        }
                        return(true);
                    }
                    break;

                case AxisName.Y2:
                    if (series.YAxisType == AxisType.Secondary)
                    {
                        if (series.YValueType != ChartValueTypes.Int && series.YValueType != ChartValueTypes.UInt && series.YValueType != ChartValueTypes.ULong && series.YValueType != ChartValueTypes.Long)
                        {
                            return(false);
                        }
                        return(true);
                    }
                    break;
                }
            }
            return(false);
        }
예제 #11
0
    public float GetAxisRaw(AxisName axisName)
    {
        float horizontal = 0;

        if (axisName == AxisName.None)
        {
            Debug.LogError("InputManager::GetAxisRaw -- no axis named : " + axisName);
        }
        else if (axisName == AxisName.Horizontal)
        {
            if (this.GetButton(ButtonName.Left))
            {
                horizontal -= 1F;
            }
            if (this.GetButton(ButtonName.Right))
            {
                horizontal += 1F;
            }

            if (this.joysticks[0] > 0)
            {
                int index = this.joysticks[0];
                horizontal += Input.GetAxisRaw("Horizontal" + index);
            }
        }
        else if (axisName == AxisName.Horizontal2)
        {
            if (this.GetButton(ButtonName.Left2))
            {
                horizontal -= 1F;
            }
            if (this.GetButton(ButtonName.Right2))
            {
                horizontal += 1F;
            }

            if (this.joysticks[1] > 0)
            {
                int index = this.joysticks[1];
                horizontal += Input.GetAxisRaw("Horizontal" + index);
            }
        }


        return(horizontal);
    }
예제 #12
0
    public float GetAxis(AxisName axisName)
    {
        switch (axisName)
        {
        case AxisName.LeftStick_Vertical:
            return(leftStick.GetInput(verticalAxisName));

        case AxisName.LeftStick_Horizontal:
            return(leftStick.GetInput(horizontalAxisName));

        case AxisName.RightStick_Vertical:
            return(rightStick.GetInput(verticalAxisName));

        case AxisName.RightStick_Horizontal:
            return(rightStick.GetInput(horizontalAxisName));

        default:
            return(0f);
        }
    }
예제 #13
0
 public Axis GetAxis(AxisName axisName, AxisType axisType, string subAxisName)
 {
     if (((ChartArea)this).Area3DStyle.Enable3D)
     {
         subAxisName = string.Empty;
     }
     if (axisName != 0 && axisName != AxisName.X2)
     {
         if (axisType == AxisType.Primary)
         {
             return(((ChartArea)this).AxisY.GetSubAxis(subAxisName));
         }
         return(((ChartArea)this).AxisY2.GetSubAxis(subAxisName));
     }
     if (axisType == AxisType.Primary)
     {
         return(((ChartArea)this).AxisX.GetSubAxis(subAxisName));
     }
     return(((ChartArea)this).AxisX2.GetSubAxis(subAxisName));
 }
예제 #14
0
        protected void addAxis(AxisName axisInput, AxisName axisOutput, AxisMethod method, byte change, bool centered)
        {
            if (axisInput != AxisName.none)
            {
                switch (method)
                {
                case AxisMethod.WeightedSum:
                    axesList.AddLast(new AxisWeightedSum(leftDeviceReader, rightDeviceReader, vJoyDevice, axisInput, axisOutput, centered));
                    break;

                case AxisMethod.Change:
                    axesList.AddLast(new AxisChange(leftDeviceReader, rightDeviceReader, vJoyDevice, axisInput, axisOutput, centered, change));
                    break;

                case AxisMethod.Minimum:
                    axesList.AddLast(new AxisMinimum(leftDeviceReader, rightDeviceReader, vJoyDevice, axisInput, axisOutput, centered));
                    break;

                case AxisMethod.Maximum:
                    axesList.AddLast(new AxisMaximum(leftDeviceReader, rightDeviceReader, vJoyDevice, axisInput, axisOutput, centered));
                    break;
                }
            }
        }
예제 #15
0
 public IEnumerable <double> this[AxisName d] => Data[d];
예제 #16
0
파일: Axis.cs 프로젝트: pmq20/mono_forked
 public Axis(ChartArea chartArea, AxisName axisTypeName)
 {
     this.ChartArea = chartArea;
     this.AxisName  = axisTypeName;
 }
예제 #17
0
 public static float GetAxis(AxisName axisName) => Input.GetAxis(GetAxisName(axisName));
예제 #18
0
파일: Axis.cs 프로젝트: carrie901/mono
		public Axis (ChartArea chartArea, AxisName axisTypeName)
		{
		}
예제 #19
0
 public Axis(ChartArea chartArea, AxisName axisTypeName)
 {
 }
예제 #20
0
파일: Axis.cs 프로젝트: nobled/mono
		public Axis (ChartArea chartArea, AxisName axisTypeName)
		{
			this.ChartArea = chartArea;
			this.AxisName = axisTypeName;
		}
예제 #21
0
 public AxisTicks()
 {
     _values   = Generate.LinearRange(-1, 0.5, 1);
     _axisName = AxisName.X;
 }
예제 #22
0
 public AxisRange(double min, double max, AxisName axisName)
 {
     _limits   = new double[] { min, max };
     _axisName = axisName;
 }
예제 #23
0
 public AxisRange(AxisName axisName)
 {
     _limits   = new double[] { -1, 1 };
     _axisName = axisName;
 }
예제 #24
0
 public double GetPositionFromAxis(string chartAreaName, AxisName axis, double axisValue)
 {
     throw new NotImplementedException();
 }
예제 #25
0
		public double GetPositionFromAxis (string chartAreaName, AxisName axis, double axisValue)
		{
			throw new NotImplementedException ();
		}
예제 #26
0
 public AxisChange(DeviceReader leftDeviceReader, DeviceReader rightDeviceReader, VJoyDevice vJoyDevice, AxisName axisInput, AxisName axisOutput, bool centered, byte change)
     : base(leftDeviceReader, rightDeviceReader, vJoyDevice, axisInput, axisOutput, centered)
 {
     this.change         = change;
     this.changeInterval = Properties.Settings.Default.changeInterval;
 }
예제 #27
0
 public AxisTicks(AxisName axisName)
 {
     _values   = Generate.LinearRange(-1, 0.5, 1);
     _axisName = axisName;
 }
예제 #28
0
 internal void Initialize(ChartArea chartArea, AxisName attachedToXAxis)
 {
     this.chartArea       = chartArea;
     this.attachedToXAxis = attachedToXAxis;
 }
예제 #29
0
 public AxisTicks(IEnumerable <double> ticksValues, AxisName axisName)
 {
     _values   = ticksValues;
     _axisName = axisName;
 }
 public AxisButton(AxisName axis)
 {
     this.axis = axis;
     axisName  = axis.ToString();
 }
예제 #31
0
 public AxisMaximum(DeviceReader leftDeviceReader, DeviceReader rightDeviceReader, VJoyDevice vJoyDevice, AxisName axisInput, AxisName axisOutput, bool centered)
     : base(leftDeviceReader, rightDeviceReader, vJoyDevice, axisInput, axisOutput, centered)
 {
 }
예제 #32
0
 public AxisRange()
 {
     _limits   = new double[] { -1, 1 };
     _axisName = AxisName.X;
 }
예제 #33
0
        public AxisWeightedSum(DeviceReader leftDeviceReader, DeviceReader rightDeviceReader, VJoyDevice vJoyDevice, AxisName axisInput, AxisName axisOutput, bool centered)
            : base(leftDeviceReader, rightDeviceReader, vJoyDevice, axisInput, axisOutput, centered)
        {
            modesWeights    = new byte[3];
            modesWeights[0] = Properties.Settings.Default.mode1Weight;
            modesWeights[1] = Properties.Settings.Default.mode2Weight;
            modesWeights[2] = Properties.Settings.Default.mode3Weight;

            modesButtons    = new byte[3];
            modesButtons[0] = Properties.Settings.Default.mode1Button;
            modesButtons[1] = Properties.Settings.Default.mode2Button;
            modesButtons[2] = Properties.Settings.Default.mode3Button;
        }