当前位置: 首页>>代码示例>>C#>>正文


C# Gear类代码示例

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


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

示例1: ConvertGearToRawPosition

        private int ConvertGearToRawPosition(Gear gear)
        {
            switch (gear)
            {
                case Gear.parking:
                    return 0;
                    break;

                case Gear.reverse:
                    return 1;
                    break;

                case Gear.neutral:
                    return 2;
                    break;

                case Gear.drive:
                    return 3;
                    break;

                case Gear.two:
                    return 4;
                    break;

                default:
                    throw new ApplicationException("Unhandled gear!");
                    break;
            }
        }
开发者ID:Spawek,项目名称:valeo,代码行数:29,代码来源:GearboxController.cs

示例2: Gearbox

 // Constructor accepts mediator as an argument
 public Gearbox(EngineManagementSystem mediator)
 {
     this.mediator = mediator;
     enabled = false;
     currentGear = Gear.Neutral;
     mediator.RegisterGearbox(this);
 }
开发者ID:phoenixproject,项目名称:csdpe,代码行数:8,代码来源:Gearbox.cs

示例3: setGear

        //TODO: make some enum
        /// <summary>
        /// 
        /// </summary>
        /// <param name="gear">
        /// p - parking
        /// r - reverse
        /// n - neutral
        /// d - tylko 1 bieg
        /// </param>
        public void setGear(Gear gear)
        {
            switch(gear)
            {
                case Gear.parking:
                    setTarget(GEARBOX_CHANNEL, GEAR_P);
                    break;

                case Gear.reverse:
                    setTarget(GEARBOX_CHANNEL, GEAR_R);
                    break;

                case Gear.neutral:
                    setTarget(GEARBOX_CHANNEL, GEAR_N);
                    break;

                case Gear.drive:
                    setTarget(GEARBOX_CHANNEL, GEAR_D);
                    break;

                default:
                    Logger.Log(this, String.Format("trying to set not-existing gear", gear), 2);
                    break;
            }
        }
开发者ID:Spawek,项目名称:autonomiczny_samochod,代码行数:35,代码来源:ServoDriver.cs

示例4: ParameterAttribute

        /// <summary>
        /// 
        /// </summary>
        /// <param name="gear"></param>
        /// <param name="attribute"></param>
        public ParameterAttribute(Gear gear, String attribute)
        {
            _gear = gear;
            _attribute = attribute;

            //If we have FixedValues use that
            //I wan't to create array with rating as index for future, but
            //this is keept for backwards/laziness
            if (_attribute.StartsWith("FixedValues"))
            {
                //Regex to extracxt anything between ( ) in Param
                Match m = FixedExtract.Match(_attribute);
                String vals = m.Groups[1].Value;

                //Regex to extract anything inbetween [ ]
                //Not sure why i don't just split by , and remove it durring
                //next phase
                MatchCollection m2 = Regex.Matches(vals, @"\[([^\]]*)\]");

                double junk; //Not used, tryparse needs out

                //LINQ magic to cast matchcollection to the double[]
                fixedDoubles = (from val in m2.Cast<Match>()
                    where double.TryParse(val.Groups[1].Value, out junk)
                    select double.Parse(val.Groups[1].Value)).ToArray();
            }
            else
            {

            }
        }
开发者ID:blackmage5242,项目名称:chummer5a-master,代码行数:36,代码来源:clsParameterAttribute.cs

示例5: GearSet

 public GearSet(PictureBox gearBox, PictureBox doorBox)
 {
     this.door = new Door();
     this.gear = new Gear();
     this.gearSetState = 0;
     this.gearBox = gearBox;
     this.doorBox = doorBox;
 }
开发者ID:VincentRoma,项目名称:Landing_Gears,代码行数:8,代码来源:GearSet.cs

示例6: Update

        public void Update(Gear gear, string externalUserId)
        {
            var oldGear = _gearRepository.ById(gear.Id);

            _gearRepository.Update(gear);

            Task.Run(() => HandleGearUpdated(gear, oldGear, externalUserId));
        }
开发者ID:loonison101,项目名称:PB,代码行数:8,代码来源:GearService.cs

示例7: Create

        public void Create(Gear gear, string externalUserId)
        {
            gear.Id = gear.Id == Guid.Empty ? Guid.NewGuid() : gear.Id;

            _gearRepository.Create(gear);

            Task.Run(() => HandleGearCreated(gear, externalUserId));
        }
开发者ID:loonison101,项目名称:PB,代码行数:8,代码来源:GearService.cs

示例8: Pose

 public Pose(Vector2 position, float orientation, float wheelAngle, Gear gear)
 {
     Position = position;
     while (orientation < 0f) orientation += MathHelper.TwoPi;
     while (orientation >= MathHelper.TwoPi) orientation -= MathHelper.TwoPi;
     Orientation = orientation;
     WheelAngle = wheelAngle;
     Gear = gear;
 }
开发者ID:jgera,项目名称:AutonomousCar,代码行数:9,代码来源:Pose.cs

示例9: openTest

 public void openTest()
 {
     GearController gc = new GearController();
     gc.ShouldDeploy = true;
     Gear gear = new Gear(gc);
     gear.Deploy();
     System.Threading.Thread.Sleep(15000);
     Assert.AreEqual(GearState.LOCKDOWN,gear.GearState);
 }
开发者ID:gbouchez,项目名称:LandingGearSystem,代码行数:9,代码来源:GearTest.cs

示例10: closeTest

 public void closeTest()
 {
     GearController gc = new GearController();
     gc.ShouldDeploy = true;
     Gear gear = new Gear(gc);
     gear.Retract();
     System.Threading.Thread.Sleep(15000);
     Assert.AreEqual(GearState.LOCKUP, gear.GearState);
 }
开发者ID:gbouchez,项目名称:LandingGearSystem,代码行数:9,代码来源:GearTest.cs

示例11: frmSelectNexus

 public frmSelectNexus(Character objCharacter, bool blnCareer = false)
 {
     InitializeComponent();
     LanguageManager.Instance.Load(GlobalOptions.Instance.Language, this);
     _objCharacter = objCharacter;
     _objGear = new Gear(objCharacter);
     chkFreeItem.Visible = blnCareer;
     MoveControls();
 }
开发者ID:Nitsuj83,项目名称:chummer5a,代码行数:9,代码来源:frmSelectNexus.cs

示例12: OnTriggerStay2D

 public void OnTriggerStay2D(Collider2D coll)
 {
     Gear gear = coll.GetComponent<Gear>();
     if (gear!=null && gear.isMovable && !isActive && (Vector3.Distance(transform.position, gear.transform.position)<minDistanceToTrigger || minDistanceToTrigger==0)) {
         print("moving now");
         gear.isMovable = false;
         gear.Start();
         this.gear = gear;
         startPos = gear.transform.position;
         isActive = true;
     }
 }
开发者ID:shadowseer99,项目名称:clockwork,代码行数:12,代码来源:GearLock2D.cs

示例13: GearController

 public GearController()
 {
     frontGear = new Gear(this);
     frontGearObserver.Subscribe(frontGear);
     frontGearObserver.Controller = this;
     rightGear = new Gear(this);
     rightGearObserver.Subscribe(rightGear);
     rightGearObserver.Controller = this;
     leftGear = new Gear(this);
     leftGearObserver.Subscribe(leftGear);
     leftGearObserver.Controller = this;
 }
开发者ID:gbouchez,项目名称:LandingGearSystem,代码行数:12,代码来源:GearController.cs

示例14: PlayerSelectionScreen

        /// <summary>
        /// Creates a new PlayerSelectionScreen object.
        /// </summary>
        public PlayerSelectionScreen(Gear gear)
        {
            // check the parameter
            if (gear == null)
            {
                throw new ArgumentNullException("gear");
            }

            this.IsPopup = true;
            this.usedGear = gear;

            isGearUsed = false;
            drawMaximum = 3;
            selectedPlayers = new List<int>();

            ResetValues();
            Reset();
        }
开发者ID:dunghand,项目名称:msrds,代码行数:21,代码来源:PlayerSelectionScreen.cs

示例15: BuildGearTree

        /// <summary>
        /// Build up the Tree for the current piece of Gear and all of its children.
        /// </summary>
        /// <param name="objGear">Gear to iterate through.</param>
        /// <param name="objNode">TreeNode to append to.</param>
        /// <param name="objMenu">ContextMenuStrip that the new TreeNodes should use.</param>
        public void BuildGearTree(Gear objGear, TreeNode objNode, ContextMenuStrip objMenu)
        {
            foreach (Gear objChild in objGear.Children)
            {
                TreeNode objChildNode = new TreeNode();
                objChildNode.Text = objChild.DisplayName;
                objChildNode.Tag = objChild.InternalId;
                objChildNode.ContextMenuStrip = objMenu;
                if (objChild.Notes != string.Empty)
                    objChildNode.ForeColor = Color.SaddleBrown;
                objChildNode.ToolTipText = objChild.Notes;

                objNode.Nodes.Add(objChildNode);
                objNode.Expand();

                // Set the Gear's Parent.
                objChild.Parent = objGear;

                BuildGearTree(objChild, objChildNode, objMenu);
            }
        }
开发者ID:hollis21,项目名称:Chummer,代码行数:27,代码来源:clsCommon.cs


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