1. 简化球机移动的传参逻辑
This commit is contained in:
		| @@ -401,14 +401,15 @@ func (this *BallCamera) retrySend(handle Core.LONG, cmd []byte, maxRetries int, | |||||||
| } | } | ||||||
|  |  | ||||||
| func (receiver *BallCamera) StartBus(direction int, speed int) error { | func (receiver *BallCamera) StartBus(direction int, speed int) error { | ||||||
| 	err := Core.PTZControlWithSpeed_Other(receiver.userId, Core.LONG(receiver.deviceInfo.ByStartChan), Core.DWORD(direction), Core.DWORD(0), Core.DWORD(speed)) |  | ||||||
|  | 	err := Core.PTZControlWithSpeed_Other(receiver.userId, Core.LONG(receiver.deviceInfo.ByStartChan), Core.DWORD(PTZEnum.toHikPTZEnum(direction)), Core.DWORD(0), Core.DWORD(speed)) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return err | 		return err | ||||||
| 	} | 	} | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
| func (receiver *BallCamera) StopBus(direction int, speed int) error { | func (receiver *BallCamera) StopBus(direction int, speed int) error { | ||||||
| 	err := Core.PTZControlWithSpeed_Other(receiver.userId, Core.LONG(receiver.deviceInfo.ByStartChan), Core.DWORD(direction), Core.DWORD(1), Core.DWORD(speed)) | 	err := Core.PTZControlWithSpeed_Other(receiver.userId, Core.LONG(receiver.deviceInfo.ByStartChan), Core.DWORD(PTZEnum.toHikPTZEnum(direction)), Core.DWORD(1), Core.DWORD(speed)) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return err | 		return err | ||||||
| 	} | 	} | ||||||
|   | |||||||
| @@ -4,6 +4,7 @@ import ( | |||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"gitea.com/kunmeng/HikNetSDKPkg/Core" | 	"gitea.com/kunmeng/HikNetSDKPkg/Core" | ||||||
| 	"testing" | 	"testing" | ||||||
|  | 	"time" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| func TestCamera(t *testing.T) { | func TestCamera(t *testing.T) { | ||||||
| @@ -18,15 +19,15 @@ func TestCamera(t *testing.T) { | |||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	//err = Camera.StartBus(PTZEnum.toHikPTZEnum(PTZEnum.PTZ_RIGHT), 1) | 	err = Camera.StartBus(PTZEnum.PTZ_RIGHT, 1) | ||||||
| 	//if err != nil { | 	if err != nil { | ||||||
| 	//	return | 		return | ||||||
| 	//} | 	} | ||||||
| 	//time.Sleep(2000 * time.Millisecond) | 	time.Sleep(2000 * time.Millisecond) | ||||||
| 	//err = Camera.StopBus(PTZEnum.toHikPTZEnum(PTZEnum.PTZ_RIGHT), 1) | 	err = Camera.StopBus(PTZEnum.PTZ_RIGHT, 1) | ||||||
| 	//if err != nil { | 	if err != nil { | ||||||
| 	//	return | 		return | ||||||
| 	//} | 	} | ||||||
|  |  | ||||||
| 	err = Camera.PtzGotoPut(1, 11.11, 22.22, 33.33) | 	err = Camera.PtzGotoPut(1, 11.11, 22.22, 33.33) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 kunmeng
					kunmeng