Now you can download a copy of these docs so you can use them offline! Download now
NetworkButton.cpp
00001 /*----------------------------------------------------------------------------*/ 00002 /* Copyright (c) FIRST 2011. All Rights Reserved. */ 00003 /* Open Source Software - may be modified and shared by FRC teams. The code */ 00004 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ 00005 /*----------------------------------------------------------------------------*/ 00006 00007 #include "Buttons/NetworkButton.h" 00008 00009 #include "NetworkTables/NetworkTable.h" 00010 00011 NetworkButton::NetworkButton(const char *tableName, const char *field) : 00012 m_netTable(NetworkTable::GetTable(tableName)), 00013 m_field(field) 00014 { 00015 } 00016 00017 NetworkButton::NetworkButton(NetworkTable *table, const char *field) : 00018 m_netTable(table), 00019 m_field(field) 00020 { 00021 } 00022 00023 bool NetworkButton::Get() 00024 { 00025 if (m_netTable->IsConnected()) 00026 return m_netTable->GetBoolean(m_field.c_str()); 00027 else 00028 return false; 00029 }
Generated on Thu Jan 12 2012 22:35:21 for WPILibC++ by
1.7.1