• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# OutputPort类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中OutputPort的典型用法代码示例。如果您正苦于以下问题:C# OutputPort类的具体用法?C# OutputPort怎么用?C# OutputPort使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OutputPort类属于命名空间,在下文中一共展示了OutputPort类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: TurnMotorAtSpeedAsync

		TurnMotorAtSpeedAsync(OutputPort ports, int speed)
		{
			return TurnMotorAtSpeedAsyncInternal(ports, speed)
#if WINRT
			.AsAsyncAction()
#endif
			;
		}
开发者ID:BananaScheriff,项目名称:legoev3,代码行数:8,代码来源:DirectCommand.cs


示例2: StepMotorAtPowerAsync

		StepMotorAtPowerAsync(OutputPort ports, int power, uint steps, bool brake)
		{
			return StepMotorAtPowerAsyncInternal(ports, power, 0, steps, 0, brake)
#if WINRT
			.AsAsyncAction()
#endif
			;
		}
开发者ID:BananaScheriff,项目名称:legoev3,代码行数:8,代码来源:DirectCommand.cs


示例3: TurnMotorAtPowerAsync

		TurnMotorAtPowerAsync(OutputPort ports, int power)
		{
			return TurnMotorAtPowerAsyncInternal(ports, power)
#if WINRT
			.AsAsyncAction()
#endif
			;
		}
开发者ID:BananaScheriff,项目名称:legoev3,代码行数:8,代码来源:DirectCommand.cs


示例4: SharpGP2D12

        // From http://www.sharpsma.com/webfm_send/1203

        public SharpGP2D12 ()
        {
            AnalogInput = new InputPort (this, "AnalogInput", Units.Ratio);
            DistanceOutput = new OutputPort (this, "DistanceOutput", Units.Distance, 0);

            lookup = new LookupTable {
                { 0.0912, 0.7904 },
                { 0.1086, 0.6472 },
                { 0.1476, 0.4352 },
                { 0.2094, 0.2912 },
                { 0.2976, 0.196 },
                { 0.3876, 0.1456 },
                { 0.528, 0.0976 },
            };

            lookup.Input.ConnectTo (AnalogInput);
            lookup.Output.ConnectTo (DistanceOutput);
        }
开发者ID:Roddoric,项目名称:Monkey.Robotics,代码行数:20,代码来源:SharpGP2D12.cs


示例5: TurnMotorAtPowerForTime

		/// <summary>
		/// Turn the motor connected to the specified port or ports at the specified power for the specified times.
		/// </summary>
		/// <param name="ports">A specific port or Ports.All.</param>
		/// <param name="power">The power at which to turn the motor (-100% to 100%).</param>
		/// <param name="milliseconds">Number of milliseconds to run at constant power.</param>
		/// <param name="brake">Apply brake to motor at end of routine.</param>
		/// <returns></returns>
		public void TurnMotorAtPowerForTime(OutputPort ports, int power, uint milliseconds, bool brake)
		{
			TurnMotorAtPowerForTime(ports, power, 0, milliseconds, 0, brake);
		}
开发者ID:isabelcabezasm,项目名称:Lego.EV3,代码行数:12,代码来源:Command.cs


示例6: StepMotorAtSpeed

		/// <summary>
		/// Step the motor connected to the specified port or ports at the specified speed for the specified number of steps.
		/// </summary>
		/// <param name="ports">A specific port or Ports.All.</param>
		/// <param name="speed">The speed at which to turn the motor (-100% to 100%).</param>
		/// <param name="steps"></param>
		/// <param name="brake">Apply brake to motor at end of routine.</param>
		public void StepMotorAtSpeed(OutputPort ports, int speed, uint steps, bool brake)
		{
			StepMotorAtSpeed(ports, speed, 0, steps, 0, brake);
		}
开发者ID:isabelcabezasm,项目名称:Lego.EV3,代码行数:11,代码来源:Command.cs


示例7: StepMotorAtPower

		/// <summary>
		/// Step the motor connected to the specified port or ports at the specified power for the specified number of steps.
		/// </summary>
		/// <param name="ports">A specific port or Ports.All.</param>
		/// <param name="power">The power at which to turn the motor (-100% to 100%).</param>
		/// <param name="steps">The number of steps to turn the motor.</param>
		/// <param name="brake">Apply brake to motor at end of routine.</param>
		public void StepMotorAtPower(OutputPort ports, int power, uint steps, bool brake)
		{
			StepMotorAtPower(ports, power, 0, steps, 10, brake);
		}
开发者ID:isabelcabezasm,项目名称:Lego.EV3,代码行数:11,代码来源:Command.cs


示例8: SetMotorPolarityAsyncInternal

		internal async Task SetMotorPolarityAsyncInternal(OutputPort ports, Polarity polarity)
		{
			Command c = new Command(CommandType.DirectNoReply);
			c.SetMotorPolarity(ports, polarity);
			await _brick.SendCommandAsyncInternal(c);
		}
开发者ID:BananaScheriff,项目名称:legoev3,代码行数:6,代码来源:DirectCommand.cs


示例9: TurnMotorAtSpeed

		/// <summary>
		/// Turn the specified motor at the specified speed.
		/// </summary>
		/// <param name="ports">Port or ports to apply the command to.</param>
		/// <param name="speed">The speed to apply to the specified motors (-100% to 100%).</param>
		public void TurnMotorAtSpeed(OutputPort ports, int speed)
		{
			if(speed < -100 || speed > 100)
				throw new ArgumentException("Speed must be between -100 and 100 inclusive.", "speed");

			AddOpcode(Opcode.OutputSpeed);
			AddParameter(0x00);			// layer
			AddParameter((byte)ports);	// ports
			AddParameter((byte)speed);		// speed
		}
开发者ID:isabelcabezasm,项目名称:Lego.EV3,代码行数:15,代码来源:Command.cs


示例10: TurnMotorAtSpeedForTime

		/// <summary>
		/// Turn the motor connected to the specified port or ports at the specified speed for the specified times.
		/// </summary>
		/// <param name="ports">A specific port or Ports.All.</param>
		/// <param name="speed">The power at which to turn the motor (-100% to 100%).</param>
		/// <param name="milliseconds">Number of milliseconds to run at constant speed.</param>
		/// <param name="brake">Apply brake to motor at end of routine.</param>
		/// <returns></returns>
		public void TurnMotorAtSpeedForTime(OutputPort ports, int speed, uint milliseconds, bool brake)
		{
			TurnMotorAtSpeedForTime(ports, speed, 0, milliseconds, 0, brake);
		}
开发者ID:isabelcabezasm,项目名称:Lego.EV3,代码行数:12,代码来源:Command.cs


示例11: SetMotorPolarity

		/// <summary>
		/// Append the Set Polarity command to an existing Command object
		/// </summary>
		/// <param name="ports">Port or ports to change polarity</param>
		/// <param name="polarity">The new polarity (direction) value</param>
		public void SetMotorPolarity(OutputPort ports, Polarity polarity)
		{
			AddOpcode(Opcode.OutputPolarity);
			AddParameter(0x00);
			AddParameter((byte)ports);
			AddParameter((byte)polarity);
		}
开发者ID:isabelcabezasm,项目名称:Lego.EV3,代码行数:12,代码来源:Command.cs


示例12: StopMotor

		/// <summary>
		/// Append the Stop Motor command to an existing Command object
		/// </summary>
		/// <param name="ports">Port or ports to stop</param>
		/// <param name="brake">Apply the brake at the end of the command</param>
		public void StopMotor(OutputPort ports, bool brake)
		{
			AddOpcode(Opcode.OutputStop);
			AddParameter(0x00);			// layer
			AddParameter((byte)ports);	// ports
			AddParameter((byte)(brake ? 0x01 : 0x00));		// brake (0 = coast, 1 = brake)
		}
开发者ID:isabelcabezasm,项目名称:Lego.EV3,代码行数:12,代码来源:Command.cs


示例13: StartMotorAsyncInternal

		internal async Task StartMotorAsyncInternal(OutputPort ports)
		{
			Command c = new Command(CommandType.DirectNoReply);
			c.StartMotor(ports);
			await _brick.SendCommandAsyncInternal(c);
		}
开发者ID:BananaScheriff,项目名称:legoev3,代码行数:6,代码来源:DirectCommand.cs


示例14: AddOutput

 internal void AddOutput()
 {
     var output = new OutputPort("Output" + Brain.KB.Sources.GetOutputPorts().Count);
     Brain.KB.Sources.AddOutputPort(output);
     LoadOutputs();
     ui.listBoxOutputs.SelectedIndex = OutputPorts.Count - 1;
     LoadSignals();
 }
开发者ID:ValdemarOrn,项目名称:KickBrain,代码行数:8,代码来源:OutputController.cs


示例15: LoadOutputs

        public void LoadOutputs()
        {
            // Outputs
            OutputPorts = Brain.KB.Sources.GetOutputPorts();

            ui.listBoxOutputs.Items.Clear();

            foreach (var port in OutputPorts)
            {
                // show in the list on the left side
                ui.listBoxOutputs.Items.Add(port.Name);
            }

            // reload selected index
            try
            {
                ui.listBoxOutputs.SelectedIndex = SelectedIndex;
            }
            catch (Exception e)
            {
                ui.listBoxOutputs.SelectedIndex = 0;
                CurrentPort = Brain.KB.Sources.GetOutputPorts()[0];
            }
        }
开发者ID:ValdemarOrn,项目名称:KickBrain,代码行数:24,代码来源:OutputController.cs


示例16: LoadOutput

        public void LoadOutput(int i)
        {
            //Detach trigger from every available event!
            Brain.KB.Sources.DetachAllEvents(this.Trigger);

            if (i < 0 || i >= ui.listBoxOutputs.Items.Count)
                return;

            CurrentPort = OutputPorts[i];

            var port = CurrentPort;

            ui.comboBoxSignal.SelectedIndex = signals.IndexOf(port.Signal);
            ui.comboBoxEvent.SelectedIndex = events.IndexOf(port.Event);
            ui.comboBoxCrosstalk.SelectedIndex = -1;

            ui.textBoxName.Text = port.Name;
            ui.checkBoxEnabled.Checked = port.Enabled;
            ui.textBoxMidiChannel.Text = port.MidiChannel.ToString();
            ui.textBoxCCNumber.Text = port.CCNumber.ToString();
            ui.checkBoxIsNote.Checked = port.IsNote;
            ui.comboBoxFilterSignal.SelectedIndex = (port.Filter != null) ? signals.IndexOf(port.Filter) : -1;
            ui.checkBoxFilterEnabled.Checked = port.FilterEnabled;
            ui.textBoxFilterMin.Text = port.FilterMin.ToString();
            ui.textBoxFilterMax.Text = port.FilterMax.ToString();
            ui.velocityMapControl.Map = new AudioLib.VelocityMap(port.VelocityMap);

            // Attach the trigger that updates the view
            if (port.Event != null)
                port.Event.Add(this.Trigger, null);

            LoadCrosstalk();
        }
开发者ID:ValdemarOrn,项目名称:KickBrain,代码行数:33,代码来源:OutputController.cs


示例17: StartMotor

		/// <summary>
		/// Start the motor(s) based on previous commands
		/// </summary>
		/// <param name="ports">Port or ports to apply the command to.</param>
		public void StartMotor(OutputPort ports)
		{
			AddOpcode(Opcode.OutputStart);
			AddParameter(0x00);			// layer
			AddParameter((byte)ports);	// ports
		}
开发者ID:isabelcabezasm,项目名称:Lego.EV3,代码行数:10,代码来源:Command.cs


示例18: TimeMotorSync

		/// <summary>
		/// Synchronize timing of motors.
		/// </summary>
		/// <param name="ports">The port or ports to which the stop command will be sent.</param>
		/// <param name="speed">Speed to turn the motor(s). (-100 to 100)</param>
		/// <param name="turnRatio">The turn ratio to apply. (-200 to 200)</param>
		/// <param name="time">The time to turn the motor(s).</param>
		/// <param name="brake">Brake or coast at the end.</param>
		/// <returns></returns>
		public void TimeMotorSync(OutputPort ports, int speed, short turnRatio, uint time, bool brake)
		{
			if(speed < -100 || speed > 100)
				throw new ArgumentException("Speed must be between -100 and 100", "speed");

			if(turnRatio < -200 || turnRatio > 200)
				throw new ArgumentException("Turn ratio must be between -200 and 200", "turnRatio");

			AddOpcode(Opcode.OutputTimeSync);
			AddParameter(0x00);
			AddParameter((byte)ports);
			AddParameter((byte)speed);
			AddParameter(turnRatio);
			AddParameter(time);
			AddParameter((byte)(brake ? 0x01 : 0x00));		// brake (0 = coast, 1 = brake)
		}
开发者ID:isabelcabezasm,项目名称:Lego.EV3,代码行数:25,代码来源:Command.cs


示例19: TurnMotorAtPower

		/// <summary>
		/// Turns the specified motor at the specified power
		/// </summary>
		/// <param name="ports">Port or ports to apply the command to.</param>
		/// <param name="power">The amount of power to apply to the specified motors (-100% to 100%).</param>
		public void TurnMotorAtPower(OutputPort ports, int power)
		{
			if(power < -100 || power > 100)
				throw new ArgumentException("Power must be between -100 and 100 inclusive.", "power");

			AddOpcode(Opcode.OutputPower);
			AddParameter(0x00);			// layer
			AddParameter((byte)ports);	// ports
			AddParameter((byte)power);	// power
		}
开发者ID:isabelcabezasm,项目名称:Lego.EV3,代码行数:15,代码来源:Command.cs


示例20: OutputReady

		/// <summary>
		/// Wait for the specificed output port(s) to be ready for the next command
		/// </summary>
		/// <param name="ports">Port(s) to wait for</param>
		/// <returns></returns>
		public void OutputReady(OutputPort ports)
		{
			AddOpcode(Opcode.OutputReady);
			AddParameter(0x00);			// layer
			AddParameter((byte)ports);	// ports
		}
开发者ID:isabelcabezasm,项目名称:Lego.EV3,代码行数:11,代码来源:Command.cs



注:本文中的OutputPort类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# OutputStream类代码示例发布时间:2022-05-24
下一篇:
C# OutputKind类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap