本文整理汇总了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);
}
}
示例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;
}
}
示例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;
}
示例4: ReporterWindow
public ReporterWindow(InputData data, ReportKind reportKind)
{
InitializeComponent();
_inputData = data;
_currentRepot = CurrentDataReport.OutputDataReport;
_reportKind = reportKind;
}
示例5: InitializeComponent
public ThermalСalculationPage()
{
InitializeComponent();
_inputData = MainWindow.DrawInputData(InputDataGrid, ReportKind.Thermal);
App.CurrentEngineType = EngineType.Petrol;
MainWindow.UpdateInputData(InputDataGrid, App.CurrentEngineType, _inputData);
}
示例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));
}
示例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);
}
示例8: EtcsBrakingData
public EtcsBrakingData()
{
Input = new InputData();
Middle = new MiddleData();
Output = new OutputData();
Params = new ConstantData();
}
示例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);
}
}
示例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");
}
}
示例11: Start
void Start()
{
touchManager = GetComponent<TouchManager>();
for (int i = 0; i < input.Length; i++) {
input[i] = new InputData();
}
}
示例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;
}
示例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;
}
}
示例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> ();
}
示例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();
}
}