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 { | ||||
| 	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 { | ||||
| 		return err | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
| 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 { | ||||
| 		return err | ||||
| 	} | ||||
|   | ||||
| @@ -4,6 +4,7 @@ import ( | ||||
| 	"fmt" | ||||
| 	"gitea.com/kunmeng/HikNetSDKPkg/Core" | ||||
| 	"testing" | ||||
| 	"time" | ||||
| ) | ||||
|  | ||||
| func TestCamera(t *testing.T) { | ||||
| @@ -18,15 +19,15 @@ func TestCamera(t *testing.T) { | ||||
| 		return | ||||
| 	} | ||||
|  | ||||
| 	//err = Camera.StartBus(PTZEnum.toHikPTZEnum(PTZEnum.PTZ_RIGHT), 1) | ||||
| 	//if err != nil { | ||||
| 	//	return | ||||
| 	//} | ||||
| 	//time.Sleep(2000 * time.Millisecond) | ||||
| 	//err = Camera.StopBus(PTZEnum.toHikPTZEnum(PTZEnum.PTZ_RIGHT), 1) | ||||
| 	//if err != nil { | ||||
| 	//	return | ||||
| 	//} | ||||
| 	err = Camera.StartBus(PTZEnum.PTZ_RIGHT, 1) | ||||
| 	if err != nil { | ||||
| 		return | ||||
| 	} | ||||
| 	time.Sleep(2000 * time.Millisecond) | ||||
| 	err = Camera.StopBus(PTZEnum.PTZ_RIGHT, 1) | ||||
| 	if err != nil { | ||||
| 		return | ||||
| 	} | ||||
|  | ||||
| 	err = Camera.PtzGotoPut(1, 11.11, 22.22, 33.33) | ||||
| 	if err != nil { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 kunmeng
					kunmeng