Jelajahi Sumber

合并优化相机模块后, 修改包名称, 使其能够编译通过

niujiuru 1 Minggu lalu
induk
melakukan
440d918b40

+ 13 - 13
Makefile

@@ -29,15 +29,15 @@ SETGO_ENV = \
 DATE := $(shell date +%Y%m%d_%H%M%S)
 
 # 编译的目标
-all : hk_u_takephoto.out air720u_4g.out rtu_linux_modules.out
+all : hk_takephoto.out air720u_4g.out rtu_linux_modules.out
 
 # 通用基础库
 libswapi.a :
 	$(MAKE) -C swapi target=$(target) $@
 
 # 海康机器人
-libhk_u_takephoto.a :
-	$(MAKE) -C hk_u_takephoto target=$(target) $@
+libhk_takephoto.a :
+	$(MAKE) -C hk_takephoto target=$(target) $@
 
 # "Air720U"
 libair720u.a :
@@ -56,16 +56,16 @@ libymodem.a :
 	$(MAKE) -C ymodem target=$(target)  $@
 
 # 海康相机拍照测试
-LIB1 := -Wl,-Bstatic -L./swapi -lswapi -L./hk_u_takephoto -lhk_u_takephoto
+LIB1 := -Wl,-Bstatic -L./swapi -lswapi -L./hk_takephoto -lhk_takephoto
 ifeq ($(target),armv7hf)
-  LIB1 += -Wl,-Bdynamic -lc -lm -ldl -lpthread -L$(PWD)/hk_u_takephoto/lib/armv7hf/. -lMvCameraControl
+  LIB1 += -Wl,-Bdynamic -lc -lm -ldl -lpthread -L$(PWD)/hk_takephoto/lib/armv7hf/. -lMvCameraControl
 else
-  LIB1 += -Wl,-Bdynamic -lc -lm -ldl -lpthread -L$(PWD)/hk_u_takephoto/lib/x86_64/64 -lMvCameraControl
+  LIB1 += -Wl,-Bdynamic -lc -lm -ldl -lpthread -L$(PWD)/hk_takephoto/lib/x86_64/64 -lMvCameraControl
 endif
-hk_u_takephoto.out : libswapi.a libhk_u_takephoto.a ./tests/hk_u_takephoto/main.go
+hk_takephoto.out : libswapi.a libhk_takephoto.a ./tests/hk_takephoto/main.go
 	mkdir -p ./build/takephoto_test
 	$(GO) mod tidy
-	$(SETGO_ENV) CGO_LDFLAGS="$(LIB1)" $(GO_BUILD) $(GO_FLAGS) -o $@ ./tests/hk_u_takephoto/main.go
+	$(SETGO_ENV) CGO_LDFLAGS="$(LIB1)" $(GO_BUILD) $(GO_FLAGS) -o $@ ./tests/hk_takephoto/main.go
 	@cp $@ ./build/takephoto_test/$(basename $@)_$(DATE)$(suffix $@)
 	rm -rf $@
 
@@ -88,13 +88,13 @@ ec200u_4g.out : libswapi.a libec200u.a ./tests/ec200u/main.go
 	rm -rf $@
 
 # 主测试程序
-LIBS := -Wl,-Bstatic -L./swapi -lswapi -L./hk_u_takephoto -lhk_u_takephoto -L./air720u -lair720u -L./air530z -lair530z -L./ec200u -lec200u
+LIBS := -Wl,-Bstatic -L./swapi -lswapi -L./hk_takephoto -lhk_takephoto -L./air720u -lair720u -L./air530z -lair530z -L./ec200u -lec200u
 ifeq ($(target),armv7hf)
-  LIBS += -Wl,-Bdynamic -lc -lm -ldl -lpthread -L$(PWD)/hk_u_takephoto/lib/armv7hf/. -lMvCameraControl
+  LIBS += -Wl,-Bdynamic -lc -lm -ldl -lpthread -L$(PWD)/hk_takephoto/lib/armv7hf/. -lMvCameraControl
 else
-  LIBS += -Wl,-Bdynamic -lc -lm -ldl -lpthread -L$(PWD)/hk_u_takephoto/lib/x86_64/64 -lMvCameraControl
+  LIBS += -Wl,-Bdynamic -lc -lm -ldl -lpthread -L$(PWD)/hk_takephoto/lib/x86_64/64 -lMvCameraControl
 endif
-rtu_linux_modules.out : libswapi.a libhk_u_takephoto.a libair720u.a libair530z.a libec200u.a ./main.go
+rtu_linux_modules.out : libswapi.a libhk_takephoto.a libair720u.a libair530z.a libec200u.a ./main.go
 	mkdir -p ./build
 	$(GO) mod tidy
 	$(SETGO_ENV) CGO_LDFLAGS="$(LIBS)" $(GO_BUILD) $(GO_FLAGS) -o $@ ./main.go
@@ -103,7 +103,7 @@ rtu_linux_modules.out : libswapi.a libhk_u_takephoto.a libair720u.a libair530z.a
 # 编译的清理
 clean :
 	make -C ./swapi clean
-	make -C ./hk_u_takephoto clean
+	make -C ./hk_takephoto clean
 	make -C ./air720u clean
 	make -C ./air530z clean
 	make -C ./ec200u  clean

+ 1 - 1
dh_takephoto/bridge.go

@@ -1,4 +1,4 @@
-package hr_g_takephoto
+package dh_takephoto
 
 /*
 #include "takephoto.h"

+ 1 - 1
dh_takephoto/readme.txt

@@ -1,5 +1,5 @@
 Todo: 待实现
-封装华睿g口相机,通过SDK实现拍照输出,目前输出图片格式支持: bmp、jpg
+封装华睿工业相机,通过SDK实现拍照输出,目前输出图片格式支持:bmp、jpg
 
 使用说明:
 - 在具体的项目代码中调用该模块的: “ModuleInit()” 函数初始化运行环境

+ 1 - 1
dh_takephoto/takephoto.go

@@ -1 +1 @@
-package hr_g_takephoto
+package dh_takephoto

+ 2 - 2
hk_takephoto/Makefile

@@ -32,12 +32,12 @@ else
 endif
 
 # 编译和清理
-build : libhk_u_takephoto.a takephoto_test.out hkcam_reset.out
+build : libhk_takephoto.a takephoto_test.out hkcam_reset.out
 
 %.o : %.c
 	$(CC) $(DEFINS) $(CFLAGS) -c $< $(INCS) -o $@
 
-libhk_u_takephoto.a : $(OBJS)
+libhk_takephoto.a : $(OBJS)
 	$(AR) -cr $@ $(OBJS)
 
 hkcam_reset.out : $(OBJS) hkcam_reset.c

+ 1 - 1
hk_takephoto/bridge.go

@@ -1,7 +1,7 @@
 // Author: NiuJiuRu
 // Email: niujiuru@qq.com
 
-package hk_u_takephoto
+package hk_takephoto
 
 /*
 #include "takephoto.h"

+ 1 - 1
hk_takephoto/readme.txt

@@ -1,4 +1,4 @@
-封装海康U口相机,通过SDK实现拍照输出,目前输出图片格式支持: bmp、jpg
+封装海康工业相机,通过SDK实现拍照输出,目前输出图片格式支持:bmp、jpg
 
 使用说明:
 - 在具体的项目代码中调用该模块的: “ModuleInit()” 函数初始化运行环境

+ 1 - 1
hk_takephoto/takephoto.go

@@ -1,4 +1,4 @@
-package hk_u_takephoto
+package hk_takephoto
 
 import (
 	"time"

+ 1 - 1
main.go

@@ -7,7 +7,7 @@ import (
 
 	gps "hnyfkj.com.cn/rtu/linux/air530z"
 	baseapp "hnyfkj.com.cn/rtu/linux/baseapp"
-	camera1 "hnyfkj.com.cn/rtu/linux/hk_u_takephoto" // 海康U口相机
+	camera1 "hnyfkj.com.cn/rtu/linux/hk_takephoto" // 海康相机
 	netmgrd "hnyfkj.com.cn/rtu/linux/netmgrd"
 	"hnyfkj.com.cn/rtu/linux/sshd"
 )

+ 2 - 2
package/armv7hf.sh

@@ -25,12 +25,12 @@ chmod a+x "${pkg_dir}/script/"*
 
 echo "3, Creating lib directory and copying library files..."
 mkdir -p "${pkg_dir}/lib"
-use_cam="hk_u_takephoto"  # 使用海康U口相机
+use_cam="hk_takephoto"  # 使用海康相机
 cam_dir="${pre_dir}/${use_cam}"
 cp -rf "${cam_dir}/lib/armv7hf/"* "${pkg_dir}/lib/"
 
 echo "4, Building hkcam_reset..."
-if [ "$use_cam" = "hk_u_takephoto" ]; then
+if [ "$use_cam" = "hk_takephoto" ]; then
   make -C "${cam_dir}" clean
   make -C "${cam_dir}" target=armv7hf hkcam_reset.out
   cp -rf "${cam_dir}/hkcam_reset.out" "${pkg_dir}/"

+ 0 - 8
scripts/start

@@ -6,14 +6,6 @@
 . $(dirname $0)/modules/funcs/functions.sh
 export_env
 
-# 重置海康相机(1200W海康U口相机在RTU板子上冷启动时, 需要先重置相机, 才能正常工作)
-HKCAM_RESET="${APPBINS_PATH}/hkcam_reset.out"
-if [ -e "$HKCAM_RESET" ]; then
-  chmod a+x "$HKCAM_RESET"
-  "$HKCAM_RESET"
-  sleep 5
-fi
-
 # 启动主应用程序模块
 ORDER="
 myapp

+ 1 - 1
tests/hk_u_takephoto/main.go

@@ -5,7 +5,7 @@ import (
 	"time"
 
 	"hnyfkj.com.cn/rtu/linux/baseapp"
-	camera "hnyfkj.com.cn/rtu/linux/hk_u_takephoto"
+	camera "hnyfkj.com.cn/rtu/linux/hk_takephoto"
 )
 
 func main() {