Ejemplo n.º 1
0
void RxDev::on_pushButton_managerNodelet_clicked()
{
    NodeItem * newNode;
    newNode = new NodeItem("","nodelet",QStringList(),QStringList(),QStringList(),QStringList());
    newNode->setType("nodelet");
    newNode->setArgs("manager");
    newNode->setLocation(findSpace(QPoint(0,55)));
    newNode->setColor(Qt::yellow);
    newNode->setPos(findSpace(QPoint(0,55)));

    if (newNode->getNodeData()==true){
        scene->addItem(newNode);
    }
}
Ejemplo n.º 2
0
/*!\brief reimplementation of the dropEvent
 *
 * Creates a node item if a node is dropped in the view.
 * The neccessary nodeinformation is fetched during the mousepressaction for the drag event
 * in RxDev::selectionHandle_availableNodes.
 */
void LaunchFileView::dropEvent(QDropEvent *event) {
    NodeItem * newNode;
    newNode = new NodeItem(selectedNodeName,selectedNodePackage,selectedNodeSubscriptions,
                           selectedNodePublications,selectedNodeServices,selectedNodeParameters);
    newNode->setLocation(mapToScene(event->pos()));

    newNode->setPos(mapToScene(event->pos()));

    if (newNode->getNodeData()==true){
        scene()->addItem(newNode);
    }

    selectedBox->setColor(Qt::black);
    selectedBox= newNode;
}
Ejemplo n.º 3
0
void RxDev::on_pushButton_blankNode_clicked()
{
    NodeItem * newNode;
    newNode = new NodeItem("","",QStringList(),QStringList(),QStringList(),QStringList());
    newNode->setType("_blank_node");
    newNode->setLocation(findSpace(QPoint(0,55)));
newNode->setColor(Qt::yellow);
    newNode->setPos(findSpace(QPoint(0,55)));

    if (newNode->getNodeData()==true){
        scene->addItem(newNode);
    }


}