|
@@ -4,8 +4,8 @@
|
|
#include "stdafx.h"
|
|
#include "stdafx.h"
|
|
#include "SATHelper.h"
|
|
#include "SATHelper.h"
|
|
#include "DeviceView.h"
|
|
#include "DeviceView.h"
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+#include "MainFrm.h"
|
|
|
|
+extern CMainFrame* g_pMainFrame;
|
|
// CDeviceView
|
|
// CDeviceView
|
|
|
|
|
|
IMPLEMENT_DYNCREATE(CDeviceView, CFormView)
|
|
IMPLEMENT_DYNCREATE(CDeviceView, CFormView)
|
|
@@ -13,7 +13,7 @@ IMPLEMENT_DYNCREATE(CDeviceView, CFormView)
|
|
CDeviceView::CDeviceView()
|
|
CDeviceView::CDeviceView()
|
|
: CFormView(DLG_DEVICEMANAGER)
|
|
: CFormView(DLG_DEVICEMANAGER)
|
|
{
|
|
{
|
|
-
|
|
|
|
|
|
+ ReadBaiduCfg(m_bdcfg);
|
|
}
|
|
}
|
|
|
|
|
|
CDeviceView::~CDeviceView()
|
|
CDeviceView::~CDeviceView()
|
|
@@ -59,11 +59,63 @@ void CDeviceView::Dump(CDumpContext& dc) const
|
|
// CDeviceView 消息处理程序
|
|
// CDeviceView 消息处理程序
|
|
|
|
|
|
|
|
|
|
|
|
+void CDeviceView::ReadBaiduCfg(BaiduCfg& bdcfg)
|
|
|
|
+{
|
|
|
|
+ TCHAR szValue[MAX_PATH] = {0};
|
|
|
|
+ TCHAR szBuffer[1024] = { 0 };
|
|
|
|
+ _stprintf_s(m_szBaiduCfgPath, _T("%s%s"), Global::g_szPython27Dir, _T("Lib\\site-packages\\ssat_sdk\\config\\baidu.cfg"));
|
|
|
|
+
|
|
|
|
+ GetPrivateProfileString(_T("CurStatus"), _T("Cur_Count"), NULL, szValue, MAX_PATH, m_szBaiduCfgPath);
|
|
|
|
+ bdcfg.cur_count = szValue;
|
|
|
|
+
|
|
|
|
+ GetPrivateProfileString(_T("CurStatus"), _T("Reset_Time"), NULL, szValue, MAX_PATH, m_szBaiduCfgPath);
|
|
|
|
+ bdcfg.reset_time = szValue;
|
|
|
|
+
|
|
|
|
+ // 读取所有Section值;
|
|
|
|
+ DWORD dwLen = GetPrivateProfileString(NULL, NULL, NULL, szBuffer, 1024, m_szBaiduCfgPath);
|
|
|
|
+ for ( int i = 0, j = 0; i < dwLen; i++ )
|
|
|
|
+ {
|
|
|
|
+ if ( szBuffer[i] == '\0' )
|
|
|
|
+ {
|
|
|
|
+ TCHAR szData[MAX_PATH] = {0};
|
|
|
|
+ memcpy(szData, &szBuffer[j], i-j);
|
|
|
|
+ if ( _tcsicmp(szData, _T("CurStatus")) )
|
|
|
|
+ {
|
|
|
|
+ CountInfo countInfo;
|
|
|
|
+ GetPrivateProfileString(szData, _T("APP_ID"), NULL, szValue, MAX_PATH, m_szBaiduCfgPath);
|
|
|
|
+ countInfo.app_id = szValue;
|
|
|
|
+
|
|
|
|
+ GetPrivateProfileString(szData, _T("API_KEY"), NULL, szValue, MAX_PATH, m_szBaiduCfgPath);
|
|
|
|
+ countInfo.api_key = szValue;
|
|
|
|
+
|
|
|
|
+ GetPrivateProfileString(szData, _T("SECRET_KEY"), NULL, szValue, MAX_PATH, m_szBaiduCfgPath);
|
|
|
|
+ countInfo.secret_key = szValue;
|
|
|
|
+
|
|
|
|
+ GetPrivateProfileString(szData, _T("Ret_Count"), NULL, szValue, MAX_PATH, m_szBaiduCfgPath);
|
|
|
|
+ countInfo.ret_count = szValue;
|
|
|
|
+
|
|
|
|
+ bdcfg.list_count.insert(std::pair<std::string, CountInfo>(szData, countInfo));
|
|
|
|
+ }
|
|
|
|
+ OutputDebugString(szData);
|
|
|
|
+ OutputDebugString("\n");
|
|
|
|
+ j = i+1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
void CDeviceView::OnInitialUpdate()
|
|
void CDeviceView::OnInitialUpdate()
|
|
{
|
|
{
|
|
CFormView::OnInitialUpdate();
|
|
CFormView::OnInitialUpdate();
|
|
|
|
|
|
// TODO: 在此添加专用代码和/或调用基类
|
|
// TODO: 在此添加专用代码和/或调用基类
|
|
|
|
+ CMFCRibbonBar* pRibbon = g_pMainFrame->GetRibbonBar();
|
|
|
|
+ ASSERT_VALID(pRibbon);
|
|
|
|
+ CMFCRibbonComboBox* pSizeCombo = DYNAMIC_DOWNCAST(CMFCRibbonComboBox, pRibbon->FindByID(ID_COMBOX_OCR));
|
|
|
|
+ if ( pSizeCombo )
|
|
|
|
+ {
|
|
|
|
+ pSizeCombo->AddItem("dfdfdfd");
|
|
|
|
+ pSizeCombo->AddItem("dfdfdfd4444444");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|