예제 #1
0
        public void SetChannelType(string card, int channel, AnalogType type)
        {
            CheckCardKey(card);
            var analogOutputCard = cards[card] as AnalogOutputCard;

            analogOutputCard.SetChannelType(channel, type);
        }
예제 #2
0
 public AnalogType[] GetAllChannelTypes()
 {
     AnalogType[] types = new AnalogType[channelCount];
     for (int i = 0; i < channelCount; ++i)
     {
         var analogOutputChannel = channels[i] as AnalogOutputChannel;
         types[i] = analogOutputChannel.type;
     }
     return(types);
 }
예제 #3
0
            public void SetChannelType(int channel, AnalogType type)
            {
                CheckChannelRange(channel);
                var analogOutputChannel = channels[channel] as AnalogOutputChannel;

                analogOutputChannel.type = type;

                var message = new byte[2];

                message[0] = (byte)channel;
                message[1] = (byte)analogOutputChannel.type;

                Write(2, message);
            }
예제 #4
0
        /// <summary>
        /// Returns a vector from one of the two analog sticks on the standard controller.  If the mouse
        /// is being used instead, the function returns the vector of the mouse according to the lop left
        /// corner of the screen.
        /// </summary>
        /// <param name="vectorType">Specifies which vector, either the left analog or the right analog
        /// vector, to return.</param>
        /// <returns></returns>
        public Vector2 getVector(AnalogType vectorType)
        {
            Vector2 vector = new Vector2();

            switch (vectorType)
            {
            case AnalogType.leftAnalog:
                vector = leftAnalog;
                break;

            case AnalogType.rightAnalog:
                vector = rightAnalog;
                break;
            }

            return(vector);
        }
예제 #5
0
 /// <summary>
 /// Creates a new <see cref="AnalogDefinition"/> from specified parameters.
 /// </summary>
 /// <param name="parent">The <see cref="ConfigurationCell"/> parent of this <see cref="AnalogDefinition"/>.</param>
 /// <param name="label">The label of this <see cref="AnalogDefinition"/>.</param>
 /// <param name="scale">The integer scaling value of this <see cref="AnalogDefinition"/>.</param>
 /// <param name="offset">The offset of this <see cref="AnalogDefinition"/>.</param>
 /// <param name="type">The <see cref="AnalogType"/> of this <see cref="AnalogDefinition"/>.</param>
 public AnalogDefinition(ConfigurationCell parent, string label, uint scale, double offset, AnalogType type)
     : base(parent, label, scale, offset, type)
 {
 }
예제 #6
0
 /// <summary>
 /// Creates a new <see cref="AnalogDefinitionBase"/> from serialization parameters.
 /// </summary>
 /// <param name="info">The <see cref="SerializationInfo"/> with populated with data.</param>
 /// <param name="context">The source <see cref="StreamingContext"/> for this deserialization.</param>
 protected AnalogDefinitionBase(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     // Deserialize analog definition
     m_type = (AnalogType)info.GetValue("type", typeof(AnalogType));
 }
예제 #7
0
 /// <summary>
 /// Creates a new <see cref="AnalogDefinitionBase"/> from specified parameters.
 /// </summary>
 /// <param name="parent">The <see cref="IConfigurationCell"/> parent of this <see cref="AnalogDefinitionBase"/>.</param>
 /// <param name="label">The label of this <see cref="AnalogDefinitionBase"/>.</param>
 /// <param name="scale">The integer scaling value of this <see cref="AnalogDefinitionBase"/>.</param>
 /// <param name="offset">The offset of this <see cref="AnalogDefinitionBase"/>.</param>
 /// <param name="type">The <see cref="AnalogType"/> of this <see cref="AnalogDefinitionBase"/>.</param>
 protected AnalogDefinitionBase(IConfigurationCell parent, string label, uint scale, double offset, AnalogType type)
     : base(parent, label, scale, offset)
 {
     m_type = type;
 }
예제 #8
0
 /// <summary>
 /// Creates a new <see cref="AnalogDefinition"/> from specified parameters.
 /// </summary>
 /// <param name="parent">The <see cref="ConfigurationCell"/> parent of this <see cref="AnalogDefinition"/>.</param>
 /// <param name="label">The label of this <see cref="AnalogDefinition"/>.</param>
 /// <param name="scale">The integer scaling value of this <see cref="AnalogDefinitionBase"/>.</param>
 /// <param name="type">The <see cref="AnalogType"/> of this <see cref="AnalogDefinition"/>.</param>
 public AnalogDefinition(ConfigurationCell parent, string label, uint scale, AnalogType type)
     : base(parent, label, scale, 0.0, type)
 {
 }
예제 #9
0
 /// <summary>
 /// Creates a new <see cref="AnalogDefinition3"/> from specified parameters.
 /// </summary>
 /// <param name="parent">The <see cref="ConfigurationCell3"/> parent of this <see cref="AnalogDefinition3"/>.</param>
 /// <param name="label">The label of this <see cref="AnalogDefinition3"/>.</param>
 /// <param name="scale">The integer scaling value of this <see cref="AnalogDefinition3"/>.</param>
 /// <param name="offset">The offset of this <see cref="AnalogDefinition3"/>.</param>
 /// <param name="type">The <see cref="AnalogType"/> of this <see cref="AnalogDefinition3"/>.</param>
 public AnalogDefinition3(ConfigurationCell3 parent, string label, uint scale, double offset, AnalogType type)
     : base(parent, label, scale, offset)
 {
     AnalogType = type;
 }
 public AnalogOutputChannel(string name) : base(name, typeof(float))
 {
     type = AnalogType.ZeroTen;
 }
예제 #11
0
 public void SetChannelType(IndividualControl channel, AnalogType type)
 {
     SetChannelType(channel.Group, channel.Individual, type);
 }
예제 #12
0
        public void SetChannelType(string channelName, AnalogType type)
        {
            IndividualControl channel = GetChannelIndividualControl(channelName);

            SetChannelType(channel.Group, channel.Individual, type);
        }
예제 #13
0
 /// <summary>
 /// Creates a new <see cref="AnalogDefinitionBase"/> from serialization parameters.
 /// </summary>
 /// <param name="info">The <see cref="SerializationInfo"/> with populated with data.</param>
 /// <param name="context">The source <see cref="StreamingContext"/> for this deserialization.</param>
 protected AnalogDefinitionBase(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     // Deserialize analog definition
     m_type = (AnalogType)info.GetValue("type", typeof(AnalogType));
 }
예제 #14
0
 /// <summary>
 /// Creates a new <see cref="AnalogDefinitionBase"/> from specified parameters.
 /// </summary>
 /// <param name="parent">The <see cref="IConfigurationCell"/> parent of this <see cref="AnalogDefinitionBase"/>.</param>
 /// <param name="label">The label of this <see cref="AnalogDefinitionBase"/>.</param>
 /// <param name="scale">The integer scaling value of this <see cref="AnalogDefinitionBase"/>.</param>
 /// <param name="offset">The offset of this <see cref="AnalogDefinitionBase"/>.</param>
 /// <param name="type">The <see cref="AnalogType"/> of this <see cref="AnalogDefinitionBase"/>.</param>
 protected AnalogDefinitionBase(IConfigurationCell parent, string label, uint scale, double offset, AnalogType type)
     : base(parent, label, scale, offset)
 {
     m_type = type;
 }