|
|
@@ -0,0 +1,771 @@
|
|
|
+// ConfigDlg.cpp : implementation file
|
|
|
+//
|
|
|
+
|
|
|
+#include "stdafx.h"
|
|
|
+#include "HscLogViewer.h"
|
|
|
+#include "ConfigDlg.h"
|
|
|
+#include "afxdialogex.h"
|
|
|
+
|
|
|
+
|
|
|
+// CConfigDlg dialog
|
|
|
+
|
|
|
+IMPLEMENT_DYNAMIC(CConfigDlg, CDialogEx)
|
|
|
+
|
|
|
+CConfigDlg::CConfigDlg(CWnd* pParent /*=NULL*/)
|
|
|
+ : CDialogEx(CConfigDlg::IDD, pParent)
|
|
|
+{
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+CConfigDlg::~CConfigDlg()
|
|
|
+{
|
|
|
+}
|
|
|
+
|
|
|
+void CConfigDlg::DoDataExchange(CDataExchange* pDX)
|
|
|
+{
|
|
|
+ CDialogEx::DoDataExchange(pDX);
|
|
|
+ DDX_Control(pDX, IDC_LIST1, m_ListView);
|
|
|
+ DDX_Control(pDX, IDC_COMBO1, CB_PUMP);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+BEGIN_MESSAGE_MAP(CConfigDlg, CDialogEx)
|
|
|
+ ON_BN_CLICKED(IDC_BUTTON_QUERY, &CConfigDlg::OnBnClickedButtonQuery)
|
|
|
+END_MESSAGE_MAP()
|
|
|
+
|
|
|
+
|
|
|
+// CConfigDlg message handlers
|
|
|
+
|
|
|
+RECORD_DATA_2 recorddata[] =
|
|
|
+{
|
|
|
+
|
|
|
+ "液压配置数据", "CFG_NB_PRODUCTS", TYPE_BIN, 1,
|
|
|
+ "液压配置数据", "CFG_NB_METERS", TYPE_BIN, 1,
|
|
|
+ "液压配置数据", "CFG_NB_FIPS", TYPE_BIN, 1,
|
|
|
+ "液压配置数据", "CFG_NB_LOGICAL_NOZZLES", TYPE_BIN, 1,
|
|
|
+ "液压配置数据", "CFG_HYDRAULIC_SETUP_ID", TYPE_BIN, 1,
|
|
|
+ "液压配置数据", "CFG_PULSER_HIDE", TYPE_BIN, 1,
|
|
|
+ "液压配置数据", "CFG_HOSE_EXPANSION_VOLUME", TYPE_BIN, 1,
|
|
|
+ "液压配置数据", "CFG_HOSE_EXPANSION_TIME", TYPE_BIN, 1,
|
|
|
+ "加油点枪配置", "CFG_FIP_NB_PRODUCTS", TYPE_BIN, 1,
|
|
|
+ "加油点枪配置", "CFG_FIP_NB_METERS", TYPE_BIN, 1,
|
|
|
+ "加油点枪配置", "CFG_FIP_NB_LOGICAL_NOZZLES", TYPE_BIN, 1,
|
|
|
+ "加油点枪配置", "CFG_NOZZLE_PROD_INTERNAL_1", TYPE_BIN, 1,
|
|
|
+ "加油点枪配置", "CFG_NOZZLE_PROD_INTERNAL_2", TYPE_BIN, 1,
|
|
|
+ "加油点枪配置", "CFG_NB_DISPLAY_PER_FIP", TYPE_BIN, 1,
|
|
|
+ "加油点枪配置", "CFG_NB_FUELLING_MODES", TYPE_BIN, 1,
|
|
|
+ "加油点枪配置", "CFG_NOZZLE_PROD_EXTERNAL_1", TYPE_BCD, 4,
|
|
|
+ "加油点枪配置", "CFG_NOZZLE_PROD_EXTERNAL_2", TYPE_BCD, 4,
|
|
|
+ "加油点枪配置", "CFG_NOZZLE_NO_EXTERNAL_1", TYPE_BIN, 1,
|
|
|
+ "加油点枪配置", "CFG_NOZZLE_NO_EXTERNAL_2", TYPE_BIN, 1,
|
|
|
+ "阀配置数据", "CFG_PRESET_VALVE_RESPONSE_NS", TYPE_BIN, 1,
|
|
|
+ "阀配置数据", "CFG_PRESET_VALVE_TYPE", TYPE_BIN, 1,
|
|
|
+ "阀配置数据", "CFG_PRESET_VALVE_RESPONSE_LOW", TYPE_BIN, 1,
|
|
|
+ "时间参数配置数据", "CFG_TIME_MAX_AUTHORIZED", TYPE_BIN, 2,
|
|
|
+ "时间参数配置数据", "CFG_TIME_MAX_NO_PROGRESS", TYPE_BIN, 2,
|
|
|
+ "时间参数配置数据", "CFG_TIME_INTER_DELIVERY", TYPE_BIN, 1,
|
|
|
+ "时间参数配置数据", "CFG_TIME_MAX_SUSPENDED", TYPE_BIN, 2,
|
|
|
+ "时间参数配置数据", "CFG_TIME_WAIT_SLOW_FLOW", TYPE_BIN, 1,
|
|
|
+ "时间参数配置数据", "CFG_TIME_SUBMERGED_VALVE_DELAY", TYPE_BIN, 1,
|
|
|
+ "时间参数配置数据", "CFG_TIME_MAX_DELIVERY", TYPE_BIN, 2,
|
|
|
+ "时间参数配置数据", "CFG_TIME_DISPLAY_ERROR", TYPE_BIN, 1,
|
|
|
+ "时间参数配置数据", "CFG_TIME_CHECK_BATTERY_TEST", TYPE_BIN, 1,
|
|
|
+ "定量配置数据", "CFG_PRESET_VOLUME_MIN", TYPE_VALUE, 5,
|
|
|
+ "定量配置数据", "CFG_PRESET_VOLUME_MAX", TYPE_VALUE, 5,
|
|
|
+ "定量配置数据", "CFG_PRESET_AMOUNT_MIN", TYPE_VALUE, 5,
|
|
|
+ "定量配置数据", "CFG_PRESET_AMOUNT_MAX", TYPE_VALUE, 5,
|
|
|
+ "定量配置数据", "CFG_VOLUME_LIMIT", TYPE_VALUE, 5,
|
|
|
+ "显示配置数据", "CFG_TYPE_DISPLAY_TYPE", TYPE_BIN, 1,
|
|
|
+ "显示配置数据", "AUX_IDLE_DISPLAY_MODE", TYPE_BIN, 1,
|
|
|
+ "显示配置数据", "CFG_DIGITS_LAYOUT_VOLUME", TYPE_BIN, 1,
|
|
|
+ "显示配置数据", "CFG_DIGITS_LAYOUT_AMOUNT", TYPE_BIN, 1,
|
|
|
+ "显示配置数据", "CFG_DIGITS_LAYOUT_UNITPRICE", TYPE_BIN, 1,
|
|
|
+ "凑整配置数据", "CFG_AMOUNT_ROUNDING_TYPE", TYPE_BIN, 1,
|
|
|
+ "凑整配置数据", "CFG_VOLUME_ROUNDING_TYPE", TYPE_BIN, 1,
|
|
|
+ "凑整配置数据", "AUX_JUST_STOP_ROUNDING_MODE", TYPE_BIN, 1,
|
|
|
+ "油品单价配置数据", "OP_HSC_UNIT_PRICE_PROD_1", TYPE_VALUE, 4,
|
|
|
+ "油品单价配置数据", "OP_HSC_UNIT_PRICE_PROD_2", TYPE_VALUE, 4,
|
|
|
+ "计量板软硬件版本信息", "CFG_MANUFACTURER_ID", TYPE_ASC, 3,
|
|
|
+ "计量板软硬件版本信息", "CFG_CALCULATOR_SERIAL_NUMBER", TYPE_ASC, 12,
|
|
|
+ "计量板软硬件版本信息", "CFG_SW_VERSION_APPLICATION", TYPE_ASC, 12,
|
|
|
+ "计量板软硬件版本信息", "CFG_SW_CHECKSUM", TYPE_ASC, 4,
|
|
|
+ "计量板软硬件版本信息", "CFG_CAN_DEVICE_VERSION", TYPE_ASC, 12,
|
|
|
+ "计量板软硬件版本信息", "CFG_CAN_DEVICE_CHECKSUM", TYPE_ASC, 4,
|
|
|
+ "其它配置", "CFG_ZERO_TRANS_THRES", TYPE_BIN, 1,
|
|
|
+ "其它配置", "CFG_NB_DELIVERY_MODES", TYPE_BIN, 1,
|
|
|
+ "其它配置", "PRODUCT_1_NAME", TYPE_BCD, 4,
|
|
|
+ "其它配置", "PRODUCT_2_NAME", TYPE_BCD, 4
|
|
|
+
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+BOOL CConfigDlg::OnInitDialog()
|
|
|
+{
|
|
|
+ CDialogEx::OnInitDialog();
|
|
|
+
|
|
|
+ // TODO: Add extra initialization here
|
|
|
+ DWORD style = m_ListView.GetExtendedStyle();
|
|
|
+ m_ListView.SetExtendedStyle(style | LVS_EX_FLATSB);
|
|
|
+ m_ListView.SetFullRowSel(true);
|
|
|
+
|
|
|
+ m_ListView.SetBkColor(RGB(255, 255, 255));//m_DetailLstCtrl.SetBkColor( RGB(87,91,92) );
|
|
|
+ m_ListView.SetTextBkColor(RGB(255, 255, 255));//m_DetailLstCtrl.SetTextBkColor( RGB(87,91,92) );
|
|
|
+ m_ListView.SetTxtColor(RGB(0, 0, 0));//m_DetailLstCtrl.SetTxtColor( RGB(255,255,255) );
|
|
|
+ m_ListView.ShowLineBk(false);
|
|
|
+ m_ListView.SetFontHeight(16);//m_DetailLstCtrl.SetFontHeight( 18 );
|
|
|
+
|
|
|
+
|
|
|
+ CB_PUMP.AddString("A");
|
|
|
+ CB_PUMP.AddString("B");
|
|
|
+ CB_PUMP.SetCurSel(0);
|
|
|
+
|
|
|
+
|
|
|
+ HEAD head[] = {
|
|
|
+ "类型", 250,
|
|
|
+ "字段", 400,
|
|
|
+ "数值", 150
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ CString tmpInfo;
|
|
|
+ int index = 0;
|
|
|
+
|
|
|
+ for (int i = 0; i < sizeof(head) / sizeof(HEAD); i++)
|
|
|
+ {
|
|
|
+ tmpInfo = head[i].name;
|
|
|
+ m_ListView.InsertColumn(index++, tmpInfo, LVCFMT_LEFT, head[i].width);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return TRUE; // return TRUE unless you set the focus to a control
|
|
|
+ // EXCEPTION: OCX Property Pages should return FALSE
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+void CConfigDlg::OnBnClickedButtonQuery()
|
|
|
+{
|
|
|
+
|
|
|
+ m_ListView.DeleteAllItems();
|
|
|
+
|
|
|
+ CString strpump = CB_PUMP.GetCurSel() == 0 ? "A" : "B";
|
|
|
+
|
|
|
+
|
|
|
+ CString path = "./config_" + strpump + ".bin";
|
|
|
+
|
|
|
+
|
|
|
+ BYTE* v = new BYTE[MAXSIZE];
|
|
|
+ int i = 0;
|
|
|
+
|
|
|
+ //open
|
|
|
+ FILE *fr;
|
|
|
+ fopen_s(&fr, path, "rb");
|
|
|
+ if (fr == NULL) //打开文件出错。
|
|
|
+ {
|
|
|
+ AfxMessageBox("打开文件失败!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //size
|
|
|
+ fseek(fr, 0, SEEK_END);
|
|
|
+ long int size = ftell(fr);
|
|
|
+ fseek(fr, 0, SEEK_SET);
|
|
|
+ if (size >= MAXSIZE)
|
|
|
+ {
|
|
|
+ AfxMessageBox("文件太大!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //scan
|
|
|
+ while (fscanf_s(fr, "%c", &v[i]) != EOF) //读取数据到数组,直到文件结尾(返回EOF)
|
|
|
+ {
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ fclose(fr);
|
|
|
+
|
|
|
+
|
|
|
+ //int count = size / len;
|
|
|
+ int index = 0;
|
|
|
+
|
|
|
+ int offset_struct = 1;
|
|
|
+
|
|
|
+ //for (int i = 0; i < count; i++)
|
|
|
+ //{
|
|
|
+ //int col = 0;
|
|
|
+
|
|
|
+ int offset = 0;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ for (int i = 0; i < sizeof(recorddata) / sizeof(RECORD_DATA); i++)
|
|
|
+ {
|
|
|
+
|
|
|
+ m_ListView.InsertItem(i, _T(""));
|
|
|
+ m_ListView.SetItemText(i, 0, recorddata[i].item);
|
|
|
+
|
|
|
+ CString text;
|
|
|
+
|
|
|
+ if (recorddata[i].type == TYPE_VALUE)
|
|
|
+ {
|
|
|
+ double val = BCDtoDec(&v[offset + offset_struct], recorddata[i].length - offset_struct);
|
|
|
+ text = _F2T(val / 100.0);
|
|
|
+ }
|
|
|
+ else if (recorddata[i].type == TYPE_BCD)
|
|
|
+ {
|
|
|
+ int val = BCDtoDec(&v[offset], recorddata[i].length);
|
|
|
+
|
|
|
+ text = _I2T(val);
|
|
|
+ }
|
|
|
+ else if (recorddata[i].type == TYPE_ASC)
|
|
|
+ {
|
|
|
+ char ch[100] = { 0 };// = new char[recorddata[i].length + 1];
|
|
|
+ memcpy(ch, v + offset, recorddata[i].length);
|
|
|
+
|
|
|
+
|
|
|
+ //char c[2] = { 0 };
|
|
|
+ //c[0] = v[offset];
|
|
|
+ text = ch;
|
|
|
+
|
|
|
+ //delete pchar;
|
|
|
+ }
|
|
|
+ else if (recorddata[i].type == TYPE_DATETIME)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ else if (recorddata[i].type == TYPE_BIN)
|
|
|
+ {
|
|
|
+ text = BINtoCString(&v[offset], recorddata[i].length);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ m_ListView.SetItemText(i, 1, recorddata[i].name);
|
|
|
+ m_ListView.SetItemText(i, 2, text);
|
|
|
+
|
|
|
+ offset += recorddata[i].length;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+
|
|
|
+ int c1 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("液压配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_NB_PRODUCTS");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c1));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c2 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("液压配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_NB_METERS");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c2));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c3 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("液压配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_NB_FIPS");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c3));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c4 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("液压配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_NB_LOGICAL_NOZZLES");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c4));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c5 = v[offset];
|
|
|
+ offset += 1;
|
|
|
+ m_ListView.InsertItem(index, _T("液压配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_HYDRAULIC_SETUP_ID");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c5));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c6 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("液压配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_PULSER_HIDE");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c6));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c7 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("液压配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_HOSE_EXPANSION_VOLUME");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c7));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c8 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("液压配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_HOSE_EXPANSION_TIME");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c8));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c8_2 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("液压配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "NOZZLE_A_PROD");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c8_2));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c8_3 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("液压配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "NOZZLE_B_PROD");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c8_3));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c9 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("阀配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_PRESET_VALVE_RESPONSE_NS");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c9));
|
|
|
+ index++;
|
|
|
+
|
|
|
+
|
|
|
+ int c10 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("阀配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_PRESET_VALVE_TYPE");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c10));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c11 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("阀配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_PRESET_VALVE_RESPONSE_LOW");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c11));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ //
|
|
|
+ int c12 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("定时器配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_TIME_MAX_AUTHORIZED");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c12));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c13 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("定时器配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_TIME_MAX_NO_PROGRESS");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c13));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c14 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("定时器配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_TIME_INTER_DELIVERY");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c14));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c15 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("定时器配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_TIME_MAX_SUSPENDED");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c15));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c16 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("定时器配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_TIME_MAX_LOW_NO_FILLING");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c16));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c17 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("定时器配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_TIME_WAIT_SLOW_FLOW");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c17));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c18 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("定时器配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_TIME_SUBMERGED_VALVE_DELAY");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c18));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c19 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("定时器配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_TIME_DISPLAY_ERROR");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c19));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c20 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("定时器配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_TIME_IDLE_DISPLAY");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c20));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c21 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("定时器配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "AUX_IDLE_DISPLAY_TIMEOUT");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c21));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ //
|
|
|
+ double c22;
|
|
|
+ c22 = BCDtoDec(&v[offset + offset_struct], 5 - offset_struct);
|
|
|
+ offset += 5;
|
|
|
+ m_ListView.InsertItem(index, _T("预设值配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_PRESET_VOLUME_MIN");
|
|
|
+ m_ListView.SetItemText(index, 2, _F2T(c22 / 100.0));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ double c23;
|
|
|
+ c23 = BCDtoDec(&v[offset + offset_struct], 5 - offset_struct);
|
|
|
+ offset += 5;
|
|
|
+ m_ListView.InsertItem(index, _T("预设值配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_PRESET_VOLUME_MAX");
|
|
|
+ m_ListView.SetItemText(index, 2, _F2T(c23 / 100.0));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ double c24;
|
|
|
+ c24 = BCDtoDec(&v[offset + offset_struct], 5 - offset_struct);
|
|
|
+ offset += 5;
|
|
|
+ m_ListView.InsertItem(index, _T("预设值配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_PRESET_AMOUNT_MIN");
|
|
|
+ m_ListView.SetItemText(index, 2, _F2T(c24 / 100.0));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ double c25;
|
|
|
+ c25 = BCDtoDec(&v[offset + offset_struct], 5 - offset_struct);
|
|
|
+ offset += 5;
|
|
|
+ m_ListView.InsertItem(index, _T("预设值配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_PRESET_AMOUNT_MAX ");
|
|
|
+ m_ListView.SetItemText(index, 2, _F2T(c25 / 100.0));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ double c26;
|
|
|
+ c26 = BCDtoDec(&v[offset + offset_struct], 5 - offset_struct);
|
|
|
+ offset += 5;
|
|
|
+ m_ListView.InsertItem(index, _T("预设值配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_VOLUME_LIMIT");
|
|
|
+ m_ListView.SetItemText(index, 2, _F2T(c26 / 100.0));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ //
|
|
|
+ int c27 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("显示配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_TYPE_DISPLAY_TYPE");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c27));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c28 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("显示配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "AUX_IDLE_DISPLAY_MODE");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c28));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c29 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("显示配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_DIGITS_LAYOUT_VOLUME");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c29));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c30 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("显示配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_DIGITS_LAYOUT_AMOUNT");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c30));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c31 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("显示配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_DIGITS_LAYOUT_UNITPRICE");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c31));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c32 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("显示配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_NB_DISPLAY_PER_FIP");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c32));
|
|
|
+ index++;
|
|
|
+
|
|
|
+
|
|
|
+ //
|
|
|
+ int c33 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("凑整配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_AMOUNT_ROUNDING_TYPE");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c33));
|
|
|
+ index++;
|
|
|
+
|
|
|
+
|
|
|
+ int c34 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("凑整配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_VOLUME_ROUNDING_TYPE");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c34));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c35 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("凑整配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "AUX_JUST_STOP_ROUNDING_MODE");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c35));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ //
|
|
|
+ int c36 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("加油模式配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_NB_DELIVERY_MODES");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c36));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ int c37 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.InsertItem(index, _T("加油模式配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "CFG_NB_FUELLING_MODES");
|
|
|
+ m_ListView.SetItemText(index, 2, _I2T(c37));
|
|
|
+ index++;
|
|
|
+
|
|
|
+
|
|
|
+ //
|
|
|
+ double c38 = BCDtoDec(&v[offset + offset_struct], 4 - offset_struct);
|
|
|
+ offset += 4;
|
|
|
+ m_ListView.InsertItem(index, _T("单价配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "OP_TQC_UNIT_PRICE_PROD_1");
|
|
|
+ m_ListView.SetItemText(index, 2, _F2T(c38 / 100.0));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ double c39 = BCDtoDec(&v[offset + offset_struct], 4 - offset_struct);
|
|
|
+ offset += 4;
|
|
|
+ m_ListView.InsertItem(index, _T("单价配置数据"));
|
|
|
+ m_ListView.SetItemText(index, 1, "OP_TQC_UNIT_PRICE_PROD_2");
|
|
|
+ m_ListView.SetItemText(index, 2, _F2T(c39 / 100.0));
|
|
|
+ index++;
|
|
|
+
|
|
|
+ //double c40 = BCDtoDec(&v[offset + offset_struct], 4 - offset_struct);
|
|
|
+ //offset += 4;
|
|
|
+ //m_ListView.InsertItem(index, _T("单价配置数据"));
|
|
|
+ //m_ListView.SetItemText(index, 1, "OP_TQC_UNIT_PRICE_PROD_3");
|
|
|
+ //m_ListView.SetItemText(index, 2, _F2T(c40 / 100.0));
|
|
|
+ //index++;
|
|
|
+
|
|
|
+ //double c41 = BCDtoDec(&v[offset], 4);
|
|
|
+ //offset += 4;
|
|
|
+ //m_ListView.InsertItem(index, _T("单价配置数据"));
|
|
|
+ //m_ListView.SetItemText(index, 1, "OP_TQC_UNIT_PRICE_PROD_4");
|
|
|
+ //m_ListView.SetItemText(index, 2, _F2T(c41 / 100.0));
|
|
|
+ //index++;
|
|
|
+
|
|
|
+ //double c42 = BCDtoDec(&v[offset], 4);
|
|
|
+ //offset += 4;
|
|
|
+ //m_ListView.InsertItem(index, _T("单价配置数据"));
|
|
|
+ //m_ListView.SetItemText(index, 1, "OP_TQC_UNIT_PRICE_PROD_5");
|
|
|
+ //m_ListView.SetItemText(index, 2, _F2T(c42 / 100.0));
|
|
|
+ //index++;
|
|
|
+
|
|
|
+ //double c43 = BCDtoDec(&v[offset], 4);
|
|
|
+ //offset += 4;
|
|
|
+ //m_ListView.InsertItem(index, _T("单价配置数据"));
|
|
|
+ //m_ListView.SetItemText(index, 1, "OP_TQC_UNIT_PRICE_PROD_6");
|
|
|
+ //m_ListView.SetItemText(index, 2, _F2T(c43 / 100.0));
|
|
|
+ //index++;
|
|
|
+
|
|
|
+ //double c44 = BCDtoDec(&v[offset], 4);
|
|
|
+ //offset += 4;
|
|
|
+ //m_ListView.InsertItem(index, _T("单价配置数据"));
|
|
|
+ //m_ListView.SetItemText(index, 1, "OP_TQC_UNIT_PRICE_PROD_7");
|
|
|
+ //m_ListView.SetItemText(index, 2, _F2T(c44 / 100.0));
|
|
|
+ //index++;
|
|
|
+
|
|
|
+ //double c45 = BCDtoDec(&v[offset], 4);
|
|
|
+ //offset += 4;
|
|
|
+ //m_ListView.InsertItem(index, _T("单价配置数据"));
|
|
|
+ //m_ListView.SetItemText(index, 1, "OP_TQC_UNIT_PRICE_PROD_8");
|
|
|
+ //m_ListView.SetItemText(index, 2, _F2T(c45 / 100.0));
|
|
|
+ //index++;
|
|
|
+
|
|
|
+
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+ int c2 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.SetItemText(index, col++, _I2T(c2));
|
|
|
+
|
|
|
+ int c3;
|
|
|
+ c3 = BCDtoDec(&v[offset], 2);
|
|
|
+ offset += 2;
|
|
|
+ m_ListView.SetItemText(index, col++, _I2T(c3));
|
|
|
+
|
|
|
+ int c4;
|
|
|
+ c4 = BCDtoDec(&v[offset], 2);
|
|
|
+ offset += 2;
|
|
|
+ m_ListView.SetItemText(index, col++, _I2T(c4));
|
|
|
+
|
|
|
+ int c5 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.SetItemText(index, col++, _I2T(c5));
|
|
|
+
|
|
|
+ int c6 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.SetItemText(index, col++, _I2T(c6));
|
|
|
+
|
|
|
+
|
|
|
+ double c7;
|
|
|
+ c7 = BCDtoDec(&v[offset], 5);
|
|
|
+ offset += 5;
|
|
|
+ m_ListView.SetItemText(index, col++, _F2T(c7 / 100.0));
|
|
|
+
|
|
|
+ double c8;
|
|
|
+ c8 = BCDtoDec(&v[offset], 5);
|
|
|
+ offset += 5;
|
|
|
+ m_ListView.SetItemText(index, col++, _F2T(c8 / 100.0));
|
|
|
+
|
|
|
+ double c9;
|
|
|
+ c9 = BCDtoDec(&v[offset], 4);
|
|
|
+ offset += 4;
|
|
|
+ m_ListView.SetItemText(index, col++, _F2T(c9 / 100.0));
|
|
|
+
|
|
|
+
|
|
|
+ int c10 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.SetItemText(index, col++, _I2T(c10));
|
|
|
+
|
|
|
+ int c11 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.SetItemText(index, col++, _I2T(c11));
|
|
|
+
|
|
|
+ int c12 = v[offset + 2] * 256 * 256 + v[offset + 1] * 256 + v[offset]; //小端模式
|
|
|
+ offset += 3;
|
|
|
+ char c12_[15];
|
|
|
+ sprintf_s(c12_, "0x%06X", c12);
|
|
|
+ m_ListView.SetItemText(index, col++, c12_);
|
|
|
+
|
|
|
+ int c13 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.SetItemText(index, col++, _I2T(c13));
|
|
|
+
|
|
|
+ double c14;
|
|
|
+ c14 = BCDtoDec(&v[offset], 3);
|
|
|
+ offset += 3;
|
|
|
+ m_ListView.SetItemText(index, col++, _F2T(c14 / 100.0));
|
|
|
+
|
|
|
+ char c15[2] = { 0 };
|
|
|
+ c15[0] = v[offset]; //asc
|
|
|
+ offset++;
|
|
|
+ m_ListView.SetItemText(index, col++, c15);
|
|
|
+
|
|
|
+
|
|
|
+ double c16;
|
|
|
+ c16 = BCDtoDec(&v[offset], 3);
|
|
|
+ offset += 3;
|
|
|
+ m_ListView.SetItemText(index, col++, _F2T(c16 / 100.0));
|
|
|
+
|
|
|
+
|
|
|
+ double c17;
|
|
|
+ c17 = BCDtoDec(&v[offset], 5);
|
|
|
+ offset += 5;
|
|
|
+ m_ListView.SetItemText(index, col++, _F2T(c17 / 100.0));
|
|
|
+
|
|
|
+
|
|
|
+ double c18;
|
|
|
+ c18 = BCDtoDec(&v[offset], 5);
|
|
|
+ offset += 5;
|
|
|
+ m_ListView.SetItemText(index, col++, _F2T(c18 / 100.0));
|
|
|
+
|
|
|
+ double c19;
|
|
|
+ c19 = BCDtoDec(&v[offset], 5);
|
|
|
+ offset += 5;
|
|
|
+ m_ListView.SetItemText(index, col++, _F2T(c19 / 100.0));
|
|
|
+
|
|
|
+
|
|
|
+ double c20;
|
|
|
+ c20 = BCDtoDec(&v[offset], 5);
|
|
|
+ offset += 5;
|
|
|
+ m_ListView.SetItemText(index, col++, _F2T(c20 / 100.0));
|
|
|
+
|
|
|
+
|
|
|
+ int c21;
|
|
|
+ c21 = BCDtoDec(&v[offset], 4);
|
|
|
+ offset += 4;
|
|
|
+ m_ListView.SetItemText(index, col++, _I2T(c21));
|
|
|
+
|
|
|
+ int c22;
|
|
|
+ c22 = BCDtoDec(&v[offset], 3);
|
|
|
+ offset += 3;
|
|
|
+ m_ListView.SetItemText(index, col++, _I2T(c22));
|
|
|
+
|
|
|
+ int c23;
|
|
|
+ c23 = BCDtoDec(&v[offset], 3);
|
|
|
+ offset += 3;
|
|
|
+ m_ListView.SetItemText(index, col++, _I2T(c23));
|
|
|
+
|
|
|
+
|
|
|
+ int c24 = v[offset];
|
|
|
+ offset++;
|
|
|
+ m_ListView.SetItemText(index, col++, _I2T(c24));
|
|
|
+
|
|
|
+
|
|
|
+ double c25;
|
|
|
+ c25 = BCDtoDec(&v[offset], 5);
|
|
|
+ offset += 5;
|
|
|
+ m_ListView.SetItemText(index, col++, _F2T(c25 / 100.0));
|
|
|
+
|
|
|
+ double c26;
|
|
|
+ c26 = BCDtoDec(&v[offset], 5);
|
|
|
+ offset += 5;
|
|
|
+ m_ListView.SetItemText(index, col++, _F2T(c26 / 100.0));
|
|
|
+
|
|
|
+
|
|
|
+ int c27;
|
|
|
+ c27 = BCDtoDec(&v[offset], 1);
|
|
|
+ offset += 1;
|
|
|
+ m_ListView.SetItemText(index, col++, _I2T(c27));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ delete v;
|
|
|
+}
|
|
|
+
|
|
|
+void CConfigDlg::redraw()
|
|
|
+{
|
|
|
+
|
|
|
+ CRect listrc;
|
|
|
+ GetClientRect(listrc);
|
|
|
+ listrc.DeflateRect(0, 6);
|
|
|
+
|
|
|
+ //listrc.bottom = listrc.top + m_rect.Height();
|
|
|
+ //listrc.right = listrc.left + m_rect.Width();
|
|
|
+
|
|
|
+ listrc.top = 155;
|
|
|
+
|
|
|
+
|
|
|
+ m_ListView.MoveWindow(listrc);
|
|
|
+}
|