Commit ff8e14a2 authored by Jan Möbius's avatar Jan Möbius

Finished python interface for data control type

parent 5dc7dc52
...@@ -416,7 +416,7 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn ...@@ -416,7 +416,7 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn
unsigned int groupCount() const; unsigned int groupCount() const;
/// Returns a list of all available DataTypes /// Returns a list of all available DataTypes
QStringList availableDataTypeNames() const; QString availableDataTypeNames() const;
/// Print information about all open objects to the console /// Print information about all open objects to the console
void printObjectInfoToLog(); void printObjectInfoToLog();
......
...@@ -642,12 +642,12 @@ unsigned int DataControlPlugin::groupCount() const { ...@@ -642,12 +642,12 @@ unsigned int DataControlPlugin::groupCount() const {
* *
* @return List of available data types * @return List of available data types
*/ */
QStringList DataControlPlugin::availableDataTypeNames() const { QString DataControlPlugin::availableDataTypeNames() const {
QStringList list; QString list;
for ( std::vector< TypeInfo >::const_iterator dataType = typesBegin(); dataType != typesEnd(); ++dataType ) for ( std::vector< TypeInfo >::const_iterator dataType = typesBegin(); dataType != typesEnd(); ++dataType )
list.push_back(dataType->name); list.append(dataType->name + "\n");
return list; return list;
} }
......
...@@ -96,8 +96,9 @@ PYBIND11_EMBEDDED_MODULE(DataControl, m) { ...@@ -96,8 +96,9 @@ PYBIND11_EMBEDDED_MODULE(DataControl, m) {
QCoreApplication::translate("PythonDocDataControl","Returns the id of an object with given name.").toLatin1().data()), QCoreApplication::translate("PythonDocDataControl","Returns the id of an object with given name.").toLatin1().data()),
py::arg(QCoreApplication::translate("PythonDocDataControl","Name of an object").toLatin1().data()); py::arg(QCoreApplication::translate("PythonDocDataControl","Name of an object").toLatin1().data());
// /// Get the DataType of a given object data.def("dataType", &DataControlPlugin::dataType,
// DataType dataType( int objectId ); QCoreApplication::translate("PythonDocDataControl","Returns the DataType of the object with the given id.").toLatin1().data()),
py::arg(QCoreApplication::translate("PythonDocDataControl","ID of the object").toLatin1().data());
data.def("hideObject", &DataControlPlugin::hideObject, data.def("hideObject", &DataControlPlugin::hideObject,
QCoreApplication::translate("PythonDocDataControl","Hide object with the given id.").toLatin1().data()), QCoreApplication::translate("PythonDocDataControl","Hide object with the given id.").toLatin1().data()),
...@@ -160,18 +161,19 @@ PYBIND11_EMBEDDED_MODULE(DataControl, m) { ...@@ -160,18 +161,19 @@ PYBIND11_EMBEDDED_MODULE(DataControl, m) {
QCoreApplication::translate("PythonDocDataControl","Remove the given object from its group and move it to the top level").toLatin1().data(), QCoreApplication::translate("PythonDocDataControl","Remove the given object from its group and move it to the top level").toLatin1().data(),
py::arg(QCoreApplication::translate("PythonDocDataControl","Id of an Object").toLatin1().data()) ) ; py::arg(QCoreApplication::translate("PythonDocDataControl","Id of an Object").toLatin1().data()) ) ;
data.def("getTargetObjects", &DataControlPlugin::getTargetObjects,
QCoreApplication::translate("PythonDocDataControl","Returns the IdList of all target objects with given DataType.").toLatin1().data(),
py::arg(QCoreApplication::translate("PythonDocDataControl","DataType of the target objects").toLatin1().data()) ) ;
// /// Get all target objects of given type data.def("getSourceObjects", &DataControlPlugin::getSourceObjects,
// IdList getTargetObjects(DataType _type); QCoreApplication::translate("PythonDocDataControl","Returns the IdList of all source objects with given DataType.").toLatin1().data(),
// py::arg(QCoreApplication::translate("PythonDocDataControl","DataType of the target objects").toLatin1().data()) ) ;
// /// Get all source objects of given type
// IdList getSourceObjects(DataType _type);
data.def("groupCount", &DataControlPlugin::groupCount, data.def("groupCount", &DataControlPlugin::groupCount,
QCoreApplication::translate("PythonDocDataControl","Returns the number of groups").toLatin1().data() ) ; QCoreApplication::translate("PythonDocDataControl","Returns the number of groups").toLatin1().data() ) ;
// /// Returns a list of all available DataTypes data.def("availableDataTypeNames", &DataControlPlugin::availableDataTypeNames,
// QStringList availableDataTypeNames() const; QCoreApplication::translate("PythonDocDataControl","Returns a QStringList of all available DataType names.").toLatin1().data() ) ;
data.def("printObjectInfoToLog", &DataControlPlugin::printObjectInfoToLog, data.def("printObjectInfoToLog", &DataControlPlugin::printObjectInfoToLog,
QCoreApplication::translate("PythonDocDataControl","Print information about all open objects to the console").toLatin1().data() ) ; QCoreApplication::translate("PythonDocDataControl","Print information about all open objects to the console").toLatin1().data() ) ;
...@@ -184,21 +186,5 @@ PYBIND11_EMBEDDED_MODULE(DataControl, m) { ...@@ -184,21 +186,5 @@ PYBIND11_EMBEDDED_MODULE(DataControl, m) {
QCoreApplication::translate("PythonDocDataControl","Show or hide the extended ui interface in the datacontrol toolbox").toLatin1().data(), QCoreApplication::translate("PythonDocDataControl","Show or hide the extended ui interface in the datacontrol toolbox").toLatin1().data(),
py::arg(QCoreApplication::translate("PythonDocDataControl","Show?").toLatin1().data()) ) ; py::arg(QCoreApplication::translate("PythonDocDataControl","Show?").toLatin1().data()) ) ;
// emit setSlotDescription("getSourceObjects(DataType)",tr("Returns the IdList of all source objects with given DataType."),
// QStringList(tr("Datatype")), QStringList(tr("Datatype of the objects")));
//
// emit setSlotDescription("getTargetObjects(DataType)",tr("Returns the IdList of all target objects with given DataType."),
// QStringList(tr("Datatype")), QStringList(tr("Datatype of the objects")));
// emit setSlotDescription("dataType(int)",tr("Returns the DataType of the object with the given id."),
// QStringList(tr("objectId")), QStringList(tr("ID of an object")));
// emit setSlotDescription("availableDataTypeNames()",tr("Returns a QStringList of all available DataType names."),
// QStringList(tr("")), QStringList(tr("")));
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment