public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); var data = Unsafe.ReadUnaligned <UInt32>(ref Unsafe.As <UInt32, byte>(ref _data)); var result = ArmBase.ReverseElementBits(data); ValidateResult(data, result); }
public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); var data = Unsafe.ReadUnaligned <Int32>(ref Unsafe.As <Int32, byte>(ref _data)); var result = ArmBase.LeadingZeroCount(data); ValidateResult(data, result); }
public void RunClassLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); var test = new ScalarUnaryOpTest__ReverseElementBits_UInt32(); var result = ArmBase.ReverseElementBits(test._fld); ValidateResult(test._fld, result); }
public void RunStructLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); var result = ArmBase.LeadingZeroCount(test._fld); ValidateResult(test._fld, result); }
public void RunClassLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); var test = new ScalarUnaryOpTest__LeadingZeroCount_Int32(); var result = ArmBase.LeadingZeroCount(test._fld); ValidateResult(test._fld, result); }
public ReadyClass(LegBase Rleg, LegBase LLeg, ArmBase Rarm, ArmBase LArm) : base(Rleg, LLeg, Rarm, LArm) { this.RLeg = RLeg; this.LLeg = LLeg; this.RArm = Rarm; this.LArm = LArm; TargetListMiddleward = new string[] { "5", "10", "5" }; }
public ShutDown(LegBase Rleg, LegBase LLeg, ArmBase Rarm, ArmBase LArm) : base(Rleg, LLeg, Rarm, LArm) { this.RLeg = RLeg; this.LLeg = LLeg; this.RArm = Rarm; this.LArm = LArm; //TargetListMiddleward = new string[] { "5", "10", "5" }; //TargetListBackward = new string[] { "-0", "0", "-0" }; //TargetListMiddleward = new string[] { "0", "0", "0" }; }
public void RunClsVarScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); var result = ArmBase.ReverseElementBits( _clsVar ); ValidateResult(_clsVar, result); }
public void RunClsVarScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); var result = ArmBase.LeadingZeroCount( _clsVar ); ValidateResult(_clsVar, result); }
public Arm2Class(ArmBase Rarm, ArmBase LArm) : base(Rarm, LArm) { this.RArm = Rarm; this.LArm = LArm; RArm.myMotor1.MyMotor.CustomData = "1,190,20"; RArm.myMotor2.MyMotor.CustomData = "1,0,20"; RArm.myMotor3.MyMotor.CustomData = "1,80,20"; }
public Arm1Class(ArmBase Rarm, ArmBase LArm) : base(Rarm, LArm) { this.RArm = Rarm; this.LArm = LArm; RArm.myMotor1.MyMotor.CustomData = "1,220,10"; RArm.myMotor2.MyMotor.CustomData = "1,0,10"; RArm.myMotor3.MyMotor.CustomData = "1,140,10"; RArm.myMotor4.MyMotor.CustomData = "1,90,10"; status = 0; }
public HaltClass(LegBase Rleg, LegBase LLeg, ArmBase Rarm, ArmBase LArm) : base(Rleg, LLeg, Rarm, LArm) { this.RLeg = RLeg; this.LLeg = LLeg; this.RArm = Rarm; this.LArm = LArm; TargetListForward = new string[] { "10", "10", "5" }; TargetListBackward = new string[] { "-0", "0", "-0" }; TargetListMiddleward = new string[] { "0", "0", "0" }; RArm.myMotor1.MyMotor.CustomData = "1,0,10"; RArm.myMotor2.MyMotor.CustomData = "1,0,10"; }
public RunClass(LegBase Rleg, LegBase LLeg, ArmBase Rarm, ArmBase LArm) : base(Rleg, LLeg, Rarm, LArm) { this.RLeg = RLeg; this.LLeg = LLeg; this.RArm = Rarm; this.LArm = LArm; TargetListForward = new string[] { "40", "30", "-10" }; TargetListBackward = new string[] { "-30", "10", "20" }; TargetListMiddleward = new string[] { "50", "60", "40" }; RArm.myMotor1.MyMotor.CustomData = "1,90,20"; RArm.myMotor2.MyMotor.CustomData = "1,0,20"; }
static unsafe int Main(string[] args) { int testResult = ArmBase.IsSupported ? Pass : Fail; try { ArmBase.Yield(); } catch (Exception e) { testResult = (ArmBase.IsSupported || (e is not PlatformNotSupportedException)) ? Fail : Pass; } return(testResult); }
public Program() { ArmR1 = GridTerminalSystem.GetBlockWithName("Rotor R") as IMyMotorStator; ArmR2 = GridTerminalSystem.GetBlockWithName("Small Conveyor Hinge R1") as IMyMotorStator; ArmR3 = GridTerminalSystem.GetBlockWithName("Two-ended Motor") as IMyMotorStator; ArmR4 = GridTerminalSystem.GetBlockWithName("Two-ended Rotor") as IMyMotorStator; ArmL1 = GridTerminalSystem.GetBlockWithName("Rotor L") as IMyMotorStator; ArmL2 = GridTerminalSystem.GetBlockWithName("Small Conveyor Hinge L1") as IMyMotorStator; mySensor = GridTerminalSystem.GetBlockWithName("Sensor") as IMySensorBlock; Arm1 = new ArmBase(ArmR1, true, ArmR2, false, ArmR3, false, ArmR4, false); Arm2 = new ArmBase(ArmL1, false, ArmL2, false, ArmL2, false, ArmL2, false); DriveEntity = new WalkClass(Arm1, Arm2); Runtime.UpdateFrequency = UpdateFrequency.Update1; }
public static int LeadingZeroCount(uint value) { if (Lzcnt.IsSupported) { // LZCNT contract is 0->32 return((int)Lzcnt.LeadingZeroCount(value)); } if (ArmBase.IsSupported) { return(ArmBase.LeadingZeroCount(value)); } // Unguarded fallback contract is 0->31 if (value == 0) { return(32); } return(31 - Log2SoftwareFallback(value)); }
/// <summary> /// コンストラクタ /// </summary> public Program() { cockpit = GridTerminalSystem.GetBlockWithName("Azimuth Open Cockpit") as IMyCockpit; GridTerminalSystem.GetBlockGroupWithName("Gyros").GetBlocks(gyros); roterR1 = GridTerminalSystem.GetBlockWithName("Hinge R1") as IMyMotorStator; roterR2 = GridTerminalSystem.GetBlockWithName("Hinge R2") as IMyMotorStator; roterR3 = GridTerminalSystem.GetBlockWithName("Hinge R3") as IMyMotorStator; roterL1 = GridTerminalSystem.GetBlockWithName("Hinge L1") as IMyMotorStator; roterL2 = GridTerminalSystem.GetBlockWithName("Hinge L2") as IMyMotorStator; roterL3 = GridTerminalSystem.GetBlockWithName("Hinge L3") as IMyMotorStator; ArmR1 = GridTerminalSystem.GetBlockWithName("Rotor R") as IMyMotorStator; ArmR2 = GridTerminalSystem.GetBlockWithName("Small Conveyor Hinge R1") as IMyMotorStator; ArmL1 = GridTerminalSystem.GetBlockWithName("Rotor L") as IMyMotorStator; ArmL2 = GridTerminalSystem.GetBlockWithName("Small Conveyor Hinge L1") as IMyMotorStator; mySensor = GridTerminalSystem.GetBlockWithName("Sensor") as IMySensorBlock; text = GridTerminalSystem.GetBlockWithName("Text panel") as IMyTextPanel; befTime = DateTime.UtcNow; buff1 = new LegBase(roterR1, true, roterR2, false, roterR3, true); buff2 = new LegBase(roterL1, false, roterL2, false, roterL3, true); Arm1 = new ArmBase(ArmR1, true, ArmR2, false, ArmR2, false); Arm2 = new ArmBase(ArmL1, false, ArmL2, false, ArmL2, false); DriveEntity = new HaltClass(buff1, buff2, Arm1, Arm2); st = "Walk"; Me.CustomData = "Walk"; Runtime.UpdateFrequency = UpdateFrequency.Update1; nowTime = DateTime.UtcNow; befTime = DateTime.UtcNow; }
public void RunStructFldScenario(ScalarUnaryOpTest__LeadingZeroCount_UInt32 testClass) { var result = ArmBase.LeadingZeroCount(_fld); testClass.ValidateResult(_fld, result); }
public void RunStructFldScenario(ScalarUnaryOpTest__ReverseElementBits_Int32 testClass) { var result = ArmBase.ReverseElementBits(_fld); testClass.ValidateResult(_fld, result); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="RLeg">右足</param> /// <param name="LLeg">左脚</param> public OperationBase(ArmBase Rarm, ArmBase LArm) { this.RArm = Rarm; this.LArm = LArm; ctrlStatus = Utilty.StatusEnum.off; }