Changeset 165 in pacpusframework for branches/2.0-beta1/examples


Ignore:
Timestamp:
08/01/13 18:30:31 (11 years ago)
Author:
Marek Kurdej
Message:

Major: changed plugins section name to plugings. Parameters section will be used for something else.

Location:
branches/2.0-beta1/examples/ProducerConsumerExample
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0-beta1/examples/ProducerConsumerExample/ConsumerExample.cpp

    r163 r165  
    5252    LOG_TRACE(Q_FUNC_INFO);
    5353    moveToThread(&thread);
     54    m_counter = 0;
    5455   
    55     m_counter = 0;
    56     static const char * outputFileName = "test2.txt";
     56    static const char * outputFileName = "consumer.txt";
    5757    m_file.open(outputFileName, std::ios_base::out | std::ios_base::app);
    5858    if (!m_file.is_open()) {
     
    7777void ConsumerExample::process(const QImage& matrix)
    7878{
    79     LOG_INFO("Size " << matrix.size().width()<< " x " << matrix.size().height());
    80     unsigned int k = 0;
     79    m_file << ++m_counter << " " << road_time() << "\n" << std::flush;
    8180
    82     // a process
    83     for (int i = 0; i < 100; ++i) {
    84         ++k;
    85     }
    86     m_file << ++m_counter << " " << road_time() << "\n";
     81    LOG_INFO("Received QIMage: "
     82        << "size = " << matrix.size().width()<< " x " << matrix.size().height()
     83        );
     84
     85    // DO PROCESSING
    8786
    8887    setState(MONITOR_OK);
  • branches/2.0-beta1/examples/ProducerConsumerExample/ProducerConsumerExample.xml

    r163 r165  
    1010    </connections>
    1111
    12     <!-- FIXME: change into plugins -->
    13     <parameters prefix="" postfix="_d" extension="dll">
     12    <plugins prefix="" postfix="" extension="dll">
    1413        <plugin lib="ProducerConsumerExample" />
    15         <plugin lib="ShMem" />
     14    </plugins>
     15   
     16    <parameters>
    1617    </parameters>
    1718</pacpus>
  • branches/2.0-beta1/examples/ProducerConsumerExample/ProducerExample.cpp

    r163 r165  
    7171void ProducerExample::run()
    7272{
    73     unsigned int counter = 0;
    74     int waitTime = 5000;
     73    unsigned int counter = 1;
     74    int waitTimeMicros = 150 * 1000;
    7575
    7676    std::fstream file(outputFileName, std::ios_base::out | std::ios_base::app);
     
    8787    while (isActive()) {
    8888        //mat.setPixel(0,0,i);
    89         LOG_INFO("Size " << mat.size().width()<< " x " << mat.size().height());
     89        LOG_INFO("Sent QImage: "
     90            << "size = " << mat.size().width()<< " x " << mat.size().height()
     91            );
    9092
    9193        if (imageOutput && imageOutput->hasConnection()) {
     
    9395        }
    9496
    95         LOG_INFO("Send data " << counter << " time " << road_time());
    96         file << ++counter << " " << road_time() << "\n";
     97        LOG_INFO("Sent data=" << counter << ", time=" << road_time());
     98        file << counter << " " << road_time() << "\n" << std::flush;
    9799
    98         usleep(waitTime);
     100        usleep(waitTimeMicros);
    99101        ++counter;
    100102        setState(MONITOR_OK);
Note: See TracChangeset for help on using the changeset viewer.