Changeset 8831
- Timestamp:
- 03/02/09 14:48:22 (4 years ago)
- Location:
- ossiedev/branches/hvolos/packetwfrm/components/FrameAssembler
- Files:
-
- 10 modified
-
Makefile.am (modified) (2 diffs)
-
configure.ac (modified) (1 diff)
-
documentation.txt (modified) (2 diffs)
-
src/FrameAssembler.cpp (modified) (16 diffs)
-
src/FrameAssembler.h (modified) (6 diffs)
-
src/FrameAssemblerDSP.cpp (modified) (5 diffs)
-
src/FrameAssemblerDSP.h (modified) (3 diffs)
-
src/main.cpp (modified) (4 diffs)
-
xml/FrameAssembler.prf.xml (modified) (1 diff)
-
xml/FrameAssembler.spd.xml (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ossiedev/branches/hvolos/packetwfrm/components/FrameAssembler/Makefile.am
r8015 r8831 1 1 AM_CXXFLAGS = -Wall 2 2 3 bin_PROGRAMS = FrameAssembler _metadata3 bin_PROGRAMS = FrameAssembler 4 4 bindir = $(prefix)/bin 5 5 6 # ---------- FrameAssembler _metadata----------6 # ---------- FrameAssembler ---------- 7 7 8 FrameAssembler_ metadata_SOURCES = \9 src/FrameAssembler _metadata.cpp \8 FrameAssembler_SOURCES = \ 9 src/FrameAssembler.cpp \ 10 10 src/FrameAssemblerDSP.cpp \ 11 11 src/PNCodes.cpp \ 12 12 src/main.cpp 13 13 14 ossieName1 = FrameAssembler _metadata14 ossieName1 = FrameAssembler 15 15 xml1dir = $(prefix)/xml/$(ossieName1) 16 16 dist_xml1_DATA = \ 17 xml/FrameAssembler _metadata.prf.xml \18 xml/FrameAssembler _metadata.scd.xml \19 xml/FrameAssembler _metadata.spd.xml17 xml/FrameAssembler.prf.xml \ 18 xml/FrameAssembler.scd.xml \ 19 xml/FrameAssembler.spd.xml 20 20 21 21 # ---------- autotest ---------- … … 31 31 cxxtest: 32 32 cxxtestgen.py --error-printer -o autotest.cpp \ 33 atsrc/FrameAssembler_ metadata_testsuite.h33 atsrc/FrameAssembler_testsuite.h 34 34 35 35 # ---------- documentation --------- -
ossiedev/branches/hvolos/packetwfrm/components/FrameAssembler/configure.ac
r8015 r8831 1 AC_INIT(FrameAssembler _metadata, 0.7.0)1 AC_INIT(FrameAssembler, 0.7.0) 2 2 AM_INIT_AUTOMAKE 3 3 -
ossiedev/branches/hvolos/packetwfrm/components/FrameAssembler/documentation.txt
r8015 r8831 3 3 Copyright 2007 Virginia Polytechnic Institute and State University 4 4 5 This file is part of the OSSIE FrameAssembler _metadata.5 This file is part of the OSSIE FrameAssembler. 6 6 7 OSSIE FrameAssembler _metadatais free software; you can redistribute it and/or modify7 OSSIE FrameAssembler is free software; you can redistribute it and/or modify 8 8 it under the terms of the GNU General Public License as published by 9 9 the Free Software Foundation; either version 2 of the License, or 10 10 (at your option) any later version. 11 11 12 OSSIE FrameAssembler _metadatais distributed in the hope that it will be useful,12 OSSIE FrameAssembler is distributed in the hope that it will be useful, 13 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 16 16 17 17 You should have received a copy of the GNU General Public License 18 along with OSSIE FrameAssembler _metadata; if not, write to the Free Software18 along with OSSIE FrameAssembler; if not, write to the Free Software 19 19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 20 -
ossiedev/branches/hvolos/packetwfrm/components/FrameAssembler/src/FrameAssembler.cpp
r8827 r8831 3 3 Copyright 2007 Virginia Polytechnic Institute and State University 4 4 5 This file is part of the OSSIE FrameAssembler _metadata.6 7 OSSIE FrameAssembler _metadatais free software; you can redistribute it and/or modify5 This file is part of the OSSIE FrameAssembler. 6 7 OSSIE FrameAssembler is free software; you can redistribute it and/or modify 8 8 it under the terms of the GNU General Public License as published by 9 9 the Free Software Foundation; either version 2 of the License, or 10 10 (at your option) any later version. 11 11 12 OSSIE FrameAssembler _metadatais distributed in the hope that it will be useful,12 OSSIE FrameAssembler is distributed in the hope that it will be useful, 13 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 16 16 17 17 You should have received a copy of the GNU General Public License 18 along with OSSIE FrameAssembler _metadata; if not, write to the Free Software18 along with OSSIE FrameAssembler; if not, write to the Free Software 19 19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 20 … … 24 24 #include <string> 25 25 #include <iostream> 26 #include "FrameAssembler _metadata.h"27 28 FrameAssembler_ metadata_i::FrameAssembler_metadata_i(const char *uuid, omni_condition *condition) :26 #include "FrameAssembler.h" 27 28 FrameAssembler_i::FrameAssembler_i(const char *uuid, omni_condition *condition) : 29 29 Resource_impl(uuid), component_running(condition) 30 30 { … … 32 32 dataOut_0 = new standardInterfaces_i::complexShort_u("FrameSymbolsOut"); 33 33 34 num_frames_sent_app_1 = 0; 35 num_frames_sent_app_2 = 0; 36 num_frames_sent_app_5 = 0; 37 num_frames_sent_app_6 = 0; 34 frame_size_option=1; 38 35 39 36 //Create the thread for the writer's processing function … … 45 42 } 46 43 47 FrameAssembler_ metadata_i::~FrameAssembler_metadata_i(void)44 FrameAssembler_i::~FrameAssembler_i(void) 48 45 { 49 46 delete dataIn_0; … … 52 49 53 50 // Static function for omni thread 54 void FrameAssembler_ metadata_i::Run( void * data )55 { 56 ((FrameAssembler_ metadata_i*)data)->ProcessData();57 } 58 59 CORBA::Object_ptr FrameAssembler_ metadata_i::getPort( const char* portName ) throw (51 void FrameAssembler_i::Run( void * data ) 52 { 53 ((FrameAssembler_i*)data)->ProcessData(); 54 } 55 56 CORBA::Object_ptr FrameAssembler_i::getPort( const char* portName ) throw ( 60 57 CORBA::SystemException, CF::PortSupplier::UnknownPort) 61 58 { 62 DEBUG(3, FrameAssembler _metadata, "getPort() invoked with " << portName)59 DEBUG(3, FrameAssembler, "getPort() invoked with " << portName) 63 60 64 61 CORBA::Object_var p; … … 78 75 } 79 76 80 void FrameAssembler_ metadata_i::start() throw (CORBA::SystemException,77 void FrameAssembler_i::start() throw (CORBA::SystemException, 81 78 CF::Resource::StartError) 82 79 { 83 DEBUG(3, FrameAssembler _metadata, "start() invoked")84 } 85 86 void FrameAssembler_ metadata_i::stop() throw (CORBA::SystemException, CF::Resource::StopError)80 DEBUG(3, FrameAssembler, "start() invoked") 81 } 82 83 void FrameAssembler_i::stop() throw (CORBA::SystemException, CF::Resource::StopError) 87 84 { 88 DEBUG(3, FrameAssembler _metadata, "stop() invoked")89 } 90 91 void FrameAssembler_ metadata_i::releaseObject() throw (CORBA::SystemException,85 DEBUG(3, FrameAssembler, "stop() invoked") 86 } 87 88 void FrameAssembler_i::releaseObject() throw (CORBA::SystemException, 92 89 CF::LifeCycle::ReleaseError) 93 90 { 94 DEBUG(3, FrameAssembler _metadata, "releaseObject() invoked")91 DEBUG(3, FrameAssembler, "releaseObject() invoked") 95 92 96 93 component_running->signal(); 97 94 } 98 95 99 void FrameAssembler_ metadata_i::initialize() throw (CF::LifeCycle::InitializeError,96 void FrameAssembler_i::initialize() throw (CF::LifeCycle::InitializeError, 100 97 CORBA::SystemException) 101 98 { 102 DEBUG(3, FrameAssembler _metadata, "initialize() invoked")103 } 104 105 void FrameAssembler_ metadata_i::configure(const CF::Properties& props)99 DEBUG(3, FrameAssembler, "initialize() invoked") 100 } 101 102 void FrameAssembler_i::configure(const CF::Properties& props) 106 103 throw (CORBA::SystemException, 107 104 CF::PropertySet::InvalidConfiguration, 108 105 CF::PropertySet::PartialConfiguration) 109 106 { 110 DEBUG(3, FrameAssembler _metadata, "configure() invoked")107 DEBUG(3, FrameAssembler, "configure() invoked") 111 108 112 109 std::cout << "props length : " << props.length() << std::endl; … … 115 112 std::cout << "Property id : " << props[i].id << std::endl; 116 113 117 if (strcmp(props[i].id, "DCE: c15e70e4-96e4-4cc8-b1f0-06cb301f6c2e") == 0) {114 if (strcmp(props[i].id, "DCE:a15e70e4-96e4-4cc8-b1f0-06cb301f6c2e") == 0) { 118 115 // Modulation type 119 116 const char * prop_str; … … 133 130 } else { 134 131 // unknown property 135 std::cerr << "ERROR: FrameAssembler _metadata::configure() unknown mod. scheme "132 std::cerr << "ERROR: FrameAssembler::configure() unknown mod. scheme " 136 133 << prop_str << std::endl; 137 134 throw CF::PropertySet::InvalidConfiguration(); 138 135 } 139 ///\todo catch exception thrown by FrameAssembler _metadataDSP::ConfigureModulationScheme()140 141 } else if (strcmp(props[i].id, "DCE: 06b798ba-5412-4bbe-bf0b-8ca665d25b83") == 0) {136 ///\todo catch exception thrown by FrameAssemblerDSP::ConfigureModulationScheme() 137 138 } else if (strcmp(props[i].id, "DCE:96b798ba-5412-4bbe-bf0b-8ca665d25b83") == 0) { 142 139 // Frame size 143 140 CORBA::UShort simple_temp; 144 141 props[i].value >>= simple_temp; 145 146 ConfigureFrameSize(simple_temp); 142 frame_size_option=simple_temp; 143 ConfigureFrameSize(frame_size_option); 144 DEBUG(3, FrameAssembler, "Frame Size Option "<<frame_size_option<<" read and configured") 145 } else if (strcmp(props[i].id, "DCE:cdac2d50-214c-4c47-8a6d-d9ec453b3b3c") == 0) { 146 CORBA::UShort simple_temp; 147 props[i].value >>= simple_temp; 148 SetFrameSize(simple_temp,1); 149 } else if (strcmp(props[i].id, "DCE:a6caa288-08d2-4f0e-b0f0-f34fa513ce3d") == 0) { 150 CORBA::UShort simple_temp; 151 props[i].value >>= simple_temp; 152 SetFrameSize(simple_temp,2); 153 } else if (strcmp(props[i].id, "DCE:bcf3ff9b-9f9d-4498-b29a-78f813678271") == 0) { 154 CORBA::UShort simple_temp; 155 props[i].value >>= simple_temp; 156 SetFrameSize(simple_temp,3); 157 } else if (strcmp(props[i].id, "DCE:34311a06-2055-4490-a949-478786cad4d4") == 0) { 158 CORBA::UShort simple_temp; 159 props[i].value >>= simple_temp; 160 SetFrameSize(simple_temp,4); 147 161 148 162 } else { 149 163 // unknown property 150 std::cerr << "ERROR: FrameAssembler _metadata::configure() unknown property" << std::endl;164 std::cerr << "ERROR: FrameAssembler::configure() unknown property" << std::endl; 151 165 throw CF::PropertySet::InvalidConfiguration(); 152 166 } 153 167 } 154 155 } 156 157 void FrameAssembler_metadata_i::ConfigureModulationSchemeOnMetaData() { 158 switch (metadata->modulation_scheme.scheme) { 159 case standardInterfaces::ModulationScheme::PSK: 160 switch (metadata->modulation_scheme.M) { 161 case 2: 162 ConfigureModulationScheme(SigProc::BPSK); 163 DEBUG(5, FrameAssembler_metadata, "Frame mod set to BPSK"); 164 break; 165 case 4: 166 ConfigureModulationScheme(SigProc::QPSK); 167 DEBUG(5, FrameAssembler_metadata, "Frame mod set to QPSK"); 168 break; 169 case 8: 170 ConfigureModulationScheme(SigProc::PSK8); 171 DEBUG(5, FrameAssembler_metadata, "Frame mod set to 8PSK"); 172 break; 173 default: 174 std::cerr << "FrameAssembler_metadata-metadata: Unsupported PSK modulation depth" << std::endl; 175 throw 0; 176 } 177 break; 178 case standardInterfaces::ModulationScheme::QAM: 179 switch (metadata->modulation_scheme.M) { 180 case 4: 181 ConfigureModulationScheme(SigProc::QPSK); 182 DEBUG(5, FrameAssembler_metadata, "Frame mod set to QPSK (4QAM)"); 183 break; 184 case 16: 185 ConfigureModulationScheme(SigProc::QAM16); 186 DEBUG(5, FrameAssembler_metadata, "Frame mod set to 16QAM"); 187 break; 188 default: 189 std::cerr << "FrameAssembler_metadata-metadata: Unsupported QAM modulation depth" << std::endl; 190 throw 0; 191 } 192 break; 193 case standardInterfaces::ModulationScheme::PAM: 194 switch (metadata->modulation_scheme.M) { 195 case 4: 196 ConfigureModulationScheme(SigProc::PAM4); 197 DEBUG(5, FrameAssembler_metadata, "Frame mod set to 4PAM"); 198 break; 199 default: 200 std::cerr << "FrameAssembler_metadata-metadata: Unsupported PAM modulation depth" << std::endl; 201 throw 0; 202 } 203 break; 204 case standardInterfaces::ModulationScheme::UNKNOWN: 205 default:; 206 } 207 } 208 209 210 211 212 void FrameAssembler_metadata_i::ProcessData() 213 { 214 DEBUG(3, FrameAssembler_metadata, "ProcessData() invoked") 168 169 //Update frame size 170 ConfigureFrameSize(frame_size_option); 171 DEBUG(3, FrameAssembler, "Frame Size Option "<<frame_size_option<<" configured") 172 173 } 174 175 176 177 void FrameAssembler_i::ProcessData() 178 { 179 DEBUG(3, FrameAssembler, "ProcessData() invoked") 215 180 216 181 PortTypes::ShortSequence I_out_header, Q_out_header; … … 270 235 while ( numFrameSymbolsAssembled < (frameSize-1) ) { 271 236 // Get data from port 272 //dataIn_0->getData(I_in_0, Q_in_0, metadata);273 237 dataIn_0->getData(I_in_0, Q_in_0); 274 238 // Read input data length 275 239 N_in = I_in_0->length(); 276 DEBUG(1, FrameAssembler _metadata, "got " << N_in << " samples");240 DEBUG(1, FrameAssembler, "got " << N_in << " samples"); 277 241 278 242 279 243 /* HV 280 if (metadata->app_id==0) {281 // control packet; configure282 DEBUG(1, FrameAssembler_metadata, "configuring end-of-frame control (app_id = 0)");283 if (N_in != 1024) {284 std::cerr << "ERROR! FrameAssembler_metadata: control packet is wrong length!"285 << std::endl;286 throw 0;287 }288 244 289 245 for (unsigned int i=0; i<N_in; i++) { … … 298 254 if ( numFrameSymbolsAssembled==0 ) { 299 255 // first packet 300 ConfigureModulationScheme(SigProc::QPSK);256 //ConfigureModulationScheme(SigProc::QPSK); 301 257 302 /* HV 303 ConfigureModulationSchemeOnMetaData(); 304 305 if (metadata->app_id==5) { 306 DEBUG(1, FrameAssembler_metadata, "configuring special control frame (app_id = 5)"); 307 ConfigureFrameType(FRAME_TYPE_CONTROL); 308 // control frame 309 if (N_in != frameSize) { 310 std::cerr << "ERROR! FrameAssembler_metadata: control packet (app_id=5) is wrong length!" 311 << std::endl; 312 throw 0; 313 } 314 num_frames_sent_app_5++; 315 } else if (metadata->app_id==6) { 316 DEBUG(1, FrameAssembler_metadata, "configuring special beacon frame (app_id = 6)"); 317 ConfigureFrameType(FRAME_TYPE_CONTROL); 318 // control frame 319 if (N_in != frameSize) { 320 std::cerr << "ERROR! FrameAssembler_metadata: control packet (app_id=6) is wrong length!" 321 << std::endl; 322 throw 0; 323 } 324 num_frames_sent_app_6++; 325 } else if (metadata->app_id==1) { 326 // audio data 327 ConfigureFrameType(FRAME_TYPE_DATA); 328 ///todo configure for BPSK 329 if (metadata->modulation_scheme.M == 4) 330 ConfigureFrameSize(8192); // QPSK 331 else 332 ConfigureFrameSize(4096); // 16-QAM 333 num_frames_sent_app_1++; 334 } else if (metadata->app_id==2) { 335 // text data 336 ConfigureFrameType(FRAME_TYPE_DATA); 337 ConfigureFrameSize(512); 338 num_frames_sent_app_2++; 339 } else { 340 std::cerr << "ERROR! FrameAssembler_metadata: Unknown app_id: " 341 << metadata->app_id << std::endl; 342 throw 0; 343 } 344 */ 345 346 //HV audio data 258 347 259 ConfigureFrameType(FRAME_TYPE_DATA); 348 ///todo configure for BPSK 349 //if (metadata->modulation_scheme.M == 4) 350 // ConfigureFrameSize(8192); // QPSK 351 //else 352 ConfigureFrameSize(4096); // 16-QAM 353 num_frames_sent_app_1++; 260 261 ConfigureFrameSize(frame_size_option); 262 354 263 355 264 I_out_data.length(frameSize); … … 357 266 } 358 267 359 DEBUG(1, FrameAssembler _metadata, "Assembling " << N_in << " symbols (max: " << frameSize);268 DEBUG(1, FrameAssembler, "Assembling " << N_in << " symbols (max: " << frameSize); 360 269 361 270 for (unsigned int i=0; i<N_in; i++) { … … 373 282 374 283 // ASSEMBLE_PREAMBLE 375 DEBUG(4, FrameAssembler _metadata, "Assembling preamble")376 //HV metadata->port_id = 0; 284 DEBUG(4, FrameAssembler, "Assembling preamble") 285 377 286 378 287 // push ramp-up preamble phasing pattern 379 DEBUG(7, FrameAssembler_metadata, "pushing ramp up phasing " << I_out_ramp_up.length() << " frame samples") 380 // dataOut_0->pushPacket(I_out_ramp_up, Q_out_ramp_up, *metadata); 288 DEBUG(7, FrameAssembler, "pushing ramp up phasing " << I_out_ramp_up.length() << " frame samples") 381 289 dataOut_0->pushPacket(I_out_ramp_up, Q_out_ramp_up); 382 290 383 291 // push preamble 384 292 unsigned int phasing_pattern_length; 385 /* HV386 if (metadata->app_id==6)387 phasing_pattern_length = 16;388 else if (metadata->app_id==1)389 phasing_pattern_length = 32;390 else if (metadata->app_id==0)391 phasing_pattern_length = 8;392 else if (metadata->app_id==5)393 phasing_pattern_length = 32;394 else395 phasing_pattern_length = 8;396 */397 293 398 phasing_pattern_length = 32;294 phasing_pattern_length = 32; 399 295 400 296 for (unsigned int i=0; i<phasing_pattern_length; i++) { 401 DEBUG(7, FrameAssembler_metadata, "pushing phasing " << I_out_phasing_pattern.length() << " frame samples") 402 //dataOut_0->pushPacket(I_out_phasing_pattern, Q_out_phasing_pattern, *metadata); 297 DEBUG(7, FrameAssembler, "pushing phasing " << I_out_phasing_pattern.length() << " frame samples") 403 298 dataOut_0->pushPacket(I_out_phasing_pattern, Q_out_phasing_pattern); 404 299 } 405 300 406 301 // ASSEMBLE_HEADER 407 DEBUG(4, FrameAssembler _metadata, "Assembling header")302 DEBUG(4, FrameAssembler, "Assembling header") 408 303 // copy header 409 304 I_out_header.length(512); … … 416 311 417 312 // push data 418 DEBUG(7, FrameAssembler _metadata, "pushing header " << I_out_header.length() << " frame samples")419 //dataOut_0->pushPacket(I_out_header, Q_out_header, *metadata); 313 DEBUG(7, FrameAssembler, "pushing header " << I_out_header.length() << " frame samples") 314 420 315 dataOut_0->pushPacket(I_out_header, Q_out_header); 421 316 … … 436 331 I_out_0.length(j); 437 332 Q_out_0.length(j); 438 DEBUG(7, FrameAssembler_metadata, "pushing frame " << I_out_0.length() << " frame samples") 439 //dataOut_0->pushPacket(I_out_0, Q_out_0, *metadata); 333 DEBUG(7, FrameAssembler, "pushing frame " << I_out_0.length() << " frame samples") 440 334 dataOut_0->pushPacket(I_out_0, Q_out_0); 441 335 j=0; … … 449 343 // No need to push additional control information as internal frame data 450 344 // are already control 451 DEBUG(7, FrameAssembler_metadata, "pushing control " << I_out_control.length() << " frame samples") 452 //HV metadata->port_id = 1;//127; 453 //dataOut_0->pushPacket(I_out_control, Q_out_control, *metadata); 454 //HV no EOM dataOut_0->pushPacket(I_out_control, Q_out_control); 455 //HV metadata->port_id = 0; 345 DEBUG(7, FrameAssembler, "pushing control " << I_out_control.length() << " frame samples") 346 347 //no EOM dataOut_0->pushPacket(I_out_control, Q_out_control); 348 456 349 } 457 350 458 351 // push ramp-down phasing pattern 459 DEBUG(7, FrameAssembler _metadata, "pushing ramp down phasing " << I_out_ramp_up.length() << " frame samples")460 // dataOut_0->pushPacket(I_out_ramp_down, Q_out_ramp_down, *metadata); 352 DEBUG(7, FrameAssembler, "pushing ramp down phasing " << I_out_ramp_up.length() << " frame samples") 353 461 354 dataOut_0->pushPacket(I_out_ramp_down, Q_out_ramp_down); 462 355 463 if (ossieDebugLevel >= 4) {464 std::cout << "Frame count: "465 << "app_1(" << num_frames_sent_app_1 << ") "466 << "app_2(" << num_frames_sent_app_2 << ") "467 << "app_5(" << num_frames_sent_app_5 << ") "468 << "app_6(" << num_frames_sent_app_6 << ") "469 << "total: " << num_frames_sent_app_1+num_frames_sent_app_2470 << std::endl;471 }472 356 } 473 357 -
ossiedev/branches/hvolos/packetwfrm/components/FrameAssembler/src/FrameAssembler.h
r8827 r8831 3 3 Copyright 2007 Virginia Polytechnic Institute and State University 4 4 5 This file is part of the OSSIE FrameAssembler _metadata.5 This file is part of the OSSIE FrameAssembler. 6 6 7 OSSIE FrameAssembler _metadatais free software; you can redistribute it and/or modify7 OSSIE FrameAssembler is free software; you can redistribute it and/or modify 8 8 it under the terms of the GNU General Public License as published by 9 9 the Free Software Foundation; either version 2 of the License, or 10 10 (at your option) any later version. 11 11 12 OSSIE FrameAssembler _metadatais distributed in the hope that it will be useful,12 OSSIE FrameAssembler is distributed in the hope that it will be useful, 13 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 16 16 17 17 You should have received a copy of the GNU General Public License 18 along with OSSIE FrameAssembler _metadata; if not, write to the Free Software18 along with OSSIE FrameAssembler; if not, write to the Free Software 19 19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 20 … … 22 22 23 23 24 #ifndef FRAMEASSEMBLER_ METADATA_IMPL_H25 #define FRAMEASSEMBLER_ METADATA_IMPL_H24 #ifndef FRAMEASSEMBLER_IMPL_H 25 #define FRAMEASSEMBLER_IMPL_H 26 26 27 27 #include <stdlib.h> … … 40 40 * 41 41 */ 42 class FrameAssembler_ metadata_i : public virtual Resource_impl, public FrameAssemblerDSP42 class FrameAssembler_i : public virtual Resource_impl, public FrameAssemblerDSP 43 43 { 44 44 public: 45 45 /// Initializing constructor 46 FrameAssembler_ metadata_i(const char *uuid, omni_condition *sem);46 FrameAssembler_i(const char *uuid, omni_condition *sem); 47 47 48 48 /// Destructor 49 ~FrameAssembler_ metadata_i(void);49 ~FrameAssembler_i(void); 50 50 51 51 /// Static function for omni thread … … 77 77 private: 78 78 /// Disallow default constructor 79 FrameAssembler_ metadata_i();79 FrameAssembler_i(); 80 80 81 81 /// Disallow copy constructor 82 FrameAssembler_ metadata_i(FrameAssembler_metadata_i&);82 FrameAssembler_i(FrameAssembler_i&); 83 83 84 84 /// Main signal processing method … … 93 93 standardInterfaces_i::complexShort_p *dataIn_0; 94 94 standardInterfaces_i::complexShort_u *dataOut_0; 95 standardInterfaces::MetaData *metadata;96 95 97 unsigned int num_frames_sent_app_1; 98 unsigned int num_frames_sent_app_2; 99 unsigned int num_frames_sent_app_5; 100 unsigned int num_frames_sent_app_6; 96 unsigned int frame_size_option; 97 98 //unsigned int numFrameSymbolsAssembled; 99 100 101 101 102 102 }; -
ossiedev/branches/hvolos/packetwfrm/components/FrameAssembler/src/FrameAssemblerDSP.cpp
r5638 r8831 38 38 controlBlock[i] = pnControlCode; 39 39 40 numFrameSymbolsAssembled = 0; 41 42 FRAME_SIZE_1=512; ///< Frame size option 1 43 FRAME_SIZE_2=2048; ///< Frame size option 2 44 FRAME_SIZE_3=4096; ///< Frame size option 3 45 FRAME_SIZE_4=8192; ///< Frame size option 4 46 40 47 ConfigureModulationScheme( BPSK ); 41 ConfigureFrameSize( FRAME_SIZE_1);48 ConfigureFrameSize(1); 42 49 ConfigureFrameType( FRAME_TYPE_DATA ); 43 44 numFrameSymbolsAssembled = 0;45 50 } 46 51 … … 101 106 controlBlock[6] = pnControlCode; // 1 102 107 frameType = FRAME_TYPE_CONTROL; 103 ConfigureFrameSize( 512);108 ConfigureFrameSize(1); 104 109 break; 105 110 default: … … 116 121 void FrameAssemblerDSP::ConfigureFrameSize(unsigned int _fs) 117 122 { 118 switch (_fs) {119 case FRAME_SIZE_1:123 switch (_fs){ 124 case 1: 120 125 frameSize = FRAME_SIZE_1; 121 126 controlBlock[3] = pnControlCodeInv; 122 127 controlBlock[4] = pnControlCodeInv; 123 break;124 case FRAME_SIZE_2:128 break; 129 case 2: 125 130 frameSize = FRAME_SIZE_2; 126 131 controlBlock[3] = pnControlCodeInv; 127 132 controlBlock[4] = pnControlCode; 128 break;129 case FRAME_SIZE_3:133 break; 134 case 3: 130 135 frameSize = FRAME_SIZE_3; 131 136 controlBlock[3] = pnControlCode; 132 137 controlBlock[4] = pnControlCodeInv; 133 break;134 case FRAME_SIZE_4:138 break; 139 case 4: 135 140 frameSize = FRAME_SIZE_4; 136 141 controlBlock[3] = pnControlCode; 137 142 controlBlock[4] = pnControlCode; 138 break;143 break; 139 144 default: 140 145 // unsupported frame size … … 142 147 << "unsupported frame size (" << _fs << ")" << std::endl; 143 148 std::cout << " => using " << FRAME_SIZE_1 << " instead" << std::endl; 144 ConfigureFrameSize(FRAME_SIZE_1); 145 } 149 ConfigureFrameSize(1); 150 } 151 152 //std::cout << "FrameAssemblerDSP::ConfigureFrameSize(): "<<frameSize<<std::endl; 146 153 } 147 154 … … 212 219 } 213 220 214 221 void FrameAssemblerDSP::SetFrameSize(unsigned int inframesize, unsigned int inframesizeno) 222 { 223 switch ( inframesizeno ) { 224 case 0: 225 std::cerr << "ERROR: FrameSynchronizerDSP::SetFrameSize:0 frame size option not allowed to be set"<<std::endl; 226 throw 0; 227 break; 228 case 1: 229 FRAME_SIZE_1=inframesize; 230 break; 231 case 2: 232 FRAME_SIZE_2=inframesize; 233 break; 234 case 3: 235 FRAME_SIZE_3=inframesize; 236 break; 237 case 4: 238 FRAME_SIZE_4=inframesize; 239 break; 240 default: 241 std::cerr << "ERROR: FrameSynchronizerDSP::SetFrameSize:Invalid frame size option"<<std::endl; 242 throw 0; 243 } 244 245 } 246 247 248 unsigned int FrameAssemblerDSP::GetFrameSize(unsigned int inframesizeno) 249 { 250 switch ( inframesizeno ) { 251 case 0: 252 return frameSize; 253 break; 254 case 1: 255 return FRAME_SIZE_1; 256 break; 257 case 2: 258 return FRAME_SIZE_2; 259 break; 260 case 3: 261 return FRAME_SIZE_3; 262 break; 263 case 4: 264 return FRAME_SIZE_4; 265 break; 266 default: 267 std::cerr << "ERROR: FrameSynchronizerDSP::GetFrameSize:Invalid frame size option"<<std::endl; 268 throw 0; 269 } 270 271 } 272 -
ossiedev/branches/hvolos/packetwfrm/components/FrameAssembler/src/FrameAssemblerDSP.h
r5630 r8831 29 29 #include "PNCodes.h" 30 30 31 #define FRAME_SIZE_1 2048 ///< Frame size option 132 #define FRAME_SIZE_2 4096 ///< Frame size option 233 #define FRAME_SIZE_3 8192 ///< Frame size option 334 #define FRAME_SIZE_4 512 ///< Frame size option 431 //#define FRAME_SIZE_1 2048 ///< Frame size option 1 32 //#define FRAME_SIZE_2 4096 ///< Frame size option 2 33 //#define FRAME_SIZE_3 8192 ///< Frame size option 3 34 //#define FRAME_SIZE_4 512 ///< Frame size option 4 35 35 36 36 … … 48 48 /// Destructor 49 49 ~FrameAssemblerDSP(); 50 51 void SetFrameSize(unsigned int inframesize, unsigned int inframesizeno); 52 53 unsigned int GetFrameSize(unsigned int inframesizeno); 50 54 51 55 protected: … … 61 65 /// 62 66 unsigned int frameSize; 67 68 unsigned int FRAME_SIZE_1,FRAME_SIZE_2,FRAME_SIZE_3,FRAME_SIZE_4; 63 69 64 70 /// -
ossiedev/branches/hvolos/packetwfrm/components/FrameAssembler/src/main.cpp
r8015 r8831 3 3 Copyright 2006 Virginia Polytechnic Institute and State University 4 4 5 This file is part of the OSSIE FrameAssembler _metadata.5 This file is part of the OSSIE FrameAssembler. 6 6 7 OSSIE FrameAssembler _metadatais free software; you can redistribute it and/or modify7 OSSIE FrameAssembler is free software; you can redistribute it and/or modify 8 8 it under the terms of the GNU General Public License as published by 9 9 the Free Software Foundation; either version 2 of the License, or 10 10 (at your option) any later version. 11 11 12 OSSIE FrameAssembler _metadatais distributed in the hope that it will be useful,12 OSSIE FrameAssembler is distributed in the hope that it will be useful, 13 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 16 16 17 17 You should have received a copy of the GNU General Public License 18 along with OSSIE FrameAssembler _metadata; if not, write to the Free Software18 along with OSSIE FrameAssembler; if not, write to the Free Software 19 19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 20 … … 25 25 #include "ossie/debug.h" 26 26 27 #include "FrameAssembler _metadata.h"27 #include "FrameAssembler.h" 28 28 29 29 using namespace std; … … 48 48 cout << "Identifier - " << uuid << " Label - " << label << endl; 49 49 50 FrameAssembler_ metadata_i* frameassembler_servant;50 FrameAssembler_i* frameassembler_servant; 51 51 CF::Resource_var frameassembler_var; 52 52 53 53 // Create the frameassembler component servant and object reference 54 54 55 frameassembler_servant = new FrameAssembler_ metadata_i(uuid, component_running);55 frameassembler_servant = new FrameAssembler_i(uuid, component_running); 56 56 frameassembler_var = frameassembler_servant->_this(); 57 57 -
ossiedev/branches/hvolos/packetwfrm/components/FrameAssembler/xml/FrameAssembler.prf.xml
r8827 r8831 4 4 <!--Powered by Python--> 5 5 <properties> 6 <simple type="string" id="DCE: c15e70e4-96e4-4cc8-b1f0-06cb301f6c2e" name="mod_type" mode="readwrite">6 <simple type="string" id="DCE:a15e70e4-96e4-4cc8-b1f0-06cb301f6c2e" name="mod_type" mode="readwrite"> 7 7 <description>Modulation type: BPSK, QPSK, 8PSK, 16QAM</description> 8 8 <value>BPSK</value> 9 9 <kind kindtype="configure"/> 10 10 </simple> 11 <simple type="ushort" id="DCE:06b798ba-5412-4bbe-bf0b-8ca665d25b83" name="frame_size" mode="readwrite"> 12 <description>Frame size (number of modulated symbols): 2048, 4096, 8192, 16384</description> 11 <simple type="ushort" id="DCE:96b798ba-5412-4bbe-bf0b-8ca665d25b83" name="FrameSizeOptionNumber" mode="readwrite"> 12 <description>Frame Size Option Number</description> 13 <value>1</value> 14 <kind kindtype="configure"/> 15 </simple> 16 <simple type="ushort" id="DCE:cdac2d50-214c-4c47-8a6d-d9ec453b3b3c" name="FrameSizeOption1" mode="readwrite"> 17 <description>Frame Size for Option 1</description> 18 <value>512</value> 19 <kind kindtype="configure"/> 20 </simple> 21 <simple type="ushort" id="DCE:a6caa288-08d2-4f0e-b0f0-f34fa513ce3d" name="FrameSizeOption2" mode="readwrite"> 22 <description>Frame Size for Option 2</description> 13 23 <value>2048</value> 14 24 <kind kindtype="configure"/> 15 25 </simple> 26 <simple type="ushort" id="DCE:bcf3ff9b-9f9d-4498-b29a-78f813678271" name="FrameSizeOption3" mode="readwrite"> 27 <description>Frame Size for Option 3</description> 28 <value>4096</value> 29 <kind kindtype="configure"/> 30 </simple> 31 <simple type="ushort" id="DCE:34311a06-2055-4490-a949-478786cad4d4" name="FrameSizeOption4" mode="readwrite"> 32 <description>Frame Size for Option 4</description> 33 <value>8192</value> 34 <kind kindtype="configure"/> 35 </simple> 16 36 </properties> -
ossiedev/branches/hvolos/packetwfrm/components/FrameAssembler/xml/FrameAssembler.spd.xml
r8827 r8831 3 3 <!--Created with OSSIE WaveDev Beta Version 0.6.0b--> 4 4 <!--Powered by Python--> 5 <softpkg name="FrameAssembler _metadata" id="DCE:fd67fe3a-ec3b-45f6-8c2b-b4cdab07ad56">5 <softpkg name="FrameAssembler" id="DCE:ad67fe3a-ec3b-45f6-8c2b-b4cdab07ad56"> 6 6 <title>Frame assembler component</title> 7 7 <description>Adds BPSK preamble header information for assembling frames</description> … … 12 12 </author> 13 13 <propertyfile type="PRF"> 14 <localfile name="xml/FrameAssembler _metadata/FrameAssembler_metadata.prf.xml"/>14 <localfile name="xml/FrameAssembler/FrameAssembler.prf.xml"/> 15 15 </propertyfile> 16 16 <descriptor> 17 <localfile name="xml/FrameAssembler _metadata/FrameAssembler_metadata.scd.xml"/>17 <localfile name="xml/FrameAssembler/FrameAssembler.scd.xml"/> 18 18 </descriptor> 19 <implementation id="DCE: a2a578b9-6ca0-4e20-9375-196a5f2a8121">19 <implementation id="DCE:d2a578b9-6ca0-4e20-9375-196a5f2a8121"> 20 20 <description>Default implementation description</description> 21 21 <code type="Executable"> 22 <localfile name="bin/FrameAssembler _metadata"/>22 <localfile name="bin/FrameAssembler"/> 23 23 </code> 24 24 <processor name="x86"/>