]> Creatis software - creaMiniTools.git/blob - bbtk_package_creaMiniTools/src/bbcreaMiniToolsCreateReport01.cxx
#3421 template_creaPatientsSystem
[creaMiniTools.git] / bbtk_package_creaMiniTools / src / bbcreaMiniToolsCreateReport01.cxx
1 //===== 
2 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
3 //===== 
4 #include "bbcreaMiniToolsCreateReport01.h"
5 #include "bbcreaMiniToolsPackage.h"
6 namespace bbcreaMiniTools
7 {
8
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMiniTools,CreateReport01)
10 BBTK_BLACK_BOX_IMPLEMENTATION(CreateReport01,bbtk::AtomicBlackBox);
11 //===== 
12 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
13 //===== 
14 void CreateReport01::Process()
15 {
16
17 // THE MAIN PROCESSING METHOD BODY
18 //   Here we simply set the input 'In' value to the output 'Out'
19 //   And print out the output value
20 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
21 //    void bbSet{Input|Output}NAME(const TYPE&)
22 //    const TYPE& bbGet{Input|Output}NAME() const 
23 //    Where :
24 //    * NAME is the name of the input/output
25 //      (the one provided in the attribute 'name' of the tag 'input')
26 //    * TYPE is the C++ type of the input/output
27 //      (the one provided in the attribute 'type' of the tag 'input')
28 //    bbSetOutputOut( bbGetInputIn() );
29 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
30       
31     bbSetOutputLstTitles( bbGetInputLstTitles1() );
32     
33     std::vector<std::string> lstPatients    = bbGetInputLstPatientsID();
34     std::vector<std::string> lstTitles1     = bbGetInputLstTitles1();
35     std::vector<std::string> lstTitles2     = bbGetInputLstTitles2();
36     std::vector<std::string> lstStepsPath   = bbGetInputLstStepsPath();
37     std::vector<std::string> lstCommentsPath= bbGetInputLstCommentsPath();
38
39     std::vector<std::string> lstOut00;
40     std::vector<std::string> lstOut01;
41     std::vector<std::string> lstOut02;
42     std::vector<std::string> lstOut03;
43     std::vector<std::string> lstOut04;
44     std::vector<std::string> lstOut05;
45     std::vector<std::string> lstOut06;
46     std::vector<std::string> lstOut07;
47     std::vector<std::string> lstOut08;
48     std::vector<std::string> lstOut09;
49     std::vector<std::string> lstOut10;
50
51     std::vector< std::vector<std::string>* > pLstOut;
52     
53     pLstOut.push_back( &lstOut00 );
54     pLstOut.push_back( &lstOut01 );
55     pLstOut.push_back( &lstOut02 );
56     pLstOut.push_back( &lstOut03 );
57     pLstOut.push_back( &lstOut04 );
58     pLstOut.push_back( &lstOut05 );
59     pLstOut.push_back( &lstOut06 );
60     pLstOut.push_back( &lstOut07 );
61     pLstOut.push_back( &lstOut08 );
62     pLstOut.push_back( &lstOut09 );
63     pLstOut.push_back( &lstOut10 );
64
65
66     int iTitle2,sizeTitles2     = lstTitles2.size();
67     for (iTitle2=0 ; iTitle2<sizeTitles2 ; iTitle2++ )
68     {
69         pLstOut[iTitle2]->push_back( lstTitles2[iTitle2]  );
70         pLstOut[iTitle2]->push_back( " "  );
71     } // for iTitle2
72     
73
74     int id;
75     int i,sizeLstPatientsID     = lstPatients.size();
76     int j,sizeLstStepsPath      = lstStepsPath.size();
77     int jj,sizeLstCommentsPath  = lstCommentsPath.size();
78     for ( i=0 ;  i<sizeLstPatientsID ; i++ )
79     {
80         printf("EED CreateReport01::Process Patient:%s\n", lstPatients[i].c_str() );
81         pLstOut[0]->push_back( lstPatients[i] );
82         pLstOut[0]->push_back( " " );
83         pLstOut[0]->push_back( " " );
84         pLstOut[0]->push_back( " " );
85         
86         for (j=0; j<sizeLstStepsPath;j++)
87         {
88             id=j+1;
89             pLstOut[id]->push_back( "Step:"+std::to_string(j) );
90             pLstOut[id]->push_back( "2021/11/12" );
91             pLstOut[id]->push_back( "16h56" );
92             pLstOut[id]->push_back( " " );
93             printf("EED CreateReport01::Process Step:%s\n", lstStepsPath[j].c_str() );
94         } // for j
95
96         for ( jj=0; jj<sizeLstCommentsPath ; jj++ )
97         {
98             id=jj+1+sizeLstStepsPath;
99             pLstOut[id]->push_back( "Comment:"+std::to_string(jj) );
100             pLstOut[id]->push_back( "2021/11/12" );
101             pLstOut[id]->push_back( "16h56" );
102             pLstOut[id]->push_back( " " );
103             printf("EED CreateReport01::Process Comment:%s\n", lstCommentsPath[jj].c_str() );
104         } // for j
105
106     } // for i
107     
108     bbSetOutputOut00( lstOut00 );
109     bbSetOutputOut01( lstOut01 );
110     bbSetOutputOut02( lstOut02 );
111     bbSetOutputOut03( lstOut03 );
112     bbSetOutputOut04( lstOut04 );
113     bbSetOutputOut05( lstOut05 );
114     bbSetOutputOut06( lstOut06 );
115     bbSetOutputOut07( lstOut07 );
116     bbSetOutputOut08( lstOut08 );
117     bbSetOutputOut09( lstOut09 );
118     bbSetOutputOut10( lstOut10 );
119 }
120 //===== 
121 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
122 //===== 
123 void CreateReport01::bbUserSetDefaultValues()
124 {
125
126 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
127 //    Here we initialize the input 'In' to 0
128 //   bbSetInputIn(0);
129   
130 }
131 //===== 
132 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
133 //===== 
134 void CreateReport01::bbUserInitializeProcessing()
135 {
136
137 //  THE INITIALIZATION METHOD BODY :
138 //    Here does nothing 
139 //    but this is where you should allocate the internal/output pointers 
140 //    if any 
141
142   
143 }
144 //===== 
145 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
146 //===== 
147 void CreateReport01::bbUserFinalizeProcessing()
148 {
149
150 //  THE FINALIZATION METHOD BODY :
151 //    Here does nothing 
152 //    but this is where you should desallocate the internal/output pointers 
153 //    if any
154   
155 }
156 }
157 // EO namespace bbcreaMiniTools
158
159