示例#1
0
        public static tPanoCameraList Convert(PanoCameraList panoCameraList)
        {
            tPanoCameraList tpanoCameraList = new tPanoCameraList()
            {
                PanoCamera_count = panoCameraList.PanoCamera.Length
            };

            if (panoCameraList.Page != null)
            {
                tpanoCameraList.Page_enabled = 1;
                tpanoCameraList.Page         = new tPage()
                {
                    PageCount        = panoCameraList.Page.PageCount,
                    PageIndex        = panoCameraList.Page.PageIndex,
                    PageSize         = panoCameraList.Page.PageSize,
                    RecordCount      = panoCameraList.Page.RecordCount,
                    TotalRecordCount = panoCameraList.Page.TotalRecordCount
                };
            }
            if (panoCameraList.PanoCamera.Length > 0)
            {
                tpanoCameraList.PanoCameras = new tPanoCamera[panoCameraList.PanoCamera.Length];
                for (int i = 0; i < panoCameraList.PanoCamera.Length; ++i)
                {
                    tpanoCameraList.PanoCameras[i] = ConvertClass.Convert(panoCameraList.PanoCamera[i]);
                }
            }
            return(tpanoCameraList);
        }
示例#2
0
        public static tPanoCamera Convert(PanoCamera panoCamera)
        {
            tPanoCamera tpanoCamera = new tPanoCamera()
            {
                GroupId              = panoCamera.GroupId,
                Name                 = panoCamera.Name,
                Model                = panoCamera.Model,
                MainCameraBuildInId  = panoCamera.MainCameraBuildInId,
                WiperCameraBuildInId = panoCamera.WiperCameraBuildInId,
                BuildInCamera_count  = panoCamera.BuildInCamera.Length
            };

            if (panoCamera.BuildInCamera.Length > 0)
            {
                tpanoCamera.BuildInCameras = new tBuildInCamera[panoCamera.BuildInCamera.Length];
                for (int i = 0; i < panoCamera.BuildInCamera.Length; ++i)
                {
                    tpanoCamera.BuildInCameras[i] = ConvertClass.Convert(panoCamera.BuildInCamera[i]);
                }
            }
            if (panoCamera.Id != null)
            {
                tpanoCamera.Id_enabled  = 1;
                tpanoCamera.Id          = panoCamera.Id;
                tpanoCamera.IsAllOnline = (bool)panoCamera.IsAllOnline ? 1 : 0;
                tpanoCamera.IsCompleted = (bool)panoCamera.IsCompleted ? 1 : 0;
            }
            if (panoCamera.DefaultViewPoint != null)
            {
                tpanoCamera.DefaultViewPoint_enabled = 1;
                tpanoCamera.DefaultViewPoint         = ConvertClass.Convert(panoCamera.DefaultViewPoint);
            }
            if (panoCamera.ExistedInDatabase != null)
            {
                tpanoCamera.ExistedInDatabase_enabled = 1;
                tpanoCamera.ExistedInDatabase         = (bool)panoCamera.ExistedInDatabase ? 1 : 0;
            }
            return(tpanoCamera);
        }