Giter Club home page Giter Club logo

pcbig's Introduction

大智慧舵手版

大智慧舵手版是上海大智慧股份有限公司推出新一代的行情软件,依托于大智慧云平台提供的行情服务,是一套轻、快、精的跨平台的轻客户端软件。

下载体验大智慧舵手版

环境准备

1、开发工具

在Windows中需要下载并安装VS Express 2013 for Desktop以及qt-opensource-windows-x86-msvc2013-5.7.0。如果你需要调试,还需要根据你的操作系统环境下载安装wdksetup.exe

在macOS中只需要安装qt-opensource-mac-x64-clang-5.7.0即可。

2、Protobuf的编译

  1. 在Windows系统中使用Microsoft Visual C++编译方式详见https://github.com/google/protobuf/blob/master/cmake/README.md

    为了顺利完成Protobuf的编译,需要先安装VS Express 2013 for Desktop。 生成x86目标平台的VS Solution的cmake的参数是cmake -G "Visual Studio 12 2013",加Win64表示支持64位系统。
    同时需要在VS的Solution的Properties->Configuration Properties->C/C++->Code Generation->Runtime Library设置为/MD(release)/MDd(debug)。

  2. 在Unix(macOS)系统中编译,详见https://github.com/google/protobuf/blob/master/src/README.md

发布部署

部署时需要用到的相关文件均已放在Deployment文件夹中。

  • dzhyun.ini。相关功能的配置说明
[DzhYun]  
yuntype=1 //1是alpha,2是beta      
service=10.15.208.66 //服务器地址    
isNoCompress=1 //0请求数据是压缩数据,1数据未压缩  
heartTime=3 //websocket心跳时间,秒 
threadCount=10 //数据处理线程个数    
checkUpdateInterval=24 //检查升级间隔,小时
[WEB]
webHost=10.15.208.88  //web页面相关服务地址   
[DzhLog]    
isOutputLogToFile=1 //是否输出日志到文件     
logOutputLevel=2 //0-4 (debug,warning,critical,fatal,info)日志级别  
[DzhClient]     
isSoftwareOpenGL=0 //浏览器兼容配置,默认为0,有问题调成1
  • PDFViewer 放的是mozilla/pdf.js这个PDF预览组件,需要和最终生成的QDzh3.exe放在相同目录中(Mac版,则需要放在QDZH3.app/Contents/Resources中)。
  • libEGL.dlllibGLESV2.dlllibGLESV2.dll这三个dll使用的是Qt5.6中带的库,5.7的版本会是程序在运行时有明细的黑屏情况。
  • msvcp120.dllmsvcp120.dll为Windows系统中所需的VC++的运行库。

由于QtCreator在Windows中的Debug速度很慢,基本都在Release中进行开发,故将在Windows中部署单独使用脚本处理:

C:\Qt\Qt5.7.0\5.7\msvc2013\bin\windeployqt.exe -qmldir C:\Qt\Qt5.7.0\5.7\msvc2013\qml QDzh3.exe

由于Qt的部署工具还未完善,上述命令处理后,除了需要Deployment中需要的文件之外,还需要手动从C:\Qt\Qt5.7.0\5.7\msvc2013\qmlQtWebEngineQtQuickQtGraphicalEffects这三个文件复制到部署目录中(完全覆盖即可)。更多内容详见官方文档windows-deployment
macOS中部署相对简单些。首先在QtCreator的项目Release版本的设置中增加自定义构建步骤,具体方法详见Qt官方文档osx-deployment,同时也需要手工复制源码下的QtGraphicalEffectsQtWebEngineQDZH3.app/Contents/Resources/qml中。更多发布操作参见Apple官方文档App Distribution Quick Start

授权

客户端的数据均来自大智慧金融信息云,要让客户端能够正确展示行情,首先需要获取大智慧金融信息云的相关授权,将获取到的appid和secretkey替换generatetoken.cpp中对应字段即可

void GenerateToken::init()
{
    QDateTime date;
    date = date.currentDateTime();
    this->token_expired_time = date.toTime_t();

    int mType = ConfigureSetting::getInstance()->getDzhYunType();
    qInfo()<< "DzhYun/yuntype:"<< mType;
    if(mType == 1){
        //alpha环境
        this->appid = "xxxxxxxxxxxxxxxxxxxxxxxxxxx";
        this->secret_key = "xxxxxxxxxxxx";
        this->short_id = "0000000x";

    } else if(mType == 2){
        //beta环境
        this->appid = "xxxxxxxxxxxxxxxxxxxxxxxxxxx";
        this->secret_key = "xxxxxxxxxxxx";
        this->short_id = "0000000x";
    } else{
        //外网环境
        this->appid = "xxxxxxxxxxxxxxxxxxxxxxxxxxx";
        this->secret_key = "xxxxxxxxxxxx";
        this->short_id = "0000000x";
    }
    //有效期1天
    this->token_expired_time = date.toTime_t() + 86400;
    this->expired_time.setNum(this->token_expired_time);

    this->calculateToken();
}

登录

目前已实现支持大智慧账号、QQ以及微信账号的登录,开源版本中账号相关部分已使用模拟数据(可以通过搜索"TODO 账号"定位相关逻辑)替换,任意账号均可登录。如果需要接入自己的账号系统,请根据自身的业务规则修改对应的流程

pcbig's People

Contributors

elsejj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.