source: libs/QtGui/src/SgMigration.cpp @ 445

Revision 445, 799 bytes checked in by lmalek, 10 years ago (diff)

Samgar edition by WRUT. Based on Qt. Initial import.

Line 
1#include "SgMigration.h"
2#include <fstream>
3
4namespace Sg
5{
6    MigrationPortClass::MigrationPortClass()
7    {
8        //useCallback(); // TODO: this generates problems on exit - probably hangs on onRead
9    }
10
11    MigrationPortClass::~MigrationPortClass(){}
12
13    /** it opens Perasonality.txt file on write the content of the bottle to it
14     */
15    void MigrationPortClass::onRead(yarp::os::Bottle& b)
16    {
17        Ivebeenused = 1;
18        int length = b.size();
19        std::ofstream myfile;
20        myfile.open("Personality.txt"); // TODO: what for is this file? to log?
21        for(int cc=0;cc<length;cc++)
22        {
23            b.get(cc).asString(); // get the first line from the bottle
24            myfile <<  b.get(cc).asString().c_str() << "\n";
25        }
26        myfile.close();
27    }
28}
Note: See TracBrowser for help on using the repository browser.