1 #14

Merged
pn9er3yvu merged 12 commits from main into z_branch 11 months ago

57
.gitignore vendored

@ -12,3 +12,60 @@
# Built Visual Studio Code Extensions
*.vsix
# C++ 编译生成的文件
*.o
*.obj
*.a
*.so
*.so.*
*.dylib
*.dll
*.exe
*.out
*.app
# Qt项目生成的文件
*.moc
moc_*.cpp
moc_*.h
qrc_*.cpp
ui_*.h
*.qm
Makefile*
*.qmlc
*.jsc
*_qmlcache.qrc
# 编译目录
bin/
debug/
release/
obj/
build/
*build-*/
# IDE相关文件
.idea/
*.swp
*.swo
*~
*.bak
*.orig
.DS_Store
# 临时文件
tmp/
temp/
*.tmp
*.log
*.autosave
# Linux 临时文件
*~
# 由OpenCV生成的文件
*.jpg.aux
*.png.aux
# 保留特定文件,即使它们匹配上述模式
!.gitignore

Binary file not shown.

@ -1,55 +0,0 @@
MAKEFILE = Makefile
####### Compiler, tools and options
CC = aarch64-linux-gnu-gcc
CXX = aarch64-linux-gnu-g++
DEFINES = -DQT_QML_DEBUG
CFLAGS = -pipe -g -Wall -W -fPIC $(DEFINES)
CXXFLAGS = -pipe -g -std=gnu++11 -Wall -W -fPIC $(DEFINES)
DEL_FILE = rm -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
COPY = cp -f
COPY_FILE = cp -f
COPY_DIR = cp -f -R
INSTALL_FILE = install -m 644 -p
INSTALL_PROGRAM = install -m 755 -p
INSTALL_DIR = cp -f -R
DEL_FILE = rm -f
SYMLINK = ln -f -s
DEL_DIR = rmdir
MOVE = mv -f
TAR = tar -cf
COMPRESS = gzip -9f
LINK = aarch64-linux-gnu-g++
LFLAGS =
LIBS = $(SUBLIBS) -L./bin/linux-aarch64 -lViewLink
AR = ar cqs
RANLIB =
SED = sed
STRIP = strip
####### Files
SOURCES = ./main.cpp
OBJECTS = main.o
DESTDIR = ./bin/linux-aarch64/
TARGET = ./bin/linux-aarch64/demo_for_linux
####### Build rules
$(TARGET): $(OBJECTS)
@test -d ./bin/linux-aarch64/ || mkdir -p ./bin/linux-aarch64/
cp -f ../../bin/linux-aarch64/*.so ./bin/linux-aarch64
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
clean:
rm -rf ./bin
rm -f *.o
####### Compile
main.o: ./main.cpp ../../inc/ViewLink.h \
./cmdline.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o ./main.cpp

@ -1,26 +0,0 @@
debug:[ViewLink.cpp][57][VLK_Init]########### ViewLink SDK 3.0.7 initialized ###########
debug:[ViewLink.cpp][145][VLK_RegisterDevStatusCB]VLK_RegisterDevStatusCB
debug:[ViewLink.cpp][75][VLK_Connect]VLK_Connect
debug:[TCPConnection.cpp][161][SocketCallback]TCP Gimbal Connected !!!!!!!!!!!!
debug:[DeviceConnection.cpp][1419][ProcSayHelloResponse]current connected device type: Q30T, 36T
debug:[DeviceConnection.cpp][1489][ProcSayHelloResponse]hand shake success! enjoy !!!
debug:[DeviceConnection.cpp][1419][ProcSayHelloResponse]current connected device type: Q30T, 36T
debug:[DeviceConnection.cpp][1489][ProcSayHelloResponse]hand shake success! enjoy !!!
debug:[DeviceConnection.cpp][1419][ProcSayHelloResponse]current connected device type: Q30T, 36T
debug:[DeviceConnection.cpp][1489][ProcSayHelloResponse]hand shake success! enjoy !!!
error:[DeviceConnection.cpp][1365][ProcReceivedFrame]bad frame CheckSum, it should be 0x80, but frame[46] = 0x6e
debug:[DeviceConnection.cpp][1368][ProcReceivedFrame]================begin frame==================
debug:[DeviceConnection.cpp][39][PrintHexData]frame size = 47, data: 55 aa dc ac 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f3 50 ef 00 00 00 00 00 00 00 0f 0a 18 e2 00 0a 98 55 aa dc 04 12 78 6e
debug:[DeviceConnection.cpp][1370][ProcReceivedFrame]================end frame==================
error:[DeviceConnection.cpp][1365][ProcReceivedFrame]bad frame CheckSum, it should be 0xa8, but frame[46] = 0xc6
debug:[DeviceConnection.cpp][1368][ProcReceivedFrame]================begin frame==================
debug:[DeviceConnection.cpp][39][PrintHexData]frame size = 47, data: 55 aa dc 6c 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f3 60 e2 5c 00 00 00 00 00 00 0f 0a 18 e2 00 0a b9 55 aa dc 84 12 50 c6
debug:[DeviceConnection.cpp][1370][ProcReceivedFrame]================end frame==================
error:[DeviceConnection.cpp][1365][ProcReceivedFrame]bad frame CheckSum, it should be 0x1d, but frame[46] = 0x73
debug:[DeviceConnection.cpp][1368][ProcReceivedFrame]================begin frame==================
debug:[DeviceConnection.cpp][39][PrintHexData]frame size = 47, data: 55 aa dc ec 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f3 40 df fc 00 00 00 00 00 00 0f 0a 18 e2 00 0a 84 55 aa dc c4 12 a5 73
debug:[DeviceConnection.cpp][1370][ProcReceivedFrame]================end frame==================
error:[DeviceConnection.cpp][1365][ProcReceivedFrame]bad frame CheckSum, it should be 0x50, but frame[46] = 0x00
debug:[DeviceConnection.cpp][1368][ProcReceivedFrame]================begin frame==================
debug:[DeviceConnection.cpp][39][PrintHexData]frame size = 47, data: 55 aa dc ec 40 00 00 55 aa dc ec 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18 15 e0 a0 f2 cc 00 00 00 00 00 00
debug:[DeviceConnection.cpp][1370][ProcReceivedFrame]================end frame==================

@ -1,820 +0,0 @@
/*
Copyright (c) 2009, Hideyuki Tanaka
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the <organization> nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY <copyright holder> ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include <iostream>
#include <sstream>
#include <vector>
#include <map>
#include <string>
#include <stdexcept>
#include <typeinfo>
#include <cstring>
#include <algorithm>
//当编译器非gcc时,不包含cxxabi.h头文件
#ifdef __GNUC__
#include <cxxabi.h>
#endif
#include <cstdlib>
namespace cmdline{
namespace detail{
template <typename Target, typename Source, bool Same>
class lexical_cast_t{
public:
static Target cast(const Source &arg){
Target ret;
std::stringstream ss;
if (!(ss<<arg && ss>>ret && ss.eof()))
throw std::bad_cast();
return ret;
}
};
template <typename Target, typename Source>
class lexical_cast_t<Target, Source, true>{
public:
static Target cast(const Source &arg){
return arg;
}
};
template <typename Source>
class lexical_cast_t<std::string, Source, false>{
public:
static std::string cast(const Source &arg){
std::ostringstream ss;
ss<<arg;
return ss.str();
}
};
template <typename Target>
class lexical_cast_t<Target, std::string, false>{
public:
static Target cast(const std::string &arg){
Target ret;
std::istringstream ss(arg);
if (!(ss>>ret && ss.eof()))
throw std::bad_cast();
return ret;
}
};
template <typename T1, typename T2>
struct is_same {
static const bool value = false;
};
template <typename T>
struct is_same<T, T>{
static const bool value = true;
};
template<typename Target, typename Source>
Target lexical_cast(const Source &arg)
{
return lexical_cast_t<Target, Source, detail::is_same<Target, Source>::value>::cast(arg);
}
static inline std::string demangle(const std::string &name)
{
#ifdef _MSC_VER
return name; // 为MSVC编译器时直接返回name
#elif defined(__GNUC__)
// 为gcc编译器时还调用原来的代码
int status = 0;
char *p = abi::__cxa_demangle(name.c_str(), 0, 0, &status);
std::string ret(p);
free(p);
return ret;
#else
// 其他不支持的编译器需要自己实现这个方法
#error unexpected c complier (msc/gcc), Need to implement this method for demangle
#endif
}
template <class T>
std::string readable_typename()
{
return demangle(typeid(T).name());
}
template <class T>
std::string default_value(T def)
{
return detail::lexical_cast<std::string>(def);
}
template <>
inline std::string readable_typename<std::string>()
{
return "string";
}
} // detail
//-----
class cmdline_error : public std::exception {
public:
cmdline_error(const std::string &msg): msg(msg){}
~cmdline_error() throw() {}
const char *what() const throw() { return msg.c_str(); }
private:
std::string msg;
};
template <class T>
struct default_reader{
T operator()(const std::string &str){
return detail::lexical_cast<T>(str);
}
};
template <class T>
struct range_reader{
range_reader(const T &low, const T &high): low(low), high(high) {}
T operator()(const std::string &s) const {
T ret=default_reader<T>()(s);
if (!(ret>=low && ret<=high)) throw cmdline::cmdline_error("range_error");
return ret;
}
private:
T low, high;
};
template <class T>
range_reader<T> range(const T &low, const T &high)
{
return range_reader<T>(low, high);
}
template <class T>
struct oneof_reader{
T operator()(const std::string &s){
T ret=default_reader<T>()(s);
if (std::find(alt.begin(), alt.end(), ret)==alt.end())
throw cmdline_error("");
return ret;
}
void add(const T &v){ alt.push_back(v); }
private:
std::vector<T> alt;
};
template <class T>
oneof_reader<T> oneof(T a1)
{
oneof_reader<T> ret;
ret.add(a1);
return ret;
}
template <class T>
oneof_reader<T> oneof(T a1, T a2)
{
oneof_reader<T> ret;
ret.add(a1);
ret.add(a2);
return ret;
}
template <class T>
oneof_reader<T> oneof(T a1, T a2, T a3)
{
oneof_reader<T> ret;
ret.add(a1);
ret.add(a2);
ret.add(a3);
return ret;
}
template <class T>
oneof_reader<T> oneof(T a1, T a2, T a3, T a4)
{
oneof_reader<T> ret;
ret.add(a1);
ret.add(a2);
ret.add(a3);
ret.add(a4);
return ret;
}
template <class T>
oneof_reader<T> oneof(T a1, T a2, T a3, T a4, T a5)
{
oneof_reader<T> ret;
ret.add(a1);
ret.add(a2);
ret.add(a3);
ret.add(a4);
ret.add(a5);
return ret;
}
template <class T>
oneof_reader<T> oneof(T a1, T a2, T a3, T a4, T a5, T a6)
{
oneof_reader<T> ret;
ret.add(a1);
ret.add(a2);
ret.add(a3);
ret.add(a4);
ret.add(a5);
ret.add(a6);
return ret;
}
template <class T>
oneof_reader<T> oneof(T a1, T a2, T a3, T a4, T a5, T a6, T a7)
{
oneof_reader<T> ret;
ret.add(a1);
ret.add(a2);
ret.add(a3);
ret.add(a4);
ret.add(a5);
ret.add(a6);
ret.add(a7);
return ret;
}
template <class T>
oneof_reader<T> oneof(T a1, T a2, T a3, T a4, T a5, T a6, T a7, T a8)
{
oneof_reader<T> ret;
ret.add(a1);
ret.add(a2);
ret.add(a3);
ret.add(a4);
ret.add(a5);
ret.add(a6);
ret.add(a7);
ret.add(a8);
return ret;
}
template <class T>
oneof_reader<T> oneof(T a1, T a2, T a3, T a4, T a5, T a6, T a7, T a8, T a9)
{
oneof_reader<T> ret;
ret.add(a1);
ret.add(a2);
ret.add(a3);
ret.add(a4);
ret.add(a5);
ret.add(a6);
ret.add(a7);
ret.add(a8);
ret.add(a9);
return ret;
}
template <class T>
oneof_reader<T> oneof(T a1, T a2, T a3, T a4, T a5, T a6, T a7, T a8, T a9, T a10)
{
oneof_reader<T> ret;
ret.add(a1);
ret.add(a2);
ret.add(a3);
ret.add(a4);
ret.add(a5);
ret.add(a6);
ret.add(a7);
ret.add(a8);
ret.add(a9);
ret.add(a10);
return ret;
}
//-----
class parser{
public:
parser(){
}
~parser(){
for (std::map<std::string, option_base*>::iterator p=options.begin();
p!=options.end(); p++)
delete p->second;
}
void add(const std::string &name,
char short_name=0,
const std::string &desc=""){
if (options.count(name)) throw cmdline_error("multiple definition: "+name);
options[name]=new option_without_value(name, short_name, desc);
ordered.push_back(options[name]);
}
template <class T>
void add(const std::string &name,
char short_name=0,
const std::string &desc="",
bool need=true,
const T def=T()){
add(name, short_name, desc, need, def, default_reader<T>());
}
template <class T, class F>
void add(const std::string &name,
char short_name=0,
const std::string &desc="",
bool need=true,
const T def=T(),
F reader=F()){
if (options.count(name)) throw cmdline_error("multiple definition: "+name);
options[name]=new option_with_value_with_reader<T, F>(name, short_name, need, def, desc, reader);
ordered.push_back(options[name]);
}
void footer(const std::string &f){
ftr=f;
}
void set_program_name(const std::string &name){
prog_name=name;
}
bool exist(const std::string &name) const {
if (options.count(name)==0) throw cmdline_error("there is no flag: --"+name);
return options.find(name)->second->has_set();
}
template <class T>
const T &get(const std::string &name) const {
if (options.count(name)==0) throw cmdline_error("there is no flag: --"+name);
const option_with_value<T> *p=dynamic_cast<const option_with_value<T>*>(options.find(name)->second);
if (p==NULL) throw cmdline_error("type mismatch flag '"+name+"'");
return p->get();
}
const std::vector<std::string> &rest() const {
return others;
}
bool parse(const std::string &arg){
std::vector<std::string> args;
std::string buf;
bool in_quote=false;
for (std::string::size_type i=0; i<arg.length(); i++){
if (arg[i]=='\"'){
in_quote=!in_quote;
continue;
}
if (arg[i]==' ' && !in_quote){
args.push_back(buf);
buf="";
continue;
}
if (arg[i]=='\\'){
i++;
if (i>=arg.length()){
errors.push_back("unexpected occurrence of '\\' at end of string");
return false;
}
}
buf+=arg[i];
}
if (in_quote){
errors.push_back("quote is not closed");
return false;
}
if (buf.length()>0)
args.push_back(buf);
for (size_t i=0; i<args.size(); i++)
std::cout<<"\""<<args[i]<<"\""<<std::endl;
return parse(args);
}
bool parse(const std::vector<std::string> &args){
int argc=static_cast<int>(args.size());
std::vector<const char*> argv(argc);
for (int i=0; i<argc; i++)
argv[i]=args[i].c_str();
return parse(argc, &argv[0]);
}
bool parse(int argc, const char * const argv[]){
errors.clear();
others.clear();
if (argc<1){
errors.push_back("argument number must be longer than 0");
return false;
}
if (prog_name=="")
prog_name=argv[0];
std::map<char, std::string> lookup;
for (std::map<std::string, option_base*>::iterator p=options.begin();
p!=options.end(); p++){
if (p->first.length()==0) continue;
char initial=p->second->short_name();
if (initial){
if (lookup.count(initial)>0){
lookup[initial]="";
errors.push_back(std::string("short option '")+initial+"' is ambiguous");
return false;
}
else lookup[initial]=p->first;
}
}
for (int i=1; i<argc; i++){
if (strncmp(argv[i], "--", 2)==0){
const char *p=strchr(argv[i]+2, '=');
if (p){
std::string name(argv[i]+2, p);
std::string val(p+1);
set_option(name, val);
}
else{
std::string name(argv[i]+2);
if (options.count(name)==0){
errors.push_back("undefined option: --"+name);
continue;
}
if (options[name]->has_value()){
if (i+1>=argc){
errors.push_back("option needs value: --"+name);
continue;
}
else{
i++;
set_option(name, argv[i]);
}
}
else{
set_option(name);
}
}
}
else if (strncmp(argv[i], "-", 1)==0){
if (!argv[i][1]) continue;
char last=argv[i][1];
for (int j=2; argv[i][j]; j++){
last=argv[i][j];
if (lookup.count(argv[i][j-1])==0){
errors.push_back(std::string("undefined short option: -")+argv[i][j-1]);
continue;
}
if (lookup[argv[i][j-1]]==""){
errors.push_back(std::string("ambiguous short option: -")+argv[i][j-1]);
continue;
}
set_option(lookup[argv[i][j-1]]);
}
if (lookup.count(last)==0){
errors.push_back(std::string("undefined short option: -")+last);
continue;
}
if (lookup[last]==""){
errors.push_back(std::string("ambiguous short option: -")+last);
continue;
}
if (i+1<argc && options[lookup[last]]->has_value()){
set_option(lookup[last], argv[i+1]);
i++;
}
else{
set_option(lookup[last]);
}
}
else{
others.push_back(argv[i]);
}
}
for (std::map<std::string, option_base*>::iterator p=options.begin();
p!=options.end(); p++)
if (!p->second->valid())
errors.push_back("need option: --"+std::string(p->first));
return errors.size()==0;
}
void parse_check(const std::string &arg){
if (!options.count("help"))
add("help", '?', "print this message");
check(0, parse(arg));
}
void parse_check(const std::vector<std::string> &args){
if (!options.count("help"))
add("help", '?', "print this message");
check(args.size(), parse(args));
}
void parse_check(int argc, char *argv[]){
if (!options.count("help"))
add("help", '?', "print this message");
check(argc, parse(argc, argv));
}
std::string error() const{
return errors.size()>0?errors[0]:"";
}
std::string error_full() const{
std::ostringstream oss;
for (size_t i=0; i<errors.size(); i++)
oss<<errors[i]<<std::endl;
return oss.str();
}
std::string usage() const {
std::ostringstream oss;
oss<<"usage: "<<prog_name<<" ";
for (size_t i=0; i<ordered.size(); i++){
if (ordered[i]->must())
oss<<ordered[i]->short_description()<<" ";
}
oss<<"[options] ... "<<ftr<<std::endl;
oss<<"options:"<<std::endl;
size_t max_width=0;
for (size_t i=0; i<ordered.size(); i++){
max_width=std::max(max_width, ordered[i]->name().length());
}
for (size_t i=0; i<ordered.size(); i++){
if (ordered[i]->short_name()){
oss<<" -"<<ordered[i]->short_name()<<", ";
}
else{
oss<<" ";
}
oss<<"--"<<ordered[i]->name();
for (size_t j=ordered[i]->name().length(); j<max_width+4; j++)
oss<<' ';
oss<<ordered[i]->description()<<std::endl;
}
return oss.str();
}
private:
void check(int argc, bool ok){
if ((argc==1 && !ok) || exist("help")){
std::cerr<<usage();
exit(0);
}
if (!ok){
std::cerr<<error()<<std::endl<<usage();
exit(1);
}
}
void set_option(const std::string &name){
if (options.count(name)==0){
errors.push_back("undefined option: --"+name);
return;
}
if (!options[name]->set()){
errors.push_back("option needs value: --"+name);
return;
}
}
void set_option(const std::string &name, const std::string &value){
if (options.count(name)==0){
errors.push_back("undefined option: --"+name);
return;
}
if (!options[name]->set(value)){
errors.push_back("option value is invalid: --"+name+"="+value);
return;
}
}
class option_base{
public:
virtual ~option_base(){}
virtual bool has_value() const=0;
virtual bool set()=0;
virtual bool set(const std::string &value)=0;
virtual bool has_set() const=0;
virtual bool valid() const=0;
virtual bool must() const=0;
virtual const std::string &name() const=0;
virtual char short_name() const=0;
virtual const std::string &description() const=0;
virtual std::string short_description() const=0;
};
class option_without_value : public option_base {
public:
option_without_value(const std::string &name,
char short_name,
const std::string &desc)
:nam(name), snam(short_name), desc(desc), has(false){
}
~option_without_value(){}
bool has_value() const { return false; }
bool set(){
has=true;
return true;
}
bool set(const std::string &){
return false;
}
bool has_set() const {
return has;
}
bool valid() const{
return true;
}
bool must() const{
return false;
}
const std::string &name() const{
return nam;
}
char short_name() const{
return snam;
}
const std::string &description() const {
return desc;
}
std::string short_description() const{
return "--"+nam;
}
private:
std::string nam;
char snam;
std::string desc;
bool has;
};
template <class T>
class option_with_value : public option_base {
public:
option_with_value(const std::string &name,
char short_name,
bool need,
const T &def,
const std::string &desc)
: nam(name), snam(short_name), need(need), has(false)
, def(def), actual(def) {
this->desc=full_description(desc);
}
~option_with_value(){}
const T &get() const {
return actual;
}
bool has_value() const { return true; }
bool set(){
return false;
}
bool set(const std::string &value){
try{
actual=read(value);
has=true;
}
catch(const std::exception &e){
return false;
}
return true;
}
bool has_set() const{
return has;
}
bool valid() const{
if (need && !has) return false;
return true;
}
bool must() const{
return need;
}
const std::string &name() const{
return nam;
}
char short_name() const{
return snam;
}
const std::string &description() const {
return desc;
}
std::string short_description() const{
return "--"+nam+"="+detail::readable_typename<T>();
}
protected:
std::string full_description(const std::string &desc){
return
desc+" ("+detail::readable_typename<T>()+
(need?"":" [="+detail::default_value<T>(def)+"]")
+")";
}
virtual T read(const std::string &s)=0;
std::string nam;
char snam;
bool need;
std::string desc;
bool has;
T def;
T actual;
};
template <class T, class F>
class option_with_value_with_reader : public option_with_value<T> {
public:
option_with_value_with_reader(const std::string &name,
char short_name,
bool need,
const T def,
const std::string &desc,
F reader)
: option_with_value<T>(name, short_name, need, def, desc), reader(reader){
}
private:
T read(const std::string &s){
return reader(s);
}
F reader;
};
std::map<std::string, option_base*> options;
std::vector<option_base*> ordered;
std::string ftr;
std::string prog_name;
std::vector<std::string> others;
std::vector<std::string> errors;
};
} // cmdline

@ -1,44 +0,0 @@
TEMPLATE = app
CONFIG += console c++11
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += main.cpp
HEADERS += cmdline.h
win32{
contains(QT_ARCH, x86_64){
LIBS += -L$$PWD/../../lib/win64 -lViewLink
DESTDIR = $$PWD/bin/win64
DllSrc = $$PWD/../../bin/win64/*.dll
DllSrc = $$replace(DllSrc, /, \\)
DllDst = $$replace(DESTDIR, /, \\)
QMAKE_PRE_LINK += $$QMAKE_COPY $$DllSrc $$DllDst
}else{
LIBS += -L$$PWD/../../lib/win32 -lViewLink
DESTDIR =$$PWD/bin/win32
DllSrc = $$PWD/../../bin/win32/*.dll
DllSrc = $$replace(DllSrc, /, \\)
DllDst = $$replace(DESTDIR, /, \\)
QMAKE_PRE_LINK += $$QMAKE_COPY $$DllSrc $$DllDst
}
}
linux{
contains(QT_ARCH, x86_64){
DESTDIR =$$PWD/bin/linux-x86_64
LIBS += -L$$DESTDIR -lViewLink
QMAKE_PRE_LINK += $$QMAKE_COPY $$PWD/../../bin/linux-x86_64/*.so $$DESTDIR
}
contains(QT_ARCH, aarch64){
DESTDIR =$$PWD/bin/linux-aarch64
LIBS += -L$$DESTDIR -lViewLink
QMAKE_PRE_LINK += $$QMAKE_COPY $$PWD/../../bin/linux-aarch64/*.so $$DESTDIR
}
}

@ -1,314 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.11.0, 2021-12-20T17:29:42. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{6881d35e-0f46-4e0e-ba9d-4d4c39001271}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap"/>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.9.9 GCC 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.9.9 GCC 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.599.gcc_64_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/dreamsky/SourceCode/SDK/demo/build-demo_for_linux-Cal-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/dreamsky/SourceCode/SDK/demo/build-demo_for_linux-Cal-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/dreamsky/SourceCode/SDK/demo/build-demo_for_linux-Cal-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
<value type="QString">cpu-cycles</value>
</valuelist>
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
<value type="int" key="Analyzer.Perf.Frequency">250</value>
<valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
<value type="QString">-e</value>
<value type="QString">cpu-cycles</value>
<value type="QString">--call-graph</value>
<value type="QString">dwarf,4096</value>
<value type="QString">-F</value>
<value type="QString">250</value>
</valuelist>
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/dreamsky/SourceCode/SDK/demo/demo_for_linux/demo_for_linux.pro</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/dreamsky/SourceCode/SDK/demo/demo_for_linux/demo_for_linux.pro</value>
<value type="QString" key="RunConfiguration.Arguments"></value>
<value type="bool" key="RunConfiguration.Arguments.multi">false</value>
<value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/dreamsky/SourceCode/SDK/demo/demo_for_linux/bin/linux-x86_64</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">22</value>
</data>
<data>
<variable>Version</variable>
<value type="int">22</value>
</data>
</qtcreator>

@ -1,226 +0,0 @@
#include <iostream>
#include <string>
#include <mutex>
#include <chrono>
#include <thread>
using namespace std;
#include "../../inc/ViewLink.h"
#include "cmdline.h"
bool g_bConnected = false;
int VLK_ConnStatusCallback(int iConnStatus, const char* szMessage, int iMsgLen, void* pUserParam)
{
if (VLK_CONN_STATUS_TCP_CONNECTED == iConnStatus)
{
cout << "TCP Gimbal connected !!!" << endl;
g_bConnected = true;
}
else if (VLK_CONN_STATUS_TCP_DISCONNECTED == iConnStatus)
{
cout << "TCP Gimbal disconnected !!!" << endl;
g_bConnected = false;
}
else if (VLK_CONN_STATUS_SERIAL_PORT_CONNECTED == iConnStatus)
{
cout << "serial port connected !!!" << endl;
g_bConnected = true;
}
else if (VLK_CONN_STATUS_SERIAL_PORT_DISCONNECTED == iConnStatus)
{
cout << "serial port disconnected !!!" << endl;
g_bConnected = false;
}
else
{
cout << "unknown connection stauts: " << iConnStatus << endl;
g_bConnected = false;
}
return 0;
}
int VLK_DevStatusCallback(int iType, const char* szBuffer, int iBufLen, void* pUserParam)
{
if (VLK_DEV_STATUS_TYPE_MODEL == iType)
{
VLK_DEV_MODEL* pModel = (VLK_DEV_MODEL*)szBuffer;
cout << "model code: " << pModel->cModelCode << ", model name: " << pModel->szModelName << endl;
}
else if (VLK_DEV_STATUS_TYPE_CONFIG == iType)
{
VLK_DEV_CONFIG* pDevConfig = (VLK_DEV_CONFIG*)szBuffer;
cout << "VersionNO: " << pDevConfig->cVersionNO << ", DeviceID: " << pDevConfig->cDeviceID << ", SerialNO: " << pDevConfig->cSerialNO << endl;
}
else if (VLK_DEV_STATUS_TYPE_TELEMETRY == iType)
{
/*
* once device is connected, telemetry information will keep updating,
* in order to avoid disturbing user input, comment out printing telemetry information
*/
// VLK_DEV_TELEMETRY* pTelemetry = (VLK_DEV_TELEMETRY*)szBuffer;
// cout << "Yaw: " << pTelemetry->dYaw << ", Pitch: " << pTelemetry->dPitch << ", sensor type: " << pTelemetry->emSensorType << ", Zoom mag times: " << pTelemetry->sZoomMagTimes << endl;
}
else
{
cout << "error: unknown status type: " << iType << endl;
}
return 0;
}
int main(int argc, char *argv[])
{
// parse cmd line
cmdline::parser a;
a.add<string>("type", 't', "connection type", true, "tcp", cmdline::oneof<string>("serial", "tcp"));
a.add<string>("ip", 'i', "gimbal tcp ip", false, "192.168.2.119");
a.add<int>("port", 'p', "gimbal tcp port", false, 2000);
a.add<string>("serial", 's', "serial port name", false, "/dev/ttyS0");
a.add<int>("baudrate", 'b', "serial port baudrate", false, 115200);
a.parse_check(argc, argv);
// print sdk version
cout << "ViewLink SDK version: " << GetSDKVersion() << endl;
// initialize sdk
int iRet = VLK_Init();
if (VLK_ERROR_NO_ERROR != iRet)
{
cout << "VLK_Init failed, error: " << iRet << endl;
return -1;
}
// register device status callback
VLK_RegisterDevStatusCB(VLK_DevStatusCallback, NULL);
// connect device
if (0 == a.get<string>("type").compare("tcp"))
{
VLK_CONN_PARAM param;
memset(&param, 0, sizeof(param));
param.emType = VLK_CONN_TYPE_TCP;
strncpy(param.ConnParam.IPAddr.szIPV4, a.get<string>("ip").c_str(), sizeof(param.ConnParam.IPAddr.szIPV4) - 1);
param.ConnParam.IPAddr.iPort = a.get<int>("port");
cout << "connecting gimbal ip: " << a.get<string>("ip") << ", port: " << a.get<int>("port") << "..." << endl;
iRet = VLK_Connect(&param, VLK_ConnStatusCallback, NULL);
if (VLK_ERROR_NO_ERROR != iRet)
{
cout << "VLK_Connect failed, error: " << iRet << endl;
goto quit;
}
}
else if (0 == a.get<string>("type").compare("serial"))
{
VLK_CONN_PARAM param;
memset(&param, 0, sizeof(param));
param.emType = VLK_CONN_TYPE_SERIAL_PORT;
strncpy(param.ConnParam.SerialPort.szSerialPortName, a.get<string>("serial").c_str(), sizeof(param.ConnParam.SerialPort.szSerialPortName) - 1);
param.ConnParam.SerialPort.iBaudRate = a.get<int>("baudrate");
cout << "connecting gimbal serial: " << a.get<string>("serial") << ", baudrate: " << a.get<int>("baudrate") << "..." << endl;
iRet = VLK_Connect(&param, VLK_ConnStatusCallback, NULL);
if (VLK_ERROR_NO_ERROR != iRet)
{
cout << "VLK_Connect failed, error: " << iRet << endl;
goto quit;
}
}
else
{
cout << "unknown conntion type !!!" << endl;
goto quit;
}
cout << "wait device connected..." << endl;
while (1)
{
if (g_bConnected)
{
break;
}
std::this_thread::sleep_for(std::chrono::milliseconds(500));
}
while (1)
{
cout << "press \'w\' move up \n";
cout << "press \'s\' move down \n";
cout << "press \'a\' move left \n";
cout << "press \'d\' move right \n";
cout << "press \'h\' move to home posiion \n";
cout << "press \'1\' zoom in, \'2\' zoom out\n";
cout << "press \'3\' begin track, \'4\' stop track\n";
cout << "press \'c\' exit"<< endl;
char input;
cin >> input;
if (input == 'w' || input == 'W')
{
VLK_Move(0, 1000);
std::this_thread::sleep_for(std::chrono::milliseconds(3000));
VLK_Stop();
}
else if (input == 's' || input == 'S')
{
VLK_Move(0, -1000);
std::this_thread::sleep_for(std::chrono::milliseconds(3000));
VLK_Stop();
}
else if (input == 'a' || input == 'A')
{
VLK_Move(-1000, 0);
std::this_thread::sleep_for(std::chrono::milliseconds(3000));
VLK_Stop();
}
else if (input == 'd' || input == 'D')
{
VLK_Move(1000, 0);
std::this_thread::sleep_for(std::chrono::milliseconds(3000));
VLK_Stop();
}
else if (input == 'h' || input == 'H')
{
VLK_Home();
}
else if (input == '1')
{
VLK_ZoomIn(4);
std::this_thread::sleep_for(std::chrono::milliseconds(3000));
VLK_StopZoom();
}
else if (input == '2')
{
VLK_ZoomOut(4);
std::this_thread::sleep_for(std::chrono::milliseconds(3000));
VLK_StopZoom();
}
else if (input == '3')
{
VLK_TRACK_MODE_PARAM param;
memset(&param, 0, sizeof(param));
param.emTrackSensor = VLK_SENSOR_VISIBLE1;
param.emTrackTempSize = VLK_TRACK_TEMPLATE_SIZE_AUTO;
VLK_TrackTargetPositionEx(&param, 100, 100, 1280, 720);
}
else if (input == '4')
{
VLK_DisableTrackMode();
}
else if (input == 'c' || input == 'C')
{
break;
}
std::this_thread::sleep_for(std::chrono::milliseconds(50));
}
quit:
// uninitial sdk
VLK_UnInit();
system("PAUSE");
return 0;
}

@ -1,122 +0,0 @@
debug:[ViewLink.cpp][57][VLK_Init]########### ViewLink SDK 3.4.7 initialized ###########
debug:[ViewLink.cpp][145][VLK_RegisterDevStatusCB]VLK_RegisterDevStatusCB
debug:[ViewLink.cpp][113][VLK_IsSerialPortConnected]VLK_IsSerialPortConnected
debug:[ViewLink.cpp][107][VLK_IsTCPConnected]VLK_IsTCPConnected
debug:[ViewLink.cpp][75][VLK_Connect]VLK_Connect
debug:[TCPConnection.cpp][161][SocketCallback]TCP Gimbal Connected !!!!!!!!!!!!
debug:[DeviceConnection.cpp][1454][ProcSayHelloResponse]current connected device type: TIR
debug:[DeviceConnection.cpp][1514][ProcSayHelloResponse]hand shake success! enjoy !!!
debug:[ViewLink.cpp][176][VLK_ZoomIn]VLK_ZoomIn
debug:[ViewLink.cpp][176][VLK_ZoomIn]VLK_ZoomIn
debug:[ViewLink.cpp][186][VLK_ZoomOut]VLK_ZoomOut
debug:[ViewLink.cpp][186][VLK_ZoomOut]VLK_ZoomOut
debug:[ViewLink.cpp][196][VLK_StopZoom]VLK_StopZoom
debug:[ViewLink.cpp][119][VLK_Disconnect]VLK_Disconnect
debug:[ViewLink.cpp][119][VLK_Disconnect]VLK_Disconnect
debug:[ViewLink.cpp][64][VLK_UnInit]########### ViewLink SDK 3.4.7 uninitialized ###########
debug:[ViewLink.cpp][57][VLK_Init]########### ViewLink SDK 3.4.7 initialized ###########
debug:[ViewLink.cpp][145][VLK_RegisterDevStatusCB]VLK_RegisterDevStatusCB
debug:[ViewLink.cpp][113][VLK_IsSerialPortConnected]VLK_IsSerialPortConnected
debug:[ViewLink.cpp][107][VLK_IsTCPConnected]VLK_IsTCPConnected
debug:[ViewLink.cpp][75][VLK_Connect]VLK_Connect
debug:[TCPConnection.cpp][161][SocketCallback]TCP Gimbal Connected !!!!!!!!!!!!
debug:[DeviceConnection.cpp][1454][ProcSayHelloResponse]current connected device type: TIR
debug:[DeviceConnection.cpp][1514][ProcSayHelloResponse]hand shake success! enjoy !!!
debug:[ViewLink.cpp][302][VLK_Home]VLK_Home
debug:[ViewLink.cpp][119][VLK_Disconnect]VLK_Disconnect
debug:[ViewLink.cpp][119][VLK_Disconnect]VLK_Disconnect
debug:[ViewLink.cpp][64][VLK_UnInit]########### ViewLink SDK 3.4.7 uninitialized ###########
debug:[ViewLink.cpp][57][VLK_Init]########### ViewLink SDK 3.4.7 initialized ###########
debug:[ViewLink.cpp][145][VLK_RegisterDevStatusCB]VLK_RegisterDevStatusCB
debug:[ViewLink.cpp][113][VLK_IsSerialPortConnected]VLK_IsSerialPortConnected
debug:[ViewLink.cpp][107][VLK_IsTCPConnected]VLK_IsTCPConnected
debug:[ViewLink.cpp][75][VLK_Connect]VLK_Connect
debug:[TCPConnection.cpp][161][SocketCallback]TCP Gimbal Connected !!!!!!!!!!!!
debug:[DeviceConnection.cpp][1454][ProcSayHelloResponse]current connected device type: TIR
debug:[DeviceConnection.cpp][1514][ProcSayHelloResponse]hand shake success! enjoy !!!
debug:[ViewLink.cpp][248][VLK_TrackTargetPositionEx]VLK_TrackTargetPositionEx
debug:[ViewLink.cpp][248][VLK_TrackTargetPositionEx]VLK_TrackTargetPositionEx
debug:[ViewLink.cpp][248][VLK_TrackTargetPositionEx]VLK_TrackTargetPositionEx
debug:[ViewLink.cpp][302][VLK_Home]VLK_Home
debug:[ViewLink.cpp][408][VLK_SetImageColor]VLK_SetImageColor
debug:[ViewLink.cpp][408][VLK_SetImageColor]VLK_SetImageColor
debug:[ViewLink.cpp][302][VLK_Home]VLK_Home
debug:[ViewLink.cpp][248][VLK_TrackTargetPositionEx]VLK_TrackTargetPositionEx
debug:[ViewLink.cpp][248][VLK_TrackTargetPositionEx]VLK_TrackTargetPositionEx
debug:[ViewLink.cpp][248][VLK_TrackTargetPositionEx]VLK_TrackTargetPositionEx
debug:[ViewLink.cpp][57][VLK_Init]########### ViewLink SDK 3.4.7 initialized ###########
debug:[ViewLink.cpp][145][VLK_RegisterDevStatusCB]VLK_RegisterDevStatusCB
debug:[ViewLink.cpp][107][VLK_IsTCPConnected]VLK_IsTCPConnected
debug:[ViewLink.cpp][113][VLK_IsSerialPortConnected]VLK_IsSerialPortConnected
debug:[ViewLink.cpp][75][VLK_Connect]VLK_Connect
debug:[ViewLink.cpp][57][VLK_Init]########### ViewLink SDK 3.4.7 initialized ###########
debug:[ViewLink.cpp][145][VLK_RegisterDevStatusCB]VLK_RegisterDevStatusCB
debug:[ViewLink.cpp][408][VLK_SetImageColor]VLK_SetImageColor
debug:[ViewLink.cpp][408][VLK_SetImageColor]VLK_SetImageColor
debug:[ViewLink.cpp][408][VLK_SetImageColor]VLK_SetImageColor
debug:[ViewLink.cpp][113][VLK_IsSerialPortConnected]VLK_IsSerialPortConnected
debug:[ViewLink.cpp][107][VLK_IsTCPConnected]VLK_IsTCPConnected
debug:[ViewLink.cpp][75][VLK_Connect]VLK_Connect
debug:[TCPConnection.cpp][171][SocketCallback]YEK_CONNECT_RESPONSE event->status() == 110
debug:[ViewLink.cpp][57][VLK_Init]########### ViewLink SDK 3.4.7 initialized ###########
debug:[ViewLink.cpp][145][VLK_RegisterDevStatusCB]VLK_RegisterDevStatusCB
debug:[ViewLink.cpp][408][VLK_SetImageColor]VLK_SetImageColor
debug:[ViewLink.cpp][408][VLK_SetImageColor]VLK_SetImageColor
debug:[ViewLink.cpp][408][VLK_SetImageColor]VLK_SetImageColor
debug:[ViewLink.cpp][408][VLK_SetImageColor]VLK_SetImageColor
debug:[ViewLink.cpp][408][VLK_SetImageColor]VLK_SetImageColor
debug:[ViewLink.cpp][408][VLK_SetImageColor]VLK_SetImageColor
debug:[ViewLink.cpp][408][VLK_SetImageColor]VLK_SetImageColor
debug:[ViewLink.cpp][302][VLK_Home]VLK_Home
debug:[ViewLink.cpp][119][VLK_Disconnect]VLK_Disconnect
debug:[ViewLink.cpp][119][VLK_Disconnect]VLK_Disconnect
debug:[ViewLink.cpp][64][VLK_UnInit]########### ViewLink SDK 3.4.7 uninitialized ###########
debug:[ViewLink.cpp][57][VLK_Init]########### ViewLink SDK 3.4.7 initialized ###########
debug:[ViewLink.cpp][145][VLK_RegisterDevStatusCB]VLK_RegisterDevStatusCB
debug:[ViewLink.cpp][119][VLK_Disconnect]VLK_Disconnect
debug:[ViewLink.cpp][119][VLK_Disconnect]VLK_Disconnect
debug:[ViewLink.cpp][64][VLK_UnInit]########### ViewLink SDK 3.4.7 uninitialized ###########
debug:[ViewLink.cpp][57][VLK_Init]########### ViewLink SDK 3.4.7 initialized ###########
debug:[ViewLink.cpp][145][VLK_RegisterDevStatusCB]VLK_RegisterDevStatusCB
debug:[ViewLink.cpp][119][VLK_Disconnect]VLK_Disconnect
debug:[ViewLink.cpp][119][VLK_Disconnect]VLK_Disconnect
debug:[ViewLink.cpp][64][VLK_UnInit]########### ViewLink SDK 3.4.7 uninitialized ###########
debug:[ViewLink.cpp][57][VLK_Init]########### ViewLink SDK 3.4.7 initialized ###########
debug:[ViewLink.cpp][145][VLK_RegisterDevStatusCB]VLK_RegisterDevStatusCB
debug:[ViewLink.cpp][119][VLK_Disconnect]VLK_Disconnect
debug:[ViewLink.cpp][119][VLK_Disconnect]VLK_Disconnect
debug:[ViewLink.cpp][64][VLK_UnInit]########### ViewLink SDK 3.4.7 uninitialized ###########
debug:[ViewLink.cpp][57][VLK_Init]########### ViewLink SDK 3.4.7 initialized ###########
debug:[ViewLink.cpp][145][VLK_RegisterDevStatusCB]VLK_RegisterDevStatusCB
debug:[ViewLink.cpp][302][VLK_Home]VLK_Home
debug:[ViewLink.cpp][57][VLK_Init]########### ViewLink SDK 3.4.7 initialized ###########
debug:[ViewLink.cpp][145][VLK_RegisterDevStatusCB]VLK_RegisterDevStatusCB
debug:[ViewLink.cpp][176][VLK_ZoomIn]VLK_ZoomIn
debug:[ViewLink.cpp][176][VLK_ZoomIn]VLK_ZoomIn
debug:[ViewLink.cpp][176][VLK_ZoomIn]VLK_ZoomIn
debug:[ViewLink.cpp][176][VLK_ZoomIn]VLK_ZoomIn
debug:[ViewLink.cpp][186][VLK_ZoomOut]VLK_ZoomOut
debug:[ViewLink.cpp][186][VLK_ZoomOut]VLK_ZoomOut
debug:[ViewLink.cpp][186][VLK_ZoomOut]VLK_ZoomOut
debug:[ViewLink.cpp][186][VLK_ZoomOut]VLK_ZoomOut
debug:[ViewLink.cpp][176][VLK_ZoomIn]VLK_ZoomIn
debug:[ViewLink.cpp][176][VLK_ZoomIn]VLK_ZoomIn
debug:[ViewLink.cpp][176][VLK_ZoomIn]VLK_ZoomIn
debug:[ViewLink.cpp][176][VLK_ZoomIn]VLK_ZoomIn
debug:[ViewLink.cpp][186][VLK_ZoomOut]VLK_ZoomOut
debug:[ViewLink.cpp][186][VLK_ZoomOut]VLK_ZoomOut
debug:[ViewLink.cpp][186][VLK_ZoomOut]VLK_ZoomOut
debug:[ViewLink.cpp][186][VLK_ZoomOut]VLK_ZoomOut
debug:[ViewLink.cpp][176][VLK_ZoomIn]VLK_ZoomIn
debug:[ViewLink.cpp][176][VLK_ZoomIn]VLK_ZoomIn
debug:[ViewLink.cpp][176][VLK_ZoomIn]VLK_ZoomIn
debug:[ViewLink.cpp][176][VLK_ZoomIn]VLK_ZoomIn
debug:[ViewLink.cpp][196][VLK_StopZoom]VLK_StopZoom
debug:[ViewLink.cpp][119][VLK_Disconnect]VLK_Disconnect
debug:[ViewLink.cpp][119][VLK_Disconnect]VLK_Disconnect
debug:[ViewLink.cpp][64][VLK_UnInit]########### ViewLink SDK 3.4.7 uninitialized ###########
debug:[ViewLink.cpp][57][VLK_Init]########### ViewLink SDK 3.4.7 initialized ###########
debug:[ViewLink.cpp][145][VLK_RegisterDevStatusCB]VLK_RegisterDevStatusCB
debug:[ViewLink.cpp][119][VLK_Disconnect]VLK_Disconnect
debug:[ViewLink.cpp][119][VLK_Disconnect]VLK_Disconnect
debug:[ViewLink.cpp][64][VLK_UnInit]########### ViewLink SDK 3.4.7 uninitialized ###########

@ -1,23 +0,0 @@
QMAKE_CXX.QT_COMPILER_STDCXX = 201703L
QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 11
QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 4
QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 0
QMAKE_CXX.COMPILER_MACROS = \
QT_COMPILER_STDCXX \
QMAKE_GCC_MAJOR_VERSION \
QMAKE_GCC_MINOR_VERSION \
QMAKE_GCC_PATCH_VERSION
QMAKE_CXX.INCDIRS = \
/usr/include/c++/11 \
/usr/include/x86_64-linux-gnu/c++/11 \
/usr/include/c++/11/backward \
/usr/lib/gcc/x86_64-linux-gnu/11/include \
/usr/local/include \
/usr/include/x86_64-linux-gnu \
/usr/include
QMAKE_CXX.LIBDIRS = \
/usr/lib/gcc/x86_64-linux-gnu/11 \
/usr/lib/x86_64-linux-gnu \
/usr/lib \
/lib/x86_64-linux-gnu \
/lib

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save