海康威视相机-LINUX SDK 开发

硬件与环境

mvs

相机: MV-CS020-10GC
系统:UBUNTU 22.04
语言:C++
工具:cmake
海康官网下载SDK
在这里插入图片描述

在这里插入图片描述
运行下面的命令进行安装

sudo dpkg -i  MVSXXX.deb

安装完成后从在/opt/MVS 路径下就有了相关的库,实际上我们开发的时候只需要lib和include。有兴趣的同学也可以尝试以下Samples的例子。make一下就能生成可执行文件。如果make报错,可能环境变量没有设置好,到bin文件夹下把那几个设置环境变量的shell脚本运行一下再试一试。

make

在这里插入图片描述
这里是我运行了/opt/MVS/Samples/64/Display下的例子。

在这里插入图片描述

开发

实际上我们开发的时候只需要目录/opt/MVS/lib和/opt/MVS/include下的文件。他们是海康提供的链接库。所以我们在写程序的时候链接到海康的库,我们就能调用海康官方的接口了。

我将海康的库放在我工程的3rdPartys下,这样就移植到其他电脑上会比较方便。

add_library(cameraAPISHARED
)
# Define preprocessor macro for exporting symbols on Windowsif(WIN32)target_compile_definitions(cameraAPI PRIVATE cameraAPI_EXPORTS)
endif()message( target name: cameraAPI )target_include_directories(cameraAPI  PRIVATE${OpenCV_INCLUDE_DIRS}./include./3rdPartys/mvsinclude
)target_sources(cameraAPI PRIVATE./src/edge_camera.cpp
)target_link_directories(cameraAPI  PUBLIC${OpenCV_LIBS}./3rdPartys/mvslib/64
)target_link_libraries(cameraAPI  PRIVATE${OpenCV_LIBS}MvCameraControlpthread
)

主要的程序

//
// Created by zc on 8/24/23.
//
#include "edge_camera.h"EDGE_CAMERA::EDGE_CAMERA() {std::cout<<"EDGE_CAMERA BEGIN!"<<std::endl;
}EDGE_CAMERA::~EDGE_CAMERA(){std::cout<<"EDGE_CAMERA FINISH!"<<std::endl;
}// print the discovered devices' information
void EDGE_CAMERA::PrintDeviceInfo(MV_CC_DEVICE_INFO* pstMVDevInfo)
{if (nullptr == pstMVDevInfo){printf("    NULL info.\n\n");return;}if (MV_GIGE_DEVICE == pstMVDevInfo->nTLayerType){unsigned int nIp1 = ((pstMVDevInfo->SpecialInfo.stGigEInfo.nCurrentIp & 0xff000000) >> 24);unsigned int nIp2 = ((pstMVDevInfo->SpecialInfo.stGigEInfo.nCurrentIp & 0x00ff0000) >> 16);unsigned int nIp3 = ((pstMVDevInfo->SpecialInfo.stGigEInfo.nCurrentIp & 0x0000ff00) >> 8);unsigned int nIp4 = (pstMVDevInfo->SpecialInfo.stGigEInfo.nCurrentIp & 0x000000ff);// en:Print current ip and user defined nameprintf("    IP: %d.%d.%d.%d\n" , nIp1, nIp2, nIp3, nIp4);printf("    UserDefinedName: %s\n" , pstMVDevInfo->SpecialInfo.stGigEInfo.chUserDefinedName);printf("    Device Model Name: %s\n\n", pstMVDevInfo->SpecialInfo.stGigEInfo.chModelName);}else if (MV_USB_DEVICE == pstMVDevInfo->nTLayerType){printf("    UserDefinedName: %s\n", pstMVDevInfo->SpecialInfo.stUsb3VInfo.chUserDefinedName);printf("    Device Model Name: %s\n\n", pstMVDevInfo->SpecialInfo.stUsb3VInfo.chModelName);}else{printf("    Not support.\n\n");}
}//  en:Convert pixel arrangement from RGB to BGR
void EDGE_CAMERA::RGB2BGR( unsigned char* pRgbData, unsigned int nWidth, unsigned int nHeight )
{if ( nullptr == pRgbData ){return;}// RGB TO BGRfor (unsigned int j = 0; j < nHeight; j++){for (unsigned int i = 0; i < nWidth; i++){unsigned char red = pRgbData[j * (nWidth * 3) + i * 3];pRgbData[j * (nWidth * 3) + i * 3]     = pRgbData[j * (nWidth * 3) + i * 3 + 2];pRgbData[j * (nWidth * 3) + i * 3 + 2] = red;}}
}// en:Convert data stream to Mat format then save image
bool EDGE_CAMERA::Convert2Mat(MV_FRAME_OUT_INFO_EX *pstImageInfo, unsigned char *pData, cv::Mat &img)
{if (nullptr == pstImageInfo || nullptr == pData){printf("NULL info or data.\n");return false;}cv::Mat srcImage;if ( PixelType_Gvsp_Mono8 == pstImageInfo->enPixelType )                // Mono8{srcImage = cv::Mat(pstImageInfo->nHeight, pstImageInfo->nWidth, CV_8UC1, pData);}else if ( PixelType_Gvsp_RGB8_Packed == pstImageInfo->enPixelType )     // RGB8{RGB2BGR(pData, pstImageInfo->nWidth, pstImageInfo->nHeight);srcImage = cv::Mat(pstImageInfo->nHeight, pstImageInfo->nWidth, CV_8UC3, pData);}else if(PixelType_Gvsp_BayerRG8 == pstImageInfo->enPixelType)           // BayerRG8{printf("pPixelType_Gvsp_BayerRG8 type is converted to Mat\n");//RGB2BGR(pData, pstImageInfo->nWidth, pstImageInfo->nHeight);srcImage = cv::Mat(pstImageInfo->nHeight, pstImageInfo->nWidth, CV_8UC1, pData);// srcImage.create(srcImage.rows,srcImage.cols,CV_8UC3);cvtColor(srcImage, srcImage, cv::COLOR_BayerRG2RGB);}else{printf("Unsupported pixel format\n");return false;}if ( nullptr == srcImage.data ){printf("Creat Mat failed.\n");return false;}try{// en:Save converted image in a local fileimg = srcImage;cv::imwrite("Image_Mat.bmp", srcImage);}catch (cv::Exception& ex){fprintf(stderr, "Exception in saving mat image: %s\n", ex.what());}srcImage.release();return true;
}// en:Convert data stream in Ipl format then save image
bool EDGE_CAMERA::Convert2Ipl(MV_FRAME_OUT_INFO_EX* pstImageInfo, unsigned char * pData)
{if (nullptr == pstImageInfo || nullptr == pData){printf("NULL info or data.\n");return false;}IplImage* srcImage = nullptr;if ( PixelType_Gvsp_Mono8 == pstImageInfo->enPixelType )                // Mono8????{srcImage = cvCreateImage(cvSize(pstImageInfo->nWidth, pstImageInfo->nHeight), IPL_DEPTH_8U, 1);}else if ( PixelType_Gvsp_RGB8_Packed == pstImageInfo->enPixelType )     // RGB8????{RGB2BGR(pData, pstImageInfo->nWidth, pstImageInfo->nHeight);srcImage = cvCreateImage(cvSize(pstImageInfo->nWidth, pstImageInfo->nHeight), IPL_DEPTH_8U, 3);}else{printf("Unsupported pixel format\n");return false;}if ( nullptr == srcImage ){printf("Creat IplImage failed.\n");return false;}srcImage->imageData = (char *)pData;try{// en:Save converted image in a local filecv::Mat cConvertImage = cv::cvarrToMat(srcImage);cv::imwrite("Image_Ipl.bmp", cConvertImage);cConvertImage.release();}catch (cv::Exception& ex){fprintf(stderr, "Exception in saving IplImage: %s\n", ex.what());}cvReleaseImage(&srcImage);return true;
}void EDGE_CAMERA::findCameras(){int nRet = MV_OK;//void* handle = nullptr;//unsigned char * pData = nullptr;//MV_CC_DEVICE_INFO_LIST _stDeviceList;memset(&_stDeviceList, 0, sizeof(MV_CC_DEVICE_INFO_LIST));// en:Enum devicedo {nRet = MV_CC_EnumDevices(MV_GIGE_DEVICE | MV_USB_DEVICE, &_stDeviceList);if (MV_OK != nRet) {printf("Enum Devices fail! nRet [0x%x]\n", nRet);break;}// en:Show devicesif (_stDeviceList.nDeviceNum > 0) {for (unsigned int i = 0; i < _stDeviceList.nDeviceNum; i++) {printf("[device %d]:\n", i);MV_CC_DEVICE_INFO *pDeviceInfo = _stDeviceList.pDeviceInfo[i];if (nullptr == pDeviceInfo) {break;}PrintDeviceInfo(pDeviceInfo);}} else {printf("Find No Devices!\n");break;}}while(false);
}void EDGE_CAMERA::connectCameras(){for(int device = 0; device < _stDeviceList.nDeviceNum; device++){if (!MV_CC_IsDeviceAccessible(_stDeviceList.pDeviceInfo[device], MV_ACCESS_Exclusive)){PrintDeviceInfo(_stDeviceList.pDeviceInfo[device]);printf("Can't connect %u! ", _stDeviceList.pDeviceInfo[device]->nMacAddrLow);continue;}else{void *handle;PrintDeviceInfo(_stDeviceList.pDeviceInfo[device]);printf("connect %10u!\n", _stDeviceList.pDeviceInfo[device]->nMacAddrLow);int nRet = MV_CC_CreateHandle(&handle, _stDeviceList.pDeviceInfo[device]);_handlesCameraInfos.push_back({handle,nRet}); //save the handle to handlesCameraInfosif (MV_OK != nRet){printf("Create Handle fail! nRet [0x%x]\n", nRet);}}}
}void EDGE_CAMERA::initCamera(void *handle, int createRetStatus, unsigned int cameraIndex) {int nRet;unsigned char * pData = nullptr;do{if (createRetStatus != MV_OK)break;handle = handle;// en:Open devicenRet = MV_CC_OpenDevice(handle);if (MV_OK != nRet) {printf("Open Device fail! nRet [0x%x]\n", nRet);break;}// en:Detection network optimal package size(It only works for the GigE camera)if (MV_GIGE_DEVICE == _stDeviceList.pDeviceInfo[cameraIndex]->nTLayerType) {int nPacketSize = MV_CC_GetOptimalPacketSize(handle);if (nPacketSize > 0) {nRet = MV_CC_SetIntValue(handle, "GevSCPSPacketSize", nPacketSize);if (MV_OK != nRet) {printf("Warning: Set Packet Size fail! nRet [0x%x]!", nRet);}} else {printf("Warning: Get Packet Size fail! nRet [0x%x]!", nPacketSize);}}//en:Set trigger mode as offnRet = MV_CC_SetEnumValue(handle, "TriggerMode", 0);if (MV_OK != nRet) {printf("Set Trigger Mode fail! nRet [0x%x]\n", nRet);break;}// en:Get payload sizeMVCC_INTVALUE stParam;memset(&stParam, 0, sizeof(MVCC_INTVALUE));nRet = MV_CC_GetIntValue(handle, "PayloadSize", &stParam);if (MV_OK != nRet) {printf("Get PayloadSize fail! nRet [0x%x]\n", nRet);break;}unsigned int nPayloadSize = stParam.nCurValue;// en:Init image infoMV_FRAME_OUT_INFO_EX stImageInfo = {0};memset(&stImageInfo, 0, sizeof(MV_FRAME_OUT_INFO_EX));pData = (unsigned char *) malloc(sizeof(unsigned char) * (nPayloadSize));if (nullptr == pData) {printf("Allocate memory failed.\n");break;}memset(pData, 0, sizeof(pData));//  en:Start grab imagenRet = MV_CC_StartGrabbing(handle);if (MV_OK != nRet) {printf("Start Grabbing fail! nRet [0x%x]\n", nRet);break;}_camerasDatas.push_back({handle,pData,nPayloadSize,stImageInfo});// en:Get one frame from camera with timeout=1000ms/*    while (true) {nRet = MV_CC_GetOneFrameTimeout(handle, pData, nPayloadSize, &stImageInfo, 1000);if (MV_OK == nRet) {printf("Get One Frame: Width[%d], Height[%d], FrameNum[%d]\n",stImageInfo.nWidth, stImageInfo.nHeight, stImageInfo.nFrameNum);} else {printf("Get Frame fail! nRet [0x%x]\n", nRet);break;}//  en:Convert image databool bConvertRet = false;cv::Mat img;bConvertRet = Convert2Mat(&stImageInfo, pData, img);cv::namedWindow("img", cv::WINDOW_NORMAL);cv::resizeWindow("img", cv::Size(900, 600));imshow("img", img);cv::waitKey(20);}*/}while(false);/* // en:Stop grab imagenRet = MV_CC_StopGrabbing(handle);if (MV_OK != nRet){printf("Stop Grabbing fail! nRet [0x%x]\n", nRet);break;}// en:Close devicenRet = MV_CC_CloseDevice(handle);if (MV_OK != nRet){printf("ClosDevice fail! nRet [0x%x]\n", nRet);break;}//  en:Input the format to convertprintf("\n[0] OpenCV_Mat\n");printf("[1] OpenCV_IplImage\n");int nFormat = 0;*/}void EDGE_CAMERA::initAllCameras(){unsigned int nCameraIndex = _handlesCameraInfos.size();unsigned int cameraIndex = 0;for(auto handlesCameraInfo:_handlesCameraInfos){initCamera(handlesCameraInfo.handle, handlesCameraInfo.createRetStatus, cameraIndex);cameraIndex++;}
}void EDGE_CAMERA::disPlay() {//initCamera(_handlesCameraInfos[0].handle, _handlesCameraInfos[0].createRetStatus, 0);std::string winName = "img";cv::namedWindow(winName, cv::WINDOW_NORMAL);cv::resizeWindow(winName, cv::Size(900, 600));while (cv::waitKey(50) != 'q') {unsigned int cameraIndex = 0;int nRet = MV_CC_GetOneFrameTimeout(_camerasDatas[0].handle, _camerasDatas[0].pData, _camerasDatas[0].nPayloadSize, &_camerasDatas[0].stImageInfo, 1000);if (MV_OK == nRet) {printf("Get One Frame: Width[%d], Height[%d], FrameNum[%d]\n",_camerasDatas[0].stImageInfo.nWidth, _camerasDatas[0].stImageInfo.nHeight, _camerasDatas[0].stImageInfo.nFrameNum);} else {printf("Get Frame fail! nRet [0x%x]\n", nRet);break;}//  en:Convert image databool bConvertRet = false;cv::Mat img;bConvertRet = Convert2Mat(&_camerasDatas[0].stImageInfo, _camerasDatas[0].pData, img);imshow(winName, img);cv::waitKey(20);}}bool EDGE_CAMERA::getAndProcessImg() {int nRet = MV_OK;void* handle = nullptr;unsigned char * pData = nullptr;do{MV_CC_DEVICE_INFO_LIST stDeviceList;memset(&stDeviceList, 0, sizeof(MV_CC_DEVICE_INFO_LIST));// en:Enum devicenRet = MV_CC_EnumDevices(MV_GIGE_DEVICE | MV_USB_DEVICE, &stDeviceList);if (MV_OK != nRet){printf("Enum Devices fail! nRet [0x%x]\n", nRet);break;}// en:Show devicesif (stDeviceList.nDeviceNum > 0){for (unsigned int i = 0; i < stDeviceList.nDeviceNum; i++){printf("[device %d]:\n", i);MV_CC_DEVICE_INFO* pDeviceInfo = stDeviceList.pDeviceInfo[i];if (nullptr == pDeviceInfo){break;}PrintDeviceInfo(pDeviceInfo);}}else{printf("Find No Devices!\n");break;}// en:Select deviceunsigned int nIndex = 0;while (true){printf("Please Input camera index(0-%d): ", stDeviceList.nDeviceNum - 1);if (1 == scanf("%d", &nIndex)){while (getchar() != '\n'){;}if (nIndex >= 0 && nIndex < stDeviceList.nDeviceNum){if (!MV_CC_IsDeviceAccessible(stDeviceList.pDeviceInfo[nIndex], MV_ACCESS_Exclusive)){printf("Can't connect! ");continue;}break;}}else{while (getchar() != '\n'){;}}}// en:Create handlenRet = MV_CC_CreateHandle(&handle, stDeviceList.pDeviceInfo[nIndex]);if (MV_OK != nRet){printf("Create Handle fail! nRet [0x%x]\n", nRet);break;}// en:Open devicenRet = MV_CC_OpenDevice(handle);if (MV_OK != nRet){printf("Open Device fail! nRet [0x%x]\n", nRet);break;}// en:Detection network optimal package size(It only works for the GigE camera)if (MV_GIGE_DEVICE == stDeviceList.pDeviceInfo[nIndex]->nTLayerType){int nPacketSize = MV_CC_GetOptimalPacketSize(handle);if (nPacketSize > 0){nRet = MV_CC_SetIntValue(handle, "GevSCPSPacketSize", nPacketSize);if (MV_OK != nRet){printf("Warning: Set Packet Size fail! nRet [0x%x]!", nRet);}}else{printf("Warning: Get Packet Size fail! nRet [0x%x]!", nPacketSize);}}//en:Set trigger mode as offnRet = MV_CC_SetEnumValue(handle, "TriggerMode", 0);if (MV_OK != nRet){printf("Set Trigger Mode fail! nRet [0x%x]\n", nRet);break;}// en:Get payload sizeMVCC_INTVALUE stParam;memset(&stParam, 0, sizeof(MVCC_INTVALUE));nRet = MV_CC_GetIntValue(handle, "PayloadSize", &stParam);if (MV_OK != nRet){printf("Get PayloadSize fail! nRet [0x%x]\n", nRet);break;}unsigned int nPayloadSize = stParam.nCurValue;// en:Init image infoMV_FRAME_OUT_INFO_EX stImageInfo = { 0 };memset(&stImageInfo, 0, sizeof(MV_FRAME_OUT_INFO_EX));pData = (unsigned char *)malloc(sizeof(unsigned char)* (nPayloadSize));if (nullptr == pData){printf("Allocate memory failed.\n");break;}memset(pData, 0, sizeof(pData));//  en:Start grab imagenRet = MV_CC_StartGrabbing(handle);if (MV_OK != nRet){printf("Start Grabbing fail! nRet [0x%x]\n", nRet);break;}// en:Get one frame from camera with timeout=1000msnRet = MV_CC_GetOneFrameTimeout(handle, pData, nPayloadSize, &stImageInfo, 1000);if (MV_OK == nRet){printf("Get One Frame: Width[%d], Height[%d], FrameNum[%d]\n",stImageInfo.nWidth, stImageInfo.nHeight, stImageInfo.nFrameNum);}else{printf("Get Frame fail! nRet [0x%x]\n", nRet);break;}// en:Stop grab imagenRet = MV_CC_StopGrabbing(handle);if (MV_OK != nRet){printf("Stop Grabbing fail! nRet [0x%x]\n", nRet);break;}// en:Close devicenRet = MV_CC_CloseDevice(handle);if (MV_OK != nRet){printf("ClosDevice fail! nRet [0x%x]\n", nRet);break;}//  en:Input the format to convertprintf("\n[0] OpenCV_Mat\n");printf("[1] OpenCV_IplImage\n");int nFormat = 0;while (1){printf("Please Input Format to convert: ");if (1 == scanf("%d", &nFormat)){if (0 == nFormat || 1 == nFormat){break;}}while (getchar() != '\n'){;}}//  en:Convert image databool bConvertRet = false;cv::Mat img;if (OpenCV_Mat == nFormat){bConvertRet = Convert2Mat(&stImageInfo, pData, img);}else if (OpenCV_IplImage == nFormat){bConvertRet = Convert2Ipl(&stImageInfo, pData);}//  en:Print resultif (bConvertRet){printf("OpenCV format convert finished.\n");}else{printf("OpenCV format convert failed.\n");}} while (0);// en:Destroy handleif (handle){MV_CC_DestroyHandle(handle);handle = nullptr;}// en:Free memeryif (pData){free(pData);pData = nullptr;}return true;
}void EDGE_CAMERA::saveImg(std::string path,unsigned int cameraIndex){}

Main函数

int main(int argc, char **argv){EDGE_CAMERA camera;camera.findCameras();camera.connectCameras();camera.initAllCameras();camera.disPlay();}

执行效果

在这里插入图片描述

注意

我是编译了一个动态库cameraAPI,main函数是链接的camkeraAPI。上面是把最重要的代码给贴出来了。不是完整的工程哈。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/57204.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

vue实现导出excel的多种方式

在Vue中实现导出Excel有多种方式&#xff0c;可以通过前端实现&#xff0c;也可以通过前后端配合实现。下面将详细介绍几种常用的实现方式。 1. 前端实现方式&#xff1a; 使用xlsx库&#xff1a;使用xlsx库可以在前端将数据导出为Excel文件。首先需要安装xlsx库&#xff0c;…

关于c#:BindingProxy:绑定到索引属性

我有一个BindingProxy将DataGrid的DataGridColumns的可视性-属性绑定到字典中的值(" ColumnsVisibility")。我也有一个上下文菜单&#xff0c;它应该可以隐藏/显示网格的列。 <DataGrid Name"dgMachines"ItemsSource"{Binding HVMachineList,Upda…

肯德尔秩相关系数(Kendall‘s Tau)排名

肯德尔秩相关系数&#xff08;Kendall’s Tau&#xff09;是一种用于衡量两个排列之间相似性的统计指标&#xff0c;它考虑了元素之间的顺序关系而不考虑具体数值。该系数被广泛用于排序、排名和比较不同实验结果的相关性等领域。 具体而言&#xff0c;肯德尔秩相关系数衡量了…

AUTOSAR从入门到精通-【应用篇】基于嵌入式实时Linux及AUTOSAR的跨平台技术研究与实现

目录 前言 通用实时操作系统的国内外研究现状 AUTOSAR国内外研究现状 实时操作系统的选择

专业制造一体化ERP系统,专注于制造工厂生产管理信息化,可定制-亿发

制造业是国民经济的支柱产业&#xff0c;对于经济发展和竞争力至关重要。在数字化和智能化趋势的推动下&#xff0c;制造业正处于升级的关键时期。而ERP系统&#xff0c;即企业资源计划系统&#xff0c;能够将企业的各个业务环节整合起来&#xff0c;实现资源的有效管理和信息的…

攻击与防御实战经验分享:分析真实的攻击事件和入侵行为,讨论防御方法和实践经验

章节 1: 前言 作为IT领域的从业者&#xff0c;我们时刻都面临着网络安全的挑战。攻击者不断寻找漏洞&#xff0c;而防御者则需要时刻保持警惕&#xff0c;采取最佳实践来保护系统和数据。在本文中&#xff0c;我们将分享一些真实的攻击事件和入侵行为&#xff0c;并探讨针对这…

LInux之chrony服务器

目录 场景 重要性 LInux的两个时钟 硬件时钟 系统时钟 NTP协议 Chrony介绍 定义 组成 --- chronyd和chronyc 安装与配置 安装 Chrony配置文件分析 同步时间服务器 chronyc命令 chronyc sources输出分析 其它命令 查看时间服务器的状态 查看时间服务器是否在线 …

大数据技术概述(三)——编程语言的选择

文章目录 1.6编程语言的选择1.6.1java和Scala1.6.2Python1.6.3SQL 1.6编程语言的选择 大数据编程一般会使用Java、Scala和python等编程语言&#xff0c;Flink目前也支持上述3种语言。 1.6.1java和Scala Java支持多线程&#xff0c;其生态圈中可用的第三方库众多。Java虚拟机…

如何解决索引分裂问题?

索引分裂 索引块快写满时就会发生索引分裂&#xff0c;索引分裂分为两种情况&#xff0c;55和91&#xff1a; 索引分裂和enq: TX - index contension等待事件的区别 无论是55还是91&#xff0c;都是数据增多后索引的正常行为&#xff0c;索引分裂是业务数据量增大导致索引增大…

③matlab向量和矩阵

目录 手动输入数组 创建等间距向量 数组创建函数 手动输入数组 1.背景 单个称为标量的数值实际上是一个 11 数组&#xff0c;也即它包含 1 行 1 列。 任务 创建一个名为 x 并且值为 4 的变量。 2.您可以使用方括号创建包含多个元素的数组。 x [3 5] x 3 5 任务 …

ubuntu创建自定义开机服务

创建启动脚本 如/usr/sbin/hikcam.sh 里面写要开机执行的命令 chmod 777 赋予权限 /lib/systemd/system下创建 .service文件 [Unit] Description"bringup hikcam" Afternetwork.target[Service] EnvironmentLD_LIBRARY_PATH/opt/MVS/lib/aarch64 Typesimple ExecS…

6、监测数据采集物联网应用开发步骤(5.2)

监测数据采集物联网应用开发步骤(5.1) 包含4个类数据库连接&#xff08;com.zxy.db_Self.ConnectionPool_Self.py&#xff09;、数据库操作类&#xff08;com.zxy.db_Self.Db_Common_Self.py&#xff09;、数据库管理类&#xff08;com.zxy.db_Self.DBManager_Self.py&#xf…

华为云Stack的学习(二)

三、华为云Stack产品组件 FunsionSphere CPS 提供云平台的基础管理和业务资源&#xff08;包括计算资源和存储资源&#xff09;。采用物理服务器方式部署在管理节点。可以做集群的配置&#xff0c;扩容和运维管理。 Service OM 提供云服务的运维能力&#xff0c;采用虚拟化方…

数据结构--树4.2.3(线索二叉树)

利用中序遍历可以解决二叉树中空出来的内存&#xff0c;以及前驱后继的问题。 lchildltagdatartagrchild ——ltag为0时指向该结点的左孩子&#xff0c;为1时指向该结点的前驱。 ——rtag为0时指向该结点的有孩子&#xff0c;为1时指向该结点的后继。 #include <stdio.h…

数字孪生:重塑制造、医疗和能源等领域的未来

数字孪生技术&#xff0c;作为虚拟仿真的重要领域&#xff0c;正以其强大的能力在各个行业中创造前所未有的创新。本文带大家一起深入探讨数字孪生技术在不同领域的广泛应用场景&#xff0c;展示其在实现效率、可靠性和智能化方面的积极影响。 制造业与工业领域 数字孪生技术在…

MyBatis分页插件PageHelper的使用及MyBatis的特殊符号---详细介绍

一&#xff0c;分页的概念 分页是一种将大量数据或内容分割成多个页面以便逐页显示的方式。在分页中&#xff0c;数据被分割成一定数量的页&#xff0c;每页显示一部分数据或内容&#xff0c;用户可以通过翻页或跳分页是一种将大量数据或内容分割成多个页面以便逐页显示的方式。…

MATLAB算法实战应用案例精讲-【概念篇】构建数据指标方法(补充篇)

前言 数据指标体系是指在数据分析领域中,为了评估和量化业务或项目的表现而建立的一组指标。这些指标可以用于监测和追踪业务或项目的发展情况,以便在需要时进行调整和改进。 数据指标体系通常包括多个方面,例如业务目标、数据采集、数据分析和报告等。在建立数据指标体系…

JavaScript—DOM(文档对象模型)

目录 DOM是什么&#xff1f; DOM有什么作用&#xff1f; 一、事件 理解事件 事件怎么写&#xff08;要做什么就写什么&#xff09;&#xff1f; 实战演练 1、页面加载完毕以后&#xff0c;打印一句话 2、如果有一个a标签&#xff0c;并给其添加一个点击事件 3、事件默…

1、监测数据采集物联网应用开发步骤(1)

项目介绍 本文章编写目的针对下图中《。。。解决方案》所涉及的开发资料&#xff1b; 监测数据采集物联网应用解决方案_yong427的博客-CSDN博客 开发步骤实现从0开始搭建软件框架&#xff0c;该开发步骤基于python3.0语言及相关工具实现&#xff0c;阅读本文章之前请先初步百…

React中的flushSync与Vue中的nextTick的比较

React中的flushSync与Vue中的nextTick是两种用于处理异步更新的机制。它们在React和Vue这两个流行的前端框架中起着重要的作用。 首先&#xff0c;让我们来看看flushSync。在React中&#xff0c;当需要更新UI时&#xff0c;React会将更新操作放入一个队列中&#xff0c;然后异…