public static ViewPoint Convert(tViewPoint tviewPoint) { ViewPoint viewPoint = new ViewPoint() { Angle = tviewPoint.Angle, Distance = tviewPoint.Distance, Height = tviewPoint.Height }; if (tviewPoint.Rows_enabled == 1) { viewPoint.Rows = tviewPoint.Rows; } if (tviewPoint.Fixed_enabled == 1) { viewPoint.Fixed = tviewPoint.Fixed == 0 ? false : true; } return(viewPoint); }
public static tViewPoint Convert(ViewPoint viewPoint) { tViewPoint tviewPoint = new tViewPoint() { Angle = viewPoint.Angle, Distance = viewPoint.Distance, Height = viewPoint.Height }; if (viewPoint.Rows != null) { tviewPoint.Rows_enabled = 1; tviewPoint.Rows = (int)viewPoint.Rows; } if (viewPoint.Fixed != null) { tviewPoint.Fixed_enabled = 1; tviewPoint.Fixed = (bool)viewPoint.Fixed ? 1 : 0; } return(tviewPoint); }
void DecodingUnitTest() { try { tDecodingUnitList decodingUnitList = m_howell5198client.GetDecodingUnitList(); Console.WriteLine("decodingUnitList DecodingUnit_count:{0}", decodingUnitList.DecodingUnit_count); if (decodingUnitList.DecodingUnit_count > 0) { tDecodingUnit decodingUnit = m_howell5198client.GetDecodingUnit(decodingUnitList.DecodingUnits[0].Id); Console.WriteLine("decodingUnit1 Id:{0} Name:{1} PanoCameraId:{2}", decodingUnit.Id, decodingUnit.Name, decodingUnit.PanoCameraId); tRotatingSpeed rotatingSpeed = m_howell5198client.GetRotatingSpeed(decodingUnitList.DecodingUnits[0].Id); Console.WriteLine("GetRotatingSpeed RotatingSpeed:{0} ", rotatingSpeed.RotatingSpeed); tFault fault = m_howell5198client.SetRotatingSpeed(rotatingSpeed); Console.WriteLine("SetRotatingSpeed FaultCode:{0} FaultReason:{1}", fault.FaultCode, fault.FaultReason); SwitchPanoCameraRequest switchPanoCameraRequest = new SwitchPanoCameraRequest() { DecodingUnitId = decodingUnit.Id, PanoCameraId = decodingUnit.PanoCameraId }; fault = m_howell5198client.SwitchPanoCamera(switchPanoCameraRequest); Console.WriteLine("SwitchPanoCamera FaultCode:{0} FaultReason:{1}", fault.FaultCode, fault.FaultReason); tViewPoint viewPoint = m_howell5198client.GetViewPoint(decodingUnit.Id); Console.WriteLine("GetViewPoint viewPoint Angle:{0} Distance:{1}", viewPoint.Angle, viewPoint.Distance); SetViewPointRequest setViewPointRequest = new SetViewPointRequest() { DecodingUnitId = decodingUnit.Id, ViewPoint = viewPoint }; fault = m_howell5198client.SetViewPoint(setViewPointRequest); Console.WriteLine("SetViewPoint FaultCode:{0} FaultReason:{1}", fault.FaultCode, fault.FaultReason); } } catch (Exception ex) { Console.WriteLine(String.Format("DecodingUnitTest error.{0}", ex.Message)); } }