Exemple #1
0
void CNewTstatSchedulesDlg::Fresh_List()
{
	ListCtrlEx::CStrList strlist;
	strlist.clear();
	strlist.push_back(L"");
	strlist.push_back(L"Home");
	strlist.push_back(L"Work");
	strlist.push_back(L"Sleep");
	 
	list<Schedule_Node>::iterator it;
	int index=0;
	for (it = m_ScheduleList.begin();it!=m_ScheduleList.end();++it)
	{


		CString strTime;
		int Item=index+1;
		strTime.Format(_T("%d"),Item);
		WeeeklyList.SetItemText(index,0,strTime);
		WeeeklyList.SetItemBkColor(index,0,RGB(255,255,255),0);
		strTime.Format(_T("%02d:%02d"),it->Hour,it->Minite);
		/*WeeeklyList.InsertItem(index++,L"");*/
		WeeeklyList.SetItemText(index,1,strTime);
		WeeeklyList.SetItemBkColor(index,1,RGB(255,255,255),0);
		WeeeklyList.SetWhetherShowBkCol(false);
		//设置Combox
		for (int col = 2;col<10;col++)
		{
			WeeeklyList.SetCellStringList(index, col, strlist);

		}
		WeeeklyList.SetItemText(index,2,m_strScheduleMode[it->Monday]);
		WeeeklyList.SetItemBkColor(index,2,m_COLScheduleMode[it->Monday],0);
		it->Col_Monday = m_COLScheduleMode[it->Monday];
		if (it->Monday == 0&&index!=0)
		{
			COLORREF PreviousScheduleColor=GetItemColor(index-1,2); 
			WeeeklyList.SetItemBkColor(index,2,PreviousScheduleColor,0);
			it->Col_Monday = PreviousScheduleColor;
		}
		  
		WeeeklyList.SetItemText(index,3,m_strScheduleMode[it->Tuesday]);
		WeeeklyList.SetItemBkColor(index,3,m_COLScheduleMode[it->Tuesday],0);
		
		it->Col_Tuesday = m_COLScheduleMode[it->Tuesday];
		if (it->Tuesday == 0&&index!=0)
		{
			COLORREF PreviousScheduleColor=GetItemColor(index-1,3); 
			WeeeklyList.SetItemBkColor(index,3,PreviousScheduleColor,0);
			it->Col_Tuesday = PreviousScheduleColor;
		}

		WeeeklyList.SetItemText(index,4,m_strScheduleMode[it->Wednesday]);
		WeeeklyList.SetItemBkColor(index,4,m_COLScheduleMode[it->Wednesday],0);

		it->Col_Wednesday = m_COLScheduleMode[it->Wednesday];
		if (it->Wednesday == 0&&index!=0)
		{
			COLORREF PreviousScheduleColor=GetItemColor(index-1,4); 
			WeeeklyList.SetItemBkColor(index,4,PreviousScheduleColor,0);
			it->Col_Wednesday = PreviousScheduleColor;
		}

		WeeeklyList.SetItemText(index,5,m_strScheduleMode[it->Thursday]);
		WeeeklyList.SetItemBkColor(index,5,m_COLScheduleMode[it->Thursday],0);

		it->Col_Thursday = m_COLScheduleMode[it->Thursday];
		if (it->Thursday == 0&&index!=0)
		{
			COLORREF PreviousScheduleColor=GetItemColor(index-1,5); 
			WeeeklyList.SetItemBkColor(index,5,PreviousScheduleColor,0);
			it->Col_Thursday = PreviousScheduleColor;
		}

		WeeeklyList.SetItemText(index,6,m_strScheduleMode[it->Friday]);
		WeeeklyList.SetItemBkColor(index,6,m_COLScheduleMode[it->Friday],0);

		it->Col_Friday = m_COLScheduleMode[it->Friday];
		if (it->Friday == 0&&index!=0)
		{
			COLORREF PreviousScheduleColor=GetItemColor(index-1,6); 
			WeeeklyList.SetItemBkColor(index,6,PreviousScheduleColor,0);
			it->Col_Friday = PreviousScheduleColor;
		}

		WeeeklyList.SetItemText(index,7,m_strScheduleMode[it->Saturday]);
		WeeeklyList.SetItemBkColor(index,7,m_COLScheduleMode[it->Saturday],0);

		it->Col_Saturday = m_COLScheduleMode[it->Saturday];
		if (it->Saturday == 0&&index!=0)
		{
			COLORREF PreviousScheduleColor=GetItemColor(index-1,7); 
			WeeeklyList.SetItemBkColor(index,7,PreviousScheduleColor,0);
			it->Col_Saturday = PreviousScheduleColor;
		}

		WeeeklyList.SetItemText(index,8,m_strScheduleMode[it->Sunday]);
		WeeeklyList.SetItemBkColor(index,8,m_COLScheduleMode[it->Sunday],0);
		it->Col_Sunday = m_COLScheduleMode[it->Sunday];
		if (it->Sunday == 0&&index!=0)
		{
			COLORREF PreviousScheduleColor=GetItemColor(index-1,8); 
			WeeeklyList.SetItemBkColor(index,8,PreviousScheduleColor,0);
			it->Col_Sunday = PreviousScheduleColor;
		}

		WeeeklyList.SetItemText(index, 9, m_strScheduleMode[it->Holiday]);
		WeeeklyList.SetItemBkColor(index, 9, m_COLScheduleMode[it->Holiday], 0);
		it->Col_Holiday = m_COLScheduleMode[it->Holiday];
		if (it->Holiday == 0 && index != 0)
		{
			COLORREF PreviousScheduleColor = GetItemColor(index - 1, 9);
			WeeeklyList.SetItemBkColor(index, 9, PreviousScheduleColor, 0);
			it->Col_Holiday = PreviousScheduleColor;
		}


		index++;
	}
}
void CTStatOutputView::Initial_Combox_Show_Tstat(){
    if (ListCtrlEx::ComboBox == m_output_list.GetColumnType(TStat_Range))
    {
        if ((product_register_value[7] == PM_TSTAT6)||(product_register_value[7] == PM_TSTAT7)||(product_register_value[7] == PM_TSTAT8)||(product_register_value[7] == PM_TSTAT5i)
			|| (product_register_value[7] == PM_TSTAT8_WIFI) || (product_register_value[7] == PM_TSTAT8_OCC) || (product_register_value[7] == PM_TSTAT7_ARM) || (product_register_value[7] == PM_TSTAT8_220V)
			){
            for (int lRow=0;lRow<7;lRow++)
            {
                ListCtrlEx::CStrList strlist;
                strlist.clear();
                if (lRow<5)
                {

                    for (int aaa=0;aaa<(int)sizeof(OUTPUT_RANGE45)/sizeof(OUTPUT_RANGE45[0]);aaa++)
                    {
                        strlist.push_back(OUTPUT_RANGE45[aaa]);
                    }

                }
                else{

                    for (int aaa=0;aaa<5;aaa++)
                    {
                        strlist.push_back(OUTPUT_ANRANGE6[aaa]);
                    }

                }

                m_output_list.SetCellStringList(lRow, TStat_Range, strlist);
            }
        }
        else if (product_register_value[7]==1||product_register_value[7]==2||product_register_value[7]==3){
            for (int lRow=0;lRow<5;lRow++)
            {
                ListCtrlEx::CStrList strlist;
                strlist.clear();
                if (lRow<3)
                {


                    for(int i=0;i<3;i++)//2.5.0.98
                    {

                        strlist.push_back(OUTPUT_RANGE5[i]);
                    }

                } 
                else
                {     
                    if (m_tstat_output_data.at(lRow).Function.RegValue==4)
                    {
                        for(int i=5;i<8;i++)//2.5.0.98
                        {
                            strlist.push_back(OUTPUT_ANRANGE[i]);
                        }
                    }
                    else
                    {
                        for(int i=0;i<4;i++)//2.5.0.98
                        {
                            strlist.push_back(OUTPUT_ANRANGE[i]);
                        }
                    }

                }
                m_output_list.SetCellStringList(lRow, TStat_Range, strlist);
            }
        }
        else if (product_register_value[7]==4||product_register_value[7]==12||product_register_value[7]==17||product_register_value[7]==18){

            for (int lRow=0;lRow<7;lRow++)
            {
                ListCtrlEx::CStrList strlist;
                strlist.clear();
                if (lRow<5)
                {
                    for(int i=0;i<3;i++)//2.5.0.98
                    {
                        strlist.push_back(OUTPUT_RANGE5[i]);
                    }
                } 
                else 
                {
                    if (lRow<7)
                    {
                        if (m_tstat_output_data.at(lRow).Function.RegValue==4)//Transducer
                        {
                            for(int i=5;i<10;i++)//2.5.0.98
                            {
                                strlist.push_back(OUTPUT_ANRANGE[i]);
                            }
                        }
                        else
                        {
                            for(int i=0;i<5;i++)//2.5.0.98
                            {
                                strlist.push_back(OUTPUT_ANRANGE[i]);
                            }
                        }

                    }
                    else
                        return;
                }
                m_output_list.SetCellStringList(lRow, TStat_Range, strlist);
            }
        }else if (product_register_value[7]==PM_TSTAT5E||product_register_value[7]==PM_PM5E || product_register_value[7] == PM_PM5E_ARM ||(product_register_value[7]==PM_TSTATRUNAR)){
            for (int lRow=0;lRow<7;lRow++)
            {
                ListCtrlEx::CStrList strlist;
                strlist.clear();
                if (lRow<5)
                {
                    for(int i=0;i<3;i++)//2.5.0.98
                    {
                        strlist.push_back(OUTPUT_RANGE5[i]);
                    }
                } 
                else 
                {
                    if (lRow<7)
                    {
                        if (m_tstat_output_data.at(lRow).Function.RegValue==4)//Transducer
                        {
                            for(int i=5;i<15;i++)//2.5.0.98
                            {
                                strlist.push_back(OUTPUT_ANRANGE[i]);
                            }
                        }
                        else
                        {
                            for(int i=0;i<5;i++)//2.5.0.98
                            {
                                strlist.push_back(OUTPUT_ANRANGE[i]);
                            }
                        }

                    }
                    else
                        return;
                }
                m_output_list.SetCellStringList(lRow, TStat_Range, strlist);
            }
        }
    }

    if (ListCtrlEx::ComboBox == m_output_list.GetColumnType(TStat_Funcation))
    {
        if ((product_register_value[7] == PM_TSTAT6)||(product_register_value[7] == PM_TSTAT7)||(product_register_value[7] == PM_TSTAT8)||(product_register_value[7] == PM_TSTAT5i)
			|| (product_register_value[7] == PM_TSTAT8_WIFI) || (product_register_value[7] == PM_TSTAT8_OCC) || (product_register_value[7] == PM_TSTAT7_ARM) || (product_register_value[7] == PM_TSTAT8_220V)
			)
        {
            for (int lRow=0;lRow<7;lRow++)
            {
                ListCtrlEx::CStrList strlist;
                strlist.clear();
                if (lRow<5)
                {
                    for(int i=0;i<3;i++)//2.5.0.98
                    {
                        strlist.push_back(ONTPUT_FUNS[i]);

                    }
                }
                else
                {
                    for(int i=0;i<5;i++)//2.5.0.98
                    {
                        strlist.push_back(ONTPUT_FUNS[i]);
                        //AfxMessageBox(ONTPUT_FUNS[i]);
                    }
                }

                m_output_list.SetCellStringList(lRow, TStat_Funcation, strlist);
            }
        }
        else
        {
#if 1//2.5.0.98
            int m_nModeType=product_register_value[7];
            if (m_nModeType==2||m_nModeType==3||m_nModeType==1)
            {
                for (int lRow=0;lRow<5;lRow++)
                {
                    ListCtrlEx::CStrList strlist;
                    strlist.clear();
                    if(lRow<3)
                    {
                        for(int i=0;i<4;i++)
                        {
                            strlist.push_back(ONTPUT_FUNS[i]);
                        }    
                    }
                    else if(lRow<5)
                    {

                        for(int i=0;i<5;i++)
                        {
                            strlist.push_back(ONTPUT_FUNS[i]);

                        }

                    }
                    else
                    {
                        return;
                    }
                    m_output_list.SetCellStringList(lRow, TStat_Funcation, strlist);
                }
            } 
            else
            {
                for (int lRow=0;lRow<7;lRow++)
                {
                    ListCtrlEx::CStrList strlist;
                    strlist.clear();

                    if(lRow<5)
                    {

                        for(int i=0;i<4;i++)
                        {
                            strlist.push_back(ONTPUT_FUNS[i]);
                        }

                    }
                    else
                    {

                        for(int i=0;i<5;i++) 
                        {
                            strlist.push_back(ONTPUT_FUNS[i]);
                        }

                    }
                    m_output_list.SetCellStringList(lRow, TStat_Funcation, strlist);
                }
            }

#endif
        }
    }

    if (ListCtrlEx::ComboBox == m_output_list.GetColumnType(TStat_Interlock)){
        int m_nModeType=product_register_value[7];
        if ((product_register_value[7] == PM_TSTAT6)||(product_register_value[7] == PM_TSTAT7)||(product_register_value[7] == PM_TSTAT8)||(product_register_value[7] == PM_TSTAT5i)
			|| (product_register_value[7] == PM_TSTAT8_WIFI) || (product_register_value[7] == PM_TSTAT8_OCC) || (product_register_value[7] == PM_TSTAT7_ARM) || (product_register_value[7] == PM_TSTAT8_220V)
			)
        {
            for (int lRow=0;lRow<7;lRow++)
            {
                ListCtrlEx::CStrList strlist;
                strlist.clear();
                for(int i=0;i<6;i++)
                {
                    strlist.push_back(Interlock[i]);
                    //AfxMessageBox(ONTPUT_FUNS[i]);
                }
                m_output_list.SetCellStringList(lRow, TStat_Interlock, strlist);

            }
        }
#if 1//2.5.0.98
        else if (m_nModeType==2||m_nModeType==3||m_nModeType==1)
        {
            for (int lRow=0;lRow<5;lRow++){
                ListCtrlEx::CStrList strlist;
                strlist.clear();
                if(lRow<3)
                {

                    for(int i=0;i<4;i++)
                    {
                        strlist.push_back(ONTPUT_FUNS[i]);
                    }
                }
                else if(lRow<5)
                {

                    for(int i=0;i<5;i++)
                    {
                        strlist.push_back(ONTPUT_FUNS[i]);

                    }

                }
                else
                {
                    return;
                }
                m_output_list.SetCellStringList(lRow, TStat_Interlock, strlist);
            }


        } 
        else
        {
            for (int lRow=0;lRow<7;lRow++)
            {
                ListCtrlEx::CStrList strlist;
                strlist.clear();
                if(lRow<5)
                {

                    for(int i=0;i<4;i++)
                        //for(int i=0;i<3;i++)//2.5.0.98
                    {
                        strlist.push_back(ONTPUT_FUNS[i]);

                    }

                }
                else
                {

                    for(int i=0;i<5;i++)
                        //for(int i=0;i<3;i++)//2.5.0.98
                    {
                        strlist.push_back(ONTPUT_FUNS[i]);

                    }

                }
                m_output_list.SetCellStringList(lRow, TStat_Interlock, strlist);
            }
        }

#endif
    }

    if (ListCtrlEx::ComboBox == m_output_list.GetColumnType(TStat_Signal_Type)){
        if ((product_register_value[7] == PM_TSTAT6)||(product_register_value[7] == PM_TSTAT7)||(product_register_value[7] == PM_TSTAT8)
			|| (product_register_value[7] == PM_TSTAT8_WIFI) || (product_register_value[7] == PM_TSTAT8_OCC) || (product_register_value[7] == PM_TSTAT7_ARM) || (product_register_value[7] == PM_TSTAT8_220V)
			||(product_register_value[7] == PM_TSTAT5i))
        {
            for (int lRow=0;lRow<7;lRow++)
            {
                ListCtrlEx::CStrList strlist;
                strlist.clear();
                for(int i=5;i<17;i++)//2.5.0.98
                {
                    strlist.push_back(OUTPUT_ANRANGE[i]);
                }
                m_output_list.SetCellStringList(lRow, TStat_Signal_Type, strlist);

            }
        }
    }

}
Exemple #3
0
BOOL CNewTstatSchedulesDlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();
	m_strScheduleMode[0]=L"";
	m_strScheduleMode[1]=L"Home";
	m_strScheduleMode[2]=L"Work";
	m_strScheduleMode[3]=L"Sleep";
	
	m_COLScheduleMode[0] = RGB(238, 44, 44);
	m_COLScheduleMode[1] = RGB(153, 50, 204);
	m_COLScheduleMode[2] = RGB(143, 188, 143);
	m_COLScheduleMode[3] = RGB(238, 44, 44);

	LoadSheduleDataAndColor();
	WeeeklyList.ModifyStyle(0, LVS_SINGLESEL|LVS_REPORT|LVS_SHOWSELALWAYS);
	//m_input_list.SetExtendedStyle(m_input_list.GetExtendedStyle() |LVS_EX_FULLROWSELECT |LVS_EX_GRIDLINES);
	WeeeklyList.SetExtendedStyle(WeeeklyList.GetExtendedStyle() |LVS_EX_GRIDLINES&(~LVS_EX_FULLROWSELECT));//Not allow full row select.
	WeeeklyList.InsertColumn(0, _T("Item"), 40, ListCtrlEx::Normal, LVCFMT_LEFT, ListCtrlEx::SortByDigit);
	WeeeklyList.InsertColumn(1, _T("Time"), 80, ListCtrlEx::EditBox, LVCFMT_LEFT, ListCtrlEx::SortByDigit);
	WeeeklyList.InsertColumn(2, _T("Monday"), 80, ListCtrlEx::ComboBox, LVCFMT_LEFT, ListCtrlEx::SortByDigit);
	WeeeklyList.InsertColumn(3, _T("Tuesday"), 80, ListCtrlEx::ComboBox, LVCFMT_LEFT, ListCtrlEx::SortByString);
	WeeeklyList.InsertColumn(4, _T("Wednesday"), 80, ListCtrlEx::ComboBox, LVCFMT_LEFT, ListCtrlEx::SortByString);
	WeeeklyList.InsertColumn(5, _T("Thursday"), 80, ListCtrlEx::ComboBox, LVCFMT_LEFT, ListCtrlEx::SortByString);
	WeeeklyList.InsertColumn(6, _T("Friday"), 80, ListCtrlEx::ComboBox, LVCFMT_LEFT, ListCtrlEx::SortByString);
	WeeeklyList.InsertColumn(7, _T("Saturday"), 80, ListCtrlEx::ComboBox, LVCFMT_LEFT, ListCtrlEx::SortByString);
	WeeeklyList.InsertColumn(8, _T("Sunday"), 80, ListCtrlEx::ComboBox, LVCFMT_LEFT, ListCtrlEx::SortByString);
	WeeeklyList.InsertColumn(9, _T("Holiday"), 80, ListCtrlEx::ComboBox, LVCFMT_LEFT, ListCtrlEx::SortByString);
	WeeeklyList.SetBkColor(RGB(205,201,201)) ;
	
	 
	g_hwnd_now = this->m_hWnd;
	
	ListCtrlEx::CStrList strlist;
	strlist.clear();
	strlist.push_back(L"");
	strlist.push_back(L"Home");
	strlist.push_back(L"Work");
	strlist.push_back(L"Sleep");
	list<Schedule_Node>::iterator it;
	int index=0;
	for (it = m_ScheduleList.begin();it!=m_ScheduleList.end();++it)
	{
		 
		 
		CString strTime;
		int Item=index+1;
		strTime.Format(_T("%d"),Item);
		WeeeklyList.InsertItem(index,strTime);
		strTime.Format(_T("%02d:%02d"),it->Hour,it->Minite);
		WeeeklyList.SetItemBkColor(index,0,RGB(255,255,255),0);
		WeeeklyList.SetItemText(index,1,strTime);
		WeeeklyList.SetItemBkColor(index,1,RGB(255,255,255),0);
		WeeeklyList.SetWhetherShowBkCol(false);
		//设置Combox
		for (int col = 2;col<10;col++)
		{
			WeeeklyList.SetCellStringList(index, col, strlist);
		}
		WeeeklyList.SetItemText(index,2,m_strScheduleMode[it->Monday]);
		WeeeklyList.SetItemBkColor(index,2,it->Col_Monday,0);
		WeeeklyList.SetItemText(index,3,m_strScheduleMode[it->Tuesday]);
		WeeeklyList.SetItemBkColor(index,3,it->Col_Tuesday,0);
		WeeeklyList.SetItemText(index,4,m_strScheduleMode[it->Wednesday]);
		WeeeklyList.SetItemBkColor(index,4,it->Col_Wednesday,0);
		WeeeklyList.SetItemText(index,5,m_strScheduleMode[it->Thursday]);
		WeeeklyList.SetItemBkColor(index,5,it->Col_Thursday,0);
		WeeeklyList.SetItemText(index,6,m_strScheduleMode[it->Friday]);
		WeeeklyList.SetItemBkColor(index,6,it->Col_Friday,0);
		WeeeklyList.SetItemText(index,7,m_strScheduleMode[it->Saturday]);
		WeeeklyList.SetItemBkColor(index,7,it->Col_Saturday,0);
		WeeeklyList.SetItemText(index,8,m_strScheduleMode[it->Sunday]);
		WeeeklyList.SetItemBkColor(index,8,it->Col_Sunday,0);
		WeeeklyList.SetItemText(index, 9, m_strScheduleMode[it->Holiday]);
		WeeeklyList.SetItemBkColor(index, 9, it->Col_Holiday, 0);

		index++;
	 
	}
	
	if (product_register_value[MODBUS_SCHEDULE_ON_OFF] == 1)
	{
		 
			((CButton *)GetDlgItem(IDC_CHECK_ENABLE_SCHEDULE))->SetCheck(1);
	}
	else
	{

		   ((CButton *)GetDlgItem(IDC_CHECK_ENABLE_SCHEDULE))->SetCheck(0);
	}
	
	WeeeklyList.GetFocus();
	return FALSE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
void CTStatOutputView::Initial_ListFor_Tstat(){
    m_output_list.ShowWindow(SW_HIDE);
    m_output_list.DeleteAllItems();
    while ( m_output_list.DeleteColumn (0)) ;

    if (product_type==CS3000)
    {
        m_output_list.ModifyStyle(0, LVS_SINGLESEL|LVS_REPORT|LVS_SHOWSELALWAYS);
        m_output_list.SetExtendedStyle(m_output_list.GetExtendedStyle()  |LVS_EX_GRIDLINES&(~LVS_EX_FULLROWSELECT));//Not allow full row select.
        m_output_list.InsertColumn(OUTPUT_NUM, _T("NUM"), 40, ListCtrlEx::Normal, LVCFMT_CENTER, ListCtrlEx::SortByDigit);
        m_output_list.InsertColumn(TStat_OutputName, _T("Full Label"), 140, ListCtrlEx::EditBox, LVCFMT_CENTER, ListCtrlEx::SortByString);
        m_output_list.InsertColumn(TStat_AM, _T("Input Type"), 80, ListCtrlEx::ComboBox, LVCFMT_CENTER, ListCtrlEx::SortByString);
        m_output_list.InsertColumn(TStat_Value, _T("Min"), 60, ListCtrlEx::Normal, LVCFMT_CENTER, ListCtrlEx::SortByString);
        m_output_list.InsertColumn(TStat_Unit, _T("Max"), 60, ListCtrlEx::EditBox, LVCFMT_CENTER, ListCtrlEx::SortByString);
        m_output_list.InsertColumn(TStat_Range, _T("Signal"), 80, ListCtrlEx::Normal, LVCFMT_CENTER, ListCtrlEx::SortByString);
        // 		m_output_list.InsertColumn(TStat_Funcation, _T("Function"), 60, ListCtrlEx::ComboBox, LVCFMT_CENTER, ListCtrlEx::SortByString);
        // 		m_output_list.InsertColumn(TStat_Interlock, _T("Interlock"), 60, ListCtrlEx::ComboBox, LVCFMT_CENTER, ListCtrlEx::SortByString);
        // 		m_output_list.InsertColumn(TStat_OFFON_Delay, _T("OFF->ON Delay"), 100, ListCtrlEx::EditBox, LVCFMT_CENTER, ListCtrlEx::SortByString);
        // 		m_output_list.InsertColumn(TStat_ONOFF_Delay, _T("ON->OFF Delay"), 100, ListCtrlEx::EditBox, LVCFMT_CENTER, ListCtrlEx::SortByString);
        // 		m_output_list.InsertColumn(TStat_Signal_Type, _T("Signal Type"), 70, ListCtrlEx::ComboBox, LVCFMT_CENTER, ListCtrlEx::SortByString);
        CString strTemp;
        //m_input_list.DeleteAllItems();
        for (int i=0;i<m_tstat_output_data.size();i++)
        {
            strTemp.Format(_T("%d"),i+1);
            m_output_list.InsertItem(i,strTemp); 
        }
        if (ListCtrlEx::ComboBox == m_output_list.GetColumnType(TStat_AM))
        {
            ListCtrlEx::CStrList strlist;
            strlist.clear();
            strlist.push_back(_T("Current"));
            strlist.push_back(_T("Voltage"));
            m_output_list.SetCellStringList(0, TStat_AM, strlist);
        }
    }
    else if(product_type == T3000_6_ADDRESS){
        m_output_list.ModifyStyle(0, LVS_SINGLESEL|LVS_REPORT|LVS_SHOWSELALWAYS);
        m_output_list.SetExtendedStyle(m_output_list.GetExtendedStyle()  |LVS_EX_GRIDLINES&(~LVS_EX_FULLROWSELECT));//Not allow full row select.
        m_output_list.InsertColumn(OUTPUT_NUM, _T("NUM"), 40, ListCtrlEx::Normal, LVCFMT_CENTER, ListCtrlEx::SortByDigit);
        m_output_list.InsertColumn(TStat_OutputName, _T("Full Label"), 140, ListCtrlEx::EditBox, LVCFMT_CENTER, ListCtrlEx::SortByString);
        m_output_list.InsertColumn(TStat_AM, _T("Auto/Manual"), 80, ListCtrlEx::Normal, LVCFMT_CENTER, ListCtrlEx::SortByString);
        m_output_list.InsertColumn(TStat_Value, _T("Value"), 60, ListCtrlEx::EditBox, LVCFMT_CENTER, ListCtrlEx::SortByString);
        m_output_list.InsertColumn(TStat_Unit, _T("Units"), 60, ListCtrlEx::Normal, LVCFMT_CENTER, ListCtrlEx::SortByString);
        m_output_list.InsertColumn(TStat_Range, _T("Range"), 80, ListCtrlEx::ComboBox, LVCFMT_CENTER, ListCtrlEx::SortByString);
        m_output_list.InsertColumn(TStat_Funcation, _T("Function"), 60, ListCtrlEx::ComboBox, LVCFMT_CENTER, ListCtrlEx::SortByString);
        m_output_list.InsertColumn(TStat_Interlock, _T("Interlock"), 60, ListCtrlEx::ComboBox, LVCFMT_CENTER, ListCtrlEx::SortByString);
        m_output_list.InsertColumn(TStat_OFFON_Delay, _T("OFF->ON Delay"), 100, ListCtrlEx::EditBox, LVCFMT_CENTER, ListCtrlEx::SortByString);
        m_output_list.InsertColumn(TStat_ONOFF_Delay, _T("ON->OFF Delay"), 100, ListCtrlEx::EditBox, LVCFMT_CENTER, ListCtrlEx::SortByString);
        m_output_list.InsertColumn(TStat_Signal_Type, _T("Signal Type"), 70, ListCtrlEx::ComboBox, LVCFMT_CENTER, ListCtrlEx::SortByString);

        CString strTemp;
        //m_input_list.DeleteAllItems();
        for (int i=0;i<m_tstat_output_data.size();i++)
        {
            strTemp.Format(_T("%d"),i+1);
            m_output_list.InsertItem(i,strTemp);
            for (int x=0;x<OUTPUT_COL_NUMBER;x++)
            {
                if((i%2)==0)
                    m_output_list.SetItemBkColor(i,x,LIST_ITEM_DEFAULT_BKCOLOR);
                else
                    m_output_list.SetItemBkColor(i,x,LIST_ITEM_DEFAULT_BKCOLOR_GRAY);		
            }
        }


        Initial_Combox_Show_Tstat();
    }
    else{}
    g_hwnd_now = this->m_hWnd;
   
    m_output_list.ShowWindow(SW_SHOW);
}