列表控件 树形控件显示设备信息

本文详细解析了CDeviceParameter对话框的实现过程,包括树节点类型、树节点附属信息、显示参数信息等内容。通过阅读本文,读者可以深入理解CDeviceParameter对话框的设计与实现原理。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

CDeviceParameter.h文件代码
#pragma once
#include "afxcmn.h"
#include "resource.h"
#include "config.h"
// CDeviceParameter dialog
class CDeviceParameter : public CDialog
{
 DECLARE_DYNAMIC(CDeviceParameter)
private:
    //树节点类型
    typedef
    enum _BNodeStyle
    {
        nsNone  = 1,            //无类型
        nsBasic,                //基本信息类型
        nsChannel,              //通道信息类型
        nsPair,                 //通道对信息类型
        nsElement,              //采集因子信息类型
        nsCapture,              //采集选项信息类型
    }BNodeStyle;
    //树节点附属信息
    typedef
    union _BNodeInfo
    {       
        struct
        {
            unsigned short Index;   //节点隶属于哪个编号的设备
            unsigned short Style;       //节点类型,根据节点类型显示不同的ListView内容
        };
        LPARAM lparam;
    }BNodeInfo;
private:
    // 显示参数信息
    CListCtrl m_ListView;
    // 显示参数类别信息
    CTreeCtrl m_TreeView;
    //BConfigBasic bcBasic;
public:
 CDeviceParameter(CWnd* pParent = NULL);   // standard constructor
 virtual ~CDeviceParameter();
// Dialog Data
 enum { IDD = IDD_DEVICE_PARAMETER};
protected:
 virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
    virtual BOOL OnInitDialog();
    //初始化TreeView信息
    void
    InitDeviceTree(
        CTreeCtrl *tree,               
        const BConfigSetManager *conf,  //设备参数信息
        int index                       //当前有效设备索引
        );
    //清除ListView信息
    void
    ClearDeviceView(
        CListCtrl *view
        );
    //显示配置参数基本信息
    void
    ShowBasicView(
        CListCtrl *view,
        const BConfigBasic *basic       //basic信息
        );
    //显示通道信息
    void
    ShowChannelView(
        CListCtrl *view,
        const BChannelStyleSet *channel       //通道信息
        );
    //显示通道对信息
    void
    ShowPairView(
        CListCtrl *view,
        const BChannelPairSet *pair,        //通道对信息
        const BChannelStyleSet *channel     //通道信息
        );
    //显示采集因子信息
    void
    ShowElementView(
        CListCtrl *view,
        const BFactorElement *element       //采集因子信息
        );
    //显示采集选项信息
    void
    ShowCaptureView(
        CListCtrl *view,
        const BConfigCapture *capture       //采集选项信息
        );
 DECLARE_MESSAGE_MAP()
public:
    afx_msg void OnBnClickedClose();
    afx_msg void OnTvnSelchangingTreeview(NMHDR *pNMHDR, LRESULT *pResult);
    //afx_msg void OnSize(UINT nType, int cx, int cy);
private:
    //POINT Old;
    CRect m_rect;
public:
    afx_msg void OnSize(UINT nType, int cx, int cy);
    //void ReSize();
};
 
CDeviceParameter.cpp文件代码
// DeviceParameter.cpp : implementation file
//
#include "stdafx.h"
#include "DeviceParameter.h"
#include "manager.h"
// CDeviceParameter dialog
IMPLEMENT_DYNAMIC(CDeviceParameter, CDialog)
CDeviceParameter::CDeviceParameter(CWnd* pParent /*=NULL*/)
 : CDialog(CDeviceParameter::IDD, pParent)
{
}
CDeviceParameter::~CDeviceParameter()
{
}
void CDeviceParameter::DoDataExchange(CDataExchange* pDX)
{
    CDialog::DoDataExchange(pDX);
    DDX_Control(pDX, IDC_LISTVIEW, m_ListView);
    DDX_Control(pDX, IDC_TREEVIEWSHOW, m_TreeView);
}

BEGIN_MESSAGE_MAP(CDeviceParameter, CDialog)
    ON_WM_SIZE()
    ON_BN_CLICKED(IDC_CLOSE, &CDeviceParameter::OnBnClickedClose)
    ON_NOTIFY(TVN_SELCHANGING, IDC_TREEVIEWSHOW, &CDeviceParameter::OnTvnSelchangingTreeview)
END_MESSAGE_MAP()

// CDeviceParameter message handlers
BOOL CDeviceParameter::OnInitDialog()
{
    CDialog::OnInitDialog();
    ClearDeviceView(&m_ListView);
    InitDeviceTree(&m_TreeView,&g_Manager.m_Conf,g_Manager.m_Index);
    //CRect rect;
    //GetClientRect(&rect); //取客户区大小 
    //Old.x=rect.right-rect.left;
    //Old.y=rect.bottom-rect.top;
    
    GetClientRect(&m_rect);
    return TRUE;
}
void CDeviceParameter::OnTvnSelchangingTreeview(NMHDR *pNMHDR, LRESULT *pResult)
{
    BNodeInfo info;
    LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
    info.lparam = pNMTreeView->itemNew.lParam;
    ClearDeviceView(&m_ListView);
    switch (info.Style)
    {
    case nsNone:
        ShowBasicView(&m_ListView,&g_Manager.m_Conf[info.Index].Basic);
        break;
    case nsBasic:
        ShowBasicView(&m_ListView,&g_Manager.m_Conf[info.Index].Basic);
        break;
    case nsChannel:             
        ShowChannelView(&m_ListView,&g_Manager.m_Conf[info.Index].ChannelSet);
        break;
    case nsPair:                
        ShowPairView(
            &m_ListView,
            &g_Manager.m_Conf[info.Index].PairSet,
            &g_Manager.m_Conf[info.Index].ChannelSet);
        break;
    case nsElement:             
        ShowElementView(&m_ListView,&g_Manager.m_Conf[info.Index].Factor);
        break;
    case nsCapture:             
        ShowCaptureView(&m_ListView,&g_Manager.m_Conf[info.Index].Capture);
        break;
    /*default:
         ShowBasicView(&m_ListView,&g_Manager.m_Conf[info.Index].Basic);
        break;*/
    };
   
    *pResult = 0;   
}
void CDeviceParameter::OnBnClickedClose()
{
    // TODO: 关闭当前窗口
    this->OnCancel();
}
void
CDeviceParameter::InitDeviceTree(
    CTreeCtrl *tree,               
    const BConfigSetManager *conf, 
    int index                      
    )
{
    BNodeInfo info;
    HTREEITEM hRoot;
    HTREEITEM hItem;
    CString strText;
    //BConfigBasic bcBasic;
    int i;
    //TODO:根据conf内容初始化tree,每个节点的lParam 置不同的info;
   
    this->ClearDeviceView(&m_ListView);
 m_TreeView.ModifyStyle(0,TVS_LINESATROOT|TVS_HASBUTTONS|TVS_HASLINES);
    strText = "";
    for(i = 0;i < 2;i ++)
    {
        info.Index = i;
                       
        //插入树根
        info.Style = nsNone;
        strText.Format("设备%d信息",i);
        //strText = strText + " 机组名" + bcBasic.UnitName.c_str();
        strText = strText + " 机组名" + g_Manager.m_Conf[info.Index].Basic.UnitName.c_str();
        hRoot = m_TreeView.InsertItem(
            LVIF_TEXT|LVIF_PARAM|LVIF_STATE,
            strText,
            0,
            0,
            0,
            0,
            info.lparam,
            NULL,
            NULL);
        //插入第二级内容
        info.Style = nsBasic;
        hItem = NULL;
        hItem = m_TreeView.InsertItem(
            LVIF_TEXT|LVIF_PARAM|LVIF_STATE,
            "基本信息",
            0,
            0,
            0,
            0,
            info.lparam,
            hRoot,
            hItem);
       
        info.Style = nsCapture;
        hItem = m_TreeView.InsertItem(
            LVIF_TEXT|LVIF_PARAM|LVIF_STATE,
            "采集项信息",
            0,
            0,
            0,
            0,
            info.lparam,
            hRoot,
            hItem);
        info.Style = nsElement;
        hItem = m_TreeView.InsertItem(
            LVIF_TEXT|LVIF_PARAM|LVIF_STATE,
            "采集因子信息",
            0,
            0,
            0,
            0,
            info.lparam,
            hRoot,
            hItem);
       
        info.Style = nsChannel;
        hItem = m_TreeView.InsertItem(
            LVIF_TEXT|LVIF_PARAM|LVIF_STATE,
            "通道设置信息",
            0,
            0,
            0,
            0,
            info.lparam,
            hRoot,
            hItem);
               
              
        info.Style = nsPair;
        hItem = m_TreeView.InsertItem(
            LVIF_TEXT|LVIF_PARAM|LVIF_STATE,
            "通道对信息",
            0,
            0,
            0,
            0,
            info.lparam,
            hRoot,
            hItem);
    
        m_TreeView.Expand(hRoot,TVE_EXPAND);
    }
    //TODO:根据index 决定显示哪个设备的基本信息
    if (index == 0)
    {
      
        info.Index = 0;
       
    }
    else
    {
       
        info.Index = 1;
      
    }
}
void
CDeviceParameter::ClearDeviceView(
    CListCtrl *view
    )
{
    //TODO:清除view内容
    int iCount;
    int i;
    view->DeleteAllItems();
    iCount   =   view->GetHeaderCtrl()-> GetItemCount();
    for(i   =   0;   i   <   iCount;   i++)
    {
        view->DeleteColumn(0);
    }
    for(i   =   0;   i   <   iCount;   i++)
    {
        view->GetHeaderCtrl()-> DeleteItem(0);
    }
}

void
CDeviceParameter::ShowBasicView(
    CListCtrl *view,
    const BConfigBasic *basic     
    )
{
    //TODO:在view中显示basic内容
    int id;
    //BConfigBasic bcBasic;
    CString  s;
    m_ListView.SetExtendedStyle(
          LVS_EX_FLATSB    // 扁平风格滚动
        | LVS_EX_FULLROWSELECT    // 允许整行选中
        | LVS_EX_HEADERDRAGDROP    // 允许标题拖拽
        | LVS_EX_GRIDLINES    // 画出网格线
        );
     this->ClearDeviceView(&m_ListView);
     id = 0;
     m_ListView.InsertColumn(id++,"基本信息",LVCFMT_LEFT,70);
     m_ListView.InsertColumn(id++,"值",LVCFMT_LEFT,120);
     m_ListView.InsertColumn(id,"单位注释",LVCFMT_LEFT,290);
     id = 0;
     m_ListView.InsertItem(id,"存储路径");
     m_ListView.SetItemText(id,0,"存储路径");
     //s = bcBasic.StorePath;
    // m_ListView.SetItemText(id++,1,s);
     m_ListView.SetItemText(id++,1,basic->StorePath.c_str());
     m_ListView.InsertItem(id,"装置编号");
     m_ListView.SetItemText(id,0,"装置编号");
     s.Format("%s",basic->DeviceID.String().c_str());
     m_ListView.SetItemText(id++,1,s);
    
     m_ListView.InsertItem(id,"厂名");
     m_ListView.SetItemText(id,0,"厂名");
     m_ListView.SetItemText(id++,1,basic->PlantName.c_str());
    
     m_ListView.InsertItem(id,"机组名");
     m_ListView.SetItemText(id,0,"机组名");
     m_ListView.SetItemText(id++,1,basic->UnitName.c_str());
   
     m_ListView.InsertItem(id,"额定转速");
     m_ListView.SetItemText(id,0,"额定转速");
     s.Format("%d",basic->RatingRPM);
     m_ListView.SetItemText(id,1,s);
     m_ListView.SetItemText(id++,2,"RPM(默认3000)");
    
     m_ListView.InsertItem(id,"额定功率");
     m_ListView.SetItemText(id,0,"额定功率");
     s.Format("%d",basic->RatingPower);
     m_ListView.SetItemText(id,1,s);
     m_ListView.SetItemText(id++,2,"MW");
    
     m_ListView.InsertItem(id,"最大功率");
     m_ListView.SetItemText(id,0,"最大功率");
     s.Format("%d",basic->MaxPower);
     m_ListView.SetItemText(id,1,s);
     m_ListView.SetItemText(id++,2,"MW");
    
     m_ListView.InsertItem(id,"转动方向");
     m_ListView.SetItemText(id,0,"转动方向");
     if (basic->Clockwise == false)
     {
         s.Format("逆时针方向",basic->Clockwise);
     }
     else if (basic->Clockwise == true)
     {
         s.Format("顺时针方向",basic->Clockwise);
     }
     m_ListView.SetItemText(id,1,s);
     m_ListView.SetItemText(id++,2,"顺时针方向 true 逆时针方向 false (从机头看机尾)");
    
     m_ListView.InsertItem(id,"测试单位");
     m_ListView.SetItemText(id,0,"测试单位");
     m_ListView.SetItemText(id++,1,basic->TestFirm.c_str());
    
     m_ListView.InsertItem(id,"测试人员");
     m_ListView.SetItemText(id,0,"测试人员");
     m_ListView.SetItemText(id++,1,basic->TestCrew.c_str());
     m_ListView.InsertItem(id,"测试时间");
     m_ListView.SetItemText(id,0,"测试时间");
     m_ListView.SetItemText(id++,1,basic->TestTime.c_str());
    
     m_ListView.InsertItem(id,"固件版本");
     m_ListView.SetItemText(id,0,"固件版本");
     s.Format("%d",basic->WareVersion);
     m_ListView.SetItemText(id++,1,s);
    
     m_ListView.InsertItem(id,"备注");
     m_ListView.SetItemText(id,0,"备注");
     m_ListView.SetItemText(id,1,basic->Remark.c_str());
        
}
void
CDeviceParameter::ShowChannelView(
    CListCtrl *view,
    const BChannelStyleSet *channel
    )
{
    //TODO:在view中显示channel内容
    int id;
    int k;
    CString s;
    m_ListView.SetExtendedStyle(
          LVS_EX_FLATSB    // 扁平风格滚动
        | LVS_EX_FULLROWSELECT    // 允许整行选中
        | LVS_EX_HEADERDRAGDROP    // 允许标题拖拽
        | LVS_EX_GRIDLINES    // 画出网格线
        );
    this->ClearDeviceView(&m_ListView);
    id = 1;
    m_ListView.InsertColumn(id++,"通道号",LVCFMT_LEFT,60);
    m_ListView.InsertColumn(id++,"通道名称",LVCFMT_LEFT,70);
    m_ListView.InsertColumn(id++,"传感器类型",LVCFMT_LEFT,80);
    m_ListView.InsertColumn(id++,"单位",LVCFMT_LEFT,40);
    m_ListView.InsertColumn(id++,"积分",LVCFMT_LEFT,50);
    m_ListView.InsertColumn(id++,"传感器灵敏度",LVCFMT_LEFT,90);
    m_ListView.InsertColumn(id++,"灵敏度单位",LVCFMT_LEFT,80);
    m_ListView.InsertColumn(id++,"量程上限",LVCFMT_LEFT,70);
    m_ListView.InsertColumn(id++,"量程下限",LVCFMT_LEFT,70);
    m_ListView.InsertColumn(id++,"报警值",LVCFMT_LEFT,60);
    m_ListView.InsertColumn(id,"停机值",LVCFMT_LEFT,60);
    for(id = 0;id < channel->Count;id++)
    {
        k = 0;
        s.Format("%d",channel->Value[id].Index + 1);
        m_ListView.InsertItem(id,s);
        m_ListView.SetItemText(id,k++,s);
        m_ListView.SetItemText(id,k++,channel->Value[id].Name.c_str());
        if (channel->Value[id].Type == 0)
        {
            s.Format("位移(涡流)",channel->Value[id].Type);
        }
        else if (channel->Value[id].Type == 1)
        {
            s.Format("加速度",channel->Value[id].Type);
        }
        else if (channel->Value[id].Type == 2)
        {
            s.Format("速度",channel->Value[id].Type);
        }
        m_ListView.SetItemText(id,k++,s);
        m_ListView.SetItemText(id,k++,channel->Value[id].Unit.c_str());
        if (channel->Value[id].Integral == 0)
        {
            s.Format("不积分",channel->Value[id].Integral);
        }
        else
        {
            s.Format("积分",channel->Value[id].Integral);
        }
        m_ListView.SetItemText(id,k++,s);
        s.Format("%f",channel->Value[id].Sensitivity);
        m_ListView.SetItemText(id,k++,s);
        m_ListView.SetItemText(id,k++,channel->Value[id].SensationUnit.c_str());
        s.Format("%d",channel->Value[id].UpperLimit);
        m_ListView.SetItemText(id,k++,s);
        s.Format("%d",channel->Value[id].LowerLimit);
        m_ListView.SetItemText(id,k++,s);
        s.Format("%d",channel->Value[id].Alarm);
        m_ListView.SetItemText(id,k++,s);
        s.Format("%d",channel->Value[id].Stop);
        m_ListView.SetItemText(id,k++,s);

    }

}

void
CDeviceParameter::ShowPairView(
    CListCtrl *view,
    const BChannelPairSet *pair, 
    const BChannelStyleSet *channel
    )
{
    //TODO:在view中显示pair内容
    int id;
    int k;
    CString s;
    m_ListView.SetExtendedStyle(
          LVS_EX_FLATSB    // 扁平风格滚动
        | LVS_EX_FULLROWSELECT    // 允许整行选中
        | LVS_EX_HEADERDRAGDROP    // 允许标题拖拽
        | LVS_EX_GRIDLINES    // 画出网格线
        );
    this->ClearDeviceView(&m_ListView);

    id = 1;
    m_ListView.InsertColumn(id++,"通道对号",LVCFMT_LEFT,100);
    m_ListView.InsertColumn(id++,"通道对名称",LVCFMT_LEFT,100);
    m_ListView.InsertColumn(id++,"X通道",LVCFMT_LEFT,100);
    m_ListView.InsertColumn(id,"Y通道",LVCFMT_LEFT,100);
    for(id = 0;id < pair->Count;id++)
    {
        k = 0;
        s.Format("%d",id + 1);
        m_ListView.InsertItem(id,s);
        m_ListView.SetItemText(id,k++,s);
        m_ListView.SetItemText(id,k++,pair->Value[id].Name.c_str());
        //s.Format("%d",pair->Value[id].Left);
        m_ListView.SetItemText(id,k++,channel->Value[pair->Value[id].Left].Name.c_str());
        //s.Format("%d",pair->Value[id].Right);
        m_ListView.SetItemText(id,k++,channel->Value[pair->Value[id].Right].Name.c_str());
    }
}
void
CDeviceParameter::ShowElementView(
    CListCtrl *view,
    const BFactorElement *element 
    )
{
    //TODO:在view中显示element内容
    //BFactorElement bfe;
    CString s;
    CString s1;
    int id;
    m_ListView.SetExtendedStyle(
          LVS_EX_FLATSB    // 扁平风格滚动
        | LVS_EX_FULLROWSELECT    // 允许整行选中
        | LVS_EX_HEADERDRAGDROP    // 允许标题拖拽
        | LVS_EX_GRIDLINES    // 画出网格线
        );
    this->ClearDeviceView(&m_ListView);
    id = 0;
    m_ListView.InsertColumn(id++,"采集因子",LVCFMT_LEFT,150);
    m_ListView.InsertColumn(id++,"值",LVCFMT_LEFT,150);
    m_ListView.InsertColumn(id,"默认值",LVCFMT_LEFT,150);
    id = 0;
    m_ListView.InsertItem(id,"固有因子");
    m_ListView.SetItemText(id,0,"固有因子");
    s.Format("%14.13f",element->Natural);
    m_ListView.SetItemText(id,1,s);
    s.Format("%14.13f",3.1195068359375);
    m_ListView.SetItemText(id++,2,s);
    m_ListView.InsertItem(id,"通用因子");
    m_ListView.SetItemText(id,0,"通用因子");
    s.Format("%f",element->Normal);
    m_ListView.SetItemText(id,1,s);
    s1.Format("%f",1.0);
    m_ListView.SetItemText(id++,2,s1);
    m_ListView.InsertItem(id,"位移(涡流)信号因子");
    m_ListView.SetItemText(id,0,"位移(涡流)信号因子");
    s.Format("%f",element->Displacement);
    m_ListView.SetItemText(id,1,s);
    m_ListView.SetItemText(id++,2,s1);
    m_ListView.InsertItem(id,"速度信号因子");
    m_ListView.SetItemText(id,0,"速度信号因子");
    s.Format("%f",element->Speed);
    m_ListView.SetItemText(id,1,s);
    m_ListView.SetItemText(id++,2,s1);
    m_ListView.InsertItem(id,"加速度信号因子");
    m_ListView.SetItemText(id,0,"加速度信号因子");
    s.Format("%f",element->Acceleration);
    m_ListView.SetItemText(id,1,s);
    m_ListView.SetItemText(id++,2,s1);
    m_ListView.InsertItem(id,"加速度信号积分因子");
    m_ListView.SetItemText(id,0,"加速度信号积分因子");
    s.Format("%f",element->AccelerationIntegral);
    m_ListView.SetItemText(id,1,s);
    m_ListView.SetItemText(id++,2,s1);
    m_ListView.InsertItem(id,"负荷因子");
    m_ListView.SetItemText(id,0,"负荷因子");
    s.Format("%f",element->Load);
    m_ListView.SetItemText(id,1,s);
    m_ListView.SetItemText(id++,2,s1);
   
}
void
CDeviceParameter::ShowCaptureView(
    CListCtrl *view,
    const BConfigCapture *capture 
    )
{
    //TODO:在view中显示capture内容
    int id;
    //BConfigCapture bcfc;
    CString s;
   m_ListView.SetExtendedStyle(
          LVS_EX_FLATSB    // 扁平风格滚动
        | LVS_EX_FULLROWSELECT    // 允许整行选中
        | LVS_EX_HEADERDRAGDROP    // 允许标题拖拽
        | LVS_EX_GRIDLINES    // 画出网格线
        );
    this->ClearDeviceView(&m_ListView);
    id = 0;
    m_ListView.InsertColumn(id++,"采集选项信息",LVCFMT_LEFT,150);
    m_ListView.InsertColumn(id++,"取值",LVCFMT_LEFT,150);
    m_ListView.InsertColumn(id,"备注",LVCFMT_LEFT,150);
    id = 0;
    m_ListView.InsertItem(id,"定时存储");
    m_ListView.SetItemText(id,0,"定时存储");
    if (capture->Time_Save == false)
     {
         s.Format("不定时存储",capture->Time_Save);
         m_ListView.SetItemText(id++,1,s);
       
     }
     else if (capture->Time_Save == true)
     {
         s.Format("定时存储",capture->Time_Save);
         m_ListView.SetItemText(id++,1,s);
        
     }
    m_ListView.InsertItem(id,"时间间隔");
    m_ListView.SetItemText(id,0,"时间间隔");
    s.Format("%d",capture->Delta_Time);
    m_ListView.SetItemText(id,1,s);
    m_ListView.SetItemText(id++,2,"定时存储条件下单位为s");
    m_ListView.InsertItem(id,"变转速存储");
    m_ListView.SetItemText(id,0,"变转速存储");
    if (capture->RPM_Save == false)
     {
         s.Format("不变转速存储",capture->RPM_Save);
         m_ListView.SetItemText(id++,1,s);
     }
     else if (capture->RPM_Save == true)
     {
         s.Format("变转速存储",capture->RPM_Save);
         m_ListView.SetItemText(id++,1,s);
     }
    m_ListView.InsertItem(id,"升速");
    m_ListView.SetItemText(id,0,"升速");
    if (capture->RPM_up == false)
     {
         s.Format("不升速存储",capture->RPM_up);
         m_ListView.SetItemText(id,1,s);
         s = "变转速存储条件下";
         m_ListView.SetItemText(id++,2,s);
     }
     else if (capture->RPM_up == true)
     {
         s.Format("升速存储",capture->RPM_up);
         m_ListView.SetItemText(id,1,s);
         s = "变转速存储条件下";
         m_ListView.SetItemText(id++,2,s);
     }
  
    m_ListView.InsertItem(id,"降速");
    m_ListView.SetItemText(id,0,"降速");
    if (capture->RPM_down == false)
     {
         s.Format("不降速存储",capture->RPM_down);
         m_ListView.SetItemText(id,1,s);
         s = "变转速存储条件下";
         m_ListView.SetItemText(id++,2,s);
     }
     else if (capture->RPM_down == true)
     {
         s.Format("降速存储",capture->RPM_down);
         m_ListView.SetItemText(id,1,s);
         s = "变转速存储条件下";
         m_ListView.SetItemText(id++,2,s);
     }
    m_ListView.InsertItem(id,"转速间隔");
    m_ListView.SetItemText(id,0,"转速间隔");
    s.Format("%d",capture->Delta_RPM);
    m_ListView.SetItemText(id,1,s);
    m_ListView.SetItemText(id++,2,"变转速条件下单位为RPM");
    m_ListView.InsertItem(id,"键相方式");
    m_ListView.SetItemText(id,0,"键相方式");
    if (capture->Outkey == false)
     {
         s.Format("内键相方式",capture->Outkey);
         m_ListView.SetItemText(id++,1,s);
     }
     else if (capture->Outkey == true)
     {
         s.Format("外键相方式",capture->Outkey);
         m_ListView.SetItemText(id++,1,s);
     }
    m_ListView.InsertItem(id,"内键相转速");
    m_ListView.SetItemText(id,0,"内键相转速");
    s.Format("%d",capture->Inkey_rpm);
    m_ListView.SetItemText(id,1,s);
    m_ListView.SetItemText(id++,2,"单位为RPM");
   
    m_ListView.InsertItem(id,"负荷变化");
    m_ListView.SetItemText(id,0,"负荷变化");
    s.Format("%d",capture->Delta_Road);
    m_ListView.SetItemText(id,1,s);
    m_ListView.SetItemText(id++,2,"单位为MW");
   
    m_ListView.InsertItem(id,"采集方式");
    m_ListView.SetItemText(id,0,"采集方式");
    if (capture->AutoCatch == false)
     {
         s.Format("系统不自动采集",capture->AutoCatch);
         m_ListView.SetItemText(id,1,s);
     }
     else if (capture->AutoCatch == true)
     {
         s.Format("系统启动自动采集",capture->AutoCatch);
         m_ListView.SetItemText(id,1,s);
     }
}
void
CDeviceParameter::OnSize(
    UINT nType,
    int cx,
    int cy
    )
{
    CWnd *pWnd;
    CRect rect;
    LONG cWidth,cHeight; //记录控件的左部到窗体右部的距离,记录控件的底部到窗体底部的距离
   
    CDialog::OnSize(nType, cx, cy);
   
    //窗体大小发生变动。处理函数ReSize
    /*if (nType == SIZE_RESTORED || nType == SIZE_MAXIMIZED) 
    {
        ReSize();
    }*/
    /*if (nType == SIZE_RESTORED || nType == SIZE_MAXIMIZED)
    {
        pWnd = GetDlgItem(IDC_TREEVIEWSHOW);
        if (pWnd)
        {
               
            pWnd->GetWindowRect(&rect);
            ScreenToClient(&rect);
            rect.left = rect.left * cx / m_rect.Width();
            rect.right = rect.right * cx / m_rect.Width();
            rect.top = rect.top * cy / m_rect.Height();
            rect.bottom = rect.bottom * cy / m_rect.Height();
            pWnd->MoveWindow(rect);
        }
        pWnd = GetDlgItem(IDC_STATIC_TREE);
        if (pWnd)
        {
               
            pWnd->GetWindowRect(&rect);
            ScreenToClient(&rect);
            rect.left = rect.left * cx / m_rect.Width();
            rect.right = rect.right * cx / m_rect.Width();
            rect.top = rect.top * cy / m_rect.Height();
            rect.bottom = rect.bottom * cy / m_rect.Height();
            pWnd->MoveWindow(rect);
        }
        pWnd = GetDlgItem(IDC_LISTVIEW);
        if (pWnd)
        {
               
            pWnd->GetWindowRect(&rect);
            ScreenToClient(&rect);
            rect.left = rect.left * cx / m_rect.Width();
            rect.right = rect.right * cx / m_rect.Width();
            rect.top = rect.top * cy / m_rect.Height();
            rect.bottom = rect.bottom * cy / m_rect.Height();
            pWnd->MoveWindow(rect);
        }
           
        pWnd = GetDlgItem(IDC_CLOSE);
        if (pWnd)
        {
            pWnd->GetWindowRect(&rect);
            ScreenToClient(&rect);
            rect.left = rect.left * cx / m_rect.Width();
            rect.right = rect.right * cx / m_rect.Width();
            rect.top = rect.top * cy / m_rect.Height();
            rect.bottom = rect.bottom * cy / m_rect.Height();
            pWnd->MoveWindow(rect);
        }
        GetClientRect(&m_rect);
           
    }       
  
    if (nType == SIZE_MAXIMIZED) 
    {
        pWnd = GetDlgItem(IDC_TREEVIEWSHOW);
        if (pWnd)
        {
           
            pWnd->GetWindowRect(&rect);
            ScreenToClient(&rect);
            rect.right = 200;
            rect.top = 35;
            rect.bottom = 630;
            pWnd->MoveWindow(rect);
        }
        pWnd = GetDlgItem(IDC_STATIC_TREE);
        if (pWnd)
        {
           
            pWnd->GetWindowRect(&rect);
            ScreenToClient(&rect);
            rect.right = 220;
            rect.top = 10;
            rect.bottom = 650;
            pWnd->MoveWindow(rect);
        }
        pWnd = GetDlgItem(IDC_LISTVIEW);
        if (pWnd)
        {
           
            pWnd->GetWindowRect(&rect);
            ScreenToClient(&rect);
            rect.left = 250;
            rect.right = 1260;
            rect.top = 10;
            rect.bottom = 650;
            pWnd->MoveWindow(rect);
        }
       
        pWnd = GetDlgItem(IDC_CLOSE);
        if (pWnd)
        {
           
            pWnd->GetWindowRect(&rect);
            ScreenToClient(&rect);
            rect.left = 1100;
            rect.right = 1260;
            rect.top = 670;
            rect.bottom = 700;
            pWnd->MoveWindow(rect);
        }
        GetClientRect(&m_rect);
 
    }*/
    pWnd = GetDlgItem(IDC_STATIC_TREE);     //获取控件句柄
    if(pWnd)//判断是否为空,因为对话框创建时会调用此函数,而当时控件还未创建
    {
            
         pWnd->GetWindowRect(&rect);
         ScreenToClient(&rect);//将控件大小转换为在对话框中的区域坐标
         cWidth = m_rect.Width() - rect.right;
         cHeight = m_rect.Height() - rect.bottom;
         //rect.left = cx - rect.Width() - cWidth;        
         //rect.right = cx - cWidth;
         rect.left = 10;
         rect.right = 210;
         //rect.top = cy - rect.Height() - cHeight;
         //rect.bottom = cy - cHeight; 
         rect.top = 10;
         rect.bottom = cy - 70;
               
         pWnd->MoveWindow(rect);//设置控件大小
    }
    pWnd = GetDlgItem(IDC_TREEVIEWSHOW);   
    if(pWnd)
    {
            
         pWnd->GetWindowRect(&rect);
         ScreenToClient(&rect);
         cWidth = m_rect.Width() - rect.right;
         cHeight = m_rect.Height() - rect.bottom;
         rect.left = 20;
         rect.right = 200;
         rect.top = 35;
         rect.bottom = cy - 75;
               
         pWnd->MoveWindow(rect);
    }
    pWnd = GetDlgItem(IDC_LISTVIEW);   
    if(pWnd)
    {
            
         pWnd->GetWindowRect(&rect);
         ScreenToClient(&rect);
         cWidth = m_rect.Width() - rect.right;
         cHeight = m_rect.Height() - rect.bottom;
         rect.left = 260;
         rect.right = cx - 10;
         rect.top = 10;
         rect.bottom = cy - 70;
               
         pWnd->MoveWindow(rect);
    }
   
    pWnd = GetDlgItem(IDC_CLOSE);
    if(pWnd)
    {
            
         pWnd->GetWindowRect(&rect);
         ScreenToClient(&rect);
         cWidth = m_rect.Width() - rect.right;
         cHeight = m_rect.Height() - rect.bottom;
         rect.left = cx - 90;
         rect.right = cx - 10;
         rect.top = cy - 50;
         rect.bottom = cy - 20;
               
         pWnd->MoveWindow(rect);
    }
    GetClientRect(&m_rect);
   
}
 
  
/*void
CDeviceParameter::ReSize()
{
   
    float fsp[2];
    POINT Newp; //获取现在对话框的大小
    CRect recta;
    CRect Rect;
    int woc;
    CPoint OldTLPoint;
    CPoint TLPoint; //左上角
    CPoint OldBRPoint;
    CPoint BRPoint; //右下角
    HWND hwndChild;
    GetClientRect(&recta); //取客户区大小 
    Newp.x = recta.right - recta.left;
    Newp.y = recta.bottom - recta.top;
    fsp[0] = (float)Newp.x / Old.x;
    fsp[1] = (float)Newp.y / Old.y;
   
    hwndChild = ::GetWindow(m_hWnd,GW_CHILD); //列出所有控件
    while(hwndChild)  
    {  
        woc = ::GetDlgCtrlID(hwndChild);//取得ID
        GetDlgItem(woc)->GetWindowRect(Rect); 
        ScreenToClient(Rect); 
        OldTLPoint = Rect.TopLeft(); 
        TLPoint.x = long(OldTLPoint.x * fsp[0]); 
        TLPoint.y = long(OldTLPoint.y * fsp[1]); 
        OldBRPoint = Rect.BottomRight(); 
        BRPoint.x = long(OldBRPoint.x * fsp[0]); 
        BRPoint.y = long(OldBRPoint.y * fsp[1]); 
        Rect.SetRect(TLPoint,BRPoint); 
        GetDlgItem(woc)->MoveWindow(Rect,TRUE);
        hwndChild = ::GetWindow(hwndChild, GW_HWNDNEXT);  
    }
    Old = Newp;
}*/

/*pWnd = GetDlgItem(IDC_STATIC_TREE);
    if (pWnd)
    {             
         pWnd->GetWindowRect(&rect);
         ScreenToClient(&rect);
         rect.left = 10;
         rect.right = 210;
         rect.top = 10;
         rect.bottom = cy - 70;               
         pWnd->MoveWindow(rect);
    }
   
    if (IsWindowVisible())
    {
        m_TreeView.GetWindowRect(&rect);
        ScreenToClient(&rect);
        rect.left = 20;
        rect.right = 200;
        rect.top = 35;
        rect.bottom = cy - 75;               
        m_TreeView.MoveWindow(rect);   
    }

    if (IsWindowVisible())
    {
        m_ListView.GetWindowRect(&rect);
        ScreenToClient(&rect);
        rect.left = 220;
        rect.right = cx - 10;
        rect.top = 10;
        rect.bottom = cy - 70;               
        m_ListView.MoveWindow(rect);  

    }
    if (IsWindowVisible())
    {
        m_CloseButton.GetWindowRect(&rect);
        ScreenToClient(&rect);
        rect.left = cx - 90;
        rect.right = cx - 10;
        rect.top = cy - 50;
        rect.bottom = cy - 20;         
        m_CloseButton.MoveWindow(rect);

    }

    GetClientRect(&m_rect);*/

 

configset.h文件
#ifndef _configset_h
#define _configset_h
#include "configdefine.h"
#include "configpair.h"
#include "configbasic.h"
#include "configcapture.h"
#include "configchannel.h"
#include "configfactor.h"
#include "popular.h"
 
 

typedef
struct _BConfigSet :public BConfigDef,public BPopular
{   
    bool Valid;                         //配置是否有效,只有有效才能启动采集,动态设定
    //BDeviceid DeviceID;                 //设备ID
    BConfigBasic        Basic;          //基本信息  [Basic]
    BConfigCapture      Capture;        //采集信息  [Capture]
    //BConfigOption       Option;         //通道参数  [Option]
    BChannelStyleSet    ChannelSet;     //通道集    [Channel-#] ChanSet   
    BChannelPairSet     PairSet;        //通道对    [Pair-#]
    BFactorElement      Factor;         //采集因子信息
    _BConfigSet()
    {
        Clear();
    }
    void Clear()
    {
        Valid = false;       
        Basic.Clear();
        Capture.Clear();
        //Option.Clear();
    }
    _BConfigSet(const _BConfigSet &right)
    {
        *this = right;
    }
    _BConfigSet &operator=(const _BConfigSet &right)
    {
        if (this == &right)
        {
            return *this;
        }
        static_cast<BPopular&>(*this) = right;
        Valid = right.Valid;
        //DeviceID = right.DeviceID;
        Basic = right.Basic;
        Capture = right.Capture;
        //Option = right.Option;
        ChannelSet = right.ChannelSet;
        PairSet = right.PairSet;
        Factor = right.Factor;
        return *this;
    }
    virtual void Read(CMarkup &xml);
    virtual void Write(CMarkup &xml);
}BConfigSet;

typedef BPopularManager<BConfigSet>BConfigSetManager;

#endif
 
configset.cpp文件
#include "stdafx.h"
#include "configset.h"
void _BConfigSet::Read(CMarkup &xml)
{
    string tag;
    xml.IntoElem();
    while (xml.FindElem())
    {
        tag = xml.GetTagName();
        if (tag == SECT_BASIC)
        {
            //ReadBasic(xml,Basic);
            Basic.Read(xml);
            DeviceID = Basic.DeviceID;
            continue;
        }
        //if (tag == SECT_FACTOR){ReadFactor(xml,Factor);continue;}       
        if (tag == SECT_FACTOR){ Factor.Read(xml);continue;}       
        //if (tag == SECT_CAPTURE){ReadCapture(xml,Capture);continue;}       
        if (tag == SECT_CAPTURE){ Capture.Read(xml);continue;}       
        if (tag == SECT_CHANNELS)
        {
            ChannelSet.Count = BString::str2l(xml.GetAttrib(SECT_COUNT));
            //Option.Channels = ;
            //ReadChannels(xml,BString::str2l(Option.Channels),ChannelSet);continue;
            ChannelSet.Read(xml);continue;
        }
        if (tag == SECT_PAIRS)
        {
            //Option.Pairs = xml.GetAttrib(SECT_COUNT);
            PairSet.Count = BString::str2l(xml.GetAttrib(SECT_COUNT));
            //ReadPairs(xml,BString::str2l(Option.Pairs),PairSet);continue;
            PairSet.Read(xml);continue;
        }

    }       
    xml.OutOfElem();
    DeviceID = Basic.DeviceID;//!!!
}
void _BConfigSet::Write(CMarkup &xml)
{
   xml.IntoElem();
        xml.AddElem(SECT_BASIC);
        //WriteBasic(xml,Basic);
        Basic.Write(xml);
       
        xml.AddElem(SECT_FACTOR);
        //WriteFactor(xml,Factor);
        Factor.Write(xml);
        xml.AddElem(SECT_CAPTURE);
        //WriteCapture(xml,Capture);
        Capture.Write(xml);
        xml.AddElem(SECT_CHANNELS);
        xml.AddAttrib(SECT_COUNT,ChannelSet.Count);
        //WriteChannels(xml,BString::str2l(Option.Channels),ChannelSet);
        ChannelSet.Write(xml);
        xml.AddElem(SECT_PAIRS);
        xml.AddAttrib(SECT_COUNT,PairSet.Count);
        //WritePairs(xml,BString::str2l(Option.Pairs),PairSet);
        PairSet.Write(xml);
    xml.OutOfElem();
}
 
configbasic.h文件
#ifndef _configbasic_h
#define _configbasic_h
#include "configdefine.h"

typedef
struct _BConfigBasic :public BConfigDef
{
    string StorePath;                  //存储路径   
    string PlantName;                  //厂名
    string UnitName;                   //机组名
    int     RatingRPM;                  //额定转速       RevNormal
    int     RatingPower;                //额定功率
    string TestFirm;                   //测试单位
    string TestCrew;                   //测试人员
    string TestTime;                   //测试时间
    bool    Clockwise;                 //顺时针方向 false 逆时针方向 true (从机头看机尾)
    //string Anticlockwise;              //
    string Remark;                     //备注
    int MaxPower;                       //最大功率 MaxMW
    BDeviceid DeviceID;                //设备ID
    int WareVersion;                    //固件版本
    _BConfigBasic()
    {
        Clear();
    }
    void Clear()
    {
        StorePath.clear();        
        PlantName.clear();        
        UnitName.clear();         
        //RatingRPM.clear();        
        RatingRPM = 0;
        //RatingPower.clear();      
        RatingPower = 0;
        TestFirm.clear();         
        TestCrew.clear();         
        TestTime.clear();         
        //Clockwise.clear();        
        Clockwise = true;
        //Anticlockwise.clear();    
        Remark.clear();           
        //MaxPower.clear();         
        MaxPower = 0;
        //DeviceIndex.clear();      
        //WareVersion.clear();  
        WareVersion = 0;
    }
    _BConfigBasic(const _BConfigBasic &right)
    {
        *this = right;
    }
    _BConfigBasic &operator=(const _BConfigBasic &right)
    {
        StorePath      = right.StorePath;        
        PlantName      = right.PlantName;        
        UnitName       = right.UnitName;         
        RatingRPM      = right.RatingRPM;        
        RatingPower    = right.RatingPower;      
        TestFirm       = right.TestFirm;         
        TestCrew       = right.TestCrew;         
        TestTime       = right.TestTime;         
        Clockwise      = right.Clockwise;        
        //Anticlockwise  = right.Anticlockwise;    
        Remark         = right.Remark;           
        MaxPower       = right.MaxPower;         
        DeviceID    = right.DeviceID;      
        WareVersion    = right.WareVersion;    
        return *this;
    }
    string RootPath()
    {
        return StorePath + "\\bd_" + UnitName;
    }
    virtual void Read(CMarkup &xml);
    virtual void Write(CMarkup &xml);
}BConfigBasic;
#endif
 
ConfigFactor.h文件
#ifndef _configfactor_h
#define _configfactor_h
#include "configdefine.h"
typedef
struct _BFactorElement :public BConfigDef
{
   
    double Natural;             // 固有因子
    double Normal;              // 通用因子
    double Displacement;        // 位移(涡流)信号因子   
    double Speed;               // 速度信号因子   
    double SpeedIntegral;       // 速度信号积分因子   
    double Acceleration;        // 加速度信号因子   
    double AccelerationIntegral;// 加速度信号积分因子
    double Load;                // 负荷比例
    void Clear()
    {
        Natural = DEFAULT_NATURAL_FACTOR;
        Normal = 1.0;
        Displacement = 1.0;
        Speed = 1.0;
        SpeedIntegral = 1.0;
        Acceleration = 1.0;
        AccelerationIntegral = 1.0;
        Load = DEFAULT_LOAD_FACTOR;
    }
    _BFactorElement()
    {
        Clear();
    }
    _BFactorElement(const _BFactorElement &right)
    {
        *this = right;
    }
    _BFactorElement &operator=(const _BFactorElement &right)
    {
        Natural              = right.Natural;            
        Normal               = right.Normal;             
        Displacement         = right.Displacement;       
        Speed                = right.Speed;              
        SpeedIntegral        = right.SpeedIntegral;      
        Acceleration         = right.Acceleration;       
        AccelerationIntegral = right.AccelerationIntegral;
        Load                 = right.Load;               
        return *this;
    }
    virtual void Read(CMarkup &xml);
    virtual void Write(CMarkup &xml);
}BFactorElement;

#endif
 
ConfigPair.h文件
#ifndef _configpair_h
#define _configpair_h
#include "configdefine.h"

typedef
struct _BChannelPair :public BConfigDef
{
    string Name;                    //通道对名称
    //int Left;
    //int Right
    int Left;                    //通道对Left名称
    int Right;                   //通道对Right名称

    _BChannelPair()
    {
        Clear();
    }
    _BChannelPair(const _BChannelPair &right)
    {
        *this = right;
    }
    _BChannelPair &operator=(const _BChannelPair &right)
    {
        Name = right.Name;
        Left = right.Left;
        Right = right.Right;
        return *this;
    }
    void Clear()
    {
        Name.clear();
        Left = 0;
        Right = 0;
    }
    virtual void Read(CMarkup &xml);
    virtual void Write(CMarkup &xml);
}BChannelPair;
 
typedef
struct _BChannelPairSet :public BConfigDef
{
    int Count;                                          //通道对数量
    BChannelPair Value[MAX_CHANNELS];
    _BChannelPairSet()
    {
        Clear();
    }
    void Clear()
    {
        int i;
        Count = 0;
        for (i = 0; i < MAX_CHANNELS; i++)
        {
            Value[i].Clear();
        }
    }
    _BChannelPairSet(const _BChannelPairSet &right)
    {
        *this = right;
    }
    _BChannelPairSet &operator=(const _BChannelPairSet &right)
    {
        int i;
        Count = right.Count;
        for (i = 0; i < MAX_CHANNELS; i++)
        {
            Value[i] = right.Value[i];
        }
        return *this;
    }
    virtual void Read(CMarkup &xml);
    virtual void Write(CMarkup &xml);
}BChannelPairSet;
#endif
 
ConfigChannel.h文件
#ifndef _configchannel_h
#define _configchannel_h
#include "configdefine.h"

//typedef
//struct _BChannelStyle
//{
//    string Name;                     //通道名称
//    string Sentype;                  //传感器类型
//    string Unitname;                 //单位
//    string Integral;                 //积分
//    string Senlm;                    //传感器灵敏度
//    string Senlmunit;                //灵敏度单位
//    string Maxval;                   //量程上限
//    string Minval;                   //量程下限
//    string Warnningval;              //报警值
//    string Stopval;                  //停机值
//
//}BChannelStyle;
typedef
struct _BChannelStyle :public BConfigDef
{
public:
    int Index;              //通道索引号
    string Name;            //第零列为通道名称
    BSensorStyle Type;      //第一列为传感器类型
    string Unit;            //第二列为单位
    BIntegralStyle Integral;//第三列为是否积分 true:积分
    double Sensitivity;     //第四列为传感器灵敏度
    string SensationUnit;   //第五列为灵敏度单位
    int UpperLimit;         //第六列为量程上限
    int LowerLimit;         //第七列为量程下限
    int Alarm;              //第八列为报警值
    int Stop;               //第九列为停机值
public:
    _BChannelStyle()
    {
    }
    _BChannelStyle(const _BChannelStyle &right)
    {
        *this = right;
    }
    _BChannelStyle &operator=(const _BChannelStyle &right)
    {
        Index = right.Index;
        Name = right.Name;
        Type = right.Type;
        Unit = right.Unit;
        Integral = right.Integral;
        Sensitivity = right.Sensitivity;
        SensationUnit = right.SensationUnit;
        UpperLimit = right.UpperLimit;
        LowerLimit = right.LowerLimit;
        Alarm = right.Alarm;
        Stop = right.Stop;
        return *this;
    }
    void Clear()
    {
        Index = 0;
        Name.clear();
        Type = bsDisplacement;
        Unit.clear();
        Integral = isUnIntegral;
        Sensitivity = 0.0;
        SensationUnit.clear();
        UpperLimit = 0;
        LowerLimit = 0;
        Alarm = 0;
        Stop = 0;
    }
    //小数点类型
    //规则
    //加速度 + 不积分 2dot
    //加速度 + 积分   1dot
    //速度   + 不积分 1dot
    //速度   + 积分   0dot
    //位移            0dot
    BDotStyle DotStyle()
    {
        if (Type == bsAcceleration && Integral == false)
        {
            return dsPercentile;
        }
       
        if ((Type == bsAcceleration && Integral != false) ||
            (Type == bsVelocity && Integral == false))
        {
            return dsDecile;
        }
        return dsNormal;
    }
    virtual void Read(CMarkup &xml);
    virtual void Write(CMarkup &xml);
    //void ReadChannel(CMarkup &xml);
    //void WriteChannel(CMarkup &xml);
}BChannelStyle;
//typedef BChannelStyle BChannelStyle;
//typedef vector<BChannelStyle>BChannelStyleSet;
typedef
struct _BChannelStyleSet :public BConfigDef
{
    int Count;                                      //通道数目
    BChannelStyle Value[MAX_CHANNELS];
    _BChannelStyleSet()
    {
        Clear();
    }
    void Clear()
    {
        int i;
        Count = 0;
        for (i = 0; i < MAX_CHANNELS; i++)
        {
            Value[i].Clear();
        }
    }
    _BChannelStyleSet(const  _BChannelStyleSet &right)
    {
        *this = right;
    }
    _BChannelStyleSet &operator=(const _BChannelStyleSet &right)
    {  
        int i;
        Count = right.Count;
        for (i = 0; i < MAX_CHANNELS; i++)
        {
            Value[i] = right.Value[i];
        }
        return *this;
    }
    //
    int IndexOf(const char *name)
    {
        return IndexOf((string)name);
    }
    int IndexOf(const string &name)
    {
        int i;
        for (i = 0; i < Count; i++)
        {
            if (name == Value[i].Name)
            {
                return i;
            }
        }
        return 0;
    }
    BChannelStyle &operator[](int index)
    {
        index = index % MAX_CHANNELS;
        return Value[index];
    }
    virtual void Read(CMarkup &xml);
    virtual void Write(CMarkup &xml);
    //void ReadChannels(CMarkup &xml,long count);
    //void WriteChannels(CMarkup &xml,long count);
}BChannelStyleSet;
 
 
#endif
 
ConfigCapture.h文件
#ifndef _configcapture_h
#define _configcapture_h
#include "configdefine.h"
typedef
struct _BConfigCapture :public BConfigDef
{
    bool Time_Save;                  //定时存储
    bool RPM_Save;                   //变转速存储
    int Delta_Time;                 //时间间隔
    bool RPM_up;                     //升速
    bool RPM_down;                   //降速
    int Delta_RPM;                  //转速间隔
    bool Outkey;                     //外键相     bOKeyPhasor
    int Inkey_rpm;                  //内键相转速
    int Delta_Road;                 //负荷
    bool AutoCatch;                  //系统启动自动采集
    _BConfigCapture()
    {
        Clear();
    }
    void Clear()
    {
        Time_Save = false;
        RPM_Save = false;
        Delta_Time = 0;       
        RPM_up = false;           
        RPM_down = false;
        Delta_RPM = 0;        
        Outkey = false;
        Inkey_rpm = 0;
        Delta_Road = 0;
        AutoCatch = true;
    }
    _BConfigCapture( const _BConfigCapture &right)
    {
        *this = right;
    }
    _BConfigCapture &operator=(const _BConfigCapture &right)
    {
        Time_Save   = right.Time_Save;     
        RPM_Save    = right.RPM_Save;      
        Delta_Time  = right.Delta_Time;    
        RPM_up      = right.RPM_up;        
        RPM_down    = right.RPM_down;      
        Delta_RPM   = right.Delta_RPM;     
        Outkey      = right.Outkey;        
        Inkey_rpm   = right.Inkey_rpm;     
        Delta_Road  = right.Delta_Road;    
        AutoCatch   = right.AutoCatch;     
       
        return *this;
    }
    virtual void Read(CMarkup &xml);
    virtual void Write(CMarkup &xml);
}BConfigCapture;
#endif

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值