diff options
| -rw-r--r-- | dds_io_sub/.project | 65 | ||||
| -rw-r--r-- | dds_io_sub/.settings/org.eclipse.cdt.core.prefs | 3 | ||||
| -rw-r--r-- | dds_io_sub/DataReaderListener.cpp | 7 | ||||
| -rw-r--r-- | dds_io_sub/dds_io_sub.cpp | 3 | ||||
| -rw-r--r-- | dds_io_sub/diasio.cpp | 17 | ||||
| -rw-r--r-- | dds_io_sub/diasio.h | 51 |
6 files changed, 111 insertions, 35 deletions
diff --git a/dds_io_sub/.project b/dds_io_sub/.project index db33e90..1228d10 100644 --- a/dds_io_sub/.project +++ b/dds_io_sub/.project @@ -7,13 +7,76 @@ <buildSpec> <buildCommand> <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> + <triggers>clean,full,incremental,</triggers> + <arguments> + <dictionary> + <key>org.eclipse.cdt.make.core.fullBuildTarget</key> + <value>all</value> + </dictionary> + <dictionary> + <key>?name?</key> + <value></value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.enableAutoBuild</key> + <value>false</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.buildLocation</key> + <value>${workspace_loc:/dds_io_sub/Debug}</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.enableFullBuild</key> + <value>true</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.enableCleanBuild</key> + <value>true</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.cleanBuildTarget</key> + <value>clean</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.append_environment</key> + <value>true</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.contents</key> + <value>org.eclipse.cdt.make.core.activeConfigSettings</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key> + <value>true</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.buildArguments</key> + <value></value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.buildCommand</key> + <value>make</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.autoBuildTarget</key> + <value>all</value> + </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.stopOnError</key> + <value>true</value> + </dictionary> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.cdt.core.cnature</nature> - <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> <nature>org.eclipse.cdt.core.ccnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> </natures> </projectDescription> diff --git a/dds_io_sub/.settings/org.eclipse.cdt.core.prefs b/dds_io_sub/.settings/org.eclipse.cdt.core.prefs index 938f831..94486e6 100644 --- a/dds_io_sub/.settings/org.eclipse.cdt.core.prefs +++ b/dds_io_sub/.settings/org.eclipse.cdt.core.prefs @@ -1,3 +1,4 @@ -#Fri Oct 05 19:00:29 CEST 2007 +#Wed Oct 10 08:26:43 GMT 2007 eclipse.preferences.version=1 +indexer/indexerId=org.eclipse.cdt.core.nullindexer indexerId=org.eclipse.cdt.core.nullindexer diff --git a/dds_io_sub/DataReaderListener.cpp b/dds_io_sub/DataReaderListener.cpp index c39dcf9..242d4a9 100644 --- a/dds_io_sub/DataReaderListener.cpp +++ b/dds_io_sub/DataReaderListener.cpp @@ -24,16 +24,23 @@ void DataReaderListenerImpl::on_data_available(DDS::DataReader_ptr reader) { try { + + fprintf(stderr, "1\n"); fflush(stderr); + ::IOTest::PortDataReader_var port_dr = ::IOTest::PortDataReader::_narrow(reader); if (CORBA::is_nil (port_dr.in ())) { cerr << "read: _narrow failed." << endl; exit(1); } + + fprintf(stderr, "2\n"); fflush(stderr); IOTest::Port port_obj; DDS::SampleInfo si ; DDS::ReturnCode_t status = port_dr->take_next_sample(port_obj, si) ; + fprintf(stderr, "3\n"); fflush(stderr); + if (status == DDS::RETCODE_OK) { cout << "Port: no: = " << port_obj.no << endl << " value: = " << port_obj.value << endl; diff --git a/dds_io_sub/dds_io_sub.cpp b/dds_io_sub/dds_io_sub.cpp index ae153b4..e8209c9 100644 --- a/dds_io_sub/dds_io_sub.cpp +++ b/dds_io_sub/dds_io_sub.cpp @@ -188,7 +188,8 @@ int main (int argc, char *argv[]) } while(1) { - ACE_OS::sleep (1); + fprintf(stderr, "W\n"); fflush(stderr); + ACE_OS::sleep(1); } if (!CORBA::is_nil (participant.in ())) { diff --git a/dds_io_sub/diasio.cpp b/dds_io_sub/diasio.cpp index 9209fcb..49dee57 100644 --- a/dds_io_sub/diasio.cpp +++ b/dds_io_sub/diasio.cpp @@ -49,24 +49,30 @@ DIASIO::DIASIO(){ DIASIO::~DIASIO(){ instance--; + + fprintf(stderr, "DECONSTRUCTION OF DAIS\n"); fflush(stderr); + if(instance == 0){ stop_wd = true; pthread_join(watchdog, NULL); - S_AdresseOut -= m_Bereich2; } } void DIASIO::set(TyuInt16 value){ - outw( value, S_AdresseOut ); + fprintf(stderr, "writing: %d -> %x + %x\n", value, m_Bereich2, S_AdresseOut); + fflush(stderr); + outw( value, m_Bereich2 + S_AdresseOut ); + fprintf(stderr, "DONE\n"); fflush(stderr); } TyuInt16 DIASIO::get(){ - return inw( S_AdresseOut ); + return inw( m_Bereich2 + S_AdresseOut ); } void DIASIO::init(){ - S_AdresseOut += m_Bereich2; - + + fprintf(stderr, "INIT DAIS\n"); fflush(stderr); + char a_buffer[17]; pthread_attr_t watchdog_attr; @@ -119,4 +125,5 @@ void DIASIO::init(){ pthread_attr_init(&watchdog_attr); if ( pthread_create(&watchdog, &watchdog_attr, watchDogTriggern, NULL) ) perror("watchdog thread creation failed"); + } diff --git a/dds_io_sub/diasio.h b/dds_io_sub/diasio.h index ae27b50..d8a752f 100644 --- a/dds_io_sub/diasio.h +++ b/dds_io_sub/diasio.h @@ -25,34 +25,31 @@ #define D_TCDIASIOC_BEENDENAUFHEBEN _IO( D_TCDIAS_IOC_MAGIC, 6 ) #define D_TCDIAS_IOC_MAXNR 7 -/* -static TyuInt32 S_AdresseLS7166 = 0; -static TyuInt32 S_AdresseLS7166Status = 1; -static TyuInt32 S_Adresse7Seg1 = 2; -static TyuInt32 S_Adresse7Seg2 = 3; -*/ -static TyuInt32 S_AdresseOut = 4; -/* -static TyuInt32 S_AdresseIn = 5; -static TyuInt32 S_AdresseWatchdog = 0x0c; -static TyuInt32 S_AdresseStatus = 6; -static TyuInt32 S_AdresseADStart = 7; -static TyuInt32 S_AdresseMultiplexer = 8; -static TyuInt32 S_AdresseFreigabe = 9; -static TyuInt32 S_AdresseRevisionLogik = 0x0e; -static TyuInt32 S_AdresseRevisionKarte = 0x0f; -*/ + +static const TyuInt32 S_AdresseLS7166 = 0; +static const TyuInt32 S_AdresseLS7166Status = 1; +static const TyuInt32 S_Adresse7Seg1 = 2; +static const TyuInt32 S_Adresse7Seg2 = 3; +static const TyuInt32 S_AdresseOut = 4; +static const TyuInt32 S_AdresseIn = 5; +static const TyuInt32 S_AdresseWatchdog = 0x0c; + +static const TyuInt32 S_AdresseStatus = 6; +static const TyuInt32 S_AdresseADStart = 7; +static const TyuInt32 S_AdresseMultiplexer = 8; +static const TyuInt32 S_AdresseFreigabe = 9; +static const TyuInt32 S_AdresseRevisionLogik = 0x0e; +static const TyuInt32 S_AdresseRevisionKarte = 0x0f; + //zweiter Adressblock -/* -static TyuInt32 S_AdresseFrequenzzaehlerLW = 0; -static TyuInt32 S_AdresseFrequenzzaehlerHW = 2; -static TyuInt32 S_AdresseIndexRevisionZaehler = 4; -static TyuInt32 S_AdresseAD = 6; -static TyuInt32 S_AdresseDA0 = 8; -static TyuInt32 S_AdresseDA1 = 0x0a; -static TyuInt32 S_AdresseDA2 = 0x0c; -static TyuInt32 S_AdresseDA3 = 0x0e; -*/ +static const TyuInt32 S_AdresseFrequenzzaehlerLW = 0; +static const TyuInt32 S_AdresseFrequenzzaehlerHW = 2; +static const TyuInt32 S_AdresseIndexRevisionZaehler = 4; +static const TyuInt32 S_AdresseAD = 6; +static const TyuInt32 S_AdresseDA0 = 8; +static const TyuInt32 S_AdresseDA1 = 0x0a; +static const TyuInt32 S_AdresseDA2 = 0x0c; +static const TyuInt32 S_AdresseDA3 = 0x0e; // -- exported global variables - declarations (should be empty)---------------- class DIASIO{ |
