public void SetChannelType(string card, int channel, AnalogType type) { CheckCardKey(card); var analogOutputCard = cards[card] as AnalogOutputCard; analogOutputCard.SetChannelType(channel, type); }
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); }
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); }
/// <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); }
/// <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) { }
/// <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)); }
/// <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; }
/// <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) { }
/// <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; }
public void SetChannelType(IndividualControl channel, AnalogType type) { SetChannelType(channel.Group, channel.Individual, type); }
public void SetChannelType(string channelName, AnalogType type) { IndividualControl channel = GetChannelIndividualControl(channelName); SetChannelType(channel.Group, channel.Individual, type); }