From: hachti Date: Sun, 19 Nov 2006 10:40:44 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://gitweb.hachti.de/?a=commitdiff_plain;h=4e1d6c7f0835829d41c2dff7c15baec4d15f8318;p=h316.git *** empty log message *** --- diff --git a/pc-tools/ldc2/Makefile b/pc-tools/ldc2/Makefile index 575f8cc..d50c2ee 100644 --- a/pc-tools/ldc2/Makefile +++ b/pc-tools/ldc2/Makefile @@ -1,5 +1,14 @@ -APP_NAME=test -APP_OBJECTS=test.o tape_block.o silent_code.o data_block.o data_block_0.o +APP_NAME=ldc2 +APP_OBJECTS= main.o silent_code.o + +APP_OBJECTS+= tape_block.o eot_block.o discard_block.o\ + data_block.o data_block_0.o data_block_0_0.o\ + data_block_0_label_extractor.o + +APP_OBJECTS+= data_block_0_10.o data_block_0_14.o data_block_0_1.o data_block_0_24.o\ + data_block_0_2.o data_block_0_30.o data_block_0_3.o data_block_0_4.o\ + data_block_0_50.o data_block_0_54.o data_block_0_60.o data_block_0_44.o + SRC_DIR=src default: $(APP_NAME) @@ -14,7 +23,7 @@ $(APP_NAME) : $(APP_OBJECTS) g++ -o$@ $^ clean: - rm -rf $(APP_NAME) *.o doxy/ $(SRC_DIR)/*~ + rm -rf $(APP_NAME) *.o doxy/ $(SRC_DIR)/*~ ul_timestamp $(MAKE) -C doc clean doxy/timestamp: $(SRC_DIR)/* @@ -23,13 +32,17 @@ doxy/timestamp: $(SRC_DIR)/* touch $@ doxy: doxy/timestamp +upload: ul_timestamp -upload: doxy/timestamp - scp -r doxy/html ente:h316.web/ldc-doc +ul_timestamp: doxy/timestamp + @cd doxy/html && tar -czf /tmp/doxy.tar.gz * + @touch ul_timestamp + @scp -q /tmp/doxy.tar.gz ente:/tmp/ + @ssh ente "rm -rf h316.web/ldc-doc/* && cd h316.web/ldc-doc && tar -xzf /tmp/doxy.tar.gz" doc: $(MAKE) -C doc all: $(APP_NAME) doxy doc -.PHONY: all clean doxy upload doc \ No newline at end of file +.PHONY: all clean doxy upload docdata_block_0_0.o diff --git a/pc-tools/ldc2/src/data_block_0.hh b/pc-tools/ldc2/src/data_block_0.hh index 997102b..61b2b7a 100644 --- a/pc-tools/ldc2/src/data_block_0.hh +++ b/pc-tools/ldc2/src/data_block_0.hh @@ -20,7 +20,6 @@ private: public: int get_subtype(); vector get_description(); - }; #endif diff --git a/pc-tools/ldc2/src/data_block_0_0.cpp b/pc-tools/ldc2/src/data_block_0_0.cpp index 2e1d222..815d33f 100644 --- a/pc-tools/ldc2/src/data_block_0_0.cpp +++ b/pc-tools/ldc2/src/data_block_0_0.cpp @@ -6,7 +6,7 @@ *\brief Parent class copy constructor. */ data_block_0_0::data_block_0_0(data_block_0 & org) - :data_block_0(org) + :data_block_0_label_extractor(org),data_block_0(org) {} /*! @@ -15,7 +15,14 @@ data_block_0_0::data_block_0_0(data_block_0 & org) */ vector data_block_0_0::get_description(){ vector result; - result.insert(result.end(),"Fixme! "+get_typestring()+"Default 0-* block"); + vector labels=get_labels(); + for (int i=0; i #include -#include "data_block_0.hh" +#include "data_block_0_label_extractor.hh" /*! *\brief Class for block type (0-0). */ class data_block_0_0 - : public data_block_0 + : public data_block_0_label_extractor { friend tape_block * tape_block::gen_from_fd(int,void(*)(void*), void(*)(void*),void*); diff --git a/pc-tools/ldc2/src/data_block_0_label_extractor.cpp b/pc-tools/ldc2/src/data_block_0_label_extractor.cpp index d52289d..cd53bb2 100644 --- a/pc-tools/ldc2/src/data_block_0_label_extractor.cpp +++ b/pc-tools/ldc2/src/data_block_0_label_extractor.cpp @@ -1,8 +1,10 @@ #include "data_block_0_label_extractor.hh" - /*! - *\brief Default constructor. + *\brief Constructor. */ +data_block_0_label_extractor::data_block_0_label_extractor(data_block_0& org) + : data_block_0(org) +{} /*! *\brief Extract labels from data_block_0_* blocks diff --git a/pc-tools/ldc2/src/data_block_0_label_extractor.hh b/pc-tools/ldc2/src/data_block_0_label_extractor.hh index f7c8a98..bc42bd9 100644 --- a/pc-tools/ldc2/src/data_block_0_label_extractor.hh +++ b/pc-tools/ldc2/src/data_block_0_label_extractor.hh @@ -4,18 +4,18 @@ #include #include -#include "data_block.hh" +#include "data_block_0.hh" /*! *\brief Abstract class providing label extraction for some data_block_0 subtypes. * This class cannot be instantiated.\n */ class data_block_0_label_extractor - : public virtual data_block + : public virtual data_block_0 { -private: - data_block_0_label_extractor(); +protected: + data_block_0_label_extractor(data_block_0 &); protected: vector get_labels(); diff --git a/pc-tools/ldc2/src/main.cpp b/pc-tools/ldc2/src/main.cpp new file mode 100644 index 0000000..36cb22e --- /dev/null +++ b/pc-tools/ldc2/src/main.cpp @@ -0,0 +1,39 @@ + +#include +#include + +#include "tape_block.hh" +#include "data_block.hh" + +void tape_start(void* m){ + printf("tape_start\n"); +} + +void tape_stop(void* m){ + printf("tape_stop\n"); +} + +int main(){ + tape_block * myblock=0; + do{ + if (myblock) delete myblock; + myblock=tape_block::gen_from_fd(0); + + vector desc=myblock->get_description(); + for (vector::iterator iter=desc.begin(); + iter!=desc.end();iter++) + printf("%s\n",(*iter).c_str()); + + +// if ((myblock->get_type()==0)&&(myblock->get_subtype()==050)){ +// data_block * dp=(data_block *)myblock; +// printf ("0-50 symbol name: %s\n",dp->extract_string(4).c_str()); +// printf ("0-50 symbol name: %s\n",dp->extract_string(11).c_str()); +// printf ("Block size:%i\n",dp->get_word_size()); +// } + } while (myblock->get_state()==tape_block::TBS_OK); + printf("---"); + printf("State:%i\n",myblock->get_state()); + printf("raw size:%i\n",myblock->get_raw_size()); + return 0; +} diff --git a/pc-tools/ldc2/src/test.cpp b/pc-tools/ldc2/src/test.cpp deleted file mode 100644 index 36cb22e..0000000 --- a/pc-tools/ldc2/src/test.cpp +++ /dev/null @@ -1,39 +0,0 @@ - -#include -#include - -#include "tape_block.hh" -#include "data_block.hh" - -void tape_start(void* m){ - printf("tape_start\n"); -} - -void tape_stop(void* m){ - printf("tape_stop\n"); -} - -int main(){ - tape_block * myblock=0; - do{ - if (myblock) delete myblock; - myblock=tape_block::gen_from_fd(0); - - vector desc=myblock->get_description(); - for (vector::iterator iter=desc.begin(); - iter!=desc.end();iter++) - printf("%s\n",(*iter).c_str()); - - -// if ((myblock->get_type()==0)&&(myblock->get_subtype()==050)){ -// data_block * dp=(data_block *)myblock; -// printf ("0-50 symbol name: %s\n",dp->extract_string(4).c_str()); -// printf ("0-50 symbol name: %s\n",dp->extract_string(11).c_str()); -// printf ("Block size:%i\n",dp->get_word_size()); -// } - } while (myblock->get_state()==tape_block::TBS_OK); - printf("---"); - printf("State:%i\n",myblock->get_state()); - printf("raw size:%i\n",myblock->get_raw_size()); - return 0; -}