void CBacnetInput::OnBnClickedButtonRead()
{
    //CPoint temp;
    //temp.x = 130;
    //temp.y = 201;
//	::PostMessage((HWND)GetDlgItem(IDC_LIST1),WM_LBUTTONDOWN,1,0);
    // TODO: Add your control notification handler code here
    Post_Refresh_Message(g_bac_instance,READINPUT_T3000,0,BAC_INPUT_ITEM_COUNT - 1,sizeof(Str_in_point), BAC_INPUT_GROUP);
    PostMessage(WM_REFRESH_BAC_INPUT_LIST,NULL,NULL);
}
void CBacnetProgram::OnTimer(UINT_PTR nIDEvent)
{
	// TODO: Add your message handler code here and/or call default
	if(this->IsWindowVisible())
	{
	PostMessage(WM_REFRESH_BAC_PROGRAM_LIST,NULL,NULL);
	if(bac_select_device_online)
		Post_Refresh_Message(g_bac_instance,READPROGRAM_T3000,0,BAC_PROGRAM_ITEM_COUNT - 1,sizeof(Str_program_point),BAC_PROGRAM_GROUP);
	}
	CDialogEx::OnTimer(nIDEvent);
}
void CBacnetAlarmLog::OnTimer(UINT_PTR nIDEvent)
{
	// TODO: Add your message handler code here and/or call default
	if((this->IsWindowVisible()) && (Gsm_communication == false) )	//GSM连接时不要刷新;
	{
		PostMessage(WM_REFRESH_BAC_ALARMLOG_LIST,NULL,NULL);
		if(bac_select_device_online)
			Post_Refresh_Message(g_bac_instance,READALARM_T3000,0,BAC_ALARMLOG_COUNT - 1,sizeof(Alarm_point),BAC_ALARMLOG_GROUP);
	}

	CDialogEx::OnTimer(nIDEvent);
}
void CBacnetAlarmLog::OnTimer(UINT_PTR nIDEvent)
{
	 
	if((this->IsWindowVisible()) && (Gsm_communication == false) &&  (this->m_hWnd  == ::GetActiveWindow())  )	//GSM连接时不要刷新;
	{
		PostMessage(WM_REFRESH_BAC_ALARMLOG_LIST,NULL,NULL);
		if(bac_select_device_online)
			Post_Refresh_Message(g_bac_instance,READALARM_T3000,0,BAC_ALARMLOG_COUNT - 1,sizeof(Alarm_point),BAC_ALARMLOG_GROUP);
	}

	CDialogEx::OnTimer(nIDEvent);
}
void BacnetScreen::OnTimer(UINT_PTR nIDEvent)
{
	 
	if(g_protocol == PROTOCOL_BIP_TO_MSTP)
	{
		PostMessage(WM_REFRESH_BAC_SCREEN_LIST,NULL,NULL);
	}
	else if((this->IsWindowVisible()) && (Gsm_communication == false) &&  ((this->m_hWnd  == ::GetActiveWindow()) || (bacnet_view_number == TYPE_SCREENS))  )	//GSM连接时不要刷新;
	{
	PostMessage(WM_REFRESH_BAC_SCREEN_LIST,NULL,NULL);
	if(bac_select_device_online)
		Post_Refresh_Message(g_bac_instance,READSCREEN_T3000,0,BAC_SCREEN_COUNT - 1,sizeof(Control_group_point),BAC_SCREEN_GROUP);
	}
	CDialogEx::OnTimer(nIDEvent);
}
Esempio n. 6
0
void CBacnetProgram::OnTimer(UINT_PTR nIDEvent)
{
	// TODO: Add your message handler code here and/or call default
	if(g_protocol == PROTOCOL_BIP_TO_MSTP)
	{
		PostMessage(WM_REFRESH_BAC_PROGRAM_LIST,NULL,NULL);
	}
	else if((this->IsWindowVisible()) && (Gsm_communication == false) )	//GSM连接时不要刷新;
	{
	PostMessage(WM_REFRESH_BAC_PROGRAM_LIST,NULL,NULL);
	if(bac_select_device_online)
		Post_Refresh_Message(g_bac_instance,READPROGRAM_T3000,0,BAC_PROGRAM_ITEM_COUNT - 1,sizeof(Str_program_point),BAC_PROGRAM_GROUP);
	}
	CDialogEx::OnTimer(nIDEvent);
}
Esempio n. 7
0
void CBacnetVariable::OnTimer(UINT_PTR nIDEvent)
{
	// TODO: Add your message handler code here and/or call default
	switch(nIDEvent)
	{
	case 1:
		{
			if(g_protocol == PROTOCOL_BIP_TO_MSTP)
			{
				PostMessage(WM_REFRESH_BAC_VARIABLE_LIST,NULL,NULL);
			}
			else if((this->IsWindowVisible()) && (Gsm_communication == false) )	//GSM连接时不要刷新;
			{
			::PostMessage(m_variable_dlg_hwnd,WM_REFRESH_BAC_VARIABLE_LIST,NULL,NULL);
			if(bac_select_device_online)
				Post_Refresh_Message(g_bac_instance,READVARIABLE_T3000,0,BAC_VARIABLE_ITEM_COUNT - 1,sizeof(Str_variable_point),BAC_VARIABLE_GROUP);
			}
		}
		break;
	case 2:
		{
			KillTimer(2);
			m_variable_time_picker.Invalidate();
		}
		break;
	case 3:
		{
			//在更改某一列之后要在读取此列的值,并刷新此列;

			if(this->IsWindowVisible())
				PostMessage(WM_REFRESH_BAC_VARIABLE_LIST,NULL,NULL);
			KillTimer(3);

		}
		break;
	default:
		break;
	}

	CDialogEx::OnTimer(nIDEvent);
}
void CBacnetOutput::OnTimer(UINT_PTR nIDEvent)
{
	// TODO: Add your message handler code here and/or call default
	switch(nIDEvent)
	{
	case 1:
		{
			if(g_protocol == PROTOCOL_BIP_TO_MSTP)
			{
				PostMessage(WM_REFRESH_BAC_OUTPUT_LIST,NULL,NULL);
			}
			else if((this->IsWindowVisible()) && (Gsm_communication == false) )	//GSM连接时不要刷新;
			{
				PostMessage(WM_REFRESH_BAC_OUTPUT_LIST,NULL,NULL);
				if((bac_select_device_online) && (g_protocol == PROTOCOL_BACNET_IP))
					Post_Refresh_Message(g_bac_instance,READOUTPUT_T3000,0,BAC_OUTPUT_ITEM_COUNT - 1,sizeof(Str_out_point),BAC_OUTPUT_GROUP);
				else if((bac_select_device_online) && ((g_protocol == MODBUS_RS485) || (g_protocol == MODBUS_TCPIP)))
				{
					if(read_each_485_fun_thread == NULL)
					{
						hide_485_progress = true;
						::PostMessage(BacNet_hwd,WM_RS485_MESSAGE,bacnet_device_type,BAC_OUT);//第二个参数 OUT
					}
				}
			}
		}
		break;
	case 2:	//在更改某一列之后要在读取此列的值,并刷新此列;
		{
			if(this->IsWindowVisible())
				PostMessage(WM_REFRESH_BAC_OUTPUT_LIST,NULL,NULL);
			KillTimer(2);
		}
		break;
	}



	CDialogEx::OnTimer(nIDEvent);
}
void CBacnetVariable::OnTimer(UINT_PTR nIDEvent)
{
	// TODO: Add your message handler code here and/or call default
	switch(nIDEvent)
	{
	case 1:
		{
			if(this->IsWindowVisible())
			{
			::PostMessage(m_variable_dlg_hwnd,WM_REFRESH_BAC_VARIABLE_LIST,NULL,NULL);
			Post_Refresh_Message(g_bac_instance,READVARIABLE_T3000,0,63,sizeof(Str_variable_point),16);
			}
		}
		break;
	case 2:
		{
			KillTimer(2);
			m_variable_time_picker.Invalidate();
		}
		break;
	}

	CDialogEx::OnTimer(nIDEvent);
}
void CBacnetProgram::OnBnClickedButtonProgramRead()
{
	// TODO: Add your control notification handler code here
	Post_Refresh_Message(g_bac_instance,READPROGRAM_T3000,0,BAC_PROGRAM_ITEM_COUNT - 1,sizeof(Str_program_point),BAC_PROGRAM_GROUP);
	PostMessage(WM_REFRESH_BAC_PROGRAM_LIST,NULL,NULL);
}
void CBacnetOutput::OnBnClickedButtonOutputRead()
{
	Post_Refresh_Message(g_bac_instance,READOUTPUT_T3000,0,BAC_OUTPUT_ITEM_COUNT - 1,sizeof(Str_out_point),BAC_OUTPUT_GROUP);
		PostMessage(WM_REFRESH_BAC_OUTPUT_LIST,NULL,NULL);
}