42 #ifndef _MLAB_CANSDOPLUGIN_H_ 43 #define _MLAB_CANSDOPLUGIN_H_ 50 #include <QTableWidget> 51 #include <QVBoxLayout> 52 #include <QPushButton> 56 #include <QStringListModel> 57 #include <QErrorMessage> 59 namespace mira {
namespace can {
71 (
"Name",
"CAN SDO viewer")
72 (
"Category",
"CANOpen")
73 (
"Description",
"Read and write SDOs")
79 template<
typename Reflector>
85 r.member(
"ColumnWidth",
91 bool stop(uint8 node);
105 template <
typename Reflector>
109 getter<std::string>(boost::bind(&SDOInfo::get<uint16>,
this, &module)),
110 setter<std::string>(boost::bind(&SDOInfo::set<uint16>,
this, _1, &module)),
"");
112 getter<std::string>(boost::bind(&SDOInfo::get<uint16>,
this, &index)),
113 setter<std::string>(boost::bind(&SDOInfo::set<uint16>,
this, _1, &index)),
"");
115 getter<std::string>(boost::bind(&SDOInfo::get<uint16>,
this, &sub)),
116 setter<std::string>(boost::bind(&SDOInfo::set<uint16>,
this, _1, &sub)),
"");
118 getter<std::string>(&SDOInfo::getLength,
this),
119 setter<std::string>(&SDOInfo::setLength,
this),
"");
121 getter<std::string>(&SDOInfo::getAccess,
this),
122 setter<std::string>(&SDOInfo::setAccess,
this),
"");
123 r.member(
"Description", description,
"");
125 getter<std::string>(&SDOInfo::getType,
this),
126 setter<std::string>(&SDOInfo::setType,
this),
"");
130 std::string
get(
const T* ptr)
const 136 void set(
const std::string& v, T* ptr)
138 *ptr = fromString<FromHex<T>>(v);
141 std::string getLength()
const 167 void setLength(
const std::string& v)
183 std::string getAccess()
const 185 std::string a =
"none";
186 if ((access & READ_SDO) && (access & WRITE_SDO))
188 else if ((access & READ_SDO))
190 else if ((access & WRITE_SDO))
195 void setAccess(
const std::string& v)
203 access = READ_SDO | WRITE_SDO;
206 std::string getType()
const 223 void setType(
const std::string& v)
238 std::string description;
243 void createComboboxes(
int row);
244 void restore(
const std::vector<SDOInfo>& sdoMap);
245 SDOInfo getInfoFromRow(
int row);
255 void selectionChanged(
int cbIndex);
259 void setSDOInfo(
const std::vector<SDOInfo>& info);
260 std::vector<SDOInfo> getSDOInfo();
261 void setColumnWidth(
const std::vector<int>& width);
262 std::vector<int> getColumnWidth();
264 int findObject(QObject* widget);
265 void readRow(
int row);
267 virtual void initialize();
std::vector< SDOInfo > getSDOInfo()
TEigenFormat< Derived > format(Eigen::MatrixBase< Derived > &matrix, Eigen::IOFormat format=EigenFormat::matlab())
Setter< T > setter(void(*f)(const T &))
#define MIRA_ENUM_TO_FLAGS_INCLASS(EnumType)
Plugin for showing SDO informations.
Definition: CANSDOPlugin.h:66
#define MIRA_META_OBJECT(classIdentifier, MetaInfo)
PropertyHint type(const std::string &t)
void setSDOInfo(const std::vector< SDOInfo > &info)
Getter< T > getter(T(*f)())
void reflect(Reflector &r, LogRecord &record)
#define MLAB_CANGUI_EXPORT
Definition: CANGUIExports.h:57
QTableWidget * mList
Definition: CANSDOPlugin.h:269
bool mLoading
Definition: CANSDOPlugin.h:270
A struct, which contains standard information about a CANopen node.
Definition: CANOpenDefs.h:165
std::vector< int > getColumnWidth()
void setColumnWidth(const std::vector< int > &width)