Exemple #1
0
void SVResString::loadAddMonitorStrings(MAPNODE &objNode)
{
    string szCancelTip(""), szTitle(""), szConditionTitle(""), szAddTip(""),
        szCancelEditTip(""), szBackTip(""), szBatchAddTip(""), szContinueAdd(""),
        szContinueAddTip(""), szSetAlert(""), szSetAlertTip(""), szDevice(""), szDeviceHelp(""), 
        szMonitor(""), szMonitorHelp(""), szCheckErr(""), szCheckHelp(""), 
        szDesc(""), szDescHelp(""), szFreq(""), szFreqHelp(""), szFreqErr(""), 
        szPlan(""), szPlanHelp(""), szReport(""), szReportHelp(""), szErrName("");

    FindNodeValue(objNode, "IDS_Cancle_Add_Monitor_Tip",    szCancelTip);
    FindNodeValue(objNode, "IDS_Add_Monitor_Title",         szTitle);
    FindNodeValue(objNode, "IDS_Alert_Condition_Title",     szConditionTitle);
    FindNodeValue(objNode, "IDS_Add_Monitor_Tip",           szAddTip);
    FindNodeValue(objNode, "IDS_Cancel_Current_Edit_Tip",   szCancelEditTip);
    FindNodeValue(objNode, "IDS_Back_Monitor_List_Tip",     szBackTip);
    FindNodeValue(objNode, "IDS_Batch_Add_Tip",             szBatchAddTip);
    FindNodeValue(objNode, "IDS_Continue_Add",              szContinueAdd);
    FindNodeValue(objNode, "IDS_Continue_Add_Tip",          szContinueAddTip);
    FindNodeValue(objNode, "IDS_Set_Default_Alert",         szSetAlert);
    FindNodeValue(objNode, "IDS_Set_Default_Alert_Tip",     szSetAlertTip);
    FindNodeValue(objNode, "IDS_Device_Name",               szDevice);
    FindNodeValue(objNode, "IDS_Device_Name_Help",          szDeviceHelp);
    FindNodeValue(objNode, "IDS_Monitor_Label",             szMonitor);
    FindNodeValue(objNode, "IDS_Monitor_Label_Help",        szMonitorHelp);
    FindNodeValue(objNode, "IDS_Check_Error",               szCheckErr);
    FindNodeValue(objNode, "IDS_Check_Err_Help",            szCheckHelp);
    FindNodeValue(objNode, "IDS_Monitor_Desc",              szDesc);
    FindNodeValue(objNode, "IDS_Monitor_Desc_Help",         szDescHelp);
    FindNodeValue(objNode, "IDS_Error_Freq",                szFreq);
    FindNodeValue(objNode, "IDS_Error_Freq_Help",           szFreqHelp);
    FindNodeValue(objNode, "IDS_Numbic_Error",              szFreqErr);
    FindNodeValue(objNode, "IDS_Plan",                      szPlan);
    FindNodeValue(objNode, "IDS_PlanHelp",                  szPlanHelp);
    FindNodeValue(objNode, "IDS_Report_Desc",               szReport);
    FindNodeValue(objNode, "IDS_Report_Desc_Help",          szReportHelp);
    FindNodeValue(objNode, "IDS_Monitor_Label_Error",       szErrName);

    m_lsResource["IDS_Cancle_Add_Monitor_Tip"] = szCancelTip;
    m_lsResource["IDS_Add_Monitor_Title"] = szTitle;
    m_lsResource["IDS_Add_Monitor_Tip"] = szAddTip;
    m_lsResource["IDS_Cancel_Current_Edit_Tip"] = szCancelEditTip;
    m_lsResource["IDS_Back_Monitor_List_Tip"] = szBackTip;
    m_lsResource["IDS_Batch_Add_Tip"] = szBatchAddTip;
    m_lsResource["IDS_Continue_Add"] = szContinueAdd;
    m_lsResource["IDS_Continue_Add_Tip"] = szContinueAddTip;
    m_lsResource["IDS_Set_Default_Alert"] = szSetAlert;
    m_lsResource["IDS_Set_Default_Alert_Tip"] = szSetAlertTip;
    m_lsResource["IDS_Device_Name"] = szDevice;
    m_lsResource["IDS_Device_Name_Help"] = szDeviceHelp;
    m_lsResource["IDS_Monitor_Label"] = szMonitor;
    m_lsResource["IDS_Monitor_Label_Help"] = szMonitorHelp;
    m_lsResource["IDS_Check_Error"] = szCheckErr;
    m_lsResource["IDS_Check_Err_Help"] = szCheckHelp;
    m_lsResource["IDS_Monitor_Desc"] = szDesc;
    m_lsResource["IDS_Monitor_Desc_Help"] = szDescHelp;
    m_lsResource["IDS_Error_Freq"] = szFreq;
    m_lsResource["IDS_Error_Freq_Help"] = szFreqHelp;
    m_lsResource["IDS_Numbic_Error"] = szFreqErr;
    m_lsResource["IDS_Plan"] = szPlan;
    m_lsResource["IDS_PlanHelp"] = szPlanHelp;
    m_lsResource["IDS_Report_Desc"] = szReport;
    m_lsResource["IDS_Report_Desc_Help"] = szReportHelp;
    m_lsResource["IDS_Monitor_Label_Error"] = szErrName;
}
Exemple #2
0
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 枚举此设备可以使用的所有监测器
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CEccAddMonitor1st::EnumMT(const string &szParentID, const string &szDTName, const string &szNetworkSet)
{
    m_szParentID = szParentID;
    m_szNetworkset = szNetworkSet;

    if(szDTName.empty() || m_szDTName == szDTName)
        return ;

    m_szDTName = szDTName;

    // 移除已有的消息绑定
    removeMapping();

    if(m_pContent)
    {
        m_pContent->clear();

        list<int> lsMTID;
        CEccMainView::m_pTreeView->GetDevMTList(szDTName, lsMTID);
        list<int>::iterator lstItem;
        // 枚举每个监测器模板
        for(lstItem = lsMTID.begin(); lstItem != lsMTID.end(); lstItem++)
        {
            int nMTID = (*lstItem);
            // 打开监测器模板
            OBJECT objMonitor = GetMonitorTemplet(nMTID, CEccMainView::m_szIDCUser, CEccMainView::m_szAddr);
            if(objMonitor != INVALID_VALUE)
            {// 成功
                // 主节点
                MAPNODE node = GetMTMainAttribNode(objMonitor);
                if(node != INVALID_VALUE)
                {
                    // 名称 显示 是否隐藏 描述
                    string szLabel(""), szHidden (""), szDesc ("");
                    if(FindNodeValue(node, svLabel, szLabel))
                        szLabel = SVResString::getResString(szLabel.c_str());
                    
                    if(FindNodeValue(node, svDescription, szDesc))
                        szDesc = SVResString::getResString(szDesc.c_str());

                    FindNodeValue(node, svHidden, szHidden);

                    if(szHidden != "true")
                    {
                        int nRow = m_pContent->numRows();

                        // 监测器显示文字
                        WText *pName = new WText(szLabel, m_pContent->elementAt(nRow, 0));
                        if(pName)
                        {
                            // 文字样式
                            sprintf(pName->contextmenu_, "style='color:#1E5B99;cursor:pointer;' onmouseover='" \
                                "this.style.textDecoration=\"underline\"' " \
                                "onmouseout='this.style.textDecoration=\"none\"'");
                            // 绑定 click
                            connect(pName, SIGNAL(clicked()), "showbar();", &m_MTMapper, SLOT(map()), WObject::ConnectionType::JAVASCRIPTDYNAMIC);
                            m_MTMapper.setMapping(pName, nMTID);
                            pName->setToolTip(szLabel);
                            m_lsText.push_back(pName);
                        }
                        new WText(szDesc, m_pContent->elementAt(nRow, 1));

                        m_pContent->GetRow(nRow)->setStyleClass("padding_top");
                        m_pContent->elementAt(nRow, 0)->setStyleClass("widthbold");
                        m_pContent->elementAt(nRow, 1)->setStyleClass("color_2");
                    }
                }
                // 关闭监测器模板
                CloseMonitorTemplet(objMonitor);
            }
        }
    }
}