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


C# InputData类代码示例

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


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

示例1: ShouldBitShiftAndMaskPushedInputData

        public void ShouldBitShiftAndMaskPushedInputData()
        {
            Converters.Clear();

            var controller = new NIDAQController();
            var s = new NIDigitalDAQInputStream("IN", controller);
            controller.SampleRate = new Measurement(10000, 1, "Hz");

            TimeSpan duration = TimeSpan.FromSeconds(0.5);

            var devices = new List<TestDevice>();

            for (ushort bitPosition = 1; bitPosition < 32; bitPosition += 2)
            {
                TestDevice dev = new TestDevice();
                dev.BindStream(s);
                s.BitPositions[dev] = bitPosition;

                devices.Add(dev);
            }

            var data = new InputData(Enumerable.Range(0, 10000).Select(i => new Measurement((short)(i % 2 * 0xaaaa), Measurement.UNITLESS)).ToList(),
                s.SampleRate, DateTime.Now);

            s.PushInputData(data);
            s.PushInputData(data);

            var expected = Enumerable.Range(0, 10000).Select(i => new Measurement(i % 2, Measurement.UNITLESS)).ToList();
            foreach (var ed in devices)
            {
                Assert.AreEqual(expected, ed.InputData[s].ElementAt(0).Data);
                Assert.AreEqual(expected, ed.InputData[s].ElementAt(1).Data);
            }
        }
开发者ID:Symphony-DAS,项目名称:symphony-core,代码行数:34,代码来源:NIDAQStreamTests.cs

示例2: MatchSingleQuoteString

        FSharpOption<MatchResult> MatchSingleQuoteString(InputData data) {
			if(data.Head.Value == "'") {
				var sourceLocation = data.Head.Source;
				var sb = new StringBuilder();
				data = data.Tail;


				while(true) {
					if(data.IsEmpty) {
                        throw new UnexpectedEndOfFileException();
                    }

					if(data.Head.Value == "'") {
						var next = data.Tail;
						if(next.IsCons && next.Head.Value == "'") {
							sb.Append("'");
							data = next.Tail;
						}
						else {
							var token = new Token.StringValue(sourceLocation, new Token.StringValue.StringPart(sb.ToString()));
							return MatchToken(token, data.Tail);
						}
					}
					else {
						sb.Append(data.Head.Value);
						data = data.Tail;
					}
				}
			}
			else {
				return FSharpOption<MatchResult>.None;
			}
		}
开发者ID:MI3Guy,项目名称:argon,代码行数:33,代码来源:Lexer.cs

示例3: Serialize

	public bool Serialize(InputData data)
	{
		// 기존 데이터를 클리어합니다.
		Clear();
		
		// 각 요소를 차례로 시리얼라이즈합니다.
		bool ret = true;
		ret &= Serialize(data.count);	
		ret &= Serialize(data.flag);

		MouseSerializer mouse = new MouseSerializer();
		
		for (int i = 0; i < data.datum.Length; ++i) {
			mouse.Clear();
			bool ans = mouse.Serialize(data.datum[i]);
			if (ans == false) {
				return false;
			}
			
			byte[] buffer = mouse.GetSerializedData();
			ret &= Serialize(buffer, buffer.Length);
		}
		
		return ret;
	}
开发者ID:fotoco,项目名称:006772,代码行数:25,代码来源:InputSerializer.cs

示例4: ReporterWindow

		public ReporterWindow(InputData data, ReportKind reportKind)
		{
			InitializeComponent();
			_inputData = data;
			_currentRepot = CurrentDataReport.OutputDataReport;
			_reportKind = reportKind;
		}
开发者ID:pashkados,项目名称:EngineCalculate,代码行数:7,代码来源:ReporterWindow.xaml.cs

示例5: InitializeComponent

		public ThermalСalculationPage()
		{
			InitializeComponent();
			_inputData = MainWindow.DrawInputData(InputDataGrid, ReportKind.Thermal);
			App.CurrentEngineType = EngineType.Petrol;
			MainWindow.UpdateInputData(InputDataGrid, App.CurrentEngineType, _inputData);
		}
开发者ID:pashkados,项目名称:EngineCalculate,代码行数:7,代码来源:ThermalСalculationPage.xaml.cs

示例6: PushesInput

        public void PushesInput()
        {
            TimeSpan loopDuration = TimeSpan.FromMilliseconds(IterationMilliseconds);

            var c = new SimulationDAQController(loopDuration) { Clock = new FakeClock() };

            IOutputData expectedOutput;
            DAQOutputStream outStream;
            DAQInputStream inStream;
            SetupInputPipeline(c, out expectedOutput, out outStream, out inStream);

            c.SimulationRunner = (IDictionary<IDAQOutputStream, IOutputData> output, TimeSpan timeStep) =>
            {
                var inputData = new Dictionary<IDAQInputStream, IInputData>(1);
                expectedOutput = output[outStream];
                inputData[inStream] = new InputData(expectedOutput.Data, expectedOutput.SampleRate, DateTimeOffset.Now);

                return inputData;
            };

            c.ProcessIteration += (controller, evtArgs) => ((IDAQController)controller).Stop();
            bool stopped = false;
            c.Stopped += (controller, evtArgs) =>
                             {
                                 stopped = true;
                             };
            c.Start(false);
            Thread.Sleep(500);

            var actualInput = ((TestDevice)outStream.Device).InputData.ContainsKey(inStream) ? ((TestDevice)outStream.Device).InputData[inStream].First() : null;

            Assert.That(actualInput, Is.Not.Null);
            Assert.That(actualInput.Data, Is.EqualTo(expectedOutput.Data));
        }
开发者ID:physion,项目名称:symphony-core,代码行数:34,代码来源:SimulationDAQControllerTests.cs

示例7: Main

        static void Main(string[] args)
        {
            string line;
            System.IO.StreamReader file =
               new System.IO.StreamReader(@"D:\input\input1.txt");
            List<InputData> aInputList = new List<InputData>();
            ShiftManager aManager = new ShiftManager();
            while ((line = file.ReadLine()) != null)
            {
                InputData aData = new InputData();
                string[] input = line.Split(' ');
                aData.BSC = input[0];
                aData.BCF = input[1];
                aData.BTS = input[2];
                aData.TRX = input[3];
                aData.PCM = input[4];
                aData.PCMTsl = input[5];
                aData.LAPDName = input[6];
                aData.LAPDTSL = input[7];
                aData.LAPDSSL = input[8];

                aInputList.Add(aData);
            }

            aManager.TRXshifter(aInputList);
        }
开发者ID:atchowdhury,项目名称:TrxShift,代码行数:26,代码来源:Program.cs

示例8: EtcsBrakingData

 public EtcsBrakingData()
 {
     Input = new InputData();
     Middle = new MiddleData();
     Output = new OutputData();
     Params = new ConstantData();
 }
开发者ID:nikiforovandrey,项目名称:ERTMSFormalSpecs,代码行数:7,代码来源:EtcsBrakingData.cs

示例9: Start

 void Start()
 {
     if (Application.loadedLevel == SceneName.Title.ToInt()){
         act	=	transform.root.GetComponent<SceneLoadManager>().NextScene;
     }
     SoundManager.obj.PlayBGM(2,true);
     decIcons	=	0;
     length		=	transform.childCount;
     childObj	=	new GameObject[length];
     for(int i=0;i<length;i++){
         childObj[i]			=	transform.GetChild(i).gameObject;
         if(childObj[i]	==	null)					continue;
         if(iconCount == null)		iconCount	=	childObj[i].GetComponent<IconCount>();
         if(childObj[i].tag	!=	decTexture)	continue;
         decImage			=	childObj[i].GetComponent<Image>();
         decTrans			=	decImage.rectTransform;
         decTrans.localScale	=	Vector2.zero;
     }
     playMax		=	0;
     PlayerNum	=	4;
     input			=	new InputData[PlayerNum];
     for(int i = 0;i<PlayerNum;i++){
         input[i]		=	new InputData();
         InputPad.InputData(ref input[i], i+1);
     }
 }
开发者ID:InagakiTatuya,项目名称:NKC_GlideRace,代码行数:26,代码来源:CharacterDecision.cs

示例10: Update

    // Update is called once per frame
    void Update()
    {
        // 종료 처리
        if (Input.GetKey(KeyCode.Escape)
            || Input.GetKey(KeyCode.Home)
            || Input.GetKey(KeyCode.Menu))
        {
            //Application.Quit();
            SendMessage("ApplicationQuit");
        }

        // 터치
        if (Input.GetMouseButtonDown(0))
        {
            InputData kInputData = new InputData();
            kInputData.nTouchCount = Input.touchCount;
            kInputData.tmTouchPosition.Add(0, Input.mousePosition);
            SendMessage("InputTouch", kInputData, SendMessageOptions.RequireReceiver);
        }

        if (Input.GetKeyDown(KeyCode.X))
        {
            SendMessage("KeyDownDefend");
        }
    }
开发者ID:ditto21c,项目名称:ExampleSource,代码行数:26,代码来源:ScInput.cs

示例11: Start

    void Start()
    {
        touchManager = GetComponent<TouchManager>();

        for (int i = 0; i < input.Length; i++) {
            input[i] = new InputData();
        }
    }
开发者ID:Diggery,项目名称:SuperSneak,代码行数:8,代码来源:TouchInterface.cs

示例12: Sine

 private static float Sine(InputData d)
 {
     return 0.50f +
     //				0.25f * Mathf.Sin(4 * Mathf.PI * p.x + 4 * t) * Mathf.Sin(2 * Mathf.PI * p.z + t) +
     //				0.10f * Mathf.Cos(3 * Mathf.PI * p.x + 5 * t) * Mathf.Cos(5 * Mathf.PI * p.z + 3 *t) +
     //				0.15f * Mathf.Sin(Mathf.PI * p.x + 0.6f * t);
         Mathf.Sin(d.p.x*10 +d.t*5) *.1f + Mathf.Sin(d.p.z*10+d.t*5) *.1f;
 }
开发者ID:Thecontrarian,项目名称:Unity,代码行数:8,代码来源:G2.cs

示例13: Update

 // Update is called once per frame
 void Update()
 {
     foreach( AbstractInputDevice device in myInputDevices)
     {
         device.HandleInput();
         // TODO: Sort through all of the input controllers and determine what the state of input should be...
         myCurrentInputData = device.Data;
     }
 }
开发者ID:EaganRackley,项目名称:vignettes,代码行数:10,代码来源:InputProvider.cs

示例14: Start

 void Start()
 {
     GameDataObj = GameObject.Find ("GameDataObject") as GameObject;
     scorenum = GameDataObj.GetComponent<GameData> ().score;
     difficulty = GameDataObj.GetComponent<GameData> ().difficulty;
     GameDataObj.GetComponent<GameData> ().AlignScore (scorenum,difficulty);
     score.text = "Score:" + scorenum.ToString();
     indata = GameObject.Find ("Indata") as GameObject;
     indatacomp = indata.GetComponent<InputData> ();
 }
开发者ID:gear,项目名称:PLB-2015F-ARGame,代码行数:10,代码来源:ScoreController.cs

示例15: DrawListElement

 private void DrawListElement(Rect rect, InputData data)
 {
     EditorGUI.BeginChangeCheck();
     GUI.Toggle(rect, data.m_Selected, EditorGUIUtility.TempContent(data.m_Name), s_Styles.menuItem);
     if (EditorGUI.EndChangeCheck())
     {
         this.m_Callback(data);
         base.Close();
     }
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:10,代码来源:SceneHierarchySortingWindow.cs


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