newntui/discovermdi/src/qaparams.cpp
//---------------------------------------------------------------------------------------
// This public function will query the server to fill all properties of the node 
// with the nodename mentioned.
//---------------------------------------------------------------------------------------
This public function will query the server to fill all properties of the node
with the nodename mentioned.
This public function will query the server to fill all properties of the node with the nodename mentioned .
void CQAParams::FillPropertiesOfNode(CString & node) {
CString query;
CString type;
CString status;
CString weight;
CString thresh;
CString score;
CString total;
CString hits;
BSTR sysQuery;
int i=1;
    m_Properties.Clear();
    if(node.GetLength()==0) {
         m_Properties.SetCols(2);
		 return;
	}
    query.Format("sev_get {%s} type",node);
    sysQuery=query.AllocSysString();
    type=DataSourceAccessSync(&sysQuery);
	SysFreeString(sysQuery); 
	if(type=="query_1") m_Properties.SetRows(7);
	else                m_Properties.SetRows(6);
    query.Format("sev_get {%s} on",node);
    sysQuery=query.AllocSysString();
    status=m_DataSource.AccessSync(&sysQuery);
	SysFreeString(sysQuery); 
	m_Properties.SetCellType(i,1,3);
	m_Properties.AddMenuItem(i,1,"Enabled");
	m_Properties.AddMenuItem(i,1,"Disabled");
    m_Properties.SetCellText(i,0,"Status");
	if(status=="1")
        m_Properties.SetCellText(i,1,"Enabled");
    else
        m_Properties.SetCellText(i,1,"Disabled");
	i++;
    query.Format("sev_get {%s} weight",node);
    sysQuery=query.AllocSysString();
    weight=DataSourceAccessSync(&sysQuery);
	SysFreeString(sysQuery); 
    m_Properties.SetCellText(i,0,"Weight");
	m_Properties.SetCellType(i,1,1);
    m_Properties.SetCellText(i,1,weight);
	i++;
	if(type=="query_1") {
           m_Properties.SetCellText(i,0,"Threshold");
           query.Format("sev_get {%s} threshold",node);
           sysQuery=query.AllocSysString();
           thresh=DataSourceAccessSync(&sysQuery);
	       SysFreeString(sysQuery); 
	       m_Properties.SetCellType(i,1,1);
           m_Properties.SetCellText(i,1,thresh);
	       i++;
	}
    query.Format("sev_get {%s} score",node);
    sysQuery=query.AllocSysString();
    score=DataSourceAccessSync(&sysQuery);
	SysFreeString(sysQuery); 
    m_Properties.SetCellText(i,0,"Score");
    m_Properties.SetCellText(i,1,score);
	i++;
    query.Format("sev_get {%s} hitno",node);
    sysQuery=query.AllocSysString();
    hits=DataSourceAccessSync(&sysQuery);
	SysFreeString(sysQuery); 
    m_Properties.SetCellText(i,0,"Hits");
    m_Properties.SetCellText(i,1,hits);
	i++;
    query.Format("sev_get {/} score",node);
    sysQuery=query.AllocSysString();
    total=DataSourceAccessSync(&sysQuery);
	SysFreeString(sysQuery); 
    m_Properties.SetCellText(i,0,"Total score");
    m_Properties.SetCellText(i,1,total);
	i++;
}
void CQAParams :: FillPropertiesOfNode ( CString & node ) { CString query ; CString type ; CString status ; CString weight ; CString thresh ; CString score ; CString total ; CString hits ; BSTR sysQuery ; int i = 1 ; m_Properties . Clear ( ) ; if ( node . GetLength ( ) == 0 ) { m_Properties . SetCols ( 2 ) ; return ; } query . Format ( " " , node ) ; sysQuery = query . AllocSysString ( ) ; type = DataSourceAccessSync ( & sysQuery ) ; SysFreeString ( sysQuery ) ; if ( type == " " ) m_Properties . SetRows ( 7 ) ; else m_Properties . SetRows ( 6 ) ; query . Format ( " " , node ) ; sysQuery = query . AllocSysString ( ) ; status = m_DataSource . AccessSync ( & sysQuery ) ; SysFreeString ( sysQuery ) ; m_Properties . SetCellType ( i , 1 , 3 ) ; m_Properties . AddMenuItem ( i , 1 , " " ) ; m_Properties . AddMenuItem ( i , 1 , " " ) ; m_Properties . SetCellText ( i , 0 , " " ) ; if ( status == " " ) m_Properties . SetCellText ( i , 1 , " " ) ; else m_Properties . SetCellText ( i , 1 , " " ) ; i ++ ; query . Format ( " " , node ) ; sysQuery = query . AllocSysString ( ) ; weight = DataSourceAccessSync ( & sysQuery ) ; SysFreeString ( sysQuery ) ; m_Properties . SetCellText ( i , 0 , " " ) ; m_Properties . SetCellType ( i , 1 , 1 ) ; m_Properties . SetCellText ( i , 1 , weight ) ; i ++ ; if ( type == " " ) { m_Properties . SetCellText ( i , 0 , " " ) ; query . Format ( " " , node ) ; sysQuery = query . AllocSysString ( ) ; thresh = DataSourceAccessSync ( & sysQuery ) ; SysFreeString ( sysQuery ) ; m_Properties . SetCellType ( i , 1 , 1 ) ; m_Properties . SetCellText ( i , 1 , thresh ) ; i ++ ; } query . Format ( " " , node ) ; sysQuery = query . AllocSysString ( ) ; score = DataSourceAccessSync ( & sysQuery ) ; SysFreeString ( sysQuery ) ; m_Properties . SetCellText ( i , 0 , " " ) ; m_Properties . SetCellText ( i , 1 , score ) ; i ++ ; query . Format ( " " , node ) ; sysQuery = query . AllocSysString ( ) ; hits = DataSourceAccessSync ( & sysQuery ) ; SysFreeString ( sysQuery ) ; m_Properties . SetCellText ( i , 0 , " " ) ; m_Properties . SetCellText ( i , 1 , hits ) ; i ++ ; query . Format ( " " , node ) ; sysQuery = query . AllocSysString ( ) ; total = DataSourceAccessSync ( & sysQuery ) ; SysFreeString ( sysQuery ) ; m_Properties . SetCellText ( i , 0 , " " ) ; m_Properties . SetCellText ( i , 1 , total ) ; i ++ ; }
This public function will query the server to fill all properties of the node
with the nodename mentioned.
This public function will query the server to fill all properties of the node with the nodename mentioned .
// Getting the node status // Getting the node weight // Getting the type of the node // Getting the node threshold // Getting the node  score // Getting the node set // Getting the node total score