Ejemplo n.º 1
0
void GatewayMgr::start(QString password)
{
    g_sm->checkCurrentOn(ServiceMgr::LOGIC);

    // check
    if (mdsm_ != nullptr || tdsm_ != nullptr) {
        BfDebug("mdsm_!= nullptr || tdsm_ != nullptr");
        return;
    }

    // init mdsm
    password_ = password;

    if (!initMdSm()) {
        return;
    }

    if (!initTdSm()) {
        delete mdsm_;
        mdsm_ = nullptr;
        return;
    }

    startMdSm();
    startTdSm();
    return;
}
Ejemplo n.º 2
0
void CtpMgr::tryStartSubscrible()
{
    if (mdsm_logined_ && tdsm_logined_) {
        tdsm_->queryInstrument();
    }
    if (tdsm_ == nullptr) {
        if(!initTdSm()){
            qFatal("initTdSm == false");
        }
        startTdSm();
    }
}
Ejemplo n.º 3
0
void GatewayMgr::tryStartSubscrible()
{
    g_sm->checkCurrentOn(ServiceMgr::LOGIC);

    if (mdsm_logined_ && tdsm_logined_) {
        emit tradeWillBegin();
        //函数开始执行时候才resetData
        tdsm_->queryInstrument(1000);
    }
    if (tdsm_ == nullptr) {
        if (!initTdSm()) {
            qFatal("initTdSm == false");
        }
        startTdSm();
    }
}
Ejemplo n.º 4
0
bool CtpMgr::start(QString password)
{
    // check
    if (mdsm_ != nullptr || tdsm_ != nullptr) {
        qFatal("mdsm_!= nullptr || tdsm_ != nullptr");
    }

    // init mdsm
    password_ = password;

    if (!initMdSm()) {
        return false;
    }

    if (!initTdSm()) {
        delete mdsm_;
        mdsm_ = nullptr;
        return false;
    }

    startMdSm();
    startTdSm();
    return true;
}