本文整理汇总了C#中IHost.GetParam方法的典型用法代码示例。如果您正苦于以下问题:C# IHost.GetParam方法的具体用法?C# IHost.GetParam怎么用?C# IHost.GetParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IHost
的用法示例。
在下文中一共展示了IHost.GetParam方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PuzzleBot
public PuzzleBot(IHost host)
{
_host = host;
_host.WriteLogMessage(c_componentName, "Initializing PuzzleBot comm. channels.");
_machine = new CncMachine(_host);
_upwardCamera = new OpenCV.CaptureEngine(
$"http://{_host.GetParam<string>("MachineHostName")}:{_host.GetParam<int>("UpCameraPort")}/?action=stream");
_downwardCamera = new OpenCV.CaptureEngine(
$"http://{_host.GetParam<string>("MachineHostName")}:{_host.GetParam<int>("DownCameraPort")}/?action=stream");
_upwardCameraView = _host.CreateCameraView("Upward Camera");
_downwardCameraView = _host.CreateCameraView("Downward Camera");
_downwardCameraIntrinsic = _host.GetParam<JObject>("IntrinsticCalib").ToMat();
_downwardCameraExtrinstic = _host.GetParam<JObject>("ExtrinsticCalib").ToMat();
_viewUpdateThread = new Thread(CameraViewUpdater);
_viewUpdateThread.Start();
_host.WriteLogMessage(c_componentName, "Press enter to home...");
_host.ReadLine();
_machine.PerformMechanicalHome();
AttachKeyHandlers();
MainControlLoop();
}
示例2: CncMachine
public CncMachine(IHost host)
{
Contract.Assert(host != null);
_host = host;
_client = new NetworkSerialClient(
_host.GetParam<string>("MachineHostName"),
_host.GetParam<int>("MachinePort"),
OnMsg
);
_coordSystem = new IdentityTranslator(
new MachineCoordSystem(
new Coord(0, 0, -_host.GetParam<double>("MaxZ"), 0),
new Coord(
_host.GetParam<double>("MaxX"),
_host.GetParam<double>("MaxY"),
0,
_host.GetParam<double>("MaxA")
)
)
);
// We need to request status a few times when the TinyG controller first boots
// up for *some* reason.
RequestStatus();
RequestStatus();
RequestStatus();
}