本文整理汇总了C#中DataSource.InitDataSource方法的典型用法代码示例。如果您正苦于以下问题:C# DataSource.InitDataSource方法的具体用法?C# DataSource.InitDataSource怎么用?C# DataSource.InitDataSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataSource
的用法示例。
在下文中一共展示了DataSource.InitDataSource方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main()
{
string message;
StringComparer stringComparer = StringComparer.OrdinalIgnoreCase;
_continue = true;
//Swap around the lines below to toggle between the real and dummy contollers.
data = new ControllerDataSource();
//data = new TestDataSource();
data.InitDataSource();
for (int i = 0; i < 5; i++)
{
int time1 = System.Environment.TickCount;
int c = 0;
while (System.Environment.TickCount < time1 + 1000 * 10)
{
data.GetThrottlePos();
data.GetDiodeTemp();
data.GetBatteryVoltage();
data.GetOutputCurrent();
data.GetBatteryCurrent();
data.getErrorStatus();
c++;
}
Console.WriteLine("Hello {0}", (float)c / 10f);
}
Console.Read();
/* Console.WriteLine("Type QUIT to exit");
while (_continue)
{
Console.WriteLine("Throttle position: {0:N1}%", data.GetThrottlePos());
Console.WriteLine("Diode temperature: {0:N1} degrees C", data.GetDiodeTemp());
Console.WriteLine("Battery voltage: {0:N1} V", data.GetBatteryVoltage());
Console.WriteLine("Battery current: {0:N1} anps", data.GetBatteryCurrent());
Console.WriteLine("Output current: {0:N1} amps", data.GetOutputCurrent());
Console.WriteLine("Error status: {0}", data.getErrorStatus());
message = Console.ReadLine();
if (stringComparer.Equals("quit", message) || stringComparer.Equals("q", message))
{
_continue = false;
}
}
* */
data.CloseDataSource();
}