Example #1
0
void CANJaguar::InitTable(ITable *subTable) {
	m_table = subTable;
	UpdateTable();
}
Example #2
0
void Solenoid::InitTable(ITable *subTable) {
	m_table = subTable;
	UpdateTable();
}
Example #3
0
void Encoder::InitTable(std::shared_ptr<ITable> subTable) {
  m_table = subTable;
  UpdateTable();
}
Example #4
0
void AnalogInput::InitTable(ITable *subTable) {
    m_table = subTable;
    UpdateTable();
}
Example #5
0
void Ultrasonic::InitTable(ITable *subTable) {
	m_table = subTable;
	UpdateTable();
}
void PowerDistributionPanel::InitTable(ITable *subTable) {
	m_table = subTable;
	UpdateTable();
}
Example #7
0
void ADXL345_SPI::InitTable(ITable *subtable) {
	m_table = subtable;
	UpdateTable();
}
Example #8
0
/**
 * {@inheritDoc}
 */
void HiTechnicColorSensor::InitTable(ITable *subtable) {
    m_table = subtable;
    UpdateTable();
}
Example #9
0
void CANTalon::InitTable(std::shared_ptr<ITable> subTable) {
  m_table = subTable;
  UpdateTable();
}
Example #10
0
/*
 * @ brief: 台号信息处理函数
 * @ param: hwnd [in] 窗口句柄
 * @ param: msg [in] 消息类型
 **/
BOOL CALLBACK ChildTableInfoProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch(msg)
	{
	case WM_INITDIALOG:
		{
			CListView table_list(hwnd, IDC_L_TABLE_INFO);
			table_list.SetSelectAndGrid(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
			table_list.InsertColumn(1,80,"房间名称");
			table_list.InsertColumn(2,100,"台    号");
			table_list.InsertColumn(2,60,"人    数");
			try {

				InitFloorName(hwnd, IDC_TABLE_FLOOR_COMBO);//初始化左边第一个“楼层”下拉列表
				InitFloorName(hwnd, IDC_C_FLOOR_NAME);//初始化游标第二个“楼层”下拉列表
				CComboBox floor_combo(hwnd, IDC_TABLE_FLOOR_COMBO);
				std::string floor_name;
				floor_combo.GetComboBoxText(floor_name);
			    InitTableList(hwnd, IDC_L_TABLE_INFO, floor_name.c_str(), 0);
				InitRoomCombo(hwnd,floor_name.c_str(),IDC_C_ROOM_NAME);//根据楼层名,初始化房间下拉列表
			} catch (Err &err) {
				MessageBox(hwnd, err.what(), TEXT("基础信息管理"), MB_ICONERROR);
				return FALSE;
			}
			return TRUE;
		}
	case  WM_NOTIFY:
		{
			switch(LOWORD(wParam))
			{
			case IDC_L_TABLE_INFO:
				{
					if (((LPNMHDR)lParam)->code == NM_CLICK){      // 点击列表中的一项
						int index = -1;
						CEdit num, no;
						CComboBox room_name, floor_name;
						CListView table_list;
						table_list.Initialization(hwnd, IDC_L_TABLE_INFO);
						index = table_list.GetSelectionMark();
						if (-1 == index) {
							MessageBox(hwnd, TEXT("请先在左侧选择一个台号!"), TEXT("基础信息管理"), MB_ICONINFORMATION);
							break;
						}
						
						room_name.Initialization(hwnd, IDC_C_ROOM_NAME);
						no.Initialization(hwnd, IDC_E_TABLE_NO);
						num.Initialization(hwnd, IDC_E_TABLE_NUM);
						CComboBox combo(hwnd, IDC_TABLE_FLOOR_COMBO);
						std::string name;
						combo.GetComboBoxText(name);
						floor_name.Initialization(hwnd, IDC_C_FLOOR_NAME);
						floor_name.DeleteAllString();
						InitFloorName(hwnd,IDC_C_FLOOR_NAME);
					    floor_name.SetCurSel(floor_name.FindString(name.c_str()));
						
						InitRoomCombo(hwnd,name.c_str(),IDC_C_ROOM_NAME);
						room_name.SetCurSel(room_name.FindString(table_list.GetItem(index, 0).c_str()));
						no.SetEditText(table_list.GetItem(index, 1).c_str());
						num.SetEditText(table_list.GetItem(index, 2).c_str());
					}
					break;
				}
			}
			return TRUE;
		}
	case WM_COMMAND:
		{
			switch (LOWORD(wParam))
			{
			case IDC_B_ADD_TABLE:
				{
					try {
					    if(AddTable(hwnd))
						{
							MessageBox(hwnd, TEXT("添加台号信息成功"), TEXT("基础信息管理 "), MB_ICONINFORMATION);
						}
					} catch (Err &err) {
						MessageBox(hwnd, err.what(), TEXT("基础信息管理 "), MB_ICONERROR);
						return FALSE;
					}
					break;
				}
			case IDC_B_DISHPATCH_TABLE:
				{
					try
					{
						if (UpdateTable(hwnd))
						{
							MessageBox(hwnd, TEXT("修改台号信息成功"), TEXT("基础信息管理"), MB_OK);
						}
					}
					catch (Err &err)
					{
						MessageBox(hwnd, err.what(), TEXT("基础信息管理"), MB_ICONERROR);
					}
					break;
				}
			case IDC_B_DELETE_TABLE:
				{
				try
					{
						if (DeleteTable(hwnd))
						{
								MessageBox(hwnd, TEXT("删除台号信息成功"), TEXT("基础信息管理"), MB_OK);
						}
					}
					catch (Err &err)
					{
						MessageBox(hwnd, err.what(), TEXT("基础信息管理"), MB_ICONERROR);
					}
					break;
				}
			case IDC_TABLE_FLOOR_COMBO://点击左边第一个”楼层“下拉列表
				{
					if (HIWORD(wParam) == CBN_SELCHANGE) {
						try {
							CComboBox combo(hwnd, IDC_TABLE_FLOOR_COMBO);
							std::string floor_name;
							combo.GetComboBoxText(floor_name);
							CComboBox room(hwnd, IDC_C_ROOM_NAME);
							room.DeleteAllString();//清空“房间”下拉列表,然后在插入新的数据
							InitTableList(hwnd, IDC_L_TABLE_INFO, floor_name.c_str(), 0);
						} catch (Err &err) {
							MessageBox(hwnd, err.what(), TEXT("基础信息管理"), MB_ICONERROR);
							return FALSE;
						}
					    CEdit edit;
						// 清空右侧编辑框数据
						edit.Initialization(hwnd, IDC_E_TABLE_NO);
						edit.Empty();
						edit.Initialization(hwnd, IDC_E_TABLE_NUM);
						edit.Empty();
					}
					break;
				}
			case IDC_C_FLOOR_NAME://点击第二个“楼层”下拉列表
				{
					if (HIWORD(wParam) == CBN_SELCHANGE)
					{
						try
						{
							CComboBox combo(hwnd, IDC_C_FLOOR_NAME);
							std::string floor_name_str;
							combo.GetComboBoxText(floor_name_str);
							CComboBox room_name(hwnd, IDC_C_ROOM_NAME);
							RoomInfo room_info;
							room_info.GetRoomName(floor_name_str.c_str());  // 获取楼层下的房间名称记录集
							room_name.DeleteAllString();
							while (!room_info.IsEOF())
							{
								room_name.AddString(room_info.room_name());
							} 
						}
						catch (Err &err)
						{
							MessageBox(hwnd, err.what(), TEXT("基础信息管理"), MB_ICONERROR);
							return FALSE;
						}			
					}
					break;
				}	
			case IDC_B_TABLE_CANCLE:
				{
					EndDialog(hwnd,0);
					break;
				}

			}	

			return TRUE;
		}
	case WM_CLOSE:
		{
			EndDialog(hwnd,0);
			return TRUE;
		}
	}
	return FALSE;
}
Example #11
0
void AnalogChannel::InitTable(ITable *subTable) {
	m_table = subTable;
	UpdateTable();
}
/**
 * Live Window code, only does anything if live window is activated.
 */
void AnalogPotentiometer::InitTable(std::shared_ptr<ITable> subtable) {
    m_table = subtable;
    UpdateTable();
}
Example #13
0
void Gyro::InitTable(ITable *subTable) {
	m_table = subTable;
	UpdateTable();
}
Example #14
0
//---------------------------------------------------------------------------
void __fastcall TFormDisciplines::ComboBoxSpecChange(TObject *Sender)
{
  UpdateTable(StrGridDiscip);
}
Example #15
0
void AHRS::InitTable(ITable *itable) {
    table = itable;
    UpdateTable();
}
Example #16
0
void Encoder::InitTable(ITable *subTable) {
	m_table = subTable;
	UpdateTable();
}
Example #17
0
void AHRS::InitTable(std::shared_ptr<ITable> itable) {
    table = itable;
    UpdateTable();
}
Example #18
0
void DigitalInput::InitTable(ITable *subTable) {
	m_table = subTable;
	UpdateTable();
}
Example #19
0
void Accelerometer::InitTable(ITable *subTable) {
	m_table = subTable;
	UpdateTable();
}
Example #20
0
void Counter::InitTable(ITable *subTable) {
	m_table = subTable;
	UpdateTable();
}
Example #21
0
void PWM::InitTable(ITable *subTable) {
	m_table = subTable;
	UpdateTable();
}
Example #22
0
void AnalogInput::InitTable(std::shared_ptr<ITable> subTable) {
  m_table = subTable;
  UpdateTable();
}
Example #23
0
void GyroBase::InitTable(std::shared_ptr<ITable> subTable) {
  m_table = subTable;
  UpdateTable();
}
Example #24
0
void Relay::InitTable(std::shared_ptr<ITable> subTable) {
  m_table = subTable;
  UpdateTable();
}