| | |
| | | |
| | | delegateInfoStr.Append("/").Append("封单").Append(delegateInfo.buy1_money); |
| | | |
| | | delegateInfoStr.Append(" 【比例: "); |
| | | delegateInfoStr.Append(" 【排: "); |
| | | |
| | | ColorIndexInfo colorInfo2; |
| | | colorInfo2.start_index = delegateInfoStr.Length(); |
| | |
| | | colorInfo2.end_index = delegateInfoStr.Length() - 1; |
| | | colorInfo2.color = wxColor(206, 14, 95); |
| | | delegateColors.push_back(colorInfo2); |
| | | |
| | | delegateInfoStr.Append(",撤:"); |
| | | |
| | | ColorIndexInfo colorInfo22; |
| | | colorInfo22.start_index = delegateInfoStr.Length(); |
| | | delegateInfoStr.Append(delegateInfo.l_down_cancel_rate); |
| | | colorInfo22.end_index = delegateInfoStr.Length() - 1; |
| | | colorInfo22.color = wxColor(0, 230, 0); |
| | | delegateColors.push_back(colorInfo22); |
| | | |
| | | delegateInfoStr.Append(",期:"); |
| | | |
| | | delegateInfoStr.Append(delegateInfo.expire_rate); |
| | | |
| | | delegateInfoStr.Append("】,"); |
| | | |
| | | delegateInfoStr.Append("已成大单").Append(to_string(delegateInfo.big_num_count)).Append("笔").Append(delegateInfo.big_num_money).Append(" "); |
| | |
| | | |
| | | // 绘制简介区 |
| | | int infoWidth = cell.GetSize().GetWidth(); |
| | | |
| | | wxFont font = dc->GetFont(); |
| | | font.SetPointSize(10); |
| | | dc->SetFont(font); |
| | | |
| | | int infoHeight = WidgetsRenderUtil::drawText(dc, delegateInfoStr, wxPoint(start_x, start_y + 25 * DPI / 100), infoWidth, TEXT_LINE_HEIGHT, delegateColors); |
| | | // 绘制队列,给文字信息留3排左右的位置 |
| | | |
| | |
| | | SendMessage(hwnd, WM_USER + 1024, 0, reinterpret_cast<LPARAM>(&data)); |
| | | } |
| | | } |
| | | else { |
| | | throw CString(L"没找到盘副屏窗口"); |
| | | } |
| | | } |
| | | catch (CString msg) { |
| | | } |
| | | catch (...) { |
| | | } |
| | |
| | | list<DelegateInfo> fresults; |
| | | wxString available_money = ""; |
| | | auto doc = JsonUtil::parseUTF16(result); |
| | | if (doc.IsObject() && doc[L"code"].GetInt() == 0) { |
| | | if (doc.IsObject() && doc[L"code"].GetInt() == 0&& doc.HasMember(L"data")&& doc[L"data"].HasMember(L"delegates")) { |
| | | auto root = doc[L"data"].GetObject(); |
| | | auto delegates = root[L"delegates"].GetArray(); |
| | | double money = root[L"account_available_money"].GetDouble(); |
| | | double money = 0.0; |
| | | if (root.HasMember(L"account_available_money")) { |
| | | money = root[L"account_available_money"].GetDouble(); |
| | | } |
| | | available_money = StringUtil::to_string(money); |
| | | for (int i = 0; i < delegates.Size(); i++) { |
| | | auto doc = delegates[i].GetObject(); |
| | | |
| | | auto array = doc[L"code_info"].GetArray(); |
| | | DelegateInfo delegateInfo; |
| | | delegateInfo.index = i; |
| | |
| | | delegateInfo.limit_up_time = doc[L"limit_up_time"].GetString(); |
| | | } |
| | | |
| | | array = doc[L"trade_queue"].GetArray(); |
| | | if (doc.HasMember(L"l_down_cancel_rate")) { |
| | | wxString st = StringUtil::to_string(doc[L"l_down_cancel_rate"].GetFloat() * 100); |
| | | st.Append(L"%"); |
| | | delegateInfo.l_down_cancel_rate = st; |
| | | } |
| | | |
| | | if (doc.HasMember(L"expire_rate")) { |
| | | wxString st = doc[L"expire_rate"].GetString(); |
| | | delegateInfo.expire_rate = st; |
| | | } |
| | | |
| | | |
| | | list<TradeQueue> queueList; |
| | | for (int j = 0; j < array.Size(); j++) { |
| | | int num = array[j].GetArray()[0].GetInt(); |
| | | int type = array[j].GetArray()[1].GetInt(); |
| | | queueList.push_back(TradeQueue({ to_string(num),type })); |
| | | if (doc.HasMember(L"trade_queue")) { |
| | | array = doc[L"trade_queue"].GetArray(); |
| | | for (int j = 0; j < array.Size(); j++) { |
| | | int num = array[j].GetArray()[0].GetInt(); |
| | | int type = array[j].GetArray()[1].GetInt(); |
| | | queueList.push_back(TradeQueue({ to_string(num),type })); |
| | | } |
| | | } |
| | | delegateInfo.tradeQueueList = queueList; |
| | | |
| | |
| | | //cout << "刷新UI耗时:" << TimeUtil::getNowTimeStamp() - start_time << endl; |
| | | } |
| | | } |
| | | catch (string st) { |
| | | |
| | | catch (... ) { |
| | | } |
| | | |
| | | } |
| | | |
| | | void MainFrame::OnSelectionChanged(wxDataViewEvent& event) |