Reimplemented from Impala::Application::MediaTable::SelectionCollectionListener. Definition at line 148 of file SelectionCollection.h. References Impala::Application::MediaTable::TableDataView::GetMarkedRowsMap(), Impala::Application::MediaTable::TableDataView::GetTextDataByID(), ILOG_DEBUG, ILOG_ERROR, ILOG_SYSTEM, and mSource. 00149 { 00150 ILOG_SYSTEM("SaveCollectionEvent"); 00151 00152 std::map<int, int> marks = mSource->GetMarkedRowsMap(); 00153 if(!marks.size()) return; 00154 00155 std::string filename = "marks.csv"; 00156 std::ofstream os(filename.c_str()); 00157 00158 if(!os.good()) 00159 { 00160 ILOG_ERROR("Can not write to " << filename); 00161 return; 00162 } 00163 00164 #ifndef MEDIATABLE_VIDEOLYMPICS 00165 os << "row,mark,mark1,mark2,mark3,mark4,mark5,mark6,mark7,mark8\n"; 00166 #else 00167 os << "row,mark,mark1,mark2,mark3,mark4,mark5,mark6,mark7,mark8,shotname\n"; 00168 #endif 00169 std::map<int, int>::iterator iter; 00170 for (iter = marks.begin(); iter != marks.end(); iter++) 00171 { 00172 os << iter->first << ","; 00173 os << iter->second << ","; 00174 os << ((iter->second & 1) ? "1" : "0") << ","; 00175 os << ((iter->second & 2) ? "1" : "0") << ","; 00176 os << ((iter->second & 4) ? "1" : "0") << ","; 00177 os << ((iter->second & 8) ? "1" : "0") << ","; 00178 os << ((iter->second & 16) ? "1" : "0") << ","; 00179 os << ((iter->second & 32) ? "1" : "0") << ","; 00180 os << ((iter->second & 64) ? "1" : "0") << ","; 00181 os << ((iter->second & 128) ? "1" : "0"); 00182 #ifdef MEDIATABLE_VIDEOLYMPICS 00183 os << "," << mSource->GetTextDataByID("shotname", iter->first); 00184 #endif 00185 os << "\n"; 00186 } 00187 os.close(); 00188 ILOG_DEBUG("Written " << marks.size() << " to " << filename); 00189 }
Here is the call graph for this function:
|