liborigin2-20110117/0000755000265600020320000000000011523526505013303 5ustar andreasadminliborigin2-20110117/liborigin2.pro0000644000265600020320000000205411523526505016066 0ustar andreasadminTARGET = origin2 TEMPLATE = lib CONFIG += warn_on release thread #CONFIG += staticlib MOC_DIR = ./tmp OBJECTS_DIR = ./tmp DESTDIR = ./ # Path to the folder where the header files of the BOOST C++ libraries are installed INCLUDEPATH += ../boost # link statically against a copy of BOOST C++ libraries #LIBS += ../boost/lib/libboost_date_time.a #LIBS += ../boost/lib/libboost_thread.a # or dynamically against a system-wide installation LIBS += -lboost_date_time LIBS += -lboost_thread HEADERS += endianfstream.hh \ logging.hpp \ OriginObj.h \ OriginFile.h \ OriginParser.h \ OriginDefaultParser.h \ Origin600Parser.h \ Origin610Parser.h \ Origin700Parser.h \ Origin750Parser.h \ Origin800Parser.h \ Origin810Parser.h SOURCES += OriginFile.cpp \ OriginParser.cpp \ OriginDefaultParser.cpp \ Origin600Parser.cpp \ Origin610Parser.cpp \ Origin700Parser.cpp \ Origin750Parser.cpp \ Origin800Parser.cpp \ Origin810Parser.cpp liborigin2-20110117/OriginDefaultParser.cpp0000644000265600020320000003353211523526505017726 0ustar andreasadmin/*************************************************************************** File : OriginDefaultParser.cpp -------------------------------------------------------------------- Copyright : (C) 2005-2008 Stefan Gerlach (C) 2007-2008 Alex Kargovsky, Ion Vasilief Email (use @ for *) : kargovsky*yumr.phys.msu.su, ion_vasilief*yahoo.fr Description : Default Origin file parser class ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #include "OriginDefaultParser.h" #include #include #include #include #include #include using namespace Origin; #define MAX_LEVEL 20 #define ERROR_MSG "Please send the OPJ file and the opjfile.log to the author of liborigin!\n" #define SwapBytes(x) ByteSwap((unsigned char *) &x,sizeof(x)) void ByteSwap(unsigned char * b, int n) { register int i = 0; register int j = n-1; while (i410) for(i=0;i<5;i++) // skip "0" fread(&c,1,1,f); int col_found; fread(&col_found,4,1,f); if(IsBigEndian()) SwapBytes(col_found); fread(&c,1,1,f); // skip '\n' fprintf(debug," [column found = %d/0x%X @ 0x%X]\n",col_found,col_found,(unsigned int) ftell(f)); int current_col=1, nr=0, nbytes=0; double a; char name[25], valuesize; while(col_found > 0 && col_found < 0x84) { // should be 0x72, 0x73 or 0x83 //////////////////////////////// COLUMN HEADER ///////////////////////////////////////////// fprintf(debug,"COLUMN HEADER :\n"); for(i=0;i < 0x3D;i++) { // skip 0x3C chars to value size fread(&c,1,1,f); //if(i>21 && i<27) { fprintf(debug,"%.2X ",c); if(!((i+1)%16)) fprintf(debug,"\n"); //} } fprintf(debug,"\n"); fread(&valuesize,1,1,f); fprintf(debug," [valuesize = %d @ 0x%X]\n",valuesize,(unsigned int) ftell(f)-1); if(valuesize <= 0) { fprintf(debug," WARNING : found strange valuesize of %d\n",valuesize); valuesize=10; } fprintf(debug,"SKIP :\n"); for(i=0;i<0x1A;i++) { // skip to name fread(&c,1,1,f); fprintf(debug,"%.2X ",c); if(!((i+1)%16)) fprintf(debug,"\n"); } fprintf(debug,"\n"); // read name fprintf(debug," [Spreadsheet @ 0x%X]\n",(unsigned int) ftell(f)); fflush(debug); fread(&name,25,1,f); //char* sname = new char[26]; char sname[26]; sprintf(sname,"%s",strtok(name,"_")); // spreadsheet name char* cname = strtok(NULL,"_"); // column name while(char* tmpstr = strtok(NULL,"_")) { // get multiple-"_" title correct strcat(sname,"_"); strcat(sname,cname); strcpy(cname,tmpstr); } int spread=0; if(speadSheets.size() == 0 || findSpreadByName(sname) == -1) { fprintf(debug,"NEW SPREADSHEET\n"); current_col=1; speadSheets.push_back(SpreadSheet(sname)); spread=speadSheets.size()-1; speadSheets.back().maxRows=0; } else { spread = findSpreadByName(sname); current_col=speadSheets[spread].columns.size(); if(!current_col) current_col=1; current_col++; } fprintf(debug,"SPREADSHEET = %s COLUMN %d NAME = %s (@0x%X)\n", sname, current_col, cname, (unsigned int) ftell(f)); fflush(debug); if(cname == 0) { fprintf(debug,"NO COLUMN NAME FOUND! Must be a Matrix or Function.\n"); ////////////////////////////// READ matrixes or functions //////////////////////////////////// fprintf(debug,"Reading MATRIX.\n"); fflush(debug); fprintf(debug," [position @ 0x%X]\n",(unsigned int) ftell(f)); // TODO fprintf(debug," SIGNATURE : "); for(i=0;i<2;i++) { // skip header fread(&c,1,1,f); fprintf(debug,"%.2X ",c); } fflush(debug); do{ // skip until '\n' fread(&c,1,1,f); // fprintf(debug,"%.2X ",c); } while (c != '\n'); fprintf(debug,"\n"); fflush(debug); // read size int size; fread(&size,4,1,f); fread(&c,1,1,f); // skip '\n' // TODO : use entry size : double, float, ... size /= 8; fprintf(debug," SIZE = %d\n",size); fflush(debug); // catch exception if(size>10000) size=1000; fprintf(debug,"VALUES :\n"); speadSheets[speadSheets.size()-1].maxRows=1; double value=0; for(i=0;i0) fprintf(debug,"WARNING: data section could not be read correct\n"); nr = nbytes / valuesize; fprintf(debug," [number of rows = %d (%d Bytes) @ 0x%X]\n",nr,nbytes,(unsigned int) ftell(f)); fflush(debug); speadSheets[spread].maxRows 16) { // skip 0 0 fread(&c,1,1,f); fread(&c,1,1,f); } fread(&col_found,4,1,f); if(IsBigEndian()) SwapBytes(col_found); fread(&c,1,1,f); // skip '\n' fprintf(debug," [column found = %d/0x%X (@ 0x%X)]\n",col_found,col_found,(unsigned int) ftell(f)-5); fflush(debug); } ////////////////////// HEADER SECTION ////////////////////////////////////// // TODO : use new method ('\n') int POS = ftell(f)-11; fprintf(debug,"\nHEADER SECTION\n"); fprintf(debug," nr_spreads = %d\n",speadSheets.size()); fprintf(debug," [position @ 0x%X]\n",POS); fflush(debug); ///////////////////// speadSheets INFOS //////////////////////////////////// int LAYER=0; int COL_JUMP = 0x1ED; for(unsigned int i=0; i < speadSheets.size(); i++) { fprintf(debug," reading Spreadsheet %d/%zd properties\n",i+1,speadSheets.size()); fflush(debug); if(i > 0) { if (version == 700 ) POS += 0x2530 + speadSheets[i-1].columns.size()*COL_JUMP; else if (version == 610 ) POS += 0x25A4 + speadSheets[i-1].columns.size()*COL_JUMP; else if (version == 604 ) POS += 0x25A0 + speadSheets[i-1].columns.size()*COL_JUMP; else if (version == 601 ) POS += 0x2560 + speadSheets[i-1].columns.size()*COL_JUMP; // ? else if (version == 600 ) POS += 0x2560 + speadSheets[i-1].columns.size()*COL_JUMP; else if (version == 500 ) POS += 0x92C + speadSheets[i-1].columns.size()*COL_JUMP; else if (version == 410 ) POS += 0x7FB + speadSheets[i-1].columns.size()*COL_JUMP; } fprintf(debug," reading Header\n"); fflush(debug); // HEADER // check header int ORIGIN = 0x55; if(version == 500) ORIGIN = 0x58; fseek(f,POS + ORIGIN,SEEK_SET); // check for 'O'RIGIN char c; fread(&c,1,1,f); int jump=0; if( c == 'O') fprintf(debug," \"ORIGIN\" found ! (@ 0x%X)\n",POS+ORIGIN); while( c != 'O' && jump < MAX_LEVEL) { // no inf loop fprintf(debug," TRY %d \"O\"RIGIN not found ! : %c (@ 0x%X)",jump+1,c,POS+ORIGIN); fprintf(debug," POS=0x%X | ORIGIN = 0x%X\n",POS,ORIGIN); fflush(debug); POS+=0x1F2; fseek(f,POS + ORIGIN,SEEK_SET); fread(&c,1,1,f); jump++; } int spread=i; if(jump == MAX_LEVEL){ fprintf(debug," Spreadsheet SECTION not found ! (@ 0x%X)\n",POS-10*0x1F2+0x55); // setColName(spread); return -5; } fprintf(debug," [Spreadsheet SECTION (@ 0x%X)]\n",POS); fflush(debug); // check spreadsheet name fseek(f,POS + 0x12,SEEK_SET); fread(&name,25,1,f); spread=findSpreadByName(name); if(spread == -1) spread=i; fprintf(debug," SPREADSHEET %d NAME : %s (@ 0x%X) has %d columns\n", spread+1,name,POS + 0x12,speadSheets[spread].columns.size()); fflush(debug); int ATYPE=0; LAYER = POS; if (version == 700) ATYPE = 0x2E4; else if (version == 610) ATYPE = 0x358; else if (version == 604) ATYPE = 0x354; else if (version == 601) ATYPE = 0x500; // ? else if (version == 600) ATYPE = 0x314; else if (version == 500) { COL_JUMP=0x5D; ATYPE = 0x300; } else if (version == 410) { COL_JUMP = 0x58; ATYPE = 0x229; } fflush(debug); /////////////// COLUMN Types /////////////////////////////////////////// fprintf(debug," Spreadsheet has %d columns\n",speadSheets[spread].columns.size()); for (unsigned int j=0; j #include #include #include #include using namespace boost; const char* colTypeNames[] = {"X", "Y", "Z", "XErr", "YErr", "Label", "None"}; Origin750Parser::Origin750Parser(const string& fileName) : file(fileName.c_str(), ios::binary) { objectIndex = 0; d_colormap_offset = 0x258; windowsCount = 0; } bool Origin750Parser::parse() { unsigned int dataIndex = 0; // get length of file: file.seekg (0, ios::end); d_file_size = file.tellg(); stringstream out; unsigned char c; /////////////////// find column /////////////////////////////////////////////////////////// file.seekg(0x10 + 1, ios_base::beg); unsigned int size; file >> size; file.seekg(1 + size + 1 + 5, ios_base::cur); file >> size; file.seekg(1, ios_base::cur); BOOST_LOG_(1, format(" [column found = %d/0x%X @ 0x%X]") % size % size % (unsigned int) file.tellg()); unsigned int colpos = file.tellg(); unsigned int current_col = 1, nr = 0, nbytes = 0; while(size > 0 && size < 0x84) { // should be 0x72, 0x73 or 0x83 //////////////////////////////// COLUMN HEADER ///////////////////////////////////////////// short data_type; char data_type_u; unsigned int oldpos = file.tellg(); file.seekg(oldpos + 0x16, ios_base::beg); file >> data_type; file.seekg(oldpos + 0x3F, ios_base::beg); file >> data_type_u; char valuesize; file.seekg(oldpos + 0x3D, ios_base::beg); file >> valuesize; BOOST_LOG_(1, format(" [valuesize = %d @ 0x%X]") % (int)valuesize % ((unsigned int) file.tellg()-1)); if(valuesize <= 0) { BOOST_LOG_(1, format(" WARNING : found strange valuesize of %d") % (int)valuesize); valuesize = 10; } file.seekg(oldpos + 0x58, ios_base::beg); BOOST_LOG_(1, format(" [Spreadsheet @ 0x%X]") % (unsigned int) file.tellg()); string name(25, 0); file >> name; string::size_type pos = name.find_last_of("_"); string columnname; if(pos != string::npos) { columnname = name.substr(pos + 1); name.resize(pos); } BOOST_LOG_(1, format(" NAME: %s") % name.c_str()); unsigned int spread = 0; if(columnname.empty()) { BOOST_LOG_(1, "NO COLUMN NAME FOUND! Must be a Matrix or Function."); ////////////////////////////// READ matrixes or functions //////////////////////////////////// BOOST_LOG_(1, format(" [position @ 0x%X]") % (unsigned int) file.tellg()); // TODO short signature; file >> signature; BOOST_LOG_(1, format(" SIGNATURE : %02X ") % signature); file.seekg(oldpos + size + 1, ios_base::beg); file >> size; file.seekg(1, ios_base::cur); size /= valuesize; BOOST_LOG_(1, format(" SIZE = %d") % size); // catch exception /*if(size>10000) size=1000;*/ switch(signature) { case 0x50CA: case 0x70CA: case 0x50F2: case 0x50E2: case 0x50C8: case 0x50E7: case 0x50DB: case 0x50DC: case 0x70E2: BOOST_LOG_(1, "NEW MATRIX"); matrixes.push_back(Matrix(name, dataIndex)); ++dataIndex; BOOST_LOG_(1, "VALUES :"); out.str(size > 100 ? "matrix too big..." : string()); switch(data_type) { case 0x6001://double for(unsigned int i = 0; i < size; ++i) { double value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); break; case 0x6003://float for(unsigned int i = 0; i < size; ++i) { float value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); break; case 0x6801://int if(data_type_u == 8)//unsigned { for(unsigned int i = 0; i < size; ++i) { unsigned int value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } else { for(unsigned int i = 0; i < size; ++i) { int value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } break; case 0x6803://short if(data_type_u == 8)//unsigned { for(unsigned int i = 0; i < size; ++i) { unsigned short value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } else { for(unsigned int i = 0; i < size; ++i) { short value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } break; case 0x6821://char if(data_type_u == 8)//unsigned { for(unsigned int i = 0; i < size; ++i) { unsigned char value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } else { for(unsigned int i = 0; i < size; ++i) { char value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } break; default: BOOST_LOG_(1, format("UNKNOWN MATRIX DATATYPE: %02X SKIP DATA") % data_type); file.seekg(valuesize*size, ios_base::cur); matrixes.pop_back(); } break; case 0x10C8: BOOST_LOG_(1, "NEW FUNCTION"); functions.push_back(Function(name, dataIndex)); ++dataIndex; file >> functions.back().formula.assign(valuesize, 0); oldpos = file.tellg(); short t; file.seekg(colpos + 0xA, ios_base::beg); file >> t; if(t == 0x1194) functions.back().type = Function::Polar; file.seekg(colpos + 0x21, ios_base::beg); file >> functions.back().totalPoints; file >> functions.back().begin; double d; file >> d; functions.back().end = functions.back().begin + d*(functions.back().totalPoints - 1); BOOST_LOG_(1, format("FUNCTION %s : %s") % functions.back().name.c_str() % functions.back().formula.c_str()); BOOST_LOG_(1, format(" interval %g : %g, number of points %d") % functions.back().begin % functions.back().end % functions.back().totalPoints); file.seekg(oldpos, ios_base::beg); break; default: BOOST_LOG_(1, format("UNKNOWN SIGNATURE: %.2X SKIP DATA") % signature); file.seekg(valuesize*size, ios_base::cur); ++dataIndex; if(valuesize != 8 && valuesize <= 16) { file.seekg(2, ios_base::cur); } } } else { // worksheet if(speadSheets.size() == 0 || findSpreadByName(name) == -1) { BOOST_LOG_(1, "NEW SPREADSHEET"); current_col = 1; speadSheets.push_back(SpreadSheet(name)); spread = speadSheets.size() - 1; speadSheets.back().maxRows = 0; } else { spread = findSpreadByName(/*sname*/name); current_col = speadSheets[spread].columns.size(); if(!current_col) current_col = 1; ++current_col; } BOOST_LOG_(1, format("SPREADSHEET = %s COLUMN NAME = %s (%d) (@0x%X)") % name % columnname % current_col % (unsigned int)file.tellg()); speadSheets[spread].columns.push_back(SpreadColumn(columnname, dataIndex)); string::size_type sheetpos = speadSheets[spread].columns.back().name.find_last_of("@"); if(!speadSheets[spread].multisheet && sheetpos != string::npos) { if(lexical_cast(columnname.substr(sheetpos + 1).c_str()) > 1) { speadSheets[spread].multisheet = true; BOOST_LOG_(1, format("SPREADSHEET \"%s\" IS MULTISHEET") % name); } } ++dataIndex; ////////////////////////////// SIZE of column ///////////////////////////////////////////// file.seekg(oldpos + size + 1, ios_base::beg); file >> nbytes; if(fmod(nbytes, (double)valuesize)>0) { BOOST_LOG_(1, "WARNING: data section could not be read correct"); } nr = nbytes / valuesize; BOOST_LOG_(1, format(" [number of rows = %d (%d Bytes) @ 0x%X]") % nr % nbytes % (unsigned int)file.tellg()); speadSheets[spread].maxRows> value; out << format("%g ") % value; speadSheets[spread].columns[(current_col-1)].data.push_back(value); } else if((data_type & 0x100) == 0x100) // Text&Numeric { file >> c; file.seekg(1, ios_base::cur); if(c == 0) //value { file >> value; out << format("%g ") % value; speadSheets[spread].columns[(current_col-1)].data.push_back(value); file.seekg(valuesize - 10, ios_base::cur); } else //text { string stmp(valuesize - 2, 0); file >> stmp; if(stmp.find(0x0E) != string::npos) // try find non-printable symbol - garbage test stmp = string(); speadSheets[spread].columns[(current_col-1)].data.push_back(stmp); out << format("%s ") % stmp; } } else //text { string stmp(valuesize, 0); file >> stmp; if(stmp.find(0x0E) != string::npos) // try find non-printable symbol - garbage test stmp = string(); speadSheets[spread].columns[(current_col-1)].data.push_back(stmp); out << format("%s ") % stmp; } } BOOST_LOG_(1, out.str()); } if(nbytes > 0 || columnname.empty()) { file.seekg(1, ios_base::cur); } file >> size; file.seekg(1 + size + (size > 0 ? 1 : 0), ios_base::cur); file >> size; file.seekg(1, ios_base::cur); BOOST_LOG_(1, format(" [column found = %d/0x%X (@ 0x%X)]") % size % size %((unsigned int) file.tellg()-5)); colpos = file.tellg(); } //////////////////////////////////////////////////////////////////////////// for(unsigned int i = 0; i < speadSheets.size(); ++i) { if(speadSheets[i].multisheet) { BOOST_LOG_(1, format(" CONVERT SPREADSHEET \"%s\" to EXCEL") % speadSheets[i].name.c_str()); convertSpreadToExcel(i); --i; } } //////////////////////////////////////////////////////////////////////////// ////////////////////// HEADER SECTION ////////////////////////////////////// unsigned int POS = (unsigned int)file.tellg()-11; BOOST_LOG_(1, "\nHEADER SECTION"); BOOST_LOG_(1, format(" nr_spreads = %d") % speadSheets.size()); BOOST_LOG_(1, format(" [position @ 0x%X]") % POS); //////////////////////// OBJECT INFOS ////////////////////////////////////// POS += 0xB; file.seekg(POS, ios_base::beg); while(1) { BOOST_LOG_(1, " reading Header"); // HEADER // check header POS = file.tellg(); file >> size; if(size == 0) break; file.seekg(POS + 0x7, ios_base::beg); string name(25, 0); file >> name; file.seekg(POS, ios_base::beg); if(findSpreadByName(name) != -1) readSpreadInfo(); else if(findMatrixByName(name) != -1) readMatrixInfo(); else if(findExcelByName(name) != -1) readExcelInfo(); else readGraphInfo(); } file.seekg(1, ios_base::cur); BOOST_LOG_(1, format("Some Origin params @ 0x%X:") % (unsigned int)file.tellg()); file >> c; while(c != 0) { out.str(string()); out << " "; while(c != '\n') { out << c; file >> c; } double parvalue; file >> parvalue; out << format(": %g") % parvalue; BOOST_LOG_(1, out.str()); file.seekg(1, ios_base::cur); file >> c; } file.seekg(1 + 5, ios_base::cur); while(1) { //fseek(f,5+0x40+1,SEEK_CUR); int size; file >> size; if(size != 0x40) break; file.seekg(1, ios_base::cur); Rect rect; unsigned int coord; file >> coord; rect.left = coord; file >> coord; rect.top = coord; file >> coord; rect.right = coord; file >> coord; rect.bottom = coord; unsigned char state; file.seekg(0x8, ios_base::cur); file >> state; double creationDate, modificationDate; file.seekg(0x7, ios_base::cur); file >> creationDate; file >> modificationDate; file.seekg(0x8, ios_base::cur); file >> c; unsigned char labellen; file.seekg(0x3, ios_base::cur); file >> labellen; file.seekg(4, ios_base::cur); file >> size; file.seekg(1, ios_base::cur); string name(size, 0); file >> name; if(name == "ResultsLog") { file.seekg(1, ios_base::cur); file >> size; file.seekg(1, ios_base::cur); resultsLog.resize(size); file >> resultsLog; BOOST_LOG_(1, format("Results Log: %s") % resultsLog); break; } else { notes.push_back(Note(name)); notes.back().objectID = objectIndex; notes.back().frameRect = rect; notes.back().creationDate = doubleToPosixTime(creationDate); notes.back().modificationDate = doubleToPosixTime(modificationDate); if(c & 0x01) notes.back().title = Window::Label; else if(c & 0x02) notes.back().title = Window::Name; else notes.back().title = Window::Both; notes.back().hidden = (state & 0x40); ++objectIndex; file.seekg(1, ios_base::cur); file >> size; file.seekg(1, ios_base::cur); if(labellen > 1) { file >> notes.back().label.assign(labellen-1, 0); file.seekg(1, ios_base::cur); } file >> notes.back().text.assign(size - labellen, 0); BOOST_LOG_(1, format("NOTE %d NAME: %s") % notes.size() % notes.back().name); BOOST_LOG_(1, format("NOTE %d LABEL: %s") % notes.size() % notes.back().label); BOOST_LOG_(1, format("NOTE %d TEXT: %s") % notes.size() % notes.back().text); file.seekg(1, ios_base::cur); } } file.seekg(1 + 4*5 + 0x10 + 1, ios_base::cur); try { readProjectTree(); } catch(...) {} BOOST_LOG_(1, "Done parsing"); BOOST_LOG_FINALIZE(); return true; } void Origin750Parser::readSpreadInfo() { unsigned int POS = file.tellg(); unsigned int size; file >> size; POS += 5; BOOST_LOG_(1, format(" [Spreadsheet SECTION (@ 0x%X)]") % POS); // check spreadsheet name file.seekg(POS + 0x2, ios_base::beg); string name(25, 0); file >> name; int spread = findSpreadByName(name); speadSheets[spread].name = name; file.seekg(POS, ios_base::beg); readWindowProperties(speadSheets[spread], size); speadSheets[spread].loose = false; char c = 0; unsigned int LAYER = POS; { // LAYER section LAYER += size + 0x1 + 0x5/* length of block = 0x12D + '\n'*/ + 0x12D + 0x1; //now structure is next : section_header_size=0x6F(4 bytes) + '\n' + section_header(0x6F bytes) + section_body_1_size(4 bytes) + '\n' + section_body_1 + section_body_2_size(maybe=0)(4 bytes) + '\n' + section_body_2 + '\n' //possible sections: column formulas, __WIPR, __WIOTN, __LayerInfoStorage etc //section name(column name in formula case) starts with 0x46 position while(1) { //section_header_size=0x6F(4 bytes) + '\n' LAYER += 0x5; //section_header file.seekg(LAYER + 0x46, ios_base::beg); string sec_name(41, 0); file >> sec_name; BOOST_LOG_(1, format(" SECTION NAME: %s (@ 0x%X)") % sec_name % (LAYER + 0x46)); //section_body_1_size LAYER += 0x6F + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_1 LAYER += 0x5; file.seekg(LAYER, ios_base::beg); //check if it is a formula int col_index = findSpreadColumnByName(spread, sec_name); if(col_index != -1) { file >> speadSheets[spread].columns[col_index].command.assign(size, 0); } //section_body_2_size LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_2 LAYER += 0x5; //close section 00 00 00 00 0A LAYER += size + (size > 0 ? 0x1 : 0) + 0x5; if(sec_name == "__LayerInfoStorage") break; } LAYER += 0x5; } /////////////// COLUMN Types /////////////////////////////////////////// BOOST_LOG_(1, format(" Spreadsheet has %d columns") % speadSheets[spread].columns.size()); vector header; while(1) { LAYER += 0x5; file.seekg(LAYER + 0x12, ios_base::beg); name.resize(12); file >> name; file.seekg(LAYER + 0x11, ios_base::beg); file >> c; short width=0; file.seekg(LAYER + 0x4A, ios_base::beg); file >> width; int col_index = findColumnByName(spread, name); if(col_index != -1) { SpreadColumn::ColumnType type; switch(c) { case 3: type = SpreadColumn::X; break; case 0: type = SpreadColumn::Y; break; case 5: type = SpreadColumn::Z; break; case 6: type = SpreadColumn::XErr; break; case 2: type = SpreadColumn::YErr; break; case 4: type = SpreadColumn::Label; break; default: type = SpreadColumn::NONE; break; } speadSheets[spread].columns[col_index].type = type; width/=0xA; if(width == 0) width = 8; speadSheets[spread].columns[col_index].width = width; unsigned char c1,c2; file.seekg(LAYER + 0x1E, ios_base::beg); file >> c1; file >> c2; switch(c1) { case 0x00: // Numeric - Dec1000 case 0x09: // Text&Numeric - Dec1000 case 0x10: // Numeric - Scientific case 0x19: // Text&Numeric - Scientific case 0x20: // Numeric - Engeneering case 0x29: // Text&Numeric - Engeneering case 0x30: // Numeric - Dec1,000 case 0x39: // Text&Numeric - Dec1,000 speadSheets[spread].columns[col_index].valueType = (c1%0x10 == 0x9) ? TextNumeric : Numeric; speadSheets[spread].columns[col_index].valueTypeSpecification = c1 / 0x10; if(c2 >= 0x80) { speadSheets[spread].columns[col_index].significantDigits = c2 - 0x80; speadSheets[spread].columns[col_index].numericDisplayType = SignificantDigits; } else if(c2 > 0) { speadSheets[spread].columns[col_index].decimalPlaces = c2 - 0x03; speadSheets[spread].columns[col_index].numericDisplayType = DecimalPlaces; } break; case 0x02: // Time speadSheets[spread].columns[col_index].valueType = Time; speadSheets[spread].columns[col_index].valueTypeSpecification = c2 - 0x80; break; case 0x03: // Date speadSheets[spread].columns[col_index].valueType = Date; speadSheets[spread].columns[col_index].valueTypeSpecification= c2 - 0x80; break; case 0x31: // Text speadSheets[spread].columns[col_index].valueType = Text; break; case 0x4: // Month case 0x34: speadSheets[spread].columns[col_index].valueType = Month; speadSheets[spread].columns[col_index].valueTypeSpecification = c2; break; case 0x5: // Day case 0x35: speadSheets[spread].columns[col_index].valueType = Day; speadSheets[spread].columns[col_index].valueTypeSpecification = c2; break; default: // Text speadSheets[spread].columns[col_index].valueType = Text; break; } BOOST_LOG_(1, format(" COLUMN \"%s\" type = %s(%d) (@ 0x%X)") % speadSheets[spread].columns[col_index].name.c_str() % colTypeNames[type] % (int)c % (LAYER + 0x11)); } LAYER += 0x1E7 + 0x1; int size; file.seekg(LAYER, ios_base::beg); file >> size; LAYER += 0x5; if(size > 0) { if(col_index != -1) { file.seekg(LAYER, ios_base::beg); file >> speadSheets[spread].columns[col_index].comment.assign(size, 0); } LAYER += size + 0x1; } if(col_index != -1) header.push_back(speadSheets[spread].columns[col_index]); file.seekg(LAYER, ios_base::beg); file >> size; if(size != 0x1E7) break; } for (unsigned int i = 0; i < header.size(); i++) speadSheets[spread].columns[i] = header[i]; BOOST_LOG_(1, format(" Done with spreadsheet %d") % spread); file.seekg(LAYER + 0x5*0x6 + 0x1ED*0x12, ios_base::beg); } void Origin750Parser::readExcelInfo() { unsigned int POS = file.tellg(); unsigned int size; file >> size; POS += 5; BOOST_LOG_(1, format(" [EXCEL SECTION (@ 0x%X)]") % POS); // check spreadsheet name string name(25, 0); file.seekg(POS + 0x2, ios_base::beg); file >> name; int iexcel = findExcelByName(name); excels[iexcel].name = name; file.seekg(POS, ios_base::beg); readWindowProperties(excels[iexcel], size); excels[iexcel].loose = false; char c = 0; unsigned int LAYER = POS; LAYER += size + 0x1; int isheet = 0; while(1)// multisheet loop { // LAYER section LAYER += 0x5/* length of block = 0x12D + '\n'*/ + 0x12D + 0x1; //now structure is next : section_header_size=0x6F(4 bytes) + '\n' + section_header(0x6F bytes) + section_body_1_size(4 bytes) + '\n' + section_body_1 + section_body_2_size(maybe=0)(4 bytes) + '\n' + section_body_2 + '\n' //possible sections: column formulas, __WIPR, __WIOTN, __LayerInfoStorage etc //section name(column name in formula case) starts with 0x46 position while(1) { //section_header_size=0x6F(4 bytes) + '\n' LAYER += 0x5; //section_header string sec_name(41, 0); file.seekg(LAYER + 0x46, ios_base::beg); file >> sec_name; BOOST_LOG_(1, format(" SECTION NAME: %s (@ 0x%X)") % sec_name % (LAYER + 0x46)); //section_body_1_size LAYER += 0x6F + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_1 LAYER += 0x5; file.seekg(LAYER, ios_base::beg); //check if it is a formula int col_index = findExcelColumnByName(iexcel, isheet, sec_name); if(col_index!=-1) { file >> excels[iexcel].sheets[isheet].columns[col_index].command.assign(size, 0); } //section_body_2_size LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_2 LAYER += 0x5; //close section 00 00 00 00 0A LAYER += size + (size > 0 ? 0x1 : 0) + 0x5; if(sec_name == "__LayerInfoStorage") break; } LAYER += 0x5; /////////////// COLUMN Types /////////////////////////////////////////// BOOST_LOG_(1, format(" Excel sheet %d has %d columns") % isheet % excels[iexcel].sheets[isheet].columns.size()); while(1) { LAYER += 0x5; file.seekg(LAYER + 0x12, ios_base::beg); name.resize(12); file >> name; file.seekg(LAYER + 0x11, ios_base::beg); file >> c; short width=0; file.seekg(LAYER + 0x4A, ios_base::beg); file >> width; int col_index = findExcelColumnByName(iexcel, isheet, name); if(col_index != -1) { SpreadColumn::ColumnType type; switch(c) { case 3: type = SpreadColumn::X; break; case 0: type = SpreadColumn::Y; break; case 5: type = SpreadColumn::Z; break; case 6: type = SpreadColumn::XErr; break; case 2: type = SpreadColumn::YErr; break; case 4: type = SpreadColumn::Label; break; default: type = SpreadColumn::NONE; break; } excels[iexcel].sheets[isheet].columns[col_index].type = type; width/=0xA; if(width == 0) width = 8; excels[iexcel].sheets[isheet].columns[col_index].width = width; unsigned char c1,c2; file.seekg(LAYER + 0x1E, ios_base::beg); file >> c1; file >> c2; switch(c1) { case 0x00: // Numeric - Dec1000 case 0x09: // Text&Numeric - Dec1000 case 0x10: // Numeric - Scientific case 0x19: // Text&Numeric - Scientific case 0x20: // Numeric - Engeneering case 0x29: // Text&Numeric - Engeneering case 0x30: // Numeric - Dec1,000 case 0x39: // Text&Numeric - Dec1,000 excels[iexcel].sheets[isheet].columns[col_index].valueType = (c1%0x10 == 0x9) ? TextNumeric : Numeric; excels[iexcel].sheets[isheet].columns[col_index].valueTypeSpecification = c1 / 0x10; if(c2>=0x80) { excels[iexcel].sheets[isheet].columns[col_index].significantDigits = c2 - 0x80; excels[iexcel].sheets[isheet].columns[col_index].numericDisplayType = SignificantDigits; } else if(c2>0) { excels[iexcel].sheets[isheet].columns[col_index].decimalPlaces = c2 - 0x03; excels[iexcel].sheets[isheet].columns[col_index].numericDisplayType = DecimalPlaces; } break; case 0x02: // Time excels[iexcel].sheets[isheet].columns[col_index].valueType = Time; excels[iexcel].sheets[isheet].columns[col_index].valueTypeSpecification = c2 - 0x80; break; case 0x03: // Date excels[iexcel].sheets[isheet].columns[col_index].valueType = Date; excels[iexcel].sheets[isheet].columns[col_index].valueTypeSpecification = c2 - 0x80; break; case 0x31: // Text excels[iexcel].sheets[isheet].columns[col_index].valueType = Text; break; case 0x4: // Month case 0x34: excels[iexcel].sheets[isheet].columns[col_index].valueType = Month; excels[iexcel].sheets[isheet].columns[col_index].valueTypeSpecification = c2; break; case 0x5: // Day case 0x35: excels[iexcel].sheets[isheet].columns[col_index].valueType = Day; excels[iexcel].sheets[isheet].columns[col_index].valueTypeSpecification = c2; break; default: // Text excels[iexcel].sheets[isheet].columns[col_index].valueType = Text; break; } BOOST_LOG_(1, format(" COLUMN \"%s\" type = %s(%d) (@ 0x%X)") % excels[iexcel].sheets[isheet].columns[col_index].name.c_str() % type % (int)c % (LAYER + 0x11)); } LAYER += 0x1E7 + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; LAYER += 0x5; if(size > 0) { if(col_index != -1) { file.seekg(LAYER, ios_base::beg); file >> excels[iexcel].sheets[isheet].columns[col_index].comment.assign(size, 0); } LAYER += size + 0x1; } file.seekg(LAYER, ios_base::beg); file >> size; if(size != 0x1E7) break; } BOOST_LOG_(1, format(" Done with Excel %d") % iexcel); //POS = LAYER+0x5*0x6+0x1ED*0x12; LAYER += 0x5*0x5 + 0x1ED*0x12; file.seekg(LAYER, ios_base::beg); file >> size; if(size == 0) break; ++isheet; } file.seekg(LAYER + 0x5, ios_base::beg); } void Origin750Parser::readMatrixInfo() { unsigned int POS = file.tellg(); unsigned int size; file >> size; POS+=5; BOOST_LOG_(1, format(" [Matrix SECTION (@ 0x%X)]") % POS); string name(25, 0); file.seekg(POS + 0x2, ios_base::beg); file >> name; int idx = findMatrixByName(name); matrixes[idx].name = name; file.seekg(POS, ios_base::beg); readWindowProperties(matrixes[idx], size); unsigned char h; file.seekg(POS + 0x87, ios_base::beg); file >> h; switch(h) { case 1: matrixes[idx].view = Matrix::ImageView; break; case 2: matrixes[idx].header = Matrix::XY; break; } unsigned int LAYER = POS; LAYER += size + 0x1; // LAYER section LAYER += 0x5; file.seekg(LAYER + 0x2B, ios_base::beg); file >> matrixes[idx].columnCount; file.seekg(LAYER + 0x52, ios_base::beg); file >> matrixes[idx].rowCount; LAYER += 0x12D + 0x1; //now structure is next : section_header_size=0x6F(4 bytes) + '\n' + section_header(0x6F bytes) + section_body_1_size(4 bytes) + '\n' + section_body_1 + section_body_2_size(maybe=0)(4 bytes) + '\n' + section_body_2 + '\n' //possible sections: column formulas, __WIPR, __WIOTN, __LayerInfoStorage //section name(column name in formula case) starts with 0x46 position while(1) { //section_header_size=0x6F(4 bytes) + '\n' LAYER += 0x5; //section_header string sec_name(41, 0); file.seekg(LAYER + 0x46, ios_base::beg); file >> sec_name; //section_body_1_size LAYER += 0x6F+0x1; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_1 LAYER += 0x5; //check if it is a formula if (sec_name == "MV"){ file.seekg(LAYER, ios_base::beg); file >> matrixes[idx].command.assign(size, 0); } else if (sec_name == "Y2"){ string s(size, 0); file >> s; matrixes[idx].coordinates[0] = stringToDouble(s); BOOST_LOG_(1, format(" Y2: %g") % matrixes[idx].coordinates[0]); } else if (sec_name == "X2"){ string s(size, 0); file >> s; matrixes[idx].coordinates[1] = stringToDouble(s); BOOST_LOG_(1, format(" X2: %g") % matrixes[idx].coordinates[1]); } else if (sec_name == "Y1"){ string s(size, 0); file >> s; matrixes[idx].coordinates[2] = stringToDouble(s); BOOST_LOG_(1, format(" Y1: %g") % matrixes[idx].coordinates[2]); } else if (sec_name == "X1"){ string s(size, 0); file >> s; matrixes[idx].coordinates[3] = stringToDouble(s); BOOST_LOG_(1, format(" X1: %g") % matrixes[idx].coordinates[3]); } //section_body_2_size LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_2 LAYER += 0x5; if(sec_name == "COLORMAP") { file.seekg(LAYER + 0x14, ios_base::beg); readColorMap(matrixes[idx].colorMap); } //close section 00 00 00 00 0A LAYER += size + (size > 0 ? 0x1 : 0) + 0x5; if(sec_name == "__LayerInfoStorage") break; } LAYER += 0x5; while(1) { LAYER+=0x5; unsigned short width; file.seekg(LAYER + 0x2B, ios_base::beg); file >> width; width = (width-55)/0xA; if(width == 0) width = 8; matrixes[idx].width = width; unsigned char c1,c2; file.seekg(LAYER + 0x1E, ios_base::beg); file >> c1; file >> c2; matrixes[idx].valueTypeSpecification = c1/0x10; if(c2 >= 0x80) { matrixes[idx].significantDigits = c2-0x80; matrixes[idx].numericDisplayType = SignificantDigits; } else if(c2 > 0) { matrixes[idx].decimalPlaces = c2-0x03; matrixes[idx].numericDisplayType = DecimalPlaces; } LAYER += 0x1E7 + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; LAYER += size + (size > 0 ? 0x1 : 0) + 0x5; file.seekg(LAYER, ios_base::beg); file >> size; if(size != 0x1E7) break; } file.seekg(LAYER + 0x5*0x5 + 0x1ED*0x12 + 0x5, ios_base::beg); } void Origin750Parser::readGraphInfo() { unsigned int POS = file.tellg(); unsigned int size; file >> size; POS += 5; BOOST_LOG_(1, format(" [Graph SECTION (@ 0x%X)]") % POS); string name(25, 0); file.seekg(POS + 0x02, ios_base::beg); file >> name; graphs.push_back(Graph(name)); file.seekg(POS, ios_base::beg); readWindowProperties(graphs.back(), size); file.seekg(POS + 0x23, ios_base::beg); file >> graphs.back().width; file >> graphs.back().height; unsigned int LAYER = POS; LAYER += size + 0x1; while(1)// multilayer loop { graphs.back().layers.push_back(GraphLayer()); GraphLayer& layer(graphs.back().layers.back()); // LAYER section LAYER += 0x05; file.seekg(LAYER + 0x0F, ios_base::beg); file >> layer.xAxis.min; file >> layer.xAxis.max; file >> layer.xAxis.step; file.seekg(LAYER + 0x2B, ios_base::beg); file >> layer.xAxis.majorTicks; file.seekg(LAYER + 0x37, ios_base::beg); file >> layer.xAxis.minorTicks; file >> layer.xAxis.scale; file.seekg(LAYER + 0x3A, ios_base::beg); file >> layer.yAxis.min; file >> layer.yAxis.max; file >> layer.yAxis.step; file.seekg(LAYER + 0x56, ios_base::beg); file >> layer.yAxis.majorTicks; file.seekg(LAYER + 0x62, ios_base::beg); file >> layer.yAxis.minorTicks; file >> layer.yAxis.scale; file.seekg(LAYER + 0x71, ios_base::beg); file.read(reinterpret_cast(&layer.clientRect), sizeof(Rect)); unsigned char border; file.seekg(LAYER + 0x89, ios_base::beg); file >> border; layer.borderType = (BorderType)(border >= 0x80 ? border-0x80 : None); file.seekg(LAYER + 0x105, ios_base::beg); file >> layer.backgroundColor; LAYER += 0x12D + 0x1; //now structure is next : section_header_size=0x6F(4 bytes) + '\n' + section_header(0x6F bytes) + section_body_1_size(4 bytes) + '\n' + section_body_1 + section_body_2_size(maybe=0)(4 bytes) + '\n' + section_body_2 + '\n' //possible sections: axes, legend, __BC02, _202, _231, _232, __LayerInfoStorage etc //section name starts with 0x46 position while(1) { //section_header_size=0x6F(4 bytes) + '\n' LAYER += 0x5; //section_header string sec_name(41, 0); file.seekg(LAYER + 0x46, ios_base::beg); file >> sec_name; unsigned int sectionNamePos = LAYER + 0x46; BOOST_LOG_(1, format(" SECTION NAME: %s (@ 0x%X)") % sec_name % (LAYER + 0x46)); Rect r; file.seekg(LAYER + 0x03, ios_base::beg); file.read(reinterpret_cast(&r), sizeof(Rect)); unsigned char attach; file.seekg(LAYER + 0x28, ios_base::beg); file >> attach; unsigned char border; file >> border; Color color; file.seekg(LAYER + 0x33, ios_base::beg); file >> color; //section_body_1_size LAYER += 0x6F + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_1 LAYER += 0x5; unsigned int osize = size; file.seekg(LAYER, ios_base::beg); readGraphAxisPrefixSuffixInfo(sec_name, size, layer); unsigned char type; file >> type; //text properties short rotation; file.seekg(LAYER + 0x02, ios_base::beg); file >> rotation; unsigned char fontSize; file >> fontSize; unsigned char tab; file.seekg(LAYER + 0x0A, ios_base::beg); file >> tab; //line properties unsigned char lineStyle = 0; double width = 0.0; LineVertex begin, end; unsigned int w = 0; file.seekg(LAYER + 0x12, ios_base::beg); file >> lineStyle; unsigned short w1; file >> w1; width = (double)w1/500.0; file.seekg(LAYER + 0x20, ios_base::beg); file >> begin.x; file >> end.x; file.seekg(LAYER + 0x40, ios_base::beg); file >> begin.y; file >> end.y; file.seekg(LAYER + 0x60, ios_base::beg); file >> begin.shapeType; file.seekg(LAYER + 0x64, ios_base::beg); file >> w; begin.shapeWidth = (double)w/500.0; file >> w; begin.shapeLength = (double)w/500.0; file.seekg(LAYER + 0x6C, ios_base::beg); file >> end.shapeType; file.seekg(LAYER + 0x70, ios_base::beg); file >> w; end.shapeWidth = (double)w/500.0; file >> w; end.shapeLength = (double)w/500.0; Figure figure; file.seekg(LAYER + 0x05, ios_base::beg); file >> w1; figure.width = (double)w1/500.0; file.seekg(LAYER + 0x08, ios_base::beg); file >> figure.style; file.seekg(LAYER + 0x42, ios_base::beg); file >> figure.fillAreaColor; file >> w1; figure.fillAreaPatternWidth = (double)w1/500.0; file.seekg(LAYER + 0x4A, ios_base::beg); file >> figure.fillAreaPatternColor; file >> figure.fillAreaPattern; unsigned char h; file.seekg(LAYER + 0x57, ios_base::beg); file >> h; figure.useBorderColor = (h == 0x10); //section_body_2_size LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_2 LAYER += 0x5; //check if it is a axis or legend file.seekg(1, ios_base::cur); if(sec_name == "XB") { string text(size, 0); file >> text; layer.xAxis.position = GraphAxis::Bottom; layer.xAxis.formatAxis[0].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "XT") { string text(size, 0); file >> text; layer.xAxis.position = GraphAxis::Top; layer.xAxis.formatAxis[1].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "YL") { string text(size, 0); file >> text; layer.yAxis.position = GraphAxis::Left; layer.yAxis.formatAxis[0].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "YR") { string text(size, 0); file >> text; layer.yAxis.position = GraphAxis::Right; layer.yAxis.formatAxis[1].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "ZF") { string text(size, 0); file >> text; layer.zAxis.position = GraphAxis::Front; layer.zAxis.formatAxis[0].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "ZB") { string text(size, 0); file >> text; layer.zAxis.position = GraphAxis::Back; layer.zAxis.formatAxis[1].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "3D") { file >> layer.zAxis.min; file >> layer.zAxis.max; file >> layer.zAxis.step; file.seekg(LAYER + 0x1C, ios_base::beg); file >> layer.zAxis.majorTicks; file.seekg(LAYER + 0x28, ios_base::beg); file >> layer.zAxis.minorTicks; file >> layer.zAxis.scale; file.seekg(LAYER + 0x218, ios_base::beg); file >> layer.xLength; file >> layer.yLength; file >> layer.zLength; layer.xLength /= 23.0; layer.yLength /= 23.0; layer.zLength /= 23.0; } else if(sec_name == "Legend") { string text(size, 0); file >> text; layer.legend = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "__BCO2") // histogram { file.seekg(LAYER + 0x10, ios_base::beg); file >> layer.histogramBin; file.seekg(LAYER + 0x20, ios_base::beg); file >> layer.histogramEnd; file >> layer.histogramBegin; unsigned int p = sectionNamePos + 93; file.seekg(p, ios_base::beg); file >> layer.percentile.p1SymbolType; file >> layer.percentile.p99SymbolType; file >> layer.percentile.meanSymbolType; file >> layer.percentile.maxSymbolType; file >> layer.percentile.minSymbolType; file.seekg(sectionNamePos + 106, ios_base::beg); file >> layer.percentile.whiskersRange; file >> layer.percentile.boxRange; file.seekg(sectionNamePos + 141, ios_base::beg); file >> layer.percentile.whiskersCoeff; file >> layer.percentile.boxCoeff; unsigned char h; file >> h; layer.percentile.diamondBox = (h == 0x82) ? true : false; p += 109; file.seekg(p, ios_base::beg); file >> layer.percentile.symbolSize; layer.percentile.symbolSize = layer.percentile.symbolSize/2 + 1; p += 163; file.seekg(p, ios_base::beg); file >> layer.percentile.symbolColor; file >> layer.percentile.symbolFillColor; } else if(sec_name == "vline") // Image profiles vertical cursor { file.seekg(sectionNamePos, ios_base::beg); for (int i = 0; i < 2; i++) skipLine(); file.seekg(0x20, ios_base::cur); file >> layer.vLine; BOOST_LOG_(1, format("vLine: %g") % layer.vLine); layer.imageProfileTool = true; } else if(sec_name == "hline") // Image profiles horizontal cursor { file.seekg(sectionNamePos, ios_base::beg); for (int i = 0; i < 2; i++) skipLine(); file.seekg(0x40, ios_base::cur); file >> layer.hLine; BOOST_LOG_(1, format("hLine: %g @ 0x%X") % layer.hLine % file.tellg()); layer.imageProfileTool = true; } else if(sec_name == "ZCOLORS") { layer.isXYY3D = true; } else if(sec_name == "SPECTRUM1") { layer.isXYY3D = false; unsigned char h; file.seekg(24, ios_base::cur); file >> h; layer.colorScale.reverseOrder = h; file.seekg(7, ios_base::cur); file >> layer.colorScale.colorBarThickness; file >> layer.colorScale.labelGap; file.seekg(56, ios_base::cur); file >> layer.colorScale.labelsColor; } else if(osize == 0x3E) // text { string text(size, 0); file >> text; sec_name.resize(3); if (sec_name == "PIE") layer.pieTexts.push_back(TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach)); else layer.texts.push_back(TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach)); } else if(osize == 0x5E) // rectangle & circle { switch(type) { case 0: case 1: figure.type = Figure::Rectangle; break; case 2: case 3: figure.type = Figure::Circle; break; } figure.clientRect = r; figure.attach = (Attach)attach; figure.color = color; layer.figures.push_back(figure); } else if(osize == 0x78 && type == 2) // line { layer.lines.push_back(Line()); Line& line(layer.lines.back()); line.color = color; line.clientRect = r; line.attach = (Attach)attach; line.width = width; line.style = lineStyle; line.begin = begin; line.end = end; } else if(osize == 0x28) // bitmap { if (type == 4){ unsigned long filesize = size + 14; layer.bitmaps.push_back(Bitmap()); Bitmap& bitmap(layer.bitmaps.back()); bitmap.clientRect = r; bitmap.attach = (Attach)attach; bitmap.size = filesize; bitmap.borderType = (BorderType)(border >= 0x80 ? border-0x80 : None); bitmap.data = new unsigned char[filesize]; unsigned char* data = bitmap.data; //add Bitmap header memcpy(data, "BM", 2); data += 2; memcpy(data, &filesize, 4); data += 4; unsigned int d = 0; memcpy(data, &d, 4); data += 4; d = 0x36; memcpy(data, &d, 4); data += 4; file.read(reinterpret_cast(data), size); } else if (type == 6){ string gname(30, 0); file.seekg(sectionNamePos + 93, ios_base::beg); file >> gname; layer.bitmaps.push_back(Bitmap(gname)); Bitmap& bitmap(layer.bitmaps.back()); bitmap.clientRect = r; bitmap.attach = (Attach)attach; bitmap.size = 0; bitmap.borderType = (BorderType)(border >= 0x80 ? border-0x80 : None); } } //close section 00 00 00 00 0A LAYER += size + (size > 0 ? 0x1 : 0); //section_body_3_size file.seekg(LAYER, ios_base::beg); file >> size; //section_body_3 LAYER += 0x5; //close section 00 00 00 00 0A LAYER += size + (size > 0 ? 0x1 : 0); if(sec_name == "__LayerInfoStorage") break; } LAYER += 0x5; unsigned char h; short w; file.seekg(LAYER, ios_base::beg); file >> size; if(size == 0x1E7)//check layer is not empty { while(1){ LAYER += 0x5; layer.curves.push_back(GraphCurve()); GraphCurve& curve(layer.curves.back()); file.seekg(LAYER + 0x4C, ios_base::beg); file >> curve.type; BOOST_LOG_(1, format(" graph %d layer %d curve %d type : %d") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % (int)curve.type); file.seekg(LAYER + 0x04, ios_base::beg); file >> w; pair column = findDataByIndex(w-1); short nColY = w; if (column.first.size() > 0){ curve.dataName = column.first; if(layer.is3D()){ BOOST_LOG_(1, format(" graph %d layer %d curve %d Z : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.zColumnName = column.second; } else { BOOST_LOG_(1, format(" graph %d layer %d curve %d Y : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.yColumnName = column.second; } } file.seekg(LAYER + 0x23, ios_base::beg); file >> w; column = findDataByIndex(w-1); if (column.first.size() > 0){ if(curve.dataName != column.first) BOOST_LOG_(1, format(" graph %d X and Y from different tables") % graphs.size()); if(layer.is3D()){ BOOST_LOG_(1, format(" graph %d layer %d curve %d Y : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.yColumnName = column.second; } else if (layer.isXYY3D){ BOOST_LOG_(1, format(" graph %d layer %d curve %d X : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.xColumnName = column.second; } else { BOOST_LOG_(1, format(" graph %d layer %d curve %d X : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.xColumnName = column.second; } } file.seekg(LAYER + 0x4D, ios_base::beg); file >> w; column = findDataByIndex(w-1); if (column.first.size() > 0 && layer.is3D()){ BOOST_LOG_(1, format(" graph %d layer %d curve %d X : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.xColumnName = column.second; if(curve.dataName != column.first) BOOST_LOG_(1, format(" graph %d X and Y from different tables") % graphs.size()); } if(layer.is3D() || layer.isXYY3D) graphs.back().is3D = true; file.seekg(LAYER + 0x11, ios_base::beg); file >> curve.lineConnect; file >> curve.lineStyle; file.seekg(1, ios_base::cur); file >> curve.boxWidth; file >> w; curve.lineWidth=(double)w/500.0; file.seekg(LAYER + 0x19, ios_base::beg); file >> w; curve.symbolSize=(double)w/500.0; file.seekg(LAYER + 0x1C, ios_base::beg); file >> h; curve.fillArea = (h==2); file.seekg(LAYER + 0x1E, ios_base::beg); file >> curve.fillAreaType; //text if(curve.type == GraphCurve::TextPlot){ file.seekg(LAYER + 0x13, ios_base::beg); file >> curve.text.rotation; curve.text.rotation /= 10; file >> curve.text.fontSize; file.seekg(LAYER + 0x19, ios_base::beg); file >> h; switch(h){ case 26: curve.text.justify = TextProperties::Center; break; case 2: curve.text.justify = TextProperties::Right; break; default: curve.text.justify = TextProperties::Left; break; } file >> h; curve.text.fontUnderline = (h & 0x1); curve.text.fontItalic = (h & 0x2); curve.text.fontBold = (h & 0x8); curve.text.whiteOut = (h & 0x20); char offset; file.seekg(LAYER + 0x37, ios_base::beg); file >> offset; curve.text.xOffset = offset * 5; file >> offset; curve.text.yOffset = offset * 5; } //vector if(curve.type == GraphCurve::FlowVector || curve.type == GraphCurve::Vector){ file.seekg(LAYER + 0x56, ios_base::beg); file >> curve.vector.multiplier; file.seekg(LAYER + 0x5E, ios_base::beg); file >> h; column = findDataByIndex(nColY - 1 + h - 0x64); if(column.first.size() > 0) curve.vector.endXColumnName = column.second; file.seekg(LAYER + 0x62, ios_base::beg); file >> h; column = findDataByIndex(nColY - 1 + h - 0x64); if(column.first.size() > 0) curve.vector.endYColumnName = column.second; file.seekg(LAYER + 0x18, ios_base::beg); file >> h; if(h >= 0x64){ column = findDataByIndex(nColY - 1 + h - 0x64); if(column.first.size() > 0) curve.vector.angleColumnName = column.second; } else if(h <= 0x08) curve.vector.constAngle = 45*h; file >> h; if(h >= 0x64 && h < 0x1F4){ column = findDataByIndex(nColY - 1 + h - 0x64); if(column.first.size() > 0) curve.vector.magnitudeColumnName = column.second; } else curve.vector.constMagnitude = (int)curve.symbolSize; file.seekg(LAYER + 0x66, ios_base::beg); file >> curve.vector.arrowLenght; file >> curve.vector.arrowAngle; file >> h; curve.vector.arrowClosed = !(h & 0x1); file >> w; curve.vector.width=(double)w/500.0; file.seekg(LAYER + 0x142, ios_base::beg); file >> h; switch(h){ case 2: curve.vector.position = VectorProperties::Midpoint; break; case 4: curve.vector.position = VectorProperties::Head; break; default: curve.vector.position = VectorProperties::Tail; break; } } //pie if (curve.type == GraphCurve::Pie){ file.seekg(LAYER + 0x92, ios_base::beg); file >> h; curve.pie.formatPercentages = (h & 0x01); curve.pie.formatValues = (h & 0x02); curve.pie.positionAssociate = (h & 0x08); curve.pie.clockwiseRotation = (h & 0x20); curve.pie.formatCategories = (h & 0x80); file >> curve.pie.formatAutomatic; file >> curve.pie.distance; file >> curve.pie.viewAngle; file.seekg(LAYER + 0x98, ios_base::beg); file >> curve.pie.thickness; file.seekg(LAYER + 0x9A, ios_base::beg); file >> curve.pie.rotation; file.seekg(LAYER + 0x9E, ios_base::beg); file >> curve.pie.displacement; file.seekg(LAYER + 0xA0, ios_base::beg); file >> curve.pie.radius; file >> curve.pie.horizontalOffset; file.seekg(LAYER + 0xA6, ios_base::beg); file >> curve.pie.displacedSectionCount; } //surface if (layer.isXYY3D || curve.type == GraphCurve::Mesh3D){ file.seekg(LAYER + 0x17, ios_base::beg); file >> curve.surface.type; file.seekg(LAYER + 0x1C, ios_base::beg); file >> h; if(h & 0x60 == 0x60) curve.surface.grids = SurfaceProperties::X; else if(h & 0x20) curve.surface.grids = SurfaceProperties::Y; else if(h & 0x40) curve.surface.grids = SurfaceProperties::None; else curve.surface.grids = SurfaceProperties::XY; curve.surface.sideWallEnabled = (h & 0x10); file >> curve.surface.frontColor; file.seekg(LAYER + 0x14C, ios_base::beg); file >> w; curve.surface.gridLineWidth = (double)w/500.0; file >> curve.surface.gridColor; file.seekg(LAYER + 0x13, ios_base::beg); file >> h; curve.surface.backColorEnabled = (h & 0x08); file.seekg(LAYER + 0x15A, ios_base::beg); file >> curve.surface.backColor; file >> curve.surface.xSideWallColor; file >> curve.surface.ySideWallColor; curve.surface.surface.fill = (h & 0x10); curve.surface.surface.contour = (h & 0x40); file.seekg(LAYER + 0x94, ios_base::beg); file >> w; curve.surface.surface.lineWidth = (double)w/500.0; file >> curve.surface.surface.lineColor; curve.surface.topContour.fill = (h & 0x02); curve.surface.topContour.contour = (h & 0x04); file.seekg(LAYER + 0xB4, ios_base::beg); file >> w; curve.surface.topContour.lineWidth = (double)w/500.0; file >> curve.surface.topContour.lineColor; curve.surface.bottomContour.fill = (h & 0x80); curve.surface.bottomContour.contour = (h & 0x01); file.seekg(LAYER + 0xA4, ios_base::beg); file >> w; curve.surface.bottomContour.lineWidth = (double)w/500.0; file >> curve.surface.bottomContour.lineColor; } if (curve.type == GraphCurve::Mesh3D || curve.type == GraphCurve::Contour){ ColorMap& colorMap = (curve.type == GraphCurve::Mesh3D ? curve.surface.colorMap : curve.colorMap); file.seekg(LAYER + 0x13, ios_base::beg); file >> h; colorMap.fillEnabled = (h & 0x82); if (curve.type == GraphCurve::Contour){ file.seekg(102, ios_base::cur); file >> curve.text.fontSize; file.seekg(7, ios_base::cur); file >> h; curve.text.fontUnderline = (h & 0x1); curve.text.fontItalic = (h & 0x2); curve.text.fontBold = (h & 0x8); curve.text.whiteOut = (h & 0x20); file.seekg(2, ios_base::cur); file >> curve.text.color; } file.seekg(LAYER + 0x259, ios_base::beg); readColorMap(colorMap); } file.seekg(LAYER + 0xC2, ios_base::beg); file >> curve.fillAreaColor; file >> w; curve.fillAreaPatternWidth=(double)w/500.0; file.seekg(LAYER + 0xCA, ios_base::beg); file >> curve.fillAreaPatternColor; file >> curve.fillAreaPattern; file >> curve.fillAreaPatternBorderStyle; file >> w; curve.fillAreaPatternBorderWidth=(double)w/500.0; file >> curve.fillAreaPatternBorderColor; file.seekg(LAYER + 0x16A, ios_base::beg); file >> curve.lineColor; if (curve.type != GraphCurve::Contour) curve.text.color = curve.lineColor; file.seekg(LAYER + 0x17, ios_base::beg); file >> curve.symbolType; file.seekg(LAYER + 0x12E, ios_base::beg); file >> curve.symbolFillColor; file >> curve.symbolColor; curve.vector.color = curve.symbolColor; file >> h; curve.symbolThickness = (h == 255 ? 1 : h); file >> curve.pointOffset; file.seekg(LAYER + 0x143, ios_base::beg); file >> h; curve.connectSymbols = (h&0x8); LAYER += 0x1E7 + 0x1; int size; file.seekg(LAYER, ios_base::beg); file >> size; LAYER += size + (size > 0 ? 0x1 : 0) + 0x5; file.seekg(LAYER, ios_base::beg); file >> size; if(size != 0x1E7) break; } } LAYER += 0x5; //read axis breaks while(1){ file.seekg(LAYER, ios_base::beg); file >> size; if(size == 0x2D){ LAYER += 0x5; file.seekg(LAYER + 2, ios_base::beg); file >> h; if (h == 2) { layer.xAxisBreak.minorTicksBefore = layer.xAxis.minorTicks; layer.xAxisBreak.scaleIncrementBefore = layer.xAxis.step; file.seekg(LAYER, ios_base::beg); readGraphAxisBreakInfo(layer.xAxisBreak); } else if(h == 4){ layer.yAxisBreak.minorTicksBefore = layer.yAxis.minorTicks; layer.yAxisBreak.scaleIncrementBefore = layer.yAxis.step; file.seekg(LAYER, ios_base::beg); readGraphAxisBreakInfo(layer.yAxisBreak); } LAYER += 0x2D + 0x1; } else break; } LAYER += 0x5; file.seekg(LAYER, ios_base::beg); size = readGraphAxisInfo(layer.xAxis); LAYER += size*0x6; LAYER += 0x5; file.seekg(LAYER, ios_base::beg); readGraphAxisInfo(layer.yAxis); LAYER += size*0x6; LAYER += 0x5; file.seekg(LAYER, ios_base::beg); readGraphAxisInfo(layer.zAxis); LAYER += size*0x6; LAYER += 0x5; file.seekg(LAYER, ios_base::beg); file >> size; if(size == 0) break; } file.seekg(LAYER + 0x5, ios_base::beg); } void Origin750Parser::readGraphGridInfo(GraphGrid& grid) { unsigned int POS = file.tellg(); unsigned char h; short w; file.seekg(POS + 0x26, ios_base::beg); file >> h; grid.hidden = (h == 0); file.seekg(POS + 0x0F, ios_base::beg); file >> grid.color; file.seekg(POS + 0x12, ios_base::beg); file >> grid.style; file.seekg(POS + 0x15, ios_base::beg); file >> w; grid.width = (double)w/500.0; } void Origin750Parser::readGraphAxisBreakInfo(GraphAxisBreak& axis_break) { unsigned int POS = file.tellg(); axis_break.show = true; file.seekg(POS + 0x0B, ios_base::beg); file >> axis_break.from; file >> axis_break.to; file >> axis_break.scaleIncrementAfter; file >> axis_break.position; unsigned char h; file >> h; axis_break.log10 = (h == 1); file >> axis_break.minorTicksAfter; } void Origin750Parser::readGraphAxisFormatInfo(GraphAxisFormat& format) { unsigned int POS = file.tellg(); unsigned char h; short w; file.seekg(POS + 0x26, ios_base::beg); file >> h; format.hidden = (h == 0); file.seekg(POS + 0x0F, ios_base::beg); file >> format.color; file.seekg(POS + 0x4A, ios_base::beg); file >> w; format.majorTickLength = (double)w/10.0; file.seekg(POS + 0x15, ios_base::beg); file >> w; format.thickness = (double)w/500.0; file.seekg(POS + 0x25, ios_base::beg); file >> h; format.minorTicksType = (h>>6); format.majorTicksType = ((h>>4) & 3); format.axisPosition = (h & 0x0F); switch(format.axisPosition) // need for testing { case 1: file.seekg(POS + 0x37, ios_base::beg); file >> h; format.axisPositionValue = (double)h; break; case 2: file.seekg(POS + 0x2F, ios_base::beg); file >> format.axisPositionValue; break; } } void Origin750Parser::readGraphAxisTickLabelsInfo(GraphAxisTick& tick) { unsigned int POS = file.tellg(); unsigned char h; unsigned char h1; short w; file.seekg(POS + 0x26, ios_base::beg); file >> h; tick.hidden = (h == 0); file.seekg(POS + 0x0F, ios_base::beg); file >> tick.color; file.seekg(POS + 0x13, ios_base::beg); file >> w; tick.rotation = w/10; file >> tick.fontSize; file.seekg(POS + 0x1A, ios_base::beg); file >> h; tick.fontBold = (h & 0x08); file.seekg(POS + 0x23, ios_base::beg); file >> w; file >> h; file >> h1; tick.valueType = (ValueType)(h & 0x0F); pair column; switch(tick.valueType) { case Numeric: /*switch((h>>4)) { case 0x9: tick.valueTypeSpecification=1; break; case 0xA: tick.valueTypeSpecification=2; break; case 0xB: tick.valueTypeSpecification=3; break; default: tick.valueTypeSpecification=0; }*/ if((h>>4) > 7) { tick.valueTypeSpecification = (h>>4) - 8; tick.decimalPlaces = h1 - 0x40; } else { tick.valueTypeSpecification = (h>>4); tick.decimalPlaces = -1; } break; case Time: case Date: case Month: case Day: case ColumnHeading: tick.valueTypeSpecification = h1 - 0x40; break; case Text: case TickIndexedDataset: case Categorical: column = findDataByIndex(w-1); if(column.first.size() > 0) { tick.dataName = column.first; tick.columnName = column.second; } break; default: // Numeric Decimal 1.000 tick.valueType = Numeric; tick.valueTypeSpecification = 0; break; } } unsigned int Origin750Parser::readGraphAxisInfo(GraphAxis& axis) { unsigned int POS = file.tellg(); unsigned int size; file >> size; POS += 0x5; file.seekg(POS, ios_base::beg); readGraphGridInfo(axis.minorGrid); POS += size + 1; POS += 0x5; file.seekg(POS, ios_base::beg); readGraphGridInfo(axis.majorGrid); POS += size + 1; POS += 0x5; file.seekg(POS, ios_base::beg); readGraphAxisTickLabelsInfo(axis.tickAxis[0]); POS += size + 1; POS += 0x5; file.seekg(POS, ios_base::beg); readGraphAxisFormatInfo(axis.formatAxis[0]); POS += size + 1; POS += 0x5; file.seekg(POS, ios_base::beg); readGraphAxisTickLabelsInfo(axis.tickAxis[1]); POS += size + 1; POS += 0x5; file.seekg(POS, ios_base::beg); readGraphAxisFormatInfo(axis.formatAxis[1]); return (size + 1 + 0x5); } void Origin750Parser::readProjectTree() { readProjectTreeFolder(projectTree.begin()); BOOST_LOG_(1, format("Project has %d windows") % windowsCount); BOOST_LOG_(1, "Origin project Tree"); for(tree::iterator it = projectTree.begin(projectTree.begin()); it != projectTree.end(projectTree.begin()); ++it) { BOOST_LOG_(1, string(projectTree.depth(it) - 1, ' ') + (*it).name); } vector validMatrices; for(unsigned int i = 0; i < matrixes.size(); ++i){ Matrix m = matrixes[i]; if (m.objectID >= 0) validMatrices.push_back(m); } matrixes.clear(); matrixes = validMatrices; } void Origin750Parser::readProjectTreeFolder(tree::iterator parent) { unsigned int POS = file.tellg(); double creationDate, modificationDate; POS += 5; file.seekg(POS + 0x10, ios_base::beg); file >> creationDate; if (creationDate >= 1e10) return; file >> modificationDate; if (modificationDate >= 1e10) return; POS += 0x20 + 1 + 5; unsigned int size; file.seekg(POS, ios_base::beg); file >> size; POS += 5; // read folder name string name(size, 0); file.seekg(POS, ios_base::beg); file >> name; tree::iterator current_folder = projectTree.append_child(parent, ProjectNode(name, ProjectNode::Folder, doubleToPosixTime(creationDate), doubleToPosixTime(modificationDate))); POS += size + 1 + 5 + 5; unsigned int objectcount; file.seekg(POS, ios_base::beg); file >> objectcount; windowsCount += objectcount; POS += 5 + 5; for(unsigned int i = 0; i < objectcount; ++i){ POS += 5; char c; file.seekg(POS + 0x2, ios_base::beg); file >> c; unsigned int objectID; file.seekg(POS + 0x4, ios_base::beg); file >> objectID; if (c == 0x10) projectTree.append_child(current_folder, ProjectNode(notes[objectID].name, ProjectNode::Note)); else { pair object = findObjectByIndex(objectID); projectTree.append_child(current_folder, ProjectNode(object.second, object.first)); } POS += 8 + 1 + 5 + 5; } file.seekg(POS, ios_base::beg); file >> objectcount; file.seekg(1, ios_base::cur); for(unsigned int i = 0; i < objectcount; ++i) readProjectTreeFolder(current_folder); } void Origin750Parser::readWindowProperties(Window& window, unsigned int size) { unsigned int POS = file.tellg(); window.objectID = objectIndex; ++objectIndex; file.seekg(POS + 0x1B, ios_base::beg); file.read(reinterpret_cast(&window.frameRect), sizeof(window.frameRect)); char c; file.seekg(POS + 0x32, ios_base::beg); file >> c; if(c & 0x01) window.state = Window::Minimized; else if(c & 0x02) window.state = Window::Maximized; file.seekg(POS + 0x69, ios_base::beg); file >> c; if(c & 0x01) window.title = Window::Label; else if(c & 0x02) window.title = Window::Name; else window.title = Window::Both; window.hidden = (c & 0x08); if(window.hidden) { BOOST_LOG_(1, format(" WINDOW %d NAME : %s is hidden") % objectIndex % window.name.c_str()); } double creationDate, modificationDate; file.seekg(POS + 0x73, ios_base::beg); file >> creationDate; if (creationDate > 1e4 && creationDate < 1e8) window.creationDate = doubleToPosixTime(creationDate); else return; file >> modificationDate; if (modificationDate > 1e4 && modificationDate < 1e8) window.modificationDate = doubleToPosixTime(modificationDate); else return; if(size > 0xC3) { unsigned int labellen = 0; file.seekg(POS + 0xC3, ios_base::beg); file >> c; while(c != '@') { file >> c; ++labellen; } if(labellen > 0) { file.seekg(POS + 0xC3, ios_base::beg); file >> window.label.assign(labellen, 0); } BOOST_LOG_(1, format(" WINDOW %d LABEL: %s") % objectIndex % window.label); } } void Origin750Parser::readColorMap(ColorMap& colorMap) { unsigned char h; short w; unsigned int colorMapSize; file >> colorMapSize; file.seekg(0x110, ios_base::cur); for(unsigned int i = 0; i < colorMapSize + 3; ++i){ ColorMapLevel level; file >> level.fillPattern; file.seekg(0x03, ios_base::cur); file >> level.fillPatternColor; file >> w; level.fillPatternLineWidth = (double)w/500.0; file.seekg(0x06, ios_base::cur); file >> level.lineStyle; file.seekg(0x01, ios_base::cur); file >> w; level.lineWidth = (double)w/500.0; file >> level.lineColor; file.seekg(0x02, ios_base::cur); file >> h; level.labelVisible = (h & 0x1); level.lineVisible = !(h & 0x2); file.seekg(0x0D, ios_base::cur); file >> level.fillColor; file.seekg(0x04, ios_base::cur); double value; file >> value; colorMap.levels.push_back(make_pair(value, level)); } } void Origin750Parser::readGraphAxisPrefixSuffixInfo(const string& sec_name, unsigned int size, GraphLayer& layer) { if(sec_name == "PL"){ string text(size, 0); file >> text; layer.yAxis.formatAxis[0].prefix = text; } else if(sec_name == "PR"){ string text(size, 0); file >> text; layer.yAxis.formatAxis[1].prefix = text; } else if(sec_name == "PB"){ string text(size, 0); file >> text; layer.xAxis.formatAxis[0].prefix = text; } else if(sec_name == "PT"){ string text(size, 0); file >> text; layer.xAxis.formatAxis[1].prefix = text; } if(sec_name == "SL"){ string text(size, 0); file >> text; layer.yAxis.formatAxis[0].suffix = text; } else if(sec_name == "SR"){ string text(size, 0); file >> text; layer.yAxis.formatAxis[1].suffix = text; } else if(sec_name == "SB"){ string text(size, 0); file >> text; layer.xAxis.formatAxis[0].suffix = text; } else if(sec_name == "ST"){ string text(size, 0); file >> text; layer.xAxis.formatAxis[1].suffix = text; } } void Origin750Parser::skipLine() { unsigned char c; file >> c; unsigned int POS = file.tellg(); while(c != '\n'){ file >> c; POS++; if (POS >= d_file_size) break; } } OriginParser* createOrigin750Parser(const string& fileName) { return new Origin750Parser(fileName); } liborigin2-20110117/Origin610Parser.h0000644000265600020320000000430111523526505016305 0ustar andreasadmin/*************************************************************************** File : Origin610Parser.h -------------------------------------------------------------------- Copyright : (C) 2010 Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : Origin 6.1 file parser class ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #ifndef ORIGIN_610_PARSER_H #define ORIGIN_610_PARSER_H #include "Origin800Parser.h" class Origin610Parser : public Origin800Parser { public: Origin610Parser(const string& fileName); bool parse(); protected: void readSpreadInfo(); void readMatrixInfo(); bool readGraphInfo(); void readResultsLog(); void readNotes(); int findObjectInfoSectionByName(unsigned int start, const string& name); }; #endif // ORIGIN_610_PARSER_H liborigin2-20110117/Origin800Parser.h0000644000265600020320000000451611523526505016316 0ustar andreasadmin/*************************************************************************** File : Origin800Parser.h -------------------------------------------------------------------- Copyright : (C) 2010 Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : Origin 8.0 file parser class ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #ifndef ORIGIN_800_PARSER_H #define ORIGIN_800_PARSER_H #include "Origin750Parser.h" class Origin800Parser : public Origin750Parser { public: Origin800Parser(const string& fileName); bool parse(); protected: void readSpreadInfo(); void readMatrixInfo(); void readGraphInfo(); void readColumnInfo(int spread, int); void skipObjectInfo(); void readResultsLog(); virtual void readNotes(); bool findSection(const string& name, int length, int maxLength = 0); unsigned int findStringPos(const string& name); string notes_pos_mark; }; #endif // ORIGIN_800_PARSER_H liborigin2-20110117/Origin700Parser.h0000644000265600020320000000417511523526505016316 0ustar andreasadmin/*************************************************************************** File : Origin700Parser.h -------------------------------------------------------------------- Copyright : (C) 2010 Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : Origin 7.0 file parser class (uses code from file Origin750Parser.cpp written by Alex Kargovsky) ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #ifndef ORIGIN_700_PARSER_H #define ORIGIN_700_PARSER_H #include "Origin610Parser.h" class Origin700Parser : public Origin610Parser { public: Origin700Parser(const string& fileName); bool parse(); protected: void readMatrixInfo(); void readGraphInfo(); }; #endif // ORIGIN_700_PARSER_H liborigin2-20110117/OriginFile.cpp0000644000265600020320000001355711523526505016051 0ustar andreasadmin/*************************************************************************** File : OriginFile.cpp -------------------------------------------------------------------- Copyright : (C) 2005-2008 Stefan Gerlach (C) 2007-2008 Alex Kargovsky, Ion Vasilief Email (use @ for *) : kargovsky*yumr.phys.msu.su, ion_vasilief*yahoo.fr Description : Origin file import class ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #include "OriginFile.h" #include #include #include #include #include using namespace boost; OriginFile::OriginFile(const string& fileName) : fileVersion(0) { BOOST_LOG_INIT((logging::trace >> logging::eol)); // log format logging::sink s(new ofstream("./opjfile.log"), 1); s.attach_qualifier(logging::log); BOOST_LOG_ADD_OUTPUT_STREAM(s); ifstream file(fileName.c_str(), ios_base::binary); if(!file.is_open()) { cerr << format("Could not open %s!") % fileName.c_str() << endl; return; } string vers(4, 0); file.seekg(0x7, ios_base::beg); file >> vers; fileVersion = lexical_cast(vers); file.close(); BOOST_LOG_(1, format(" [version = %d]") % fileVersion); buildVersion = fileVersion; // translate version if(fileVersion >= 130 && fileVersion <= 140) // 4.1 fileVersion = 410; else if(fileVersion == 210) // 5.0 fileVersion = 500; else if(fileVersion == 2625) // 6.0 fileVersion = 600; else if(fileVersion == 2627) // 6.0 SR1 fileVersion = 601; else if(fileVersion == 2630) // 6.0 SR4 fileVersion = 604; else if(fileVersion == 2635) // 6.1 fileVersion = 610; else if(fileVersion >= 2656 && fileVersion <= 2664) // 7.0 fileVersion = 700; else if(fileVersion == 2672) // 7.0 SR3 fileVersion = 703; else if(fileVersion == 2673) // 7.0 E fileVersion = 704; else if(fileVersion >= 2766 && fileVersion <= 2769) // 7.5 fileVersion = 750; else if(fileVersion >= 2876 && fileVersion <= 2906) // 8.0 fileVersion = 800; else if(fileVersion >= 2907) // 8.1 fileVersion = 810; else { BOOST_LOG_(1, format("Found unknown project version %d") % fileVersion); BOOST_LOG_(1, "Please contact the authors of liborigin2"); BOOST_LOG_FINALIZE(); throw std::logic_error("Unknown project version"); } BOOST_LOG_(1, format("Found project version %.2f") % (fileVersion/100.0)); switch(fileVersion){ case 810: parser.reset(createOrigin810Parser(fileName)); break; case 800: parser.reset(createOrigin800Parser(fileName)); break; case 750: parser.reset(createOrigin750Parser(fileName)); break; case 700: case 703: case 704: parser.reset(createOrigin700Parser(fileName)); break; case 610: parser.reset(createOrigin610Parser(fileName)); break; case 600: case 601: case 604: parser.reset(createOrigin600Parser(fileName)); break; default: parser.reset(createOriginDefaultParser(fileName)); break; } } bool OriginFile::parse() { parser->setFileVersion(buildVersion); return parser->parse(); } double OriginFile::version() const { return fileVersion/100.0; } const tree* OriginFile::project() const { return &parser->projectTree; } vector::size_type OriginFile::spreadCount() const { return parser->speadSheets.size(); } Origin::SpreadSheet& OriginFile::spread(vector::size_type s) const { return parser->speadSheets[s]; } vector::size_type OriginFile::matrixCount() const { return parser->matrixes.size(); } Origin::Matrix& OriginFile::matrix(vector::size_type m) const { return parser->matrixes[m]; } vector::size_type OriginFile::functionCount() const { return parser->functions.size(); } vector::size_type OriginFile::functionIndex(const string& name) const { return parser->findFunctionByName(name); } Origin::Function& OriginFile::function(vector::size_type f) const { return parser->functions[f]; } vector::size_type OriginFile::graphCount() const { return parser->graphs.size(); } Origin::Graph& OriginFile::graph(vector::size_type g) const { return parser->graphs[g]; } vector::size_type OriginFile::noteCount() const { return parser->notes.size(); } Origin::Note& OriginFile::note(vector::size_type n) const { return parser->notes[n]; } string OriginFile::resultsLogString() const { return parser->resultsLog; } liborigin2-20110117/Origin810Parser.h0000644000265600020320000000413411523526505016313 0ustar andreasadmin/*************************************************************************** File : Origin810Parser.h -------------------------------------------------------------------- Copyright : (C) 2010 Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : Origin 8.1 file parser class ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #ifndef ORIGIN_810_PARSER_H #define ORIGIN_810_PARSER_H #include "Origin800Parser.h" class Origin810Parser : public Origin800Parser { public: Origin810Parser(const string& fileName); private: void readProjectTreeFolder(tree::iterator parent); void readColorMap(ColorMap& colorMap); }; #endif // ORIGIN_810_PARSER_H liborigin2-20110117/Origin700Parser.cpp0000644000265600020320000012105311523526505016644 0ustar andreasadmin/*************************************************************************** File : Origin700Parser.cpp -------------------------------------------------------------------- Copyright : (C) 2010 Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : Origin 7.0 file parser class (uses code from file Origin750Parser.cpp written by Alex Kargovsky) ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #include "Origin700Parser.h" #include #include #include #include #include #include using namespace boost; Origin700Parser::Origin700Parser(const string& fileName) : Origin610Parser(fileName) {} bool Origin700Parser::parse() { unsigned int dataIndex = 0; // get length of file: file.seekg (0, ios::end); d_file_size = file.tellg(); stringstream out; unsigned char c; /////////////////// find column /////////////////////////////////////////////////////////// file.seekg(0x10 + 1, ios_base::beg); unsigned int size; file >> size; file.seekg(1 + size + 1 + 5, ios_base::cur); file >> size; file.seekg(1, ios_base::cur); BOOST_LOG_(1, format(" [column found = %d/0x%X @ 0x%X]") % size % size % (unsigned int) file.tellg()); unsigned int colpos = file.tellg(); unsigned int current_col = 1, nr = 0, nbytes = 0; while(size > 0 && size < 0x84) { // should be 0x72, 0x73 or 0x83 //////////////////////////////// COLUMN HEADER ///////////////////////////////////////////// short data_type; char data_type_u; unsigned int oldpos = file.tellg(); file.seekg(oldpos + 0x16, ios_base::beg); file >> data_type; file.seekg(oldpos + 0x3F, ios_base::beg); file >> data_type_u; char valuesize; file.seekg(oldpos + 0x3D, ios_base::beg); file >> valuesize; BOOST_LOG_(1, format(" [valuesize = %d @ 0x%X]") % (int)valuesize % ((unsigned int) file.tellg()-1)); if(valuesize <= 0) { BOOST_LOG_(1, format(" WARNING : found strange valuesize of %d") % (int)valuesize); valuesize = 10; } file.seekg(oldpos + 0x58, ios_base::beg); BOOST_LOG_(1, format(" [Spreadsheet @ 0x%X]") % (unsigned int) file.tellg()); string name(25, 0); file >> name; string::size_type pos = name.find_last_of("_"); string columnname; if(pos != string::npos) { columnname = name.substr(pos + 1); name.resize(pos); } BOOST_LOG_(1, format(" NAME: %s") % name.c_str()); unsigned int spread = 0; if(columnname.empty()) { BOOST_LOG_(1, "NO COLUMN NAME FOUND! Must be a Matrix or Function."); ////////////////////////////// READ matrixes or functions //////////////////////////////////// BOOST_LOG_(1, format(" [position @ 0x%X]") % (unsigned int) file.tellg()); // TODO short signature; file >> signature; BOOST_LOG_(1, format(" SIGNATURE : %02X ") % signature); file.seekg(oldpos + size + 1, ios_base::beg); file >> size; file.seekg(1, ios_base::cur); size /= valuesize; BOOST_LOG_(1, format(" SIZE = %d") % size); switch(signature) { case 0x50CA: case 0x70CA: case 0x50F2: case 0x50E2: case 0x50C8: case 0x50E7: case 0x50DB: case 0x50DC: BOOST_LOG_(1, "NEW MATRIX"); matrixes.push_back(Matrix(name, dataIndex)); ++dataIndex; BOOST_LOG_(1, "VALUES :"); out.str(size > 100 ? "matrix too big..." : string()); switch(data_type) { case 0x6001://double for(unsigned int i = 0; i < size; ++i) { double value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); break; case 0x6003://float for(unsigned int i = 0; i < size; ++i) { float value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); break; case 0x6801://int if(data_type_u == 8)//unsigned { for(unsigned int i = 0; i < size; ++i) { unsigned int value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } else { for(unsigned int i = 0; i < size; ++i) { int value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } break; case 0x6803://short if(data_type_u == 8)//unsigned { for(unsigned int i = 0; i < size; ++i) { unsigned short value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } else { for(unsigned int i = 0; i < size; ++i) { short value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } break; case 0x6821://char if(data_type_u == 8)//unsigned { for(unsigned int i = 0; i < size; ++i) { unsigned char value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } else { for(unsigned int i = 0; i < size; ++i) { char value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } break; default: BOOST_LOG_(1, format("UNKNOWN MATRIX DATATYPE: %02X SKIP DATA") % data_type); file.seekg(valuesize*size, ios_base::cur); matrixes.pop_back(); } break; case 0x10C8: BOOST_LOG_(1, "NEW FUNCTION"); functions.push_back(Function(name, dataIndex)); ++dataIndex; file >> functions.back().formula.assign(valuesize, 0); oldpos = file.tellg(); short t; file.seekg(colpos + 0xA, ios_base::beg); file >> t; if(t == 0x1194) functions.back().type = Function::Polar; file.seekg(colpos + 0x21, ios_base::beg); file >> functions.back().totalPoints; file >> functions.back().begin; double d; file >> d; functions.back().end = functions.back().begin + d*(functions.back().totalPoints - 1); BOOST_LOG_(1, format("FUNCTION %s : %s") % functions.back().name.c_str() % functions.back().formula.c_str()); BOOST_LOG_(1, format(" interval %g : %g, number of points %d") % functions.back().begin % functions.back().end % functions.back().totalPoints); file.seekg(oldpos, ios_base::beg); break; default: BOOST_LOG_(1, format("UNKNOWN SIGNATURE: %.2X SKIP DATA") % signature); file.seekg(valuesize*size, ios_base::cur); ++dataIndex; if(valuesize != 8 && valuesize <= 16) { file.seekg(2, ios_base::cur); } } } else { // worksheet if(speadSheets.size() == 0 || findSpreadByName(name) == -1) { BOOST_LOG_(1, "NEW SPREADSHEET"); current_col = 1; speadSheets.push_back(SpreadSheet(name)); spread = speadSheets.size() - 1; speadSheets.back().maxRows = 0; } else { spread = findSpreadByName(name); current_col = speadSheets[spread].columns.size(); if(!current_col) current_col = 1; ++current_col; } BOOST_LOG_(1, format("SPREADSHEET = %s COLUMN NAME = %s (%d) (@0x%X)") % name % columnname % current_col % (unsigned int)file.tellg()); speadSheets[spread].columns.push_back(SpreadColumn(columnname, dataIndex)); string::size_type sheetpos = speadSheets[spread].columns.back().name.find_last_of("@"); if(!speadSheets[spread].multisheet && sheetpos != string::npos) { if(lexical_cast(columnname.substr(sheetpos + 1).c_str()) > 1) { speadSheets[spread].multisheet = true; BOOST_LOG_(1, format("SPREADSHEET \"%s\" IS MULTISHEET") % name); } } ++dataIndex; ////////////////////////////// SIZE of column ///////////////////////////////////////////// file.seekg(oldpos + size + 1, ios_base::beg); file >> nbytes; if(fmod(nbytes, (double)valuesize)>0) { BOOST_LOG_(1, "WARNING: data section could not be read correct"); } nr = nbytes / valuesize; BOOST_LOG_(1, format(" [number of rows = %d (%d Bytes) @ 0x%X]") % nr % nbytes % (unsigned int)file.tellg()); speadSheets[spread].maxRows> value; out << format("%g ") % value; speadSheets[spread].columns[(current_col-1)].data.push_back(value); } else if((data_type & 0x100) == 0x100) // Text&Numeric { file >> c; file.seekg(1, ios_base::cur); if(c == 0) //value { file >> value; out << format("%g ") % value; speadSheets[spread].columns[(current_col-1)].data.push_back(value); file.seekg(valuesize - 10, ios_base::cur); } else //text { string stmp(valuesize - 2, 0); file >> stmp; if(stmp.find(0x0E) != string::npos) // try find non-printable symbol - garbage test stmp = string(); speadSheets[spread].columns[(current_col-1)].data.push_back(stmp); out << format("%s ") % stmp; } } else //text { string stmp(valuesize, 0); file >> stmp; if(stmp.find(0x0E) != string::npos) // try find non-printable symbol - garbage test stmp = string(); speadSheets[spread].columns[(current_col-1)].data.push_back(stmp); out << format("%s ") % stmp; } } BOOST_LOG_(1, out.str()); } if(nbytes > 0 || columnname.empty()) { file.seekg(1, ios_base::cur); } file >> size; file.seekg(1 + size + (size > 0 ? 1 : 0), ios_base::cur); file >> size; file.seekg(1, ios_base::cur); BOOST_LOG_(1, format(" [column found = %d/0x%X (@ 0x%X)]") % size % size %((unsigned int) file.tellg()-5)); colpos = file.tellg(); } //////////////////////////////////////////////////////////////////////////// ////////////////////// HEADER SECTION ////////////////////////////////////// unsigned int POS = (unsigned int)file.tellg()-11; BOOST_LOG_(1, "\nHEADER SECTION"); BOOST_LOG_(1, format(" nr_spreads = %d") % speadSheets.size()); BOOST_LOG_(1, format(" [position @ 0x%X]") % POS); //////////////////////// OBJECT INFOS ////////////////////////////////////// POS += 0xB; file.seekg(POS, ios_base::beg); while(POS < d_file_size){ POS = file.tellg(); file >> size; if(size == 0) break; file.seekg(POS + 0x7, ios_base::beg); string name(25, 0); file >> name; file.seekg(POS, ios_base::beg); if(findSpreadByName(name) != -1) readSpreadInfo(); else if(findMatrixByName(name) != -1) readMatrixInfo(); else if(findExcelByName(name) != -1) readExcelInfo(); else readGraphInfo(); POS = file.tellg(); } readNotes(); readResultsLog(); file.seekg(1 + 4*5 + 0x10 + 1, ios_base::cur); try { readProjectTree(); } catch(...){} BOOST_LOG_(1, "Done parsing"); BOOST_LOG_FINALIZE(); return true; } void Origin700Parser::readMatrixInfo() { unsigned int POS = file.tellg(); unsigned int size; file >> size; POS += 5; string name(25, 0); file.seekg(POS + 0x2, ios_base::beg); file >> name; BOOST_LOG_(1, format(" MATRIX %s (@ 0x%X)]") % name % POS); int idx = findMatrixByName(name); matrixes[idx].name = name; file.seekg(POS, ios_base::beg); readWindowProperties(matrixes[idx], size); unsigned char h; file.seekg(POS + 0x87, ios_base::beg); file >> h; switch(h){ case 1: matrixes[idx].view = Matrix::ImageView; break; case 2: matrixes[idx].header = Matrix::XY; break; } unsigned int LAYER = POS; LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; // LAYER section LAYER += 0x5; unsigned short width; file.seekg(LAYER + 0x27, ios_base::beg); file >> width; if (width == 0) width = 8; matrixes[idx].width = width; BOOST_LOG_(1, format(" Width: %d (@ 0x%X)") % matrixes[idx].width % (LAYER + 0x27)); file.seekg(LAYER + 0x2B, ios_base::beg); file >> matrixes[idx].columnCount; BOOST_LOG_(1, format(" Columns: %d (@ 0x%X)") % matrixes[idx].columnCount % (LAYER + 0x2B)); file.seekg(LAYER + 0x52, ios_base::beg); file >> matrixes[idx].rowCount; BOOST_LOG_(1, format(" Rows: %d (@ 0x%X)") % matrixes[idx].rowCount % (LAYER + 0x52)); LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; unsigned int sectionSize = size; while(LAYER < d_file_size){ LAYER += 0x5; //section_header string sec_name(41, 0); file.seekg(LAYER + 0x46, ios_base::beg); file >> sec_name; //BOOST_LOG_(1, format(" SECTION NAME: %s (@ 0x%X)") % sec_name % (LAYER + 0x46)); //section_body_1_size LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_1 LAYER += 0x5; //check if it is a formula if(sec_name == "MV"){ file.seekg(LAYER, ios_base::beg); file >> matrixes[idx].command.assign(size, 0); BOOST_LOG_(1, format(" Formula: %s (@ 0x%X)") % matrixes[idx].command % LAYER); } else if (sec_name == "Y2"){ string s(size, 0); file >> s; matrixes[idx].coordinates[0] = stringToDouble(s); BOOST_LOG_(1, format(" Y2: %g") % matrixes[idx].coordinates[0]); } else if (sec_name == "X2"){ string s(size, 0); file >> s; matrixes[idx].coordinates[1] = stringToDouble(s); BOOST_LOG_(1, format(" X2: %g") % matrixes[idx].coordinates[1]); } else if (sec_name == "Y1"){ string s(size, 0); file >> s; matrixes[idx].coordinates[2] = stringToDouble(s); BOOST_LOG_(1, format(" Y1: %g") % matrixes[idx].coordinates[2]); } else if (sec_name == "X1"){ string s(size, 0); file >> s; matrixes[idx].coordinates[3] = stringToDouble(s); BOOST_LOG_(1, format(" X1: %g") % matrixes[idx].coordinates[3]); } //section_body_2_size LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_2 LAYER += 0x5; if (sec_name == "COLORMAP"){ file.seekg(LAYER + 0x14, ios_base::beg); readColorMap(matrixes[idx].colorMap); } //close section 00 00 00 00 0A LAYER += size + (size > 0 ? 0x1 : 0) + 0x5; file.seekg(LAYER, ios_base::beg); file >> size; if(size != sectionSize) break; } file.seekg(1, ios_base::cur); LAYER = file.tellg(); file >> size; unsigned char c1, c2; file.seekg(LAYER + 0x23, ios_base::beg); file >> c1; file >> c2; matrixes[idx].valueTypeSpecification = c1/0x10; if(c2 >= 0x80){ matrixes[idx].significantDigits = c2 - 0x80; matrixes[idx].numericDisplayType = SignificantDigits; } else if(c2 > 0){ matrixes[idx].decimalPlaces = c2 - 0x03; matrixes[idx].numericDisplayType = DecimalPlaces; } LAYER += size + 0x06; file.seekg(LAYER, ios_base::beg); skipObjectInfo(); BOOST_LOG_(1, format(" Done with matrix, pos @ 0x%X") % file.tellg()); } void Origin700Parser::readGraphInfo() { unsigned int POS = file.tellg(); unsigned int size; file >> size; POS += 5; string name(25, 0); file.seekg(POS + 0x02, ios_base::beg); file >> name; BOOST_LOG_(1, format(" GRAPH name: %s cursor pos: 0x%X") % name % file.tellg()); graphs.push_back(Graph(name)); file.seekg(POS, ios_base::beg); readWindowProperties(graphs.back(), size); file.seekg(POS + 0x23, ios_base::beg); file >> graphs.back().width; file >> graphs.back().height; unsigned int LAYER = POS; LAYER += size + 0x1; while(LAYER < d_file_size){// multilayer loop graphs.back().layers.push_back(GraphLayer()); GraphLayer& layer(graphs.back().layers.back()); // LAYER section file.seekg(LAYER, ios_base::beg); file >> size; LAYER += 0x05; file.seekg(LAYER + 0x0F, ios_base::beg); file >> layer.xAxis.min; file >> layer.xAxis.max; file >> layer.xAxis.step; file.seekg(LAYER + 0x2B, ios_base::beg); file >> layer.xAxis.majorTicks; file.seekg(LAYER + 0x37, ios_base::beg); file >> layer.xAxis.minorTicks; file >> layer.xAxis.scale; file.seekg(LAYER + 0x3A, ios_base::beg); file >> layer.yAxis.min; file >> layer.yAxis.max; file >> layer.yAxis.step; file.seekg(LAYER + 0x56, ios_base::beg); file >> layer.yAxis.majorTicks; file.seekg(LAYER + 0x62, ios_base::beg); file >> layer.yAxis.minorTicks; file >> layer.yAxis.scale; file.seekg(LAYER + 0x71, ios_base::beg); file.read(reinterpret_cast(&layer.clientRect), sizeof(Rect)); unsigned char border; file.seekg(LAYER + 0x89, ios_base::beg); file >> border; layer.borderType = (BorderType)(border >= 0x80 ? border-0x80 : None); unsigned char col; file.seekg(LAYER + 0xA7, ios_base::beg); file >> col; layer.backgroundColor.type = (col & 0x01) ? Origin::Color::None : Origin::Color::Regular; file >> col; layer.backgroundColor.regular = col; LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); unsigned int sectionSize; file >> size; sectionSize = size; while(LAYER < d_file_size){ LAYER += 0x5; //section_header string sec_name(41, 0); file.seekg(LAYER + 0x46, ios_base::beg); file >> sec_name; unsigned int sectionNamePos = LAYER + 0x46; BOOST_LOG_(1, format(" SECTION NAME: %s (@ 0x%X)") % sec_name % (LAYER + 0x46)); Rect r; file.seekg(LAYER + 0x03, ios_base::beg); file.read(reinterpret_cast(&r), sizeof(Rect)); unsigned char attach; file.seekg(LAYER + 0x28, ios_base::beg); file >> attach; unsigned char border; file >> border; Color color; file.seekg(LAYER + 0x33, ios_base::beg); file >> color; LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_1 LAYER += 0x5; unsigned int osize = size; file.seekg(LAYER, ios_base::beg); readGraphAxisPrefixSuffixInfo(sec_name, size, layer); unsigned char type; file >> type; //text properties short rotation; file.seekg(LAYER + 0x02, ios_base::beg); file >> rotation; unsigned char fontSize; file >> fontSize; unsigned char tab; file.seekg(LAYER + 0x0A, ios_base::beg); file >> tab; //line properties unsigned char lineStyle = 0; double width = 0.0; LineVertex begin, end; unsigned int w = 0; file.seekg(LAYER + 0x12, ios_base::beg); file >> lineStyle; unsigned short w1; file >> w1; width = (double)w1/500.0; file.seekg(LAYER + 0x20, ios_base::beg); file >> begin.x; file >> end.x; file.seekg(LAYER + 0x40, ios_base::beg); file >> begin.y; file >> end.y; file.seekg(LAYER + 0x60, ios_base::beg); file >> begin.shapeType; file.seekg(LAYER + 0x64, ios_base::beg); file >> w; begin.shapeWidth = (double)w/500.0; file >> w; begin.shapeLength = (double)w/500.0; file.seekg(LAYER + 0x6C, ios_base::beg); file >> end.shapeType; file.seekg(LAYER + 0x70, ios_base::beg); file >> w; end.shapeWidth = (double)w/500.0; file >> w; end.shapeLength = (double)w/500.0; Figure figure; file.seekg(LAYER + 0x05, ios_base::beg); file >> w1; figure.width = (double)w1/500.0; file.seekg(LAYER + 0x08, ios_base::beg); file >> figure.style; file.seekg(LAYER + 0x42, ios_base::beg); file >> figure.fillAreaColor; file >> w1; figure.fillAreaPatternWidth = (double)w1/500.0; file.seekg(LAYER + 0x4A, ios_base::beg); file >> figure.fillAreaPatternColor; file >> figure.fillAreaPattern; unsigned char h; file.seekg(LAYER + 0x57, ios_base::beg); file >> h; figure.useBorderColor = (h == 0x10); //section_body_2_size LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_2 LAYER += 0x5; file.seekg(1, ios_base::cur); if(sec_name == "XB") { string text(size, 0); file >> text; layer.xAxis.position = GraphAxis::Bottom; layer.xAxis.formatAxis[0].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "XT") { string text(size, 0); file >> text; layer.xAxis.position = GraphAxis::Top; layer.xAxis.formatAxis[1].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "YL") { string text(size, 0); file >> text; layer.yAxis.position = GraphAxis::Left; layer.yAxis.formatAxis[0].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "YR") { string text(size, 0); file >> text; layer.yAxis.position = GraphAxis::Right; layer.yAxis.formatAxis[1].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "ZF") { string text(size, 0); file >> text; layer.zAxis.position = GraphAxis::Front; layer.zAxis.formatAxis[0].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "ZB") { string text(size, 0); file >> text; layer.zAxis.position = GraphAxis::Back; layer.zAxis.formatAxis[1].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "3D") { file >> layer.zAxis.min; file >> layer.zAxis.max; file >> layer.zAxis.step; file.seekg(LAYER + 0x1C, ios_base::beg); file >> layer.zAxis.majorTicks; file.seekg(LAYER + 0x28, ios_base::beg); file >> layer.zAxis.minorTicks; file >> layer.zAxis.scale; file.seekg(LAYER + 0x218, ios_base::beg); file >> layer.xLength; file >> layer.yLength; file >> layer.zLength; layer.xLength /= 23.0; layer.yLength /= 23.0; layer.zLength /= 23.0; } else if(sec_name == "Legend") { string text(size, 0); file >> text; layer.legend = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "__BCO2") // histogram { file.seekg(LAYER + 0x10, ios_base::beg); file >> layer.histogramBin; file.seekg(LAYER + 0x20, ios_base::beg); file >> layer.histogramEnd; file >> layer.histogramBegin; unsigned int p = sectionNamePos + 81; file.seekg(p, ios_base::beg); file >> layer.percentile.p1SymbolType; file >> layer.percentile.p99SymbolType; file >> layer.percentile.meanSymbolType; file >> layer.percentile.maxSymbolType; file >> layer.percentile.minSymbolType; file.seekg(sectionNamePos + 94, ios_base::beg); file >> layer.percentile.whiskersRange; file >> layer.percentile.boxRange; file.seekg(sectionNamePos + 129, ios_base::beg); file >> layer.percentile.whiskersCoeff; file >> layer.percentile.boxCoeff; unsigned char h; file >> h; layer.percentile.diamondBox = (h == 0x82) ? true : false; p += 109; file.seekg(p, ios_base::beg); file >> layer.percentile.symbolSize; layer.percentile.symbolSize = layer.percentile.symbolSize/2 + 1; p += 163; file.seekg(p, ios_base::beg); file >> layer.percentile.symbolColor; file >> layer.percentile.symbolFillColor; } else if(sec_name == "vline") // Image profiles vertical cursor { file.seekg(sectionNamePos, ios_base::beg); for (int i = 0; i < 2; i++) skipLine(); file.seekg(0x20, ios_base::cur); file >> layer.vLine; BOOST_LOG_(1, format("vLine: %g") % layer.vLine); layer.imageProfileTool = true; } else if(sec_name == "hline") // Image profiles horizontal cursor { file.seekg(sectionNamePos, ios_base::beg); for (int i = 0; i < 2; i++) skipLine(); file.seekg(0x40, ios_base::cur); file >> layer.hLine; BOOST_LOG_(1, format("hLine: %g @ 0x%X") % layer.hLine % file.tellg()); layer.imageProfileTool = true; } else if(sec_name == "ZCOLORS") { layer.isXYY3D = true; } else if(sec_name == "SPECTRUM1") { layer.isXYY3D = false; unsigned char h; file.seekg(24, ios_base::cur); file >> h; layer.colorScale.reverseOrder = h; file.seekg(7, ios_base::cur); file >> layer.colorScale.colorBarThickness; file >> layer.colorScale.labelGap; file.seekg(56, ios_base::cur); file >> layer.colorScale.labelsColor; } else if(size && type == 0xE9) // text { string text(size, 0); file >> text; sec_name.resize(3); if (sec_name == "PIE") layer.pieTexts.push_back(TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach)); else layer.texts.push_back(TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach)); } else if(osize == 0x5E) // rectangle & circle { switch(type){ case 0: case 1: figure.type = Figure::Rectangle; break; case 2: case 3: figure.type = Figure::Circle; break; } figure.clientRect = r; figure.attach = (Attach)attach; figure.color = color; layer.figures.push_back(figure); } else if(osize == 0x78 && type == 2) // line { layer.lines.push_back(Line()); Line& line(layer.lines.back()); line.color = color; line.clientRect = r; line.attach = (Attach)attach; line.width = width; line.style = lineStyle; line.begin = begin; line.end = end; } else if(osize == 0x28) // bitmap { if (type == 4){ unsigned long filesize = size + 14; layer.bitmaps.push_back(Bitmap()); Bitmap& bitmap(layer.bitmaps.back()); bitmap.clientRect = r; bitmap.attach = (Attach)attach; bitmap.size = filesize; bitmap.borderType = (BorderType)(border >= 0x80 ? border-0x80 : None); bitmap.data = new unsigned char[filesize]; unsigned char* data = bitmap.data; //add Bitmap header memcpy(data, "BM", 2); data += 2; memcpy(data, &filesize, 4); data += 4; unsigned int d = 0; memcpy(data, &d, 4); data += 4; d = 0x36; memcpy(data, &d, 4); data += 4; file.read(reinterpret_cast(data), size); } else if (type == 6){ string gname(30, 0); file.seekg(sectionNamePos + 93, ios_base::beg); file >> gname; layer.bitmaps.push_back(Bitmap(gname)); Bitmap& bitmap(layer.bitmaps.back()); bitmap.clientRect = r; bitmap.attach = (Attach)attach; bitmap.size = 0; bitmap.borderType = (BorderType)(border >= 0x80 ? border-0x80 : None); } } //close section 00 00 00 00 0A LAYER += size + (size > 0 ? 0x1 : 0); //section_body_3_size file.seekg(LAYER, ios_base::beg); file >> size; //section_body_3 LAYER += 0x5; //close section 00 00 00 00 0A LAYER += size + (size > 0 ? 0x1 : 0); file.seekg(LAYER, ios_base::beg); file >> size; if (!size || size != sectionSize) break; } LAYER += 0x5; unsigned char h; short w; file.seekg(LAYER, ios_base::beg); file >> size; if(size){//check layer is not empty while(LAYER < d_file_size){ LAYER += 0x5; layer.curves.push_back(GraphCurve()); GraphCurve& curve(layer.curves.back()); file.seekg(LAYER + 0x4C, ios_base::beg); file >> curve.type; BOOST_LOG_(1, format(" graph %d layer %d curve %d type : %d") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % (int)curve.type); if (curve.type == GraphCurve::Mesh3D || curve.type == GraphCurve::Contour) layer.isXYY3D = false; file.seekg(LAYER + 0x04, ios_base::beg); file >> w; pair column = findDataByIndex(w-1); short nColY = w; if(column.first.size() > 0){ curve.dataName = column.first; if(layer.is3D()){ BOOST_LOG_(1, format(" graph %d layer %d curve %d Z : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.zColumnName = column.second; } else { BOOST_LOG_(1, format(" graph %d layer %d curve %d Y : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.yColumnName = column.second; } } file.seekg(LAYER + 0x23, ios_base::beg); file >> w; column = findDataByIndex(w-1); if(column.first.size() > 0){ if(curve.dataName != column.first) BOOST_LOG_(1, format(" graph %d X and Y from different tables") % graphs.size()); if(layer.is3D()){ BOOST_LOG_(1, format(" graph %d layer %d curve %d Y : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.yColumnName = column.second; } else if (layer.isXYY3D){ BOOST_LOG_(1, format(" graph %d layer %d curve %d X : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.xColumnName = column.second; } else { BOOST_LOG_(1, format(" graph %d layer %d curve %d X : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.xColumnName = column.second; } } file.seekg(LAYER + 0x4D, ios_base::beg); file >> w; column = findDataByIndex(w-1); if(column.first.size() > 0 && layer.is3D()){ BOOST_LOG_(1, format(" graph %d layer %d curve %d X : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.xColumnName = column.second; if(curve.dataName != column.first) BOOST_LOG_(1, format(" graph %d X and Y from different tables") % graphs.size()); } if(layer.is3D() || layer.isXYY3D) graphs.back().is3D = true; file.seekg(LAYER + 0x11, ios_base::beg); file >> curve.lineConnect; file >> curve.lineStyle; file.seekg(1, ios_base::cur); file >> curve.boxWidth; file >> w; curve.lineWidth=(double)w/500.0; file.seekg(LAYER + 0x19, ios_base::beg); file >> w; curve.symbolSize=(double)w/500.0; file.seekg(LAYER + 0x1C, ios_base::beg); file >> h; curve.fillArea = (h==2); file.seekg(LAYER + 0x1E, ios_base::beg); file >> curve.fillAreaType; //text if(curve.type == GraphCurve::TextPlot){ file.seekg(LAYER + 0x13, ios_base::beg); file >> curve.text.rotation; curve.text.rotation /= 10; file >> curve.text.fontSize; file.seekg(LAYER + 0x19, ios_base::beg); file >> h; switch(h){ case 26: curve.text.justify = TextProperties::Center; break; case 2: curve.text.justify = TextProperties::Right; break; default: curve.text.justify = TextProperties::Left; break; } file >> h; curve.text.fontUnderline = (h & 0x1); curve.text.fontItalic = (h & 0x2); curve.text.fontBold = (h & 0x8); curve.text.whiteOut = (h & 0x20); char offset; file.seekg(LAYER + 0x37, ios_base::beg); file >> offset; curve.text.xOffset = offset * 5; file >> offset; curve.text.yOffset = offset * 5; } //vector if(curve.type == GraphCurve::FlowVector || curve.type == GraphCurve::Vector){ file.seekg(LAYER + 0x56, ios_base::beg); file >> curve.vector.multiplier; file.seekg(LAYER + 0x5E, ios_base::beg); file >> h; column = findDataByIndex(nColY - 1 + h - 0x64); if(column.first.size() > 0) curve.vector.endXColumnName = column.second; file.seekg(LAYER + 0x62, ios_base::beg); file >> h; column = findDataByIndex(nColY - 1 + h - 0x64); if(column.first.size() > 0) curve.vector.endYColumnName = column.second; file.seekg(LAYER + 0x18, ios_base::beg); file >> h; if(h >= 0x64){ column = findDataByIndex(nColY - 1 + h - 0x64); if(column.first.size() > 0) curve.vector.angleColumnName = column.second; } else if(h <= 0x08) curve.vector.constAngle = 45*h; file >> h; if(h >= 0x64 && h < 0x1F4){ column = findDataByIndex(nColY - 1 + h - 0x64); if(column.first.size() > 0) curve.vector.magnitudeColumnName = column.second; } else curve.vector.constMagnitude = (int)curve.symbolSize; file.seekg(LAYER + 0x66, ios_base::beg); file >> curve.vector.arrowLenght; file >> curve.vector.arrowAngle; file >> h; curve.vector.arrowClosed = !(h & 0x1); file >> w; curve.vector.width=(double)w/500.0; file.seekg(LAYER + 0x142, ios_base::beg); file >> h; switch(h){ case 2: curve.vector.position = VectorProperties::Midpoint; break; case 4: curve.vector.position = VectorProperties::Head; break; default: curve.vector.position = VectorProperties::Tail; break; } } //pie if (curve.type == GraphCurve::Pie){ file.seekg(LAYER + 0x92, ios_base::beg); file >> h; curve.pie.formatPercentages = (h & 0x01); curve.pie.formatValues = (h & 0x02); curve.pie.positionAssociate = (h & 0x08); curve.pie.clockwiseRotation = (h & 0x20); curve.pie.formatCategories = (h & 0x80); file >> curve.pie.formatAutomatic; file >> curve.pie.distance; file >> curve.pie.viewAngle; file.seekg(LAYER + 0x98, ios_base::beg); file >> curve.pie.thickness; file.seekg(LAYER + 0x9A, ios_base::beg); file >> curve.pie.rotation; file.seekg(LAYER + 0x9E, ios_base::beg); file >> curve.pie.displacement; file.seekg(LAYER + 0xA0, ios_base::beg); file >> curve.pie.radius; file >> curve.pie.horizontalOffset; file.seekg(LAYER + 0xA6, ios_base::beg); file >> curve.pie.displacedSectionCount; } //surface if (layer.isXYY3D || curve.type == GraphCurve::Mesh3D){ file.seekg(LAYER + 0x17, ios_base::beg); file >> curve.surface.type; file.seekg(LAYER + 0x1C, ios_base::beg); file >> h; if(h & 0x60 == 0x60) curve.surface.grids = SurfaceProperties::X; else if(h & 0x20) curve.surface.grids = SurfaceProperties::Y; else if(h & 0x40) curve.surface.grids = SurfaceProperties::None; else curve.surface.grids = SurfaceProperties::XY; curve.surface.sideWallEnabled = (h & 0x10); file >> curve.surface.frontColor; file.seekg(LAYER + 0x14C, ios_base::beg); file >> w; curve.surface.gridLineWidth = (double)w/500.0; file >> curve.surface.gridColor; file.seekg(LAYER + 0x13, ios_base::beg); file >> h; curve.surface.backColorEnabled = (h & 0x08); file.seekg(LAYER + 0x15A, ios_base::beg); file >> curve.surface.backColor; file >> curve.surface.xSideWallColor; file >> curve.surface.ySideWallColor; curve.surface.surface.fill = (h & 0x10); curve.surface.surface.contour = (h & 0x40); file.seekg(LAYER + 0x94, ios_base::beg); file >> w; curve.surface.surface.lineWidth = (double)w/500.0; file >> curve.surface.surface.lineColor; curve.surface.topContour.fill = (h & 0x02); curve.surface.topContour.contour = (h & 0x04); file.seekg(LAYER + 0xB4, ios_base::beg); file >> w; curve.surface.topContour.lineWidth = (double)w/500.0; file >> curve.surface.topContour.lineColor; curve.surface.bottomContour.fill = (h & 0x80); curve.surface.bottomContour.contour = (h & 0x01); file.seekg(LAYER + 0xA4, ios_base::beg); file >> w; curve.surface.bottomContour.lineWidth = (double)w/500.0; file >> curve.surface.bottomContour.lineColor; } if (curve.type == GraphCurve::Mesh3D || curve.type == GraphCurve::Contour){ ColorMap& colorMap = (curve.type == GraphCurve::Mesh3D ? curve.surface.colorMap : curve.colorMap); file.seekg(LAYER + 0x13, ios_base::beg); file >> h; colorMap.fillEnabled = (h & 0x82); if (curve.type == GraphCurve::Contour){ file.seekg(102, ios_base::cur); file >> curve.text.fontSize; file.seekg(7, ios_base::cur); file >> h; curve.text.fontUnderline = (h & 0x1); curve.text.fontItalic = (h & 0x2); curve.text.fontBold = (h & 0x8); curve.text.whiteOut = (h & 0x20); file.seekg(2, ios_base::cur); file >> curve.text.color; } file.seekg(LAYER + 0x258, ios_base::beg); readColorMap(colorMap); } file.seekg(LAYER + 0xC2, ios_base::beg); file >> curve.fillAreaColor; file >> w; curve.fillAreaPatternWidth=(double)w/500.0; file.seekg(LAYER + 0xCA, ios_base::beg); file >> curve.fillAreaPatternColor; file >> curve.fillAreaPattern; file >> curve.fillAreaPatternBorderStyle; file >> w; curve.fillAreaPatternBorderWidth=(double)w/500.0; file >> curve.fillAreaPatternBorderColor; file.seekg(LAYER + 0x16A, ios_base::beg); file >> curve.lineColor; if (curve.type != GraphCurve::Contour) curve.text.color = curve.lineColor; file.seekg(LAYER + 0x17, ios_base::beg); file >> curve.symbolType; file.seekg(LAYER + 0x12E, ios_base::beg); file >> curve.symbolFillColor; file >> curve.symbolColor; curve.vector.color = curve.symbolColor; file >> h; curve.symbolThickness = (h == 255 ? 1 : h); file >> curve.pointOffset; file.seekg(LAYER + 0x143, ios_base::beg); file >> h; curve.connectSymbols = (h&0x8); LAYER += size + 0x1; int newSize; file.seekg(LAYER, ios_base::beg); file >> newSize; LAYER += newSize + (newSize > 0 ? 0x1 : 0) + 0x5; file.seekg(LAYER, ios_base::beg); file >> newSize; if(newSize != size) break; } } LAYER += 0x5; //read axis breaks while(LAYER < d_file_size){ file.seekg(LAYER, ios_base::beg); file >> size; if(size == 0x2D){ LAYER += 0x5; file.seekg(LAYER + 2, ios_base::beg); file >> h; if(h == 2) { layer.xAxisBreak.minorTicksBefore = layer.xAxis.minorTicks; layer.xAxisBreak.scaleIncrementBefore = layer.xAxis.step; file.seekg(LAYER, ios_base::beg); readGraphAxisBreakInfo(layer.xAxisBreak); } else if(h == 4){ layer.yAxisBreak.minorTicksBefore = layer.yAxis.minorTicks; layer.yAxisBreak.scaleIncrementBefore = layer.yAxis.step; file.seekg(LAYER, ios_base::beg); readGraphAxisBreakInfo(layer.yAxisBreak); } LAYER += 0x2D + 0x1; } else break; } LAYER += 0x5; file.seekg(LAYER, ios_base::beg); size = readGraphAxisInfo(layer.xAxis); LAYER += size*0x6; LAYER += 0x5; file.seekg(LAYER, ios_base::beg); readGraphAxisInfo(layer.yAxis); LAYER += size*0x6; LAYER += 0x5; file.seekg(LAYER, ios_base::beg); readGraphAxisInfo(layer.zAxis); LAYER += size*0x6; LAYER += 0x5; file.seekg(LAYER, ios_base::beg); file >> size; if(size == 0) break; } file.seekg(LAYER + 0x5, ios_base::beg); } OriginParser* createOrigin700Parser(const string& fileName) { return new Origin700Parser(fileName); } liborigin2-20110117/OriginParser.h0000644000265600020320000000732111523526505016063 0ustar andreasadmin/*************************************************************************** File : OriginParser.h -------------------------------------------------------------------- Copyright : (C) 2008 Alex Kargovsky Email (use @ for *) : kargovsky*yumr.phys.msu.su Description : Origin file parser base class ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #ifndef ORIGIN_PARSER_H #define ORIGIN_PARSER_H #include "OriginObj.h" #include "tree.hh" class OriginParser { public: virtual ~OriginParser() {}; virtual bool parse() = 0; void setFileVersion(unsigned int version){fileVersion = version;}; vector::size_type findSpreadByName(const string& name) const; vector::size_type findMatrixByName(const string& name) const; vector::size_type findFunctionByName(const string& name) const; vector::size_type findExcelByName(const string& name) const; protected: vector::size_type findSpreadColumnByName(vector::size_type spread, const string& name) const; vector::size_type findExcelColumnByName(vector::size_type excel, vector::size_type sheet, const string& name) const; pair findDataByIndex(unsigned int index) const; pair findObjectByIndex(unsigned int index) const; void convertSpreadToExcel(vector::size_type spread); int findColumnByName(int spread, const string& name); public: vector speadSheets; vector matrixes; vector excels; vector functions; vector graphs; vector notes; tree projectTree; string resultsLog; unsigned int windowsCount; unsigned int fileVersion; }; OriginParser* createOriginDefaultParser(const string& fileName); OriginParser* createOrigin600Parser(const string& fileName); OriginParser* createOrigin610Parser(const string& fileName); OriginParser* createOrigin700Parser(const string& fileName); OriginParser* createOrigin750Parser(const string& fileName); OriginParser* createOrigin800Parser(const string& fileName); OriginParser* createOrigin810Parser(const string& fileName); #endif // ORIGIN_PARSER_H liborigin2-20110117/Origin600Parser.h0000644000265600020320000000375111523526505016314 0ustar andreasadmin/*************************************************************************** File : Origin600Parser.h -------------------------------------------------------------------- Copyright : (C) 2010 Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : Origin 6.0 file parser class ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #ifndef ORIGIN_600_PARSER_H #define ORIGIN_600_PARSER_H #include "Origin610Parser.h" class Origin600Parser : public Origin610Parser { public: Origin600Parser(const string& fileName); }; #endif // ORIGIN_600_PARSER_H liborigin2-20110117/copying0000755000265600020320000010451311523526505014705 0ustar andreasadmin GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . liborigin2-20110117/doc/0000755000265600020320000000000011523526505014050 5ustar andreasadminliborigin2-20110117/doc/Doxyfile0000644000265600020320000002114011523526505015554 0ustar andreasadmin#--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = liborigin2 PROJECT_NUMBER = 13/09/2010 OUTPUT_DIRECTORY = . CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = NO BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES ABBREVIATE_BRIEF = ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = YES STRIP_FROM_PATH = STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO DETAILS_AT_TOP = YES INHERIT_DOCS = YES DISTRIBUTE_GROUP_DOC = NO TAB_SIZE = 4 ALIASES = OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_ALL = YES EXTRACT_PRIVATE = YES EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = YES EXTRACT_LOCAL_METHODS = NO HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO HIDE_FRIEND_COMPOUNDS = NO HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO SHOW_INCLUDE_FILES = YES INLINE_INFO = YES SORT_MEMBER_DOCS = YES SORT_BRIEF_DOCS = YES SORT_BY_SCOPE_NAME = NO GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES GENERATE_DEPRECATEDLIST= YES ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES SHOW_DIRECTORIES = YES FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = NO WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = .. FILE_PATTERNS = *.c \ *.cc \ *.cxx \ *.cpp \ *.c++ \ *.dox \ *.h \ *.hh \ *.hxx \ *.hpp \ *.h++ \ *.txt \ *.CC \ *.C++ \ *.HH \ *.H++ \ *.C \ *.H RECURSIVE = yes EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = *moc_* EXAMPLE_PATH = .. EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = NO IMAGE_PATH = INPUT_FILTER = FILTER_PATTERNS = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = NO INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = YES COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html HTML_HEADER = HTML_FOOTER = HTML_STYLESHEET = HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO CHM_FILE = HHC_LOCATION = GENERATE_CHI = NO BINARY_TOC = NO TOC_EXPAND = NO DISABLE_INDEX = NO ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = NO TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = NO LATEX_OUTPUT = latex LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4wide EXTRA_PACKAGES = LATEX_HEADER = PDF_HYPERLINKS = NO USE_PDFLATEX = NO LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf COMPACT_RTF = NO RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml XML_SCHEMA = XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO PERLMOD_PRETTY = YES PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = PREDEFINED = EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = YES HIDE_UNDOC_RELATIONS = YES # recommendation: install graphviz and use HAVE_DOT = YES HAVE_DOT = NO CLASS_GRAPH = YES COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES UML_LOOK = NO TEMPLATE_RELATIONS = NO INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES CALL_GRAPH = NO GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = png DOT_PATH = DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_HEIGHT = 1024 MAX_DOT_GRAPH_DEPTH = 1000 DOT_TRANSPARENT = NO DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = NO liborigin2-20110117/doc/liborigin2.dox0000644000265600020320000000367011523526505016632 0ustar andreasadmin/*! \mainpage liborigin2 A library for reading OriginLab project files created with versions ranging from 6.0 to 8.1. Any help from developers interested in working on the import of files created with other OriginLab versions is most welcome. \image html images/origin_import.png \section license License liborigin2 is distributed under the terms of the \ref gpllicense. \section platforms Platforms liborigin2 might be usable in all environments where you find a C/C++ compiler. \section dependencies Dependencies liborigin2 depends on the following libraries: BOOST C++ libraries (version >= 1.33.0), tree.hh and an old version of loglite (provided in the source archive).\n \section downloads Downloads liborigin2.zip \section installonmainpage Installation Have a look at the \ref projectfile project file in the source archive. It is prepared for building dynamic libraries in Win32 and Unix/X11 environments. If you don't know what to do with it, read the \ref liborigin2install file and/or Trolltechs qmake manual. \section relatedprojects Related Projects QtiPlot, data analysis and scientific plotting tool. \section credits Credits: \par Authors: Ion Vasilief, Alex Kargovsky (not active anymore) \par Contributors: Stefan Gerlach \par Contact: Ion Vasilief */ /*! \page gpllicense GPL License, Version 3 \include "copying" */ /*! \page projectfile liborigin2.pro \include "liborigin2.pro" */ /*! \page liborigin2install README \include "readme" */ liborigin2-20110117/doc/html/0000755000265600020320000000000011515047264015015 5ustar andreasadminliborigin2-20110117/doc/html/images/0000755000265600020320000000000011523526505016261 5ustar andreasadminliborigin2-20110117/doc/html/images/origin_import.png0000644000265600020320000015772411523526505021670 0ustar andreasadmin‰PNG  IHDR^È®þØ pHYs  šœ IDATxÚìw|Åùÿß³{EŲ\ä"WL¯¶1„¡½C!„$@¡0å‹ ìB€„œÀ7ð%Sbz Í@B5Õ±ƒ{S½»-3¿?f¯êît’N²%æýzt»·7mçf>û̳ϊ†…ÿ§*+"øžÄ²ÁoZIÕE»"„ €r£` RD*ôvÔ† ž!aÛ(_'Á²ÀdúkxCßÃ6M`è{Ç´¡o¡ìP‚-ùÞן ßCù öa H¸Ð‡Å_ ˜ôOÅð‘  ¢&X4œ%¾„m¡2H­pÎ%Rö‚§åÚÙŠÐ`ès˜‹ ƒÁ`èr^”J %%óŠ)-Ä2¿³™Y^°ßS 3nPq¸­ZV°ü¨­DˆVT´ªh™EF¡nÞÏ”/Jè;‘úÎÆä÷¤1_ ƒÁÐW Åé{…¹ê¤ŒêRZgýi3ßpq•(Ú\ÅÌ×â¸R€§[>§ïåªS†1¢.ܵ´¯ÿŠ™O­Åõ8.â­àµ¢ñè?²Pó•$”ˆª ±¥raRpùFxúÊXr ¦_ INß7Ê%Gæ¦Ç\Ö4z´Äq\OáxúÎB'°Û$åCÜU©í¸±„˪î½xHÉ]¯&º'm%¹ë%œ¾O”ÛŽi¥á/—³rýdk *Gy.ÊutâžèmþRNàIïûH'ŽÑÜ3¦ß ⮿/O7LÜËA0üaň¡P]UBö,^Ѱ^Éø\Bi+–P°b¼÷, [`Òä´…+Óº•)¸ û–ƒÁ`0áeè{]ç‘1\úç# B64´(Ö·h7'ÇUH©=| Jë+|Ž¢5M­> Ôð5³oÞ…‘g-í¾´þN{ÖXÖÜt)öÐ;„lnÀoZrà8¨ î„] <åû(ÏA9 T¼¯¥‰õ , ×0aæ;Œ<âc­] ZÀZC–NZÑ6¢+éb)3ŸP5ûFà|`SøðàFÔøÉú»Vð'ß:ª0îš3A C_g]³bÜpmk)-†¤Àl¥ÀÒâH)JaI°-AÈR„mÛðͲæ6KŠÝ’vÒJÖ¸ŽÐ¨qÛ;„…Aú(-e#”BY ¡@ ¬ôñV(Lóòo1$¸y1×Y›!¼T¬ˆö¼÷#àØ±AêèóÊW[ –½ÉæM1Ÿýà"àe—`)‚¶¯$f‰ÑÐW1Ó¯ †,šZ­²­ E, G[¥\O/úO¡Ð±³\?°RÀ±“7ôY¡îKÛOG°W-MÈæFD(„Š·¢1T"r”ë \W/=J_/?¢ô?Øïû`YXvpc¡ Z´õˆPšgÚò7Ù´ù1Î>v"ãÇŸÊA= öâL´^âÀ‰—˜Þf0 ÷ǃõ- Û‚–¸m•p”HžÂq á)\Oÿ—ÁÓ%¥J*,!‡D»ißtf´ärMúUKÑ´•ë ›×ƒe£b-Tï •;íÍò‹N×AºÊK€ëêÿR2ê94¿ð(ë’ aYÚRV€Ö@móô&¶H_é¬x“ÍšãW'îÄ;ü„÷ߟ‹žº®š WLŒ?žßŸ~83gN澇ÀöçÍlÊq5œºO%[Ök½7o™Çý¯Å˜öhSцZq÷p†±õ÷©ý W±xµÏ?Þ‹sÑ}©ý‹ÿ4Œaµ§,ëÑŽöáCØzDˆhX°²Aò¿¯·f•+¿8°šÛϨeÞ2/Õ.ɺ}±ÔcâäUæÜ ´×G2Ïå¼e[¿²¬ùgöéî$³muþʲç[¨ÿ4Æ_­Üøûpnõt~™cZÊØtâÒ²æ™;n–4¶ôÂ'¬˜ôïÓ—cذ¸žE–Ž®›~9®OŽ«}¯œL¿,ô_!òöÇÜ´;‚'EÛ´³„—‹jmÛB%*wÚ€á¿{€¥g‰òpí×å:Œ~è_ô;ð8ÖÝq5  ØŸt.…pàTˆ®M\Ìo^È×þ„‰'"¥ä’'.aîÞsáàç³ÑÚ4R ¥§žz*'mó_,Û%ô+)âlÁ”cû1°JPµÏ«œé3 '˜rl5çìI•iÎô:þZßv ’•‹ßOmW×Oã’)Ï20êqááýøóýRŸ©³‰†UŸ½ØîI(”_G‰ÿ­ž­G„¸þþ¯©Þþ>׬g¯M\"‰–¢ß;l’Vê¿óe›ºm:âÞ§~Œåjï®R¬,þÓ0&Œ sýý_së_?cì`Á¼ß ìtýJíÓÝAfÿª\>¯ìùê¿ÕõÓxóùLæëÛoÔ}2·ÊÕG ¥“ïœd¶[uý4ª^¿·[êÚ¡±%Ô _ÉþýÍû½³ü}å|Ç D—ž¯ð|ð¤^êó¤ÂWà)…+EúåkÏ$ H¥Pˆìþ˜'íŽ7í,á•@:*¡—W\vZê³·?©â(}ð½”èXrÔÖ }„’ZOîÁ ô_‘Ún»ˆïë]»o;ì°Cz·ïþèw%¼¤”xž‡ÀÆ…Ò!ó…Åœkꈆ³_\‰fnùjO}¨ˆ†-ÎÚÏ&äk϶ݶˆÐ¿RP5ÿ­TÞÃÎXÎØï?ߦ¨·|5ÛžÓ·rž°[”H,Ǻ´æëvOB¾ü:3ÀF·ß_Á 7ýw‹½Øâ²8ûþò#¬–µE¿;~¬6G¾>çë6u{øíѰÅÇ×VöáUŽö.+yúȘ:½6Ã÷sÑãô?a!y8k’ìHý:Ò§ËMfÿ’5ueÏ·PÿmÝû§zw5£‡F©üæ“¶Oæ¶Q¹úh¡tróËm·ä«»è«cKOþ® %$œt¨_¢'ù_i¯ª@¦àF-p“±LEZ¿Kà„kãueŒï_cÿÉ­ìya+ß9¿…ñ¿je›_¶²Å/´UÞ´sÜÒU"Ž ÂHàû,?ÿ„Ôg#ï}¥|F=øNZt¹ø®~)¡"Óì¥"m®iÒD"ÕV*¥žçáû>BÞÿ}xø.°Ð’,mcÊ⥔Ò-…­k&|¶¥³:çWáïü ÌÏîŠñÓïõc“U„Ö~‰ûÊn©o¶¼<âÄU¨¿IjMĉ¹¦ñ0×Ìr¹ú‡‰†}óÎæ{·9æÃ2a¬Îÿ£Å'¯ ÌïCÚä×¶¥Ò¾úrÄxܰ~@løviøÝƒƒaM›I¾©ÅãžûÞã3É*wfûT¬ú’øÍ Öà¥ß `çÍBô¯4Æ+Áw6eÕ5YÇÌmõ÷!¼ü‰›úî׫%¼àøÝ¢Œ©³hŒ)n|²•iêŽ[¬ êïC˜·ÌglM4 _¯–ÜýRŒi¶æmï»ÏªáÈ# ­m›O. ­£¥ó™é¶—oÚ’58UŸÜ>’IcLÑ¿RðöKg0~ª¾q¶MŸ›Žô§âûFdbåO–=áBC«ä“%>\³¾ÝöËì_ñe‡´É·³ç²”þûÒoÐÔ”@,|FîX´fn´ØcÜP›ÚÓV·[ÎöúE±ü ·Qö˜P(ÿBí_llÉÌÏßc|Á¾øå±e½Í=/Å9ãÎ&î>«†ŸPÁ¼e>[¿6•G²¿~½Z2ö—kJ±Ê;¶jÿdŸ½ò¡¦=Úʔ㪸ö¤jV6È6ã`{¿­ÌsW¨¾Åç COÓšP$\¥ƒ#BKwb©´úB‹ ”:•R e!SV©pÁ´¡´´|½Ž™¶è@Æ[±Ø!P ¤D ÅÒ_ň۞`Ôýo¦Êòͱ[cY ÜÝ.™l€ ¨QE¤Ÿ6…E*@Øà‡@Ù)á•H$x|òd¾sÅ$Þ„ŸHÓ”ðZRŠD"A,ÃóÒv?[ ©ìÔÀé7@XÄjj¢XË?\e¯zýά}U¯ß™][ð‹ƒõÛ¼ù«u8~[äX£ôùáWÖð—>`ÂØï\] ¶È›_ª\x%ë6ãæ7ðûΜLà_ÿ;µïÁ úðù+`Ävmê–Û>ÅêòÒUØû0_,ŽQ½Ó,V.[Çý›ˆ8Ym’ªcN›î¿}˜çÞmàšÛ?cLÅ…‡Wrï \s÷BúW .9.~N;I^‰h]G"0³o1 %Ý~N+Ø!¶•Ñ¿êÆµÉwÇqú\ÿ䔌þ´y%ëÿÛn™ò¦Ÿ!4ªë§ñÏ70q|=þÈŠÖ;wû´³gqö xcvL·ù±ùÛüñöÝc³ûŲÏJʯ½6jÝ÷œ¢ùkÿ|ç½X~iÿ®;õ~;ÄݯzD#6·þrÑ0üõ‘/aÄöÄFnŸ•þ¡Ò~c[Ž©L÷ÅÌWn;dî[öYÑ:î¼Y0¶ì²n\zlñbEÛÿŒ{b4¶J¶Ù²»eMjÕãÙç#ë6mSÆRûcÑúæ«§yõü ºÁñ~àÓ%e0ýYÚõ[Ø ½!BÚH£BÒÑ\®/ˆ!Z,m­¼ÛO ¤­—ü´€s]¤çèpÏ–ÒqdzY]lÄÿÍŲÀ²BH>Bê%G!#”Œ€îºt"ªÆBUiE–³ð¨”âã?æñÇg/`*°5:l*>°<-¼æÎË{ï½Gss³¶x‰0ˆ0"lƒ²ÁЦ–w~þãR ø‹ƒ*SKb;Ä‹–eS¸ýgU4´HfÌ\À=ϬòY›ã£›‰ZíLØXË?/ù‡ª˜zåûx“ö' Ú¦›’™N_úIª -˦Ÿ½uº «æ·I7ó»bÁ›yËqãl‡¦sÏÚ•ÏnÌEïGbàÈ6m·ø¶Lkóäë¨ÿ@:ÝÅÿ.)߬¶8²Ýó~Û6ýuœ¹ó›8j× ¢±õªI“^žó‘[þdÿº~ê\wưTŸ Þ,Ú~múW~ùÚ´Xÿm=à|ö½C/¯o¾é ¬–5^É29ýꊶyGúE¾íöÚ(³ïäË¿hÿÍsÞÛ˯õ€ói=àüÔñ=èðñ"íÿ:÷³\vé£xãv)X·¬¾XDx[ÚÔqåüì±eð@˜XýâƱøÖ ý__Gõ9íO˜§?”ÔÔD¹ÿ¢¡ô¯,YÓK¬ÕCƒ¥£ô+«?ö«O—aÙç´}|]8«Œétr1¯ óÒ‘äÁÝ‹žTHTÚ"•G!RˆPà”a‘r¤ÀW"ç|¶M›LkW‘´üi‡"©´•›ÐQè]¤‡R¥õ·>™êYËÏÜ'õ~èÌ!’â !=„ç`%-^‘ˆ¶xE* :’!µd(]±;Âg}Æ®»îÊ 'œÀœä¿ã[C–ðz›ÓN[Ïi§ÝÂ|À³Ï>Ë‚ P›ÚÏÇ¢úîÏ–*vÛL°÷îc¸ýQ/á»ÛêŠ.Z²FOÐB-ƒÜíLªë§¥Eâöâíp~¤²Í= /=¨$ÓK8>¬ZXr~Öé­T>{“6a±ï_˜õùW«F þzû1œø„]’öw?ˆ ÁüÅÚO­ܦ,»n\± µÙnEë’ï³Bû¼½6Iæ“Ùþ¥~7ßöôÙ>3f5ñÄÙ>‡ì5Œ)GÙ̘ՄÉ~Xû˜ÁúÌþä‡ÄßóÔçS¬} µ‡®dÂt3õoõ6 o\Áú§lÙ…¶KÝ—³}ã?<®=!̹gíª9WûÌüó¿P›ìÆ´Y>3jâ‰ó|Ù;h¿‡š¸þôYýË©ÜæçÌ6Iæ™ìOí•éw'W¶M¿Èñâó¡~|ÇÚ+Y¦"}.«_ìrj‡ÒÏ[ÕöÜË¿Pû»9ýeó»S"%å—É”£ÃŒßD“;l;ŒK®ûS_¨-ø½‚ç/çØ]7Ë[6Ù­h³ú‰eåø¨íržö·,~øG‡C'Z°¾Øyçí…¨-¾‹®()Ÿ„ãÃê…mòm÷óÍ#~W˜ƒØëWqÖ‘õ:ÞN/ƒ"”õãSíÄwmý~þ€­™i|°X ¾¿Þ~ ãôý£¹ËaèæʯP^w¼¢¸ù‡ŠƒØœsVƸmN_^&æÂÄßèÆ_ñÝ®ÃÎ׿ûæº}þ3o9jûï·ÉûŠ#¢¸ÍªŸCOø_Ôw~P´.oþG±ÿ6‚§þûþ9Ä—×…YÛ»OÓù7Æ %\zÁ^ŒØ½¢ð˜œSŽÜíÌ|šjÆpàv,V©|ÚK+·½ÿ6ÌÒõ•ì>ÍEí(Iø“q'›õÝ–hq{é{1éû£Sû/½`/®ú"Ôn¾_,Óß侓8ôâÇxM˜úZÁ°ó¦a§¬ ¬\Ðný³&H¨à¾,r÷ålŸ{°žxo½ó.›ú‚.óÖûám:‘Å·T¦Ûoï ýæ½È[”Õ¿òå[¬?µW¦=¶²‹§ ñá5ºÜó®Mí+Ú äY¬ÍÛëÅò+T‡ÜóU,ÿ¬þ›Ñþî¤cÛ¤Ón›åiƒÉ‡‡IxpןßáÌÓwæÂã1ý…Xa÷Ô%ºnóæ¯Îþ2ÅÜqQÜ!{l)VÇbcK)¿Ë/ì¿Mz Yîùˆ„ÚŒ‰é%Õ72êg’´J…m²ïðË{ů…’D WêÐÒSx¾hs>ó¥íù‰BŠô‹*'mWÒ6mÛ ¼îÑÖ.' …Áˆ;žN¯ÊŸ}B?‡P¬:m[²¾Å'þÈ(nÿ±MÿJ˜qï<îy®¿~3Df} S&°Ð¹ åýïI‘ÁâÝy ö;|&rì„‚ùuôuçë>×=å²b­Ã­g@ÍŒ0 ZðÁ§k¨Xù¹®ƒá;T.x‚mGŠ´¿Cm]V=[–Maò¡6oÍóØä»£¶ØÄ°1Eëò½›\^cÒ„zÔÌÞc)k Bðô'’„+ùÍ¥ûòÝ-‹·i±íd>»í2šÃ'X$\ÉóÏ~’ʧ½´rÛû­…z°U3#¬l‚¿]·UNïxËܯbüæÒ}ÒOññ"=X]KX¶¶›ïŽ×¸,YårÈ[Ðð§PÑ~ôè{’DÂEÍŒ0åH›wøìvÀÝÈIG´[ÿ|ý©½>ÝÞöú`©ñܳv¥eÙZ–Maù3{rßý ¶_¾þ•›n{¿bej¯ÿª™¶®Ìý*Æ„=ÿ„ÿývûa¾ÁâãEŽî§£¶iÓ§Û[ ÖqÕWpƒäÕ3Æ–ZÁó¯/£bÕWLüdî¸nÿj•Z3º–°“lþ—J_¼‰šúÔºð]*ÿó&`³û4™ÓÝGï˜åÇ™®¯«ë[¿]^ÛÎùëšWy^z0î@ÜU$Ú‰µå+‘²TÉ`Û l\Jl/íÙWWðÌÕ•ð[uòÄž»Oïó¼ Àª—¹¬T´œ(‚±+F €•PcC4„6"ÒfºÀT§Þ½†“6ŸÏ 'œ€ïûø¾Ï§Ÿ~Êý//â›?AŒÚ/݈r”A¥DÆ] ¡D öןpÆŽë¸áÚƒxûÝ%ô—:¼hú.¥pà ì—îÑ>Ç^@ÅcÓSÛ™ï n^‹=÷%äV{à Iô¿Ÿ!ÞÕæB¹Ç‰8÷(š_g%Z°—ýñþìÀ*±r̸ýi„Ïþ©žm¿«ëôá3°ð}Ü#/ÆE³ê À¦“#·Á²I¶oN‘ºDV-ÂúæsXø>l: o›}RmnXýÙk°ljÒa©rækÓö¶#«aÍÿ,›×&Ÿö¾›ÛÞ™Ûjë½ð7Û9«?ä«»ÜãD„ç"Þ…ÐÙ¸ýµ›/@ô?ï æ¾›NÒmTàœ'û©˜û"Ôo‰7±m;¨¾þÔ^Ÿ.¶}ÑÝSØ¡ÿ:~rÒSÖ„ß\º/ WR{ºŽ´ž¯ýòõ¯|ùëOÅÊØnÿ¨ß5z;£¶Íþ½臅Î[{m^¬_í÷Ú(ßù*”±þ››N{ç$“ø±W¤êåðsÜÚa©ôÔ.ÇÐúÄvi·‹ ?«]ŽÉjëLJ[²ê¸É$Ü-÷ÁjëZÅêÅÚßjÑûm?[úÖ{#w9|ë½ÇñöÿNõ ~w‚àÂyàÎ~ L|Dº|•_ê11¶ÕwÓå Ò»œH|Øæºmï²ÒõÝd,z¹ÓÑYéeÓzÄÿ³ÓBÝe1ä¤föô«„Š„lÇA m•’\!p$8*TžÀqNÜÇojD­üùÚ~ˆ3e÷¥}ºžº?½‡`×DTöÊV ì`ÉQ%íq¡\„t^á;à9àÄQŽƒ—phlõù²Iqô—qD³¾ S¹ú¦ÄÄ|#>PŒœ^¢"Š%*d§„—RlíôWcH IDAT6g*GÕÏåýÕ,ýS¬Ñû¦;ð%ó „ù×ë§i“ãÙ{zœµs ;l©ãýØç˜i ¹|5M0¬îx¡… ÿQÅ“g Û^;ForÐl⻟`é[ˆÿG‘]¹`ì‰26Æõ›NO‰áî¨oòw1÷³ìvÀÝm›|[úfí1ké_mѯB kq$øèðJ¾¥½›\„FRèÇyà8 ×ñ‘M°æsÔ›¥ôAw¤-N=ÓæËÝj±ûõǪ쇈Dva måè;•‡%]ð„/W?BÈs\b’/›á„ùJ /Ðâ«ÁçóüNMR),Ï×wÃøJߟiƒŠðWñ4Àf¢M, akñe+•_¡lñ%2JyÇ;aî~£{Ù§ˆ·gQ$Nœbz­¡w]ÝyÝ{Ápýspö.­üâ€JÎ?DЇ¹‹]vÛí÷¨­÷2'À°Q3áZxøcØtR§EW)}êwqÀݨ]Ž1 ¿YºÖgDÿFV5€r ¶ ñ®¤(K¤¢Õû¢ɋÀ·KèðYŽñÆÖ©îO;,ÀU,]ëÓ2hjÝ*pv$¤ŠÐ/¡tx åcãa#|”ï"<åùx®¢ÁQ?6+í,­”kñÂ!ÂvÊ꥕À¶Xvú.Œåt¥²ï%,dñêî Ê`è«Ø^‚Ðòˆ%Ÿ¦–ºTÝØ‚ËJ†o¥¸]l eT“ïߢ  A9ê[ñØtó»ØHøùN1~¹·Ç¦|Ì7+š…£!±H¥ýÈ:œƒ¯ÃŽ"•…ô}ó 幌ìòø ;sû›Üó^e÷¤ýz”»Þ­Wqæîq®ß{>sÎû ˾!éhúÂ)±­àÞÊÇV>BúXJâû¤­$ޝÃDzÏ3ååqÜõJH ¯ ‹W ¼€ê”ðÂ÷Àa‡¡$•@D °$VZ}ùª°¨RÁ­Í©€bCÂ÷mÓƒÁ@ÒÈ#9ý; îüyׄöÒµ>W?gæ¿¢¸Ê*Ú´2óí°NÛ ÒÞÍåÎ_Öt-í5>W?ÐÌÌ®´²}¼Ú/+®ïl %'’ ®WÈÂŽd Íl"ÈaS”këú€2ÚËÐç0ÂËÐ'/)Lú^ oF8¸Pv‹ômßK_sd&¤âêç\kË`¿”t§’ ¬À·ËÒ‰T C°“ǹ>b§TŸ ŽYn<ýyf0ÖLa¥òl‘ýÞ`èƒ(e| }3bú>”4ZÛ9ÿó}–ïØÜ§VeëW@k#„ „‚h¡v—:W­ã¿÷Vš“c0 ƒÁP&êN¬€¥Ë1³2 ƒÁ`è!Œð2 ƒÁ`0ÂË`0 ƒÁ/ƒÁ`0 ÃÆ ¼ê†m½QTlc)‡¡÷ÐWúŒéûƒÁЇ„Wݰ­Û¼zr°/”{“P¹Ë—›^O·CGÚ¨\v¡:oha±1Ÿ‹îQFX Cï%Ô™/­^ñEIûº‹ŽäÕ“åÚùå›”;[†Ž~oC×µ·—Ï`0 Fx•uÂϼ2ï‰I°u ™wòóî,K¾ü2óÌý<ßûžhŸÕ+¾Hå™ï!“Ù†9~Cˆ¡Î”¯Xß-åÜmÈ>_ì÷g„¨Á`0ôbáUÊ€ž+$Ê),Ú› M¨åœxò –žª)åj¯}Ú+W¡²ªC¾ãK9'åjûb碣åëì¹ë®s\L¶WÎ Ñ ƒÁPfáUêàÝ]¾(½eò(Vÿö„B¹Ú§½ôÍDܹóZªàîŽþžÙ¯Œ¿—Á`0| „W_H¦þ†ržïžXÒ6}Ì`0z'=Ç«/^™wÄb•Ï7ª£i ·}O´c©yn¨si¬_ƒÁ°ñÓm¯B¾FÝ1Á¬^ñE^'êBåÙ¾V==ù抄RË“ïØŽ¶a{çdcoå:w=}¾K)ç†èƒƒÁ`(Œ þYMí.u4®ZÇosM«|ËéN'q3ù÷þóh0 †ŽÇ§ÕCÓ XúAÇ-^íY•zb2Ùùolåè “¹Û¥#V´Þ~.Ú««ékƒÁл0/ƒÁ`0 †î¼ˆÎ°x™‡d ƒÁ`0ôFx ƒÁ`0áe0 ƒÁзhã\ÿê+ÿ4­b0 ƒÁP6~PXxwÒ™¦} ƒÁ`Øxô¡»Ì¼ÜøKc¶ðÊ\o\³òKÓ@ƒÁ`0lD˜¹¹·S–^¬{ŸÕh0 Æà«Õ’÷æ-çë eK³®¶Š¶Îv#£¦ Æ/ƒÁ`0ô)>ý&Á7«´ëŒ«¯+[º+×5ñÒ¿uÐb#¾ ÅÜÕh0t# |nÁœ'ÓGz¸ ßûr9ì¼uYEÀÐ5°óÖ¼÷årÓèæ7n„—Á`0 «Z:°¦[Ò:°†Õ ­¦‘ Ý'¼V.]Ëœ9s±­ZÓZƒÁ`0l`̼ܻi×ÇkÁâÌûâs?êxÖ¬,î¤XêË»ò`_“‡É£·æ±±Ó•š_wÃ=<>û9â-MÔ„‘ J¡”!@R2ãGJZùôóÜüÀó|ðÚ³: Á˜š ”ç"= Bà —H |½íù’%­.oùµô½3.>½]ápÙ%çñÅÿa³Í6ÀóôÀ$¥Âó“ï%±XœD"ã¸Ìzüé²·QR¤&Û¨»Ey©=}1ÒÙô×­k`ÂŽGàº.RzH)‰Çã´¶6³hÑbN:éXþñôóTWÆÙo¿ƒ»Ü~ï¾û£G **ÒSÞm·ÝÀé§ŸCÿþý7è9êL[vt^îN”Oèû¬;.–nœqU—.Ì6:á¶Ê®¨ÿòà¬nŸÀz"ß_ÿû>‘Çk¯ü­Oœ¾’G.ÃGnŸz¿ü›OºÅ¢•o»#‰BÒÒÚLcC«×.£B" P(⎇-¾ë¡¤‡Ûc•UÅÚ¡[±¤åsb­±’òI$x¾GSS3R¦-hŽë¦,%®ãâù±Ö8ëÖ—gìÊm‹\ÁÕÕI·ÔVî¢Kõ-åB¤# ºõAÄÚ5°b%紴¬·ÀsÁqÁqð|É¢U«øâ¬_0jÔ(¾»ïA¼øâl^~ù9öß¿kâkÍšEì¼óø¬}'ž¸sæëÐñ™—;*LÚ>ÅÄNW…Pòû±xõ&ñÕ®ðZ¹t- Ã^{î…/Ë'ÀŒøê[â+9¬Ëu>2üÜüÊyÎ=!@¤ó(EteŠ­ävîþR&ÒÅ‹>fÌØñ|½øã¢B¡3BB)ð‘D*,Fî}cG ×sVpª|ßÇBOcR‚”Ô,_ɯ½O“ç—,*¤”TVV²Ûî»·¨¬]Ëo¾“%κjÈl“|Ö/€Á9í¶¦Œ}ä­7ÞìÐñ{ìÕõ<ó‰«äÒ`Gû¿ˆÇàßïÁªUÐܱ88 pZQ4#øP@CÃZFÅ÷¾w/<ÿdYD«R~†  6˜ÔQýËG)¥$JÉ`[¿¿ä’[Ú^P¥³óò½¾µ¤ã~ú³s»$äÊáÐQ‹WW-l•ðêεäîœÀ~òÃcò’F|uøJÆÝ}>2ž"Ë7¤œç|™Tr IÆvC¥+®’¢«3$Eט±ã³DXæÿä)ìT½|…P4ˆððÙWèyø ËHÇÏñÿjG{+–¿ݺ,Ë*›ð*U”e ­Á=b+?™Ö®ö¬^4;AC$ð%(-À]  Å"¥¨¯Áå—OAJŸ~ýjèß¿†gŸ}ŠïÿˆÎË.¥‚>&ȦDŽ8K .½ª—A•ÒïKɧ\·»æåŸþìÜ’؆²xuDÄõFÿͲûxuT•ój¬Ð`ÑÑN]*¿¾ì×Ý~‚z"}ö;¥[Óï®ó‘™n¹óhâÁûx7×£#K‰]@‘•ï?ŒïÒùð<Õ«W‰DÚ=véÒ¥XBà{J–jñÒÇ >¼èq‘H„ áû~ÙÄH>KW>ëàà<°5½Ð/°˜µ+³MJé_<ûÿX¶´è1­¡güè‡|óÍ78ŽCkk+555üëíÙ]¶xIéVê‚ ,ZZâ|öùJ>øî'+V¬ B-âðïOdÜ¸áø¾‹”É—×ávKŽÅöuF¬•:/?üÈ“œpü‘Ý"¾ºËâULÈ%EVo[Zì°ð*·W¹&/mé€ôzFÛ;cz£˜èî<ºK„¶I7¹Y!²·7b2~N7æ3|äö¬kX d`ÍöE­_]ññÊYc7IЬìÿùü™J˜×¾Ä—>Çgܸq%õ™Wþõ)Jz¨R—ËX{¯††&¤”XVyBó‰ËýlÍŠ/²ÄW¹D×{íÕíý¾Tk×[¯¿Å{ïÁ[¯¿U²åwȇ/rzðþïÿûì{<ñxœP(Dÿþýi¹èb*o˜ã8ÔÔÔà8–e1pà@\¯«Wþ*ã¥-]ÍÍ1^x»™–ðvŒ_ËØÁ ê*büû³U<ñìË}ˆÇÈ‘ƒÒÁ÷ÝŒ¥ÊŽ[½JÝW*]—{“Å+Ÿekc°råÞ@Б 6˜Wy&{H›ŠEQaÑ™e¡ŽŠ”5¬¼”âµW`Ÿ}O.ø¿®þYK™«Œb+³­ºrµØ AuðãP€ <$'u›hÔ¢ Ö±®i`ÖvòÿÀš]Î%WtMÚþwJ9&9­¹R Û,[¶¬¤ó²dÉ@«ŽãJ*ÇÍ+È,¡…V掂¤ø*—èê ¤ànoLÊ]{ì½G§óëׯB***:t(«|—P´‚ʪJÂá0­­­xžGEEEêîÕ®\Äê¥F…R!$Ÿ|¶‚æðx¶¥¾z-µUŠ•+¹÷¶­?ˆ{u_ÿúÀ ,_ªÃãTg…Z9æå‡y² Õ«\Ëù¬[™Â£˜0ëí$ÅeÒú–»Ý%áµ1Ç ÉµxûßYCÏ&Ñõ,J (éýÆšG’¤¸Böàö^{…Ôþ•Lq—Ï\_.1¶>°rÙAïñ€–n­Y~±•ý¿ëäZºJU%¡¶ÂjÑ¿²ŠAƒµf¹=«©¹©@únÉâÜó<*++øäÓ/RòècÿèÔÕiO‰¯ÞBݰ­yëõ·J³¼eˆ®®ˆ¯P(D8¦¶¶–æeËkÖ~öy*N>)e©L$D"<¯«KÆÉ¥Æ4-PŒ?€qƒÖãÆ<úõëGs³ „©®D$2œuëÖÒ¯_)]”òJ§º›RæåŽ?²àRc¹DW±¥¿ÜÏrß÷:+¾6ˆW‡û’DWþa¿42…N)ï7Ö<„¼öÊßÒ–­<–/‚¥ÚÎ,Gæµv%Õq¾eǘõ@,ÃâåÝû€l‘¥Ÿt20C”iòùwudé1St•:9”Ú”‚„+ÃÇñð‹oà%žGI•úå%^ù¬]™+ÉßMg~?=íãµ±Yξµ>^=añê $­]$-\¯ÐÖ·k¿SzìÆ„r×-W€u¥ Áµp½ÔH`ñŠMÝlñêNÑ•¤œË‹m ÇqX¶ø 6à³Ãø‰T÷«!ŽàKŸ–æfZ[›Y¾ôæ,ZÀ ú1dÔ¦D"¡’Ź”©t,¯ªªÊ Ú÷’‚*SXz_6D/€+®œ’z?ç·:e!ËG$AÁúë¦ýõ…„ÇŒ¡C'œ@óÚV½óîc³²óÓUñ¥T2L„ÏV£c,kZA(4”h4D"¡¨© !D˜%KÑØ¸Û®ÃóÜTh‰ÅâÕÕy9Óú›|Ÿü_ªëÉ»“ée¦»¡ïhÌX‚½ÚÇ«'DW>‡îbï;—ÇÔ½ï²Å+Ï8¥‹uékì"íÑQ”ÛæåŠ"CyÁ#Sxé8CÝE÷‹®ÜÇe –¯®XÁßwY·|1GœüsZZZx챇‰ÇbœyÖ9ô b•‚±õø÷'óITTã:­)K>—--­H)q—x<‘wBɽšï6¡™óŒÁr[Â{šÒ„ÔY²®ˆ/}MWüöNß¡r×ïÇñb-È–&<×ÅÚ|ÎÙgÐÔÔõKž†Åå—ߕЧE˜bõêÇxûm¹à‚³ƒ_¼ÅÍ7ÿžõ뛘8ñ ¦]óg"z¹s«­öÞh,^]™—ËéßÕ¯¾øœUããUâ¨7/5¦—OÉr¨ÏüßUSê$ÔÕ<Šíëj5B0íX&½ÔèûšKd™-ƒ=aé*8ˆPÖÿÌ÷`¾TX(¤ïS;`MMM¬X¾œxçÂK§³få— †ÒY¸às6Ýl›>_Ïu6¿ýÝM<ôÈ£ %µ5•„Ca„Ð!$,ÛÆ¶là8 V®^‹!†Œ›ˆqèßeÚÕç+ÏÓ·¥ôdÞ4ës¦ŸÕu±öÛë¦2ïå먫rxéSxg¾¾@¸âÎǹð˜ž9g¯¾òOŽ;é̬ù×Ì˽ïwVwZ=´¬‚Eoôv/ƒÁ°10°¿Ïô«ÏgúOC¹¹øò©Üˆàá{¦²ÝnÇl4å2ór聯ûx ƒÁMÿª -1j«»rdòåW1ùòô’WCKŒþU‘ Z?3/÷n,ÓƒÁ`èKLÚªž§ßú„¯–­.kº+×5ñô[Ÿ0i«zÓȆN2M`0tÆwÇœ'ÓGz¾ 'mRÅW«%Ï¿3—¯W”Ï2TW[ÅN[ g»‘QÓèæ7n„—Á`0 IÆÕYŒ«Œ0aبh#¼^}埦U ƒÁ`ØHxô¡»L#ôz~PXxù"ÿóÅþ÷µ­8(ŠUnóY$¤]Ŭþw¬8ÒÜ™a0 ƒ¡“H¯ýX€ÊóÛìsƒXŸ2î²nm‚íÓ6ÛßÛ‹ÚC°¬p§Ê¶níRø ……W.3gcèØþl»µM¨&B8"¹ºmG´àª¬°.| ½°¬ÒƒJ©L¯1 ƒÁÐar5—tUJ“H·°¾ˆ¾£Ÿßéx•ÄâÌþd+7rúa_ekYa–­óYÙNÂÇq$ž_‚T_ê§UHi!•ēЯ…Ù¬>BCK¶u©¨ðzðùͽÕêê,BÕalË"¶±…BV®J¡ˆØa‹ ®$¶é7ƒÁÐ}ÖsqkèeX–h·ß*_Ê=.’Ö!^¸°&©pD,â@ µŒY Š*|~3~xЂ¬ãW6ÀÀj‹DÔÂq%¾(_!¥ÀË`¾Ž+Y°$ÁfõÖ—*¼fÎÇè­0¨¿B„Ò“ ¾”¸–ŽÄ Y8B2%Ä:ó0åIÓË ƒÁ`0tˆ¤Åª=¯­SnöÒ£‡K© 1rHˆ{ËO[œN#ᓈZH_âûZ`y¥Ëó)ðA¿W¤ Rk›ýÒ„×àaª• „q H|@„~°žh‡l\[lË å & «@- ½ …é·ƒÁ°AÆ_¥5…’ $¨@è&éŒãUöØè %•^+ÌÅ•„-‹ºAáñ&S–.ÏÄÚò–p¾Ì|V+XA¾Í1·}áõä+›3`€ ¶P®ÂG„õ‚ r@x–`øe¥R*ªÊ‰ë÷®Ã„ïíÌØ·äñßÜøzI”ïé‚K¤âØ?\ÊWo~Àûÿ÷Œ^z·,„eç¤]ÏKûk]ráeø™6H Â!Á™\šòW£€ÿzaá)å'@ßž x*[úýƒ˜^ª@2¡¢KŽ‹9ùÞˆ/C—d—Ñ]ƒ¡àùzIOÉ œdü)ñ•`Á{Kiÿ­,k”(œ6ÀY×­ÂóTÊ’æI•ò›òkÚ“7 CæK;G¼(?ˆ¬}>qåuíYZ|Ýx]x#ÇÞ|iZt=• øÂmŒ]™X¶Äk³ÇÍÂÌ_×w`æ’|e7 („Ôw?n3VK¬þÕv[á•ïÖx˶A}·€~æP>Ñz©±Ð²cò»Yq¼’ÉYí,Î^‘:æþÙ+Ú~Ö‰ýéJšÙÓ`0| 0É6ä1€$}º,K¥âŠ*¥2æç´éIeXœ”™Š %ÛQñ´)1m€Ô“w2ÒNÞȇå¹ß×wõJQ¡˜uÅŸ8fú/8ö¦É©âÌúÕ5ˆ”Mw8’t5© ¸‘¼ñéröÚn8›Šv¨™g½¹”}w¨Íj›âÎõ–@ØÉPa¢ è*ÄÄmÖç`"Ù²Á­§6,m‘Ê#œ ûƒÁ`0”ˆ¹È4äQ^¾Oê`Q©(Éé^‡éÔ.V2ð™ˆW"_:|ƒLNæ©~Ö6mJMPB´M;”tXÖ.}¬¬’#P̺ü޹î¼T-¿`:"™_ZzeRÙå–*%À¬HáV:ˆê¶£ûñð?¿feCœæV…ë»8ž@(‰LŠÃ “_8d1¨_”ì?ܵY-_Px‰~£@ÓÈM™¢+)®>ü|@ÁeGae¯SªŒ_KX àoϬà”C†`Ç[ß;å!©cŠ—¹]h¡mƒÁ`0¾²K€D eRwˆÀ"¥]Œ’qµ’±9E z”@;+¡ÿÏ%Ô¡¬‚i§>h'meåKÛ„–%ý m¡´EË3ý¼¬z}óJ $À²­lï~ËB¡xà¹5œrÈxnMvÖÉ“—#Œ mwt¡mƒ¡T”4Ñ CïV^¾ø*Ó_K¤ SX*%Ž´ØÑV©äj• ž{¨Úâcµ“v°¿¤´-Ñ6m‹´™LIýJ‰/‚£¯ùeªO\~G]w!‡^?™g.»^?¼ZIèBi!˜¡„,ÏBÚÁT»¢KÊ –s,^™Ö®?Ðæ½]vàóe#l‘'ðªNïÁÖròÁƒs‘ÈúßÞq™û|amÞïgnÿðÀA©ï=øÂZó4t|̲lÓ†^t¡`|¼ ¹ºKߥ˜GÁÝ—.xüñÓVkad)ÆA*¤Ô>X*)ªR¯¶i£dYóf”õdÚZý7m… "ãûÁ+ˆH/਩g¥Êúä”[Bðä¥7räŒÉ„++8òSyê¼+µ SII'uÚ"KØ@BÛŠìp¨[Ú¾p8‰d /,战L¡z©1¹ì¨”Þo7*-%-¡EOrýV?Ä(-–^Î?v°/gnËw\›ý™ûró(r¼Á`0ôÙIÖ6>^†ÜN‘ŒÏ%°s÷—÷bSÇÔRR€Ì¸ÃQéeEa DXM[¡W»”H‹®T˜®dÚ”DYië2ë”RG¡Ç²A ޼:mézòÊÛ´QLè2ÿãÒë8|Æåq˵<õ«ÿÁ"ˆ‹jc -[D¨ûVÄBíýX“ñ¼¬Œn®èjËJ6fÆ ,ã˜T ƒÁ`èÈÄ©C"xJñºQ–ȸ;‘`P!«”Èœ‹ ¤}Ï%ƒJ*ZÞ´Ã"X’©eF” ÿûSÆî¼Oýæ6*ý€l¡ï¢üÇ%Ó8ü†)|ýÖ¿(”’¥Å—.wFÞ>Ú&ü #¼´¥ ,¬¬‚]…ö K·“•¡,Ówt‡^_ŸW± ƒÁ` ð¼¬À“K›–øñõkux‡d´ô’›HPU©G)”i'"‘i™êXÚ¾J?ÑóÓ1IJҶŸs‹@xy¨ "þGO¼ÈGO¼˜²b%ƒ§f¾þqÑUú™?©ÜƒÐy–¥ãwëÀ¥-`ÚªË2)ó!Ú¹"Ì`0 CO*//¥¶Jù:<„%µ(AФ@ *<àZ?ZH*…’]Êúÿì½yœ\U÷ÿ>·ª—t:B  „%à„ Ý H7âF$QöÅ„ÇpæÑÇñç2:0£ ã€:ú›QH ¨!‘‰ šÉ“0t£ŒìaIH ’„,tw-÷žç[Õ]]©åVuUwUõçÍëÒ©»œ{ï÷.çs¿ç{¾g@x•£l’-eÆø=ÝXzã%š “9¸-c=ß»åzýãYÏ/Ûµ‰V8Ç`ÂfÐ?&”p<…Ë£SÂ\#Sx°YÒÕ˜ì–ô€ !„bø‰Ä=Æ5Fè‰ø $ä88‰`,›ðµ$²/àùQQ¾×˳xÉTqãF?ÖòÍ”­llj¹D›ÆAï~¿wb(‘H“h:ðx9X¿íг Eç 0Ï…ˆ3îà”LJ_1^žN)U”µðÏ÷mÅ„,Æ8ýbÊÉ3vŠ—’Öq2Ù¤7B!Äð±ñ­(·á«þJ÷¾ˆß¡.!\|mä$êðD ;Æoþó¼„hòs]oò¸|v Ïnîë¯ËËQvb^~+Êñ¼ˆ7~ûK"Ý{ …[ã ¯dãš±6Çåa¬÷…çƒëYlóÁóÑËØ°±7³vqF(Æ«ÿ\ÿd¬ëâXƒÅņKâgmœçÙ~wâ`u Ø’äU‰>„UÌö½1¬æ3½+‹·%õ¯=p~‚¾ˆËËoEÙÙïoj,uÙïì‹ùÁýÀŽ]qpÇó7Wfhe÷¹¼´9ÂŽ±Òœ—JxyÖÃÄ-x¾*u7fý®–q‡þdþ!C>mhÓWð|u*o—B1â+ãÿ¬¼Ô|¥*;S²ê··»¬ÚЩ¸éÇäoo­Åx´ÉH /·/ŠªÃóúGJ„’£zùGÛ?Æ’ÿ£ /µø]„B!r‰ºdð{š‹ÊЋ“"Ò¼ ƒa[ëA¢§¤ç¹¸±xYÎEcæ!„Bd`ßþÞ’—™Õãå™0Öð¾ñ÷ï"ÒÛƒëÆüµ,D#Xß0¦ÿßþ€’Ž¢aL¡PXWS!„Ç—¿ù*žgðÊ4²M éíÁ÷rûÏÿÀý«žãå­» ÚÉá‡4ñ‰÷ŸÈíŸþ ž[/á%„BˆQI°^žËí?ÿy¯ÌŸÆéSõc»vx}{w<ò2·Ý÷ÿü© du!„BHxåâþUÏqÃEÓi=á0Bá:œP(!¾rc­åÝãÆ³ðüznüé:nºnž¬.„B ¯ìâÉãå­»9óäÉÔÕ×SW߀ ç^v séÙ3ÆñòÖßÊâB!„ðÊ…I ´è„ÄÂõ8á:'‘¢?ß¶þ%„B!á•þŒ°Éħ=[Ž:Ž­[^Í"Ü$º„BQ45„ãÔ ¿ð²‰‘¾ý”)`:úøþådW⥠!„¢úpœ:ÞÚåòöˆF\¢QxBò¸ž?ÒÿoC,n‰{–éÇÖ1õÈz"Q¯xá•-olì_B!„µÆÛ{౑‡hÌõ¾cɺ/‘?îA_Ôy¼òF„©GÖóÚÛ‘â…×€ÇË#SÌVv—Q„—B!ª–·¶Gèë­÷ÇüñÀK(ךþq§û<ˆ»¬!”èÅ-=C^¶ʶ\!„¢Öp=ƒk ¡„ÈJæmp×¼žcš"Ó)8¸Þ&¦ÌÂKF!„µG8äO“PÛõÀ&ãÞ]C؃qL „6eʶ\!„BdÂ)Hvßµ–þß1S¦pÌ”i—c¬$™B!F=y¼Œ1sr½þúó9¶0Êå%„B ¯BV…êüÉ cLþ†E“\Ž’¥…B!ád%c ‡ÒÄæ}œrìx¡º¤++{D½ñSHã`ŒáùÍÛ9ü&Y\!„^¹…Â|üìùÞòg¸ö‚Ó9gƱ8&@xX¢™ñ…MÛ¹ýN.é˜&‹ !„BÂ+çJõ |ïsò{þ›/üà^Þº» ~H—{2ßúÌÇdq!„BHxå\)\á:¾ö© ùÚ§.”Õ„B!ŠÀ‘ „B!$¼„B!$¼„B!„„—B!„„—B!„„—B!„ðB!„ðB!„^B!„•JC*V1Æ >›màî–[®} !„¢1€5Á† ªtÑ•.z2Í+e¹åÚ§B!j›ª^ùÄNÏT¡¢IK!„£Rxå]òL !„¢R¨¹àú‘VùöiŒ 4‰/¾WFd ÙA¶jŽšñx%…K&W®õ3ý*ܲí3 åIx !„^U#º²‰› ó‹ñ’©ÉR!„…RõM…  Rx–$º„BQ 5ãñJÇZÛŸú!}~òm›mŸB!„5+¼J_5”fJ!„Bˆ hÈ !„B /!„B /!„B!á%„B!á%„B!á%!„BäÆZ‹õ,x€IL˜Ä°Æâ+á%„B1’Hx !„BHx !„BHx !„B /!„BˆÊ% PÉ#còŽXì@ØAö­ÜríS!„5ˆõ{=Vì Ùé¦aD¬ ¥ÜríS!„µMÅ ¯¤ˆ *À‚ ¸Lâ¨PÑ$%„Bˆš^¥@ž)!F'«W¯fõêÕ5ynÏ<³×^{Y¹lÑÑÑAGG‡.¤„—(…ÀK_„Å‹ï•1“XËÿ|}/¾@ãI'Ó0uê¨4…î‹Âm±|ùƒ<ýôŸX¸paÍÙ`ÆŒéºjÀ‹-â™g6°iÓV½'JÌ‚WJx•·~¶9…M¶eéóSõˆ%·É·~òŒ1³ Ñîn¾^c¢[8yN/`ظ¼‘Æ©­Ì_²œúææQ%4t_n‹×^{™3¦óõ¯]†5/ôž¨.j"„µvДkYry¾ßA„R!ë‹À“¥WÌeúì—¹þénο=Îù·Çøôún&N{ŒeWÏ“„BHx 'ù<\¥hö "ºDéÙÒÙÉžÍOñ[☔»Ó8pÞ-ÞÙØÅÖ®.J!„„W©ÅUR$¥þ;׺é‚(Ù ™my.òm›¾¬‚NÀ¦µk™:§wèJ_Sçô±iÍJ!DURñé$‚,+dÝBÖ)t¾(™ìΧÊe"!„U‰† Å”öv6>Òˆõ2^6>ÒÈu¿B!á%ÄÐiikcÂÔVV~5]_ú¯üéOÌ[½Jž.QXËëÖ±ùÑG8¦½£ÚÚ†5ö0WgžRTúÙʯVA4ç¢^bTÓÒÚJóÅó“OJt‰Š ²w/K¯˜ËÞ-O3uN/+®oâàcgññ%Ë©7nõŸöò%`„:ŠñÍØãgB$¢½yÉ}˜ù×?ÕÍù·Å9ÿ¶8×?½—ÃN~œGArßj|S“]+íð"ᣎâH`ß¾}2†QÞX·Ž½[žæÜ‰fLî»ë•'ÙÚÙY1b#×üô‰…’L&_9¹–gˇt¸·RÙ*Û1d;.åpE×k2¨hŽ<’#€;w2n›qÄèaõêÕ¬^½:ýøãœ9{Öä¾Çž¿ŸŸüÓ?aßûÞ@ûíèè c©QrÅa%ÅQzÒçB~rÅî'Ó>G"8=Ó1&mä¸P/ A/QÙL˜@³µ¼³m›l!*šL¹çʺ¿ ãÐf¹#›0Èô»PïM¶rƒî7_òëLžµrœLešÄ[ž/y¼Dec »Ø÷Ê+p晲‡(9A=O[žx‚×wa½½x½¬¯­˵wßÂä3Ψ1˜ÁóUúGÔŒèö…Ãá°‡ù¨xW‡²\c&æ*Wã4{ÇŽ¥÷ÕWe1¢ÕÖÆÁÇÎbÕ Ù“ûVèNq—ËóDeÛ.Ÿ÷l¨ïq!F‚Šõx}@Ê#«ÜJ‰K-ôŽOü7d1Ò/%>¾d9^=;f<ÉÔöõ‡±ªÔä¾¹ÞY¥|7Žd9A„a1u‹e^•x¦1–RÀeËMSÈ @kx‰L˜€}ë-BŒ8õãÆqÙòÿfkg'›Ö®`ÞÝééJ}¯_AÞƒ™Þ§¹>DƒùçEÅ ÇlÛ”£¹QÞ" zkk;ÆKž©ÚÀ=üpBo¿-CˆŠ¡¥­–¶¶¿eû0Ìôží£6ˆg(—ɶ^úòt1˜¯¬J­[ô1.Š¥ê…W¾‡~¤^d:‹ß«;2ƒ=ê÷÷0fÓ¦QkÝ…Ûâ™g60cÆôÚýnÎóŽË¶¼…Ã}<¥~=¿ ÇPÛ=ó̆’=ßzO °`Á•^Ã-zr}ÕeC™¾È‚~õûÒI/«Òo–á®`“öX¿ézŸ{–y£Ð>©vÐ=ܯ½ö² V#dû°Í÷A[ ^¨3¦—äùÖ{¢º¨ùtA¾´J? JϘc¥nÿ~BQUÂJˆš^C=åêñ(ÊGó 'àD£2„£P´TÚ±êÝ/jVxe«ÐÀΡÄåÛ6hà©:Ÿtuñ8X ê .„¢Š©Øªù†ÂȵnÐeùS®ý›0PNÓÁ³Ï¢J)!„BÂKˆòbŒáíPˆÝ/¼ c!„ð¢ÜìnldÿÆ2„BˆªFƒd‹ª »¹™ñ¯¿.C³Ð›>ÓüL뤯WHÈE®°BHx 1Âôh¼F! _Å–‘>ÔP!Û—bø5õµŽšEU0\/Ä Ñ2”áureX¬pª–!„ð"Þ¤I„¶o—!„ТªQS£¨Ž/„–þøGB”žÕ«ýi¸éèð§mÅŒ3[ª¦@åC^BT(uGÍØînBˆ"T¾m³‰žr¥¦/!á%D…2æ¸ã8Hã5Šr0ž§J_¥=¥LC9!ªÅx‰ª`üQGò<èé‘1„È!XF¢ %!$¼Dqèĉ¼ Á¶m2†„D—5&¼ò}}c2N¥Úw¶2˱?‘‰'ò¦µJ)!D ñXeZ¯PUÑ%!'jŠñ úòÈœYއ?W6h½,ÊËøñãyÓóð¶n•›VˆÄW¶žƒ™DZ1ï°¡ôLT¯F!áUa/bDT¦LÊA„ÚP{âˆòâ8;ëëé}í5ÆÊBâ*Ðò ëûžÊ»PïQ1j별ô¨É“K ªÔIÍ‚UY˰å‰' ±uùr¶vvÊ&BTÁû7×$Äè|0j,ÄH5÷›„0Å‹ïÕM™fÛ×Ç®Ÿ|›ðþ×éxo/cßêdéÂsñÆÇøk>ÓØ8*ì ³Å3Ïl`ÆŒé2؈~/É£ä>-Õó­÷Ä \YÑÇWóy¼²‰žLÁò…¾0’Û ÅŸZV¥ß,Ã]Á.øäÜ÷±s™1çν9ŠyøwËgWô²ê†ìxø>.]¶²öí û¢`[¼öÚË2˜¨xf̘^’ç[ï‰ê¢fâ”s øš>¥ÏÏô;èþôUW>¶tv²góS¾èr€#€·À8pÞ-ÞÙØÅÖ®.J!„„W¹EÖHl›Oä‰Ò²iíZ¦ÎéõEÀ‘@"—q`êœ>6­Y#C !„¨ª"D¾&½\Þ®b»KçÛVÝ ‡íNøçaÀNÀBýB&B!á5T éæ\®.Ñ…Î¥eJ{;]ÛÈì[c¾×+ l{8l|¤‘y‹:d(‘‘E‹É¢¢ïÏ… Ê£å¢KK[¦¶²ê†¬—˜y$Ø­°ò+ Lœv“gÍ’¡ÄtttÔl¥öÌ3tkÀ .¤£ÊgÅ– D%3Ér–]=;ft1uN§½cݼzúÚÚ™·h© $² ¯Z­ÔÔƒM¶^B”úæf.]¶’­]]lZ³†7¢ÿ†=á.ùå#2ŽB /!ÊAKk+-­­¼üÇ?òΟþ$ƒ!„¨Jã%ªŠ#O;øoຮŒ!„BÂKˆrÒ| ]WÇsÏ='c!„ð¢¬qS›šX·nl!„BÂKˆ²rä‘L²VÂK!„„—eçˆ#hîîæ /!„^B”™¦&œ†önÙÂ;ï¼#{!„ð¢¬y$x÷»éìì”-„B ®gp­ÄH*6ñŸƒõÕTbrÁb‰{™Ë©ø<^ÙÀδ^’R¥XÈ Ù¿qx…×9õõ<ñíosІ Lio§¥­MvBQñT¬ðJ6¥gC|Éy¹–‰òíîæ­—žãhg7G]£gûZº¶‘ S[™¿d9õÍÍ2’BˆŠ¥b›­µ=]¹Ö3Æ š†*ò’Ç&Fä¦`ésqŽÚÉœÏGùÐw,çßãÓë»™8í1–]=O6B!áUn²‰«¤(K Y¢rØÒÙÉžÍOqÔå.æÕ”ëïÀy·Dxgc[»ºd(!„KÀV¹éf¿ ^· ,^|¯îÈöØó›L;¿s ðPš8vv~ç»ôáÖ´tOÙA¶²³`Á•zdf@xÕ2A›‹ ÎOn“oý M¦•{³ŒÌK$Ýÿu+=Û—Â).<à6Žãpú¬÷ðÞ²c&;èždÙBv¨^j^xe=é= õ)˜~ø™ÒÞÎC×62û›1Ì~`pHâzz°ñ‘Fæ-ê¡jýcê‚§0&ä_÷Xƒ?3”ò!UßèÿnA8qÂ!L(„u-Ä=p?Ð"µ»w¼Z"/>ȇwŒÀ~Ch‹°ðá]rcFGpç³YøÈ_+¸"e¸—Ü׋$ÿê!‡úÄCu >ì/"îO±Äs_gSäLb"Û°«§Kx•ìþ‚è)…`’èZÚÚ˜0µ•U7>ÆNŽø^¯÷ú¢kåW˜8í,&Ïš%CÕ(×üòo¸æ—ÏPÔI˜±chnthhô— A¸š,ÐcïôPâ çÐTž'çÂQÖGÝ?%¾<ܸÿœ¦þÍGo,óü½ á¶{?tï€éØ{÷aŸ:KÂ+¨¸Iÿw&±“)`>¹^®eyzžm35aJŒ•ŸùK–³ìêy¼øÒZâ_wÙt²åõÿnfâ´³˜·h© T«/í¹Ï`9’pÓXâu.uŽÿüEú ¡z]hˆ'¾“#M~`'^Ðõ)oºh\öb8‰§8·Â¡Áóâ})Ë3?ŸN¼4µ‰¸^$¥,24Ì|7‘¿ö`ÎÞ€}¬r¼_+¼r‰˜ôe…¬[È:…Îå§¾¹™K—­dÏg?ËÎÎN~ô³×øáo+OW cÎ{ÆíÙC¬ÑDb»ú[%œº0Æ ƒ©#\&b-!ë^‡KÄZJÉeÉù Æ`]0Æ×`¢H¼¨ê…¬Nõ/j± þóçšÁîAÓëbbŠëâÅÂXëB,u.ÄÁÔ% ¬ &EÅ=;`ÃÐÓ7vNü÷B£Áœó víT /!Šeüœ9Œ}áÖÆã]£Øvhš€Ý¿oðçqØÁzžÇ©‹s9rÿÕÇ&I¾¦“ް8àxqL<Ä lו­EqâB&ÈN$aŸÈàç/á’ö,ú­U®^BÈö$æEñãJú= ‰»þrãÆ±nâéNÌ#d ƒ}}°é@ÂKˆâ9åÂ/½DOO±XŒºº:Ù¤1§¯…#Z€=þ 4IC]¢¢ àzXÏÃö’ÄÁI»'¼Á!Æóðb¡Á_Î"¥bd ‚ó¬/”¬‡Í ¦|!–ºAZ[db]OÌ[ðR::D-Äz`òá˜Ãcß^ á%DQL™Û·ó® رcGy¤lR«lÛ ãÇ`L¶¡)·PKy¹[b—Y×ÃXã÷pÄó{6&·óÔ\$ª:ÇrÍÙõ|íÒƒ™tˆeë îþõvb})/ƒ¾ˆï¯˜ë%á%ª“PN<‘3zz$¼j™½[á –lÕM fÝÄ‹8ElÙôç¤àr%¼šŸE IDAT²bå¬Tû\ÓÑÈ—/œÀw–ÆØ¹7Îþ>K_bqK4î÷(Œ&¾C’C_Ìöÿî‹Bo$ÆaM{¸ë‹Àõ¸su_yÊî\ëqÍÙüÇ…Ýì¹û6ÞÞ½¯g?6҇ǰ±¨_x<šxŽ}·—&"è]/ÚG¼¯—}Æ­·Üñ ܹ|Ç€èJÒ瀅È+^B ‰“OfƆ lß¾]¶¨UöÕÁA@ÜÁDÀ6dXÖ`…¸Å‹ %šã eðpy ÎÝ•êካ)MT'?úÌáüÃF8ú0ñGöì·ìÞï·ÎGcÏó[Ò]¬…˜kq]CÔ…HÔÒîž»ö„øäMøõw[¹sõ›å+{å[€áGŸ=œßù6á#ŽÆ´‹·on÷nl4Ñ(6‘oÂ]â1¬ëbãQl4‚Ó×û»aÏ.Ö}á“|íî®áU_狯hÐWQ×Kñ€¢z9å¦yž„×(Ásª«¡¨KôK÷_aí¯\‚½ûpÚ_¹„s^ºûãÃ8çÕ‹9çÕ‹á®IþߟNòWÏ–Ê8šrM¢¢ÙµÏÒPõu†pÈPö‘ºÁq !!ÇŸÂŽ!ä€c äÂÔ…üiëÛûhö+gÙîÞ]˜úL}=„˜p&†p8Öñ“'NØÿkpBýë;á:ömÛÊäÃêü¯³äZ}Â+k%—¨j×±}}¬•ðªml8õ~%·ÞOÒUÏÏ>?ãé9û¹Ïqì¢E¬_¿ž™»wðïEë×3sÊv¯iãõ÷®;pjbÌÄWEÛ§»Ç²·Â!KOÄÒHÔ÷JEã‹û̓®ѸÅâçÌŠ¹ /Ub@‡PòÃÄ —¯l7‘Ÿs7Þ¾½˜pÛ׃ôb#l4ŠE±±˜ßôè¹~ó#Öÿë&æ».8N(-;~¿{¼'q>õ^B”ÂãuÔÞ½ìØ±C¶­üt,[3g03ñ÷€¿þ: O;å›6ñº¬&jhvï·„Øßç§´ŠD­/â–h"qK,îÿõ£gyøM„Ö³8ÆP6yËþÎu ë=ŸÙŸ³l‹âíÛ NÛ»ŸæóæÓxúûÙö…+ Å‹E±ñÄbþ_Ï㨟­cßÊÙuç¿b=‹qL¸zz¶ëFT/ÇÏø={صm›lQ«8‡øÍñÄwbÈ ò,Ìœ9³_`­ÿîw˜Ö¬_?HˆðòÿùdìÏ'0/ù–¡eˆ !>‚¾×iŸŸ²*…Xl`ŠF}ñA$Qú\ˆ¸u qÏàa uD–ed–Le»&ExŰ=û±½û°‘§¿€#¾ý³„èŠBB|ÙX”£~æ{¬›gÜ_Èzê°vê3{·¼hå¼Öô´ˆª¥¾žžI“¨{í5Ù¢–± P—H#‘]ÖÀ=“àk_ó¯^}àvþßåËYxÚi/½ãooÍÍCMÞ•ów:ù–]C)CTᜀHÌú±äQ_(Å]KÜ…¸ç7õÅ=‹k!n-1Ï L®ßÒîžµXÌàóÉPv!d,{Ç+‚b#~³â_¿2gkòòÅ•ç‚çèžì_öÆ…ÓÀs16Ñc&9¢Lb8±~ñå6þ]!·ŠUKßqÇ1nËb´à:ýo­ToÌL ­’Þ®ƒÏ=·¨/CÈŒ×&jœ„ø{俲ÿ­1—¼™Ó3•º|ÿ[7š—m½LóÍ%oÊã%Jû>ŒúMz^Bl¹61µMä)e c¯‹ïÐòEQâ±2ú%WÙßÜG4j}ZÜ&¼g–ˆkˆ%z:¾|G±eÛHŸŸüØóÀuÙö¹‹9â{¿ å®•l¹ú}u_ç€èúØ þºÖóì-2në©´U!¼Œ19ÇFÌ4X5”f<ÅBÉÖø#ÄÉ'søòå²Ãh ¾^ªûŽðc»ò±|9‡’eaȯ Œ{€«çý×Mæ’í4=ú#ÿ÷[7b.ÙÞ/Öš",Ózöç‡ šßƒÊ÷ÑÈ bhôD,‘˜õ;û&„–µ6Ñ“×ÔöÆø_¬1~FkÁÖñ›ÓîÉô²ûë¼ËGýtÆ\°LþþÃÎqòýØvÉI`­Ÿ\Õ‚ñ\pÁxñç;ùlÏ]ÑzhÇ«äÞ©l¢Mž©¯‡O9…ãÝ;v0áðÃeZÃ6A]øÀ·Õ”)¬ß½;ûv«W³{õj¦ÌŸŸá…Q—øc±QüDŒý7TsUw¿H|³ey]¦ÍïùÀçüC¿gæªîþyæªnì=ãhZýýþuò–-ªwd½–‘˜?…?ß–1))Ç÷9'¡E<_$á‚Åô;3=ÏàÚ›Óˆ`eÄõóà²â ?¸ÞF#~¢Ôp‹_Gùïõ¯ºíºs8âεLZô$o/˜‰q,ÖuýfƸ‡“ôx™†oš06î_9 q«TýÓ^ V)„_1qhé,^|¯^^EØã\Çá‘Û¿CýßLÕv¨MN/šæš(M€M|‹šk¢4=|[âË><è÷ çC_´^r^¦õòm›>¿b©×{©’Iz¥êBYzø ªpñ]< æù©'¼¸%žôÜÕ‡s–w /Q–µI/Ø@Ù€ßÃ1½ìQg£ W¸0L¾ã7ýËÞúÛ9¾>±¾¼Û¾àT[üg_ö&otŽÇÆ=H65Ö§xµlÌ¿qǽM•ðùR¯blÜźq¬ëÔÉu)²&‡:z:OÂ+ˆ¸Iÿw&±“LïÉ›•kYÞ‡(϶™š0%ÆF†Þ)S·r¥ Q‹ÄÜ´÷BÂÛ•2/¶|ï{ßãC$´Ö¬Y3 Ðwïö›ßãÿv0‰€ÛT¯…žaQNÝÈú,£Ñ(½‡1x.„CÆÏÀ‚ìî:~k} ã #Ïuâ+jq£.^4nì€ó)uÙ©¢.‹âõõâ˜Æó0¡0Æ1~zcã8^ Ü(&õ{DÆâØXœxÌ%÷^ɲcÖa1€˜˜„WátY!ë²N¡óÅÝ+Ó¦1ág?ó#D•R¢æñ¬Å‰»$ÒσqhøœË׿ž¿©§þó!kqMʰ()Ù$LX ~YŸ3‰ÒŠåÍ]“ÚËö=~'ˆH]ˆ°c1ÆâYƒuL¶zׄˆY¿ Ðí2þ‡Ñ8ôíᘉvøÊ~Çcÿ„ÉØ]Û!f Õ'©b|—±ëa¬KÜÆs±n ÷›ã1Ëž˜#üL×_| zyD$¼„(}4ûÃaêßx2$Ê5TùÇÜþž‡6ÑCÊÅ#äYê?èUJýP,¦Üô€%,D•ó/Ë#Üã.»ñÏlýk7Ẍñpðð¬ï)Æøé\\ žuð\×6ã˜Cc,¿í >}w/ÐX–²¯ÿIOÙ7=ØÇ7¿}?ëþ÷eìyk+õua?›¾ñ‡ 9Æïèh]BÖÅx.Žõp]<—õˆºïˆch¿c9×/ÕpNÂKT='Näõ¦&yþy ¯šdpl†í‹à†Â„l¢é ^‡Ûàg%cHb¤ä粸9½âþzý EF\WT+•»ž¨Ãº–ç8{Hå¼ùŽÇMöq÷“uýiVJZö/û¸û‰:°þ³v÷ˆOåG¿~heït¹ñ¾ýܽÚñ_IOW,žèÙ(á%DI9ì°Ãx)â´çžƒ}H©Uöï‡üdB.¸n"¯WØ…Þ0¡ú^ÜdœG(^ê ·/K+´YŒû½¼¤½r `i:b{Žw>æÎÇK‘³*ÌÀPÚ%*;žxnãaÜ ã‚ç³!î\æÎ5}~ÊÏK¬Ë€7:]¥Äã‰ø-áDïȘ_h¥cêgQË„üÉøþ>Œ;0’M~ º†°çÇÇHx‰Ú^Kãq.}þy£VÙ½þºêCcú{Ì{uýÕžIÉoCa¼’PêpA6c†që*¶K ‘ˆ+d£ t@g™Áº5> ]SW3‰Ø]—Á­ˆÉ˜^σd˜€gýÁ$cÖ_×Å畦Š2‡„—¨z&NœÈ÷ï‡çž“1júÄ›×ÚþwXßàOÿäû:UXÙ ?Œüo‘u*Êî ¸ý¥¡´¿™–eZ7=LjÒþ¾FèÙë« $Di3f /†BØçžK °ªW`íÔöÐØÓGÓñã ÖÀßžþ¢l"„ÌM‹Ç›aû~.0 /!†üΖÎN¦74ëëãßþ–#>òÙ¥¶´× Ïå¯ÿ˜Œ"„ÈË×ïªKŒgDE¹$•ôHT-Ñînîûع¬¸~ÿkánöÚG×g/æù³‰îÛ' !„¨8äñÕ‰µ,½b.“N]Çe¿Šb`?Ìý›V½ùË®žÇ¥Ë”Í^!De!—¨J¶tv²góSœ{sBt̳λ%Â;»ØÚÕ%C !„ð*S` ´)a`µße}` ºL”ŸMk×2uNï€èh:Á80uN›RÆéÕ‹¡ôáÆ\€1 iûRKe¾{/}÷Úï‹jÝwmcýHõÊ­ŠA²GJt¥wŸNÎ˵L w•œÂ©ÀkÀÞþ‹"Õx%yÀ+Ö®´]êzÉßéósm3ÜçY辇k›R_›|å åøRËÊTNÐû"ßïáºÆÅÞçBÂ+»FMˆ˜ b*Uåc™ÄQ¡¢Ikä™ÒÞÎC×62ûÖØ€×«˜öIØøH#óuÈPµü›¨D†Z¡¨2*ïõ)e9Å^ëbDHÐýTËý£û\«ÄÊÞTòLÕ-mmL˜Úʪã¼["â«^¹)ÌÄig1yÖ,j’ϳ‘ºNºG#u~®mrí§ý=ö û.æxËuŽ…  ž­l×+ßñ=Æ ÷E¦õrCó˶ï vÊd‹|ç“íZ—JðŠ^• ¤òCP¯ÝâÅ÷êŽ,ÀÞ‡.gÃÝÛxö”W9ñÃQ<ÏÃ>bZ¬‰ýW^R3öÝ÷Å»ËâÙÈU±õÓ,•íóUvAö]ˆ§(¨]Š=Çlç•.TR·+´¢/¦É8_ÙAçY/—½†â‘*äœ iR•Ø’ð*XødBÙDO®&É B.¹M¾õƒ”gŒaÁ‚+uG¦ˆ@ö¸þSlíêbÓš5ü~åJÎÃG;;™zÝÿ¨‰¯Àv¨Q~u=`ªjxæáÚé ì ûêµN[KLGÕÛÌšŠJ ®þ"wSb6Ñ“:¿¯™š,+‡–ÖVZZ[é;ýtnøÇä+ñ8lÙG-㈪©¤‚zF‚®7*â¡4s 1R8¾¬.ÏÀPz/–¢ç£DWeÒÖÖÆ3þ3î¬YÐÙ)ƒˆ xW] sÌ"€Š±M¾ž§]º«ªH'´IïÀ¯!¨Wc1Ûfpc#ËØ±c9å”Sxcòd¦tvÂEÉ(£Œô ½Ê6uÛL1=¹ï Ù6Ñd~2P<_E˜o›|Ç5ÔsÌTY§71(Ÿï8²Í/65E.[)£‘Yè6™Î9Ûqå5.¼r‰˜B–CAš#%°ª¢Ö¥}êTÿóŸ™°s'Ý]DK[›ìRí—Õä× ødý ÁõÅ–‘o¡w—r›¡œc1çQH'ˆá¶WeA·šã¬ÐÎùÖ/ÔÖ…ÞÓ•KeÅwU´ð¢¢ÝÝ,½b.S^éâˆsûûcË}ÿó|>¾•ùK–SßÜ,# !F¦ê—‡I¤ ±E ¸DÌþÌ_zùÀ÷-¡ãàºÅÝLœæ˜-„¨äGxEÍŸ_!ùÄ„„—MƳÛÀ<©³…BHx QR²˜Ý¥³kc-(¬RQ•÷þðµR=þÙ¤f”ЀÙB!$¼„:SÚÛÙøH#ÖK™y*ðØÝþ€ÙS::d(!„^B •³ÄW=0žútÌBQ1(„¨ æ/Yβ«çqÇŒ.¦Îé#3ùÅõÝS˜·n© $„BÂKˆRQßÜÌ¥ËVö˜½üW¿âým1·¾”몱Æ`¢'„(SYÑõ^¢¦H˜ýÊGðÈý÷3·³¬Up½BˆŠ@1^¢&immå×Ï> ñ8lÙ"ƒ!„ð ‚ à©0Æ šJ¹ïlå–kŸ¢4œp ìÚ½›ÈÌ™ÐÙ)ƒ!„ð "z‚¬g­4•Bå*·\û%¼±‡3Î8ƒ×'M’ðªr”@UQü ü ÑÊ©£+Vx%Mõ‚¸\B®PÑä¸ÄÈsÆgø9T%¼„BHx ƒÐ•gjTÓÚÚÊCÛ¶ÁSOù±^B!ÄS3½SÕp{¤’/ȱåbñâ{uG–лwïâá':Ù3î Ö~ã6Þy×1£ÒÕÍ»õ !*k-Ö³XÇ‚Ç@ë¥ÆKü0`ŵÊ#®%ƒdBA›‹nÉmò­¤DzScRåûD(²¾Z[[yñCàñÇe !„^Åê*4f«”=EÅ«nfq®_OdÅ ¶*È^”ô=tAAó‹]¯Üe”Ó&ùޝTÇ?Òv0æ‚@ÇP ×k8ïÏJ9—Š^¦EDj/Ä\=“ó©Sª+Û²üuvîmÓ—)h¿²ˆvwsßÇÎeüÚÅœrÎÓ8½»Xµp6ÌŸMtß>h b·MÎêK½ØísmWŽŠ&¨h(¦\kWädÖ®¨ÚÊ3ý<“çZ Â@â¨\ÆðÿWñé$25¦‹§lëå[–­¼|Ûf:6yÀ*êæaés™tê:þîÏ=|ðß,uçÃUÿ´‰ÓcÙÕód£©—âeŸ©"Îí…µ‰Æj5Ç–ÎNöl~ŠË~Å$?-Þæ18ï?"Ü1£‹­]]´´¶ÊXU¯±3{LRç+€ryl2ÍOßÏP¶ÏuìéËò•‘Ëéǘ­Ì\ûÌwî©e¤þÍ´,—€.Ôæ©¿‡z>ùl:×+×µÊUv6»ݶcŠ}‚^Zð Ix‰šcÓÚµLÓ; ºÎ†ØÐõ-h<¤‡ K–HxQ–ï¥äEž©2ÏV!ä«0ƒnŸK,¦/Ë&4‚[Pûeú÷PË/DøæVÃq>¹ö] ×+WADW¦ýr¬¥°O¾ë‘ëY’ðbĈ¹‹vò…O¼±7 e–ËK¿ù1ÌžùK–SßÜ,s–¯r©•/êJ<\ž-QXÐ{¡¶Ì'" {¥lâ1`áṡ L÷oÅE‰Ò3¥½‡®mdö­1Œ¥WÀ¤™îŽ9À\8ÿ[VÝàÇ{]ºl¥Œ6 *´ÑVáç;ßL$Œ*÷z•Sõç;ÖRxéFe®Ï$º4|('-mmL˜ÚʪxcìÙ çÞ ¼x4q:pÞ-ÞÙèÇ{‰Ú\¹zœFñ™©¢LDå^¯Lbi(B9S|d1e•³ƒK­¢¦FQ“Ì_²œeWÏcý¢Ç˜~EÄ÷z?ðÏ€…-°i­â½j¥‚*EŒL!T9·ÏÕ1 h§LååÙŽ3È~s5§ï#ßy•3=E16Îë5Ôã º]¶ý™?ÔëU éG†]x)ñ¨.ê››¹tÙJ~óÙÏ?<8 x~þQxg+L£x¯jg¨M¹b¾Ò{Þ¥ ŽlAÓCÝ>H%KxRzîùÊ/¶‰ª˜c,ä¼óC.;s<å¸^AŽ3Èñ{®A޵˜ç±Ðc®Ϭ<^¢¦™qÕUõ)Nüâq]—W^yEÍ5H¾`ölâ!hp})¶ z ù~zl¹znb—\Ç%q&DFáUίM3è¯DŒ¨Î<\óä“|xútþë+_¡µµ•)íí´´µÉ>¢&‘ÇJŒ²//?¾«‚3j:—yj ÜË/çÕK?ÎiMïp‡"ôlˆ‡®mdÂÔVæ/YN}s³ìTÕï\ ‹RÚDö¢ „×P3Ï QÎ/¡?ÂGÞ~“ÏìÓcö­1VÝðË®žÇ¥ËVÊNB!qâ»Béj€?¾â¼ðÊ/Ñ%F’-¼õö³Ô ¬.IÜ›œwK„;ft±µ«‹–ÖVK!D?/mvyì%7ã²SeÃ,¼r 2‰/uµ IDAT1’lZ»–©szá=À¢á•_Sçô±iÍ ¯Æ•ÚÙ´˜ 하Õ}$ŽIÙí+ߺFÙ9ñ]¡ ^/ßãwsëGæ£üµó€NàÍŒo™¨Â+­äTìöA~§ÿÊ>jùZTãqVãõ rÌCy.FÃ}0T^Úìr×ÊèÓŸ_‹çÝ6Œ£”)ííWÔ¡Š¼ôrƒ¤gºM!e¥ŸkêßleeKìdßÙ„mú¾ƒî#Û9åÚG.Q]ˆMS¯G&Ûe»æ…ÜOùì_Ês(äZsý ±M{°ZÅ™ë\ky6gŒ×IÇ„q¬GÜ!á•«W£â»ÄH3Ér–]=;Vt±`Û>ž¹Â°îÉ0GÍlgÞ¢¥2P•ée¤‚ÊTñf«ˆ³UJAòM®Ê-W˜mY¶² ?TQœëüòUê¥Þg1^™bŽ/èµ ò»çä~-æäZ¯Öãòz¼^óˆäimT/1ª©onæÒe+ÙÚÕÅŽ¯IÏ¿É}½ÛéúÅÃ>¨’¼[E¾ü«íK{(ñ1™*úrŠÜá²gÐý õ|óy¿Jñ1PèPS•rïõ òA4Œgægz(±ÉçñQá5pŠ3±ž¥î%YÈX˜ÕMKk+Üy'ÌœI](IJ/~‘I“&)‹}…Ôû02/ü¡‹§RÙ¥ÖžË}¾…^—lÞÖ¡ 5U¨€Êå -•ýry•ƒxœ«³N ÷&%XŸG^—3<…é´:ÛàÕ™¶ êq(dÝRs1ç#*Ÿèøñls¿ë§{ñŠõÊ-'ßqfKh›^öPS™¥£"ëÕ,•a_á•/~Ë¿±Œ.*›¦¦&"'žÈ¾PˆqË–Á%—È(UH9ò^•Û#Qªì‘(§Ð¸º ÙèƒxªížËv]µMY=^ÙÄWÐÄ£BŒ4§Ÿ~:67ó‘n€ /„†ET´XÌ$T†*V†Ò [©ö©•ë,ª§|7”͘’A‰GE½™q衬ìêâúzöþýßË&bÀÏËHxw ííTddk¬&ûdºî¥ð~æ:¥ ¨-†eÈ !ªhw7K¯˜KÝkO2gN/Ïí qÆŸgÅ«˜³ôaê››e¤áà‡h”¹ÍTqfŠKÊ„ž-V)hÅ^ÈúéMxÅ6æ*'×y•RŒf‹ÍÊñjûR\£lezlbˆo‘ Ò" ®âÀ7"K¯˜Ë¤S×qÙ¯¢ ŽmÓïZÇOÎ<Ÿ¼–)íí´´µÉ^})óY'×übË*´œ ëZNPARìy¥ ©BÖûUÌñs Ëa“R]Q]82ƒÙÒÙÉžÍOqîÍIÑÑnøEŒÝæÑvâFzÞ¾‡®=ŸæÏ&ºoŸŒ&„BÂKˆbØ´v-Sçôö‹.,,½&΄qKáô pþ-q>½¾›‰ÓcÙÕód4!¯„ì#„„—Å3îdK'ìÙ çÞ æàà[`8ï–ïlìbkW—LV® ‹Uö!DqŠßŸ*(…UM ¯RçË5¶È®]¦´·³ñ‘F¬çÿÞ´¦ÎaÀö]à;À&ÞÔ9}lZ³F†B1:„W9ÄOjÚ‹ÔÔù–‰ê§¥­ S[YuCC¿øıÀߟtÃÈpB!òR½“)+2‰ŸôyÙº’öB)2jŸùK–³ìêyÜ1£‹IÓ{Ùú§8³oMñz} ø°+`ã#¼÷ ‡òøm·µ4MœHÏÎêù(„¢ö„W62 ªBE–Ô77s鲕líêbÓš5ìxñǬúÇ×9ïÿÄ|ñÕöÇ»À0n‚á‰ï~Žc;zyå÷.nNú˜P˜‡®mdÌ!'qÜùª¯—B /Q—¾<‹ß+cV¢=ŸLÝuÿÀ†»ÿgOy•?ÅZË3XN …¸hß^Ÿ„û¯…ióAøD»cìx>ÆÎ¤÷?qXº°oüqŒ¿æó8º/òòn £o%!ÄPÕaEAæ§þê :ædòŒ1,Xp¥ž±Qqö¸þSlíêâÕßýŽgy7¡Ðë¼:9ÎG>Ñ9°¸ìW‰æÈD ŠI3ಇÀ8p™s{/«nØÈއïãÒe+«ÓÃȯ®×à „¨)j>Dz|RåûD(iÌÉÑGËg°¥s%'~t g}Ö㤹À¿Â^æÆ’P JA‘ò”)…BHx*JÑûPqb£—AYíÍÀSôò%0f/ð5Ö)(,lyþð-h<¤‡ K–È B!áUb*5ÕCj`z¾­ ‚)ß¶éË”NbtšÕ~J;l|¬ïú,ü XtàvÑn¸ïc°âzèÙ-³\6þþÇr(ȳhPU!D‘?ÝUÕÒ¾˜³4'fZ–mû åæÚŸ<`£íI†–6˜0Vݓπ1'ÁþN7 Êúã½N…럆óo‡9ßÿõ\DC !D•ù“ã8à€±c žg°žÅz\{ÆPç˜Ú^B éYíç//À3à £á©Ça¹c÷%hˆ~ÿ%xc⽄BHx Q0éYíë›áÒe0÷ÇðöŸÃ˜Ð‰ûÍ»Ùùž÷s!'±mýüü 7;-Þ+E|iÈ!!„=(—’šÕ~êœ>ÀÏ^?qÚY\¾b)õÍÍpÙeÐÖÆ'/ù¿ùË_€^öBSc­eKg'›Ö®eÏŸžfë´ãGuÒUc©¤xì1˜;÷é§ùÅ–ç¹jü.Æò]z¶‡xèÚFš&L£gg#³oe¿»ctÙÍÛK¼g'îö0ì2x®ÅÚâ*Š¢+³WüÃúåmʰY‘çfЍpsUî†"`B©Ø}•C@uü¶ä·qÑ‚­Ô×:ßýh=ˆ÷ÒŸ|QÂKˆQÄñÇÃþÀÛ'ÏœæÝòG3Àcö­1VÝðgžýùXVÝÐ=ÿŒ3F—ÍìNâ½{¡7ùöŠj)±§`¸ÅxŒL‘;³ÅVªfíXÁV1{¸Ë,Æ$Ãx é(xàE%¼„lyñE~sDŒë:TÇÖ®SùîIÏpò.žçòêï›9ü”÷öá*¼í°¿[7Ž¢fðÊùiÒ>,m eBdcÓÚµûÁ^¸ø¾øº8×_Ç(ÂØIñ½ïlæŸÂWsÏ=÷pé?üÿýßJ{Ùí×õÿ{ñâ{Y°àÊQɲ…ì áU³¢+]L%çåZ&D€»Ëÿs=pp%ðeØÒ [Ÿôˆ°‚ºp˜ o»ýå96ööÊdB!á%„(”)íí À1ííÕÖ–'–G!„„—£A¶óè üòËpäõб Nüð ÇœoEYuÃc÷Û×¹×@dï^–^1—½[žfêß ¶âú&>v_²œúqãd`!„ð& 7bñâ{e¬Q`ïC—³áîm<{Ê«LžaçË—ý ¿ò?€³ÀÜíÛ?»l+ݯÄùÏŸ,bïneúù¹ü¡xÇÙßÜËʯ®åû³ÏbÂß}U÷„ž ÙBvõTz¼›„W’±\¥*+ˆ8Späà—HMÛãúO±µ«‹57Ýĉ}ã$rÌ|˜|Ì8å1Þ³ëP¦6„x!¶•ükü€á„f#ÎÆ›™=íxZÚÚtOèÙ-dQÁh¬Æ<‚)u¢”´´¶rL{;ÆI˨|°Á:Ï^ârîØ±üå׿Î=œÐûØ´v­Œ*„^µz-Šr0¥½4˜TyØÀoÇ7ðÉ;8síZ¹òÿéÖB ¯Z[É)Ut%›!³-"(Áö ƒÄW2[ý¦£Oäw_ú½ûö1ë.öw4Wb8¡)2¨BHxU/¹šÕ )JÅü%ËÙñÂÙÜ1c¿ûB¿ûB?7Œ1Gà¹né‚BQR\/ÄSßÜÌ¥ËV²µ«‹MkÖ0ï®vÖÜüe¦Ïyµ? >úuËC—Á´_ÀÔûá÷ ¯×Y¦]èbB¯±âú*µ„BHx !‚ÐÒÚJKk+[žx‚=o<Åe¿èÅX?.ú5lù<ôaÃ…{,_³pPœÙßÜ˪çÁ«çqÙòÿ–A…¢QS£Ȧµk³öb´ÀöÉ–†M@˜üf` í]¯<ÉÖÎNQ!*y¼„¨DrÄjm~Nü(˜ñÀÀJào¡÷›ðì{aÌ!=üùž{|ïY©†ÒPEBQäñ¢9¦½Wi:0ÍDR“¥è²H+<sæ| ›}4ÐPEµ¾d9^=;f<ÉÔöñòoâœ8×rùq,gö7öòÃSãð¹––',æ5˜ò)‹ö±kýjºf¿³ŸxæÀ¼\)åÿû)à„G1žû¯GÍlgÞ¢¥ºBˆQµëY¬cýèŽäëÒã%~°ÆâZe‰ÅPS£UN2Þëc?ù=ñ¾ë€zfƒAñ[:ùíÝw|uâÿñ×l½((M‚„@ˆ˜ˆž‚"w* ¨pÞëwöòýõ8A½;﫞܇r6l R•vJEŠ)±ÐBIݙߛÝìn¶Ìn6Énò~úÈÃ0ÙÝ™ùìÌì{?ó)8RL†ÿÉr-Ïv€ó×&=Ö~MáI'qà±ÇÀ4¾þºSÎeKÁXŽ¿eNQ®xãCR›5Ó "/‘z¢cV-O9…£œUz!îú2Fú†±’Bxå—ðæ[°þwùçÀü÷²¿i6N˜@ÁÊ•žö_–eñÁW_1zútÆ>ñ–ÓIÞwØj'&""•t«1÷-EÿeÑ0lN«2{öË*x•GµÊáðšud¦ûµ„·àðNHnâ»ì­ Ю?ŒŸ¥Gá­ «3-²N-!cñ«”¼ýyé8ôûÿÇO¦¬¬Œe-aÞ¬¿0¾ÅšåØ~ƒ·§¤álq*­&ÿ£Q£hN6Jò·Q¼e32{‘Ö5#àtD:&T* •C8×^{µ‚W"Še;.;Ï1 #î–Ú¾ˆ¨<"/‡‚žÌŸúÖŒÂʆöàÀVWm×¹þ¿{¥kàÕñó\ùÆ;„W0³Þ1¹pÊn~퇥·ÜÆ%_L£÷^¢Ë…Û9ÿáòŠÚ3‹ f±äþ|ö}ð ãòG´%……¼5a4Eëè5²€üwšvê * þuL¨T*‡ú@·Eê‘Ê^ˆiXÎÊ@uË&h“ KîwõHô¾õèažÑï 0Æ@£‹ï­#Œyè!nÙµ‹c»ýF±· `¤µ,áûUËY÷ïÛ»íhYì^¾œç‡öçä¾Ë5‘ˆ(x‰Hªè…¸oÓžêÑ„Ÿó+UŒ}öm‚™ýàÛ÷ðŒÍ¨ý—çåšÀ¡‰&7¦¦rÊ?2q×QŒw\«¤^ ïÝE?C߉%¬xâæ°“g»'Ýλn$å¥ß1lšSÓ‰ˆ‚WCçnãåýcy54ö7‘ºæî…Øý“éq‰ÃjR›Ã¸<¸ô98¹ly‡€£V9L‹ÉÉäO™Â¦x8VsÕ¦M]뺅9ò ¸icIèÚ*¯I·üú8=Gv:"¯¾¼ìþM$´8å GÕS¼cüâÿ )Õ`ñ=Ét ù üB˜»WÀgÓáË¡KïÞtÉÎæ¿[›b}ûÇCïo`Ø{`ÌÃ3uP¸Ú*ŸI·Ãõ9Ñi%" ^"’(BN÷ce5åû/0jsL§Á¢»]áËûâñýÐïšr2­ã³Тó–<ÆfÖÝ<< œ¼ ][å=évzvèÀ·áeMÚ´ÑP"¢à%"ñϧ¡½W¸qO÷Ó¶÷9\»ä¿\úÜBúŽ{˜í‹»ñìiMyîlƒ“úºn!Ž|.ü3Üòu1m{- ömÂê'+^óR`ME{è \6š$…Ù>hujeƒÿÀwúÄRV=y[Ø6c"" ^"R÷¼ÚÏìלîHá£ÛSxöôæÜ^9ÝOǬ,†>ðS×~ËÙxHeø46x?¼s-Cïýæ=÷ïU„/£"€½ìk4[npæŒpÉ%ðÚkPRøÕ¾ þŸ;ŸÀ7ò K=EDÁKD‡÷tBÍNžF³vÓóüb®|sAÀé~Š8ò½;|¹o!˜2…{©Z›Ö}•ÆGÃøá?þýoèÜN'œàS çnðÖ­`–4ðÌÿœ’ü|½¡"’ð4€ªHÐ1+‹ŽYYÕ!ws«“scÁ—sMRZ¥sÆØsY>s&éÙÙtZ°¶o‡çžƒìl®ìÙ“KzðdÏÍômâ0lxÙÁéK+&õø¶lÝb»,v¯\É®O?\5k²²Àæ¬"" ^"RëÒ³³™?µ #¦V©õ²Lض cžÏ*kÓ¾_½šŸ|Byq1)-_Ày4Ÿ’#ðö¤4’RÛqÚU×Ðõ²Ëè”›‹cÞ<†üéO´ùÎäèÎË(Íʢϻ13òÐ/÷è÷…ëȨý~þÔ&´ 0ú½ˆH]Ó­Fñ× ¿Mæ`:œy¦Ïs:feqÎwP°z§*à[œœ÷@9û¾)'¥é1ºý"Ÿâù̟z!s®º˜Ò‹.båÓOó÷NôÝwœóꫜuÊ)Á{`V¾F™½ü±r\°`£ßï^±‚å3fhBo‰ ªñ‘JAn!n[Ј6™ƒ= òý¹Çç?¯4ðÜXXf!Kîw…¡u=ÑrÒ$xøax÷]NÌÍåª&ǦÐçÕ2ŒÆU_Ñ©]C¯×¯mØ»Kxº×2æOI·_¸÷ûÔ„5kVy{Ò²htâ‰8†¡[•"¢à%"µÃÿ"À˜çsªÔtyóŸk÷ ¯ ¸4”ŸÙïs–¯ÏçÉ7ßt›K/…Ñ£iþúë´¹õ&Š[dσݧ¬\bÒùŒóûŸ·xõÍ…F­Ñá;“gœá•Ê ’¯ºŠvW]Åž¹sIyúiÎ~ó ZG»õÇr:ùù™i¼Wö½O;.³¼-Ý/©º †¿?–ðçNË9cŠƒñï”ñêeÐk¬÷$á垀6wÒÆå-ÖÁ "1£6^"Rm¡FÉ÷õt<ËdH»b^{AÀQO;–ŽK–²?G§L¡ý3Ïp¤ýI ë¼…©k|Ûqu´‹ÍyV•õ†šø»`54jåäüGÊ(Xí h•¡Ë+ i¢nQðª=þ“`»‚ý]¤!ón”ï3÷£UÙÞË{2íßnu†µ¤¸˜í[×ðzë"VŸXJ¿ï,ŒA@žëu \6«ŒÒ#°ä¾ßÎVð Àw} =.q=?h@³ `4n}œe?¬Fù"¢àUÓü'ÁöžÛ0Œ*Sø’þMÅ3J¾÷Ü»–GY£TÑ[±ÃÿeÈ-©ã©œšÈknHãô¹ÂÁ¶Òùkd>üCïÿÎà¿Ï¦±e^rÐy*COQYC×á,'mz}èê‘©©‹DDÁ«6?W Ÿð%"¾¼GÉwÏýøú/Sé:‚°#áûs÷V<ÿáÒÊŽ…üæ†4¿œ¡]úòê)¤¶~/6_ÀžsIÛÞçcï×)ly×ʪLÔíWC皺ÈÔÔE"¢à%"ñÉ{îÇ>Wü&ôe&Èwï^’U‘×ÜÖNX_šF“ù¤¬Œa«Vñˬ,V|û­§îÿz¥ñá¼ÿ;ƒÿëÕ˜òâó=Óu<Ów¢nw£|µù‘š¢^6T·¶ËîmÈÙ³_Va«<êU9”œÐ–’7Ӹౢ€#áošŸL“ñÅ|뷇׬#3Ý•´:eU†£a^s9Z&,øc ›;wçöc†Mº–±)©œúæ[Ìݼ‰ÍW\IÚ°‹yc}>ÙkOåàÁƒüÔª—¾«¸˜ ³öóuïmd /aó<ƒ¯_ƒ ë+xÌVÇxýÿå„«¯©:Æ—eQ’¿â-®©eö"­kFŒ¦sCe¡rîÚk¯Vðjèì„6Ã0âíýÉ[ IDATþ`©í‹ˆÊ£”ƒe1gÃ',¹9æ•ø„¦E÷¤Ñ¾ïP®Ìýß*O+è™Áü©`ÍpM]4öE˜; föƒŒ Á,ƒ/_wТMzEñßþÆCŸ,£EË–ŒéÛ—§ÚœÈ˜¿<Î û÷3øþûY{Ê)Ütß}•å9õ×<—›Ë‡ï¼Ã„ë&дM6¾ù&ð!à }%…®[…®Fø³LŽ¿÷ iyNŸ1¾ÜÓ¬£WÅpùï4!­ÆÓ¹¡²P9$6Ýj´ˆÔ¶K$êÈsËof¿æ|tG ݞ³§7çàöì #áûO]”ÚÆåÁèÂ÷«“ùúõÆ$7…Œ‹¶c”Íà†Ž¥¼íXWãwË"£W/fïßÏó#GòßSO%uþ|ξòJݰ¢™3áÐ!69Â)ãÆqÎwÒoòdÎûßÿeûÂf!{dÞ´±Ä·½—i‹DDÜTã%"5*š‘ðM]d:M¶/lBÙñdÎøõ1ÎØôÔ ]0Ãô‘¾ËwŸÓý¢b Ž&§2ÇèÌØM›øï°a ˜=›ÆwÝC‡ÒjçNΘ>=@à[N÷KJÂŽÀÿýêÕ˜NgÐi‹<[µ Ó4}FÝ×”D" ^RåÚ¸¶+Ððª -Ò‘ðýÛš5ë8÷÷ÃYýÔï]½CH?¯Ìó÷‘•¸F¡¿ùŽËSÉÉ<òá‡Xóæ1ô׿æ¼É“aòdøÍo {wOà[ÿürúN, Û#Ó2ÍÀÓU<®Ëùż;õj0öùŒº¯)‰D&Ýj !T˜ 6Æ—ˆÄ>°sç´øÅ%ß¿?hÈñ‘>XÄmÛòÙgŸAË–ää0þÄq¬ZIIpÞy0|8©sç2î…·èý«ë‰¦G¦ÿc¶/*§ûÅ;+oCÎ(çâg )9ü Ï=@ƒ³Š(x‰ˆ$ïéý¹k¨N~ä~xýuz6m8À´l “&ÑvëvòFœÇ’¯q|‚Áž ˜Ý½·gã,-ñôd¼~¥Åo]Ã]cFLLÓ¦MéÝ»7GÛ´aóÖ¦ XWˆqxxÎZ»“Àê Æ UåmÈ‚ðÊ¥Ým0b†ÓÓà~×rXr2†ÑÓétµ9³;°ªÚ׋$µñ±`,‹ì®]YŸ—‡áhËâ{S°šw€Ý°µ…Áþ?и˜ Öϰ)/ÎçæpàÛlfökοMá™>y×A‡ANºýâ»*æCöâtwÈÉÑû'’@Tã%"õ^zv6ó§6aÄôBÛ·ùü¹'ÂöLG”™ÄºÙ&_¿á ÷XXÛ4â„Ag²Ðé¤(u gQD»G,ZM±8í¤æ´~ ÉãÆñýºu¼;õj2/ÛY1Æ—”3bzae›³·a9®€wÏ1†OwV™d¼MæàÐS/‰ˆ‚—ˆHmóžƒqØ´’ÈŒWïÂʆîåŒü ¼39…m¦ÓÿÚÿñ™ƒÒÝÎìHt4ˆößÿùÜu-FŒ eéÏÀªnî6gÏöý//d¤¸p§æ±õ}“o@Ï1¦i‘ÿQSNî3$è$ãÞÛ½{åJÍ)¢à%"R‹LºíÝã1\€ Õ»ð²ç˘ÙoéççÞÎM9q"äçsøúëùåîc×—áéi`YÇ8eÈŸ`V°–ÜŸÄ–µ)´¿ñV®|ôÑÛ쮡+,X§9"E¼ézmx}y´.÷ÿ›ˆÄŸPÃP„ÓÞ…ì¼è"¶œñ×ËÀ­xzF~ßÞu=ñ¯ ë4&-*çÉž›¾ù&ô:ÖÐá{+3Äð"¢àUg¡+P  ´<ØcE$¾¬‰ª®O}w›³abü 8Œ§gd»0®ý€&•!¯×h'«^_4pí^¹’ /½ÄÁí«5þ—HR¯ÆC—ˆ4<±î]Xe꣖ÀD°Þ†×&óc/¾nNN&³!¥Ø`Ïž=û¼¦÷ÔBû6þƒî—„¬¡ûòÅY>cËgÌÐÜ" ^ñ¾¼D¤a 5GdT½ L}´àÉ<‘‘DYÚ@–ïn†õ`-pø7pð ý‡“é©©ü8}::äªåZ¾œç‡öçä¾Ë™ºöÝ/6†.W@ƒoß/ç»%ÏqüÀ?ð@ìç~ôšÔ[ÁNÄïô§ý:«Q»&´Ü–Â}™ý«/˜÷q7Ú·k‰ÑØIÝÞµA†®`·#½Õh7´½ðÂK:"Eâ”U\ÌÁY%éðvz\\ ly?ëÄn´¼öw85ŠêuKòó)Ùº˲xöƒ÷˜t÷}4y÷EúdoeÄ£å>=0Ü™ÂwŸugÿ!“QEÇ9mß^ Ò’ÙšRÌ®Öå\¿ÙU£U° æO…©ëüFÉ·à•QÐö4ñ(¾½;ïMæë¥=9á¦{£ Z%ùÛ(Þ²«¬Œòo×jí¥çÅ%ly/ g‹Si5ùQ–“ˆ]×^{uµž×ôí˜eå”e×wyþŸ½h}BÞ[]Dëæ©$®Ïz'†ç¼rV<·Ø„’rp˜&”—pñYÍxáý¯˜üT:ßß}¦6^µrÁ¶ñMÏ0Œj,õÉìÙ/«5jäé9{öË <½7yO=ÅÆ?Òkm9+‡Òàü37€[áÊÁ°jüë]H¿L¾~5…~×”W Øê÷å/š¹ýzO¬‚üð ]î×V£~µñ‰%……|}ÿoßb?Ç<€yì~uJ9{×,eÐ 7øÔ¬õë×çöíž!.Ò³aËR°&à™ºÈ1 Îi ×ÿ'ü+‰M {QÒm†#)DŠl›Ýã›_1ùø®O!c$a‡ÝQð’_ä¬*ëÝ· CýMD$Рާæè[LF>îdäã&·m.§m/׸[Þš4iB›6m<×NY•·}zI~+~•JóN¹éǹ|Ó&’ç¤`ý\5píú 6¼ìàð®]¶Çß,ÁN¤>Ò­Æ0á+š¿‰ˆD"ÔÈøÁnÑ8p ›ç/æ‚®VǾs'ÁÌ~q!˜eÿQSÚöÂY_¼Å?üÀß²²x°¬)fû"’†WAÉ0xëWÛ¯Ó'–b8fòö¤çIJmÇiWN¢i‡8†vÊ¡ôlW£þÓ‰zNL‘úN5^""uÌîÈø^ßüÈìÙ“ÃGRY|O– ©Ía\Œþ'üøE2ß}܃Ëÿó1W¾¹€ÔfÍHïÞ·““)Yò y#ÎãõÉì}ÄÀÑFn†›„ì»-ö}SNJÓcœ:<Ÿ¯^ËeùcS9¶ï¾€ÃNøoV¥æÍ+tiRoÕx‰ˆÄ;¯ v³¨ˆWFç²s /?ÎÖ÷ñL íp$±mAcÚdfüü·HmÖ¬2ÀYYY¬Ý¸‘_Î_Ê™íÛóû¬áO~‹ëï/Á˜ÖµpîpÊxõè5ÎØòL î?åP ÉÇǾs'ÂÓ™ÐãgEMW»Ó††ŸÔ[DÁKDDjš{ ¡Ó Cߢ³,ýûÏô»p»ÏmI÷ÚG÷vaÌó¯®U²,ÎjßžuO=Ÿ}Frr2é}ûRÔñuŒI°;>½&dƒó\È.#ÀXôÚ¾õéž|üÿz-§ç%e8Œ$~ÎoDËN½iÒf4ò G¶á·/¿¬7ZDÁKD¤îª9r‡.ï[t»W¬ ùøNO/BÏó+&ОÙo–Yu^#÷X['ìø‚naŸ1®i2^|Žî—¸³ëSh; ˜«[@³ÕÐñ[ Ø”»˜Ñ†t9Îî%K蘕å™|üÒ3Πå‘ôèÑÃgòñ²Áƒ¹ï¾ûô&‹(x‰ˆÄ‰Š)„æNÃÌ~Ÿ“qa1XxMuߢÛõé§ô 3c•q¸üÆÚr=×bäc¥¼3y›ó,FL÷}-+ öôóZ¸¯"€m„Ž LZ,ý<¿ù GÚµcé¶m¼¶|97öy­¬¬,6lØ@QQQ•¿¹'õÞõé§aï‹Ôj\/"<5GÏ-¤ÙÉÓhÖncž_ìioK€ÎÖþcmyµËf•Qz–Ü—Bç¡¿ÀUË–ž]ù»G[ ¬áµfÍ88{6…?ýDéÀéÙ“imÚÐØoân€¦M›Ò»wo>ÿüsŸåÞ“zG4g¤×<‡ß{Wó@JÂQ—ˆH 52~zv6oOIã‚E¶‡kÙc2 ú\á`ÛGél}o–u”Ew»jÀM9ä¾õyBÆ™,šõ7 ÖÑý7EœøíQ.ùØ ü¤¶8† Ç1a\v´j–Ev×®|ò§?‘´r¥«V묳ÔÂQ¥ñ¾?÷-Ó‚udŒ,"3ÝdþÔhuê Æ¾˜Gjóæ:€$~Y ^"" £SVΧ²äþümÁ"áH¾ãÿ‡ôóÎcûÂ…|3w6Ïöý‘®#JÙ2¯œ¯_ƒÌËÀp$ñå\‹”Vé¤9·Óã’ÝŒŸçôÚ‹OîH#mYgÏ ·ÞŠ9x0ë òz¬€–•rüÀbæOmBZËî”ÞѸeo™‚5#tX‰7 ^""‰Â0h5ùìûà•mÁ¼Ùí1ÙáÌ3阕ÅÐðLÞÿ:hÚ¦ Çöï§¼¸˜”–/PºÉÍLŸš0wh:ï‰föÛÍ)÷Í¢ãìÙ¬:0é¿c`[ÞÊ˹ O![ó×Q<ÀÂ(Òüv1P[5ËbÍ?ÿÉÁí«C‡µU«0MSmÆDÁKDDb”½5b\ÞbO8|zú³ÛcÒ[•Û–Å+£s8}T©ÍLŠ~?£ét²ÁúžÁÿ5+[W4ÐOú«IÇ/ÎÀµÀo€îÞ‰°òW÷íÅŸÖ®æ´ Á;t9¿˜w§^ Æ>2F0j݆/©¾PmÁ|S‰½“¡xOi´âñ0®MÛ–U4ÐOk¯^7/cpи¬Ñ¾ã–¹o/v>·”¢Ÿƒ¯sû¢r2/Ûɰi΀mƆÜõˆjÂ$.¨WcÐk•ð'ØßEDâUu{Lz‡¨€=Ýù§âÖe—œœ i÷ عÊŽ,ú§k°¸x œíáòitøæ¾_¸ÐÓ#³KNðõîZÎ2|B¸j†Ü]BÁêeÌŸ:2²Þ“"5D5^¡¾¸é¢lF•¿Z&"Ol×’…à=c î[—¦ÓéÓ¶¬¤Þš…1z]f±þ?°ñ-½Ç:07t½èÇ÷ßÏÛ“‘”ÚŽÓ®œDÓ(>p #fáÈ Pû3/ Èÿ¢j´D¤!òo ŸÚÆå¹æˆ\|o2ÇîÊåÿyÉ·‘¾WÛ²§z¬Â‘zÜ'tAÅ ®Ï—ñlߟؽø~yJ9Σsü˜Ã5ìD«”lBŸyG\Ï+†V_o‚9z,€NmZÑvÂ8Þ™û$Öô#ž×ù\|;XøÀÒ£ðÖ')M‘~^>_½–‹³Ì óR0’’|ÃQ³fÑÕXÃg̲·©6LÁK…¬ho'Úm6{¶&‘Uy¨TñYÖ/&°aÖ6öÞN‹KÁ‚-ï§bØ–7ÿŽ…ßl…o¶V}âåSpM"³ÿ" G ë*˜Ö1:žó%×þÉtˤ祅,y`-‡LfáÝI\0ÉÑ8Z„å)|mtäÇ}ǹmþ{\½ùº$²h± Îÿ¬xÑw]»WºnuŽŸ‡O@ÿ¼zô ç?lUlCyÅ6,寽º‘ܪ1©Ö^z^\ÀãS(u¶¤ñ ¡4:­/i]3¥’mßRòÝçA‡Áø¿Ì•ü¹ï©>¯ýö”4œ-N¥Õä?`4j¤s#B×^{µ‚—B\ø°fFÜ,µýÁ¢òP9¨,⬦þÚg‹+^ʱ5`ëòŸ 8~àcÜ·ýÖň?YÚ‚™´ë[Ê—ÿ1ø¦¢-–áé‘Ù|êþßÝ·óÇåŸÁÏ?³uô4úÇ&†´£? .†½pÛ\íË ‡«ý—;„¬ò d¶áØÞ½ô¼ÄuËÒUK[–ÐgÄ^°æ²ý…¤¹m¸|Æ Ž_Rx ’“‹9mtOÇ€ f±äþ|ö}ðŠ­AaunÔR`Jrý8011œ® í4Á¢¢×‡Ó Ù†#p¥‹z5Šˆˆm³²8çÎ;9çÎ;m’ŸžMþ‚&{$îüz\\q;ÐëVàÔµpÁcpÑSpÇ]†&±íÃ.>=2µhá™2µcGvÞù¿üë¤Søü*ìG>|Ӷ잃AÓ¡û2à[ØõieóþÝ2Ç@RjE;1Ã÷o#Ÿ€‘¶˜º®¶½\· #±{¥ë‹y Þ˜Ã¦•p0ß5‚¿Ô/ ^!j DD¤ú*Ûˆ¥ù„/Ë„m${nѹožÿpà¶`†±‡ôóΫ |^ó@.Ÿ1ƒ9O<ÁodûÂf®õœç~ëó?Áâap`pœö/è¼X©G|Ã÷6x‡²PÛ,(ÙžBqÕÆ­x·>Ά—^Ò$à ^ ƒeYUÆêrß2 õ7©òM–±/æ±oÓfökÎGw¤ðÑí)<{zsŒ¤lÿÈ”|jžü_ÂkT|põüù™itÙ8ŸA}>âøûzhI«Ò¢óOÈswýOØs8™¥iMøxb å“¡üKà0ð8ï/À¹ò{Ò×tF~"Ù¾HC§kŸà•Ñ®!0Ž€g9Ù¾è_s¬žQ¯0á+š¿‰ˆˆ/÷ ®U¦:4ˆ9—`ÉýËIkYæ¢ì¹óÖ„Ñô½`ÃÿX^„œŒ˜Kî_Áž¯Î®yUGêŸ:g6óo¸š×ó?Çjw”δ±Þé'@Ë£ÐažéŒ2΄¼W`Ät;ÁCçÜIcxæ´UtY„Á–÷ShÝ©?Û?úËôíéÝûó‚ÇJÂ÷~/‘@ âê&{¿Z…#å8#¦rBïÊ)ŒÊƒL˜½–KŸ[p>Kwܾp!ßÌͳ}¤ëˆRV-.§è¤5³¸ù#×tFí~ ——÷BQðÁ|°#)øö OÞq‹?ûŒž={²ò¤|^[ü©'tv¿¤Ä§¿ÿ>=Û÷¿¼=âÂmUƳ~1A–‚—ˆˆˆ=žÚ°U«˜Ó$ß³ƒáÓËƒŽŠ¿|ÆŒªó@z÷-¿sî¼3èHýî8ô<µpý¯ƒ¦'žÈª§eñ¿*¶á!8ñ5(üPz/\Y Φ<èô‚½Àǯ%cí0NW›¬í„×ïßÏàÉ“¹âÊ+¹³KJËÊ<¡sí¿?¥ß5Á{?ZÖ1N²!à\”fí©¿Ö¤à%""b_dzÏfò²µÕšÐÛ•Ô"\¯_-\¯+®¨º MÑììÞt>w$;ó^¢UÁtO.Ã|ÃIëbK9†ù-ûGœK~Û“IpÉãÇCZšçu׬YÃ-·ÜBëÖ­ÉÌÌdõêÕ :”qy‹¹÷ôÓ±¬¯n|¸Þ{oçûÕ««=”Ô5®‘¸agBïP=ÃNÔ]m¸fÉ*r~˜k7lgМùä`:{¦&Ñá(¤‡äÝpò<'GOÚ÷ÜDY›6™8¶nåøñãlÛ¶¾}û0bÄ-ZäYç祥l[ÐØ~ïG¯ðÕãâÒ*úEÁKDDĶPã…¹{ .º7¹JOAï[’5¹ ¦i‚±Ï§ª$ ^ý ¬,q²ij«Ç±mᛟޗÒ!Cx¤MÒ>ý~ü‘dzp¡«ÚÑ£GY¹k­»že«÷cÕ´©ã%‘èV£ˆˆ$–Šž‚ÏŒ̶~»¢¿%Y »>ýÔ·™¨W¢ëN–Þ“Æ‘·ö0¨EkøãaãFÎ//ç/GŽP:y2;:ub`ß¾üêåy>·8åN¶~J«Žý*{?èt°åýT®x)GÇ…‚—ˆˆHÍHmÞœnº—™Ýö\¬m>ó@z…±‚UrB ›ï%mÈrfÏvÕ^íݡ9987m¢ý»ïòþ±c¤>òãŸÉ÷?ÿÌÎO>aÕªU|Óõ8Ͻÿ¾§÷ã°i%U:X'v«³ý–(ƒ—j)ED$ž¢6¤gg3jFL/¬:íþó=€ëœly÷5æ\þ=—üýEÞýŸñœÀvŽž[ÊÖ!°|^ƒò^'ó?ÿ¡cŸ>t¼ôRN5ŠËî»˲<½Ÿî³ŠŒ ‹À‚üšprŸ!´¼öJ‰¼DDDľÊé]µP>¬`ƒ¡–²äþåÌÒ‡¾Wgü¼ÒÊÚ«Ç‹YrÿO|µq0W^s#|ü1§lÜÈ¢½{±Z·&µo_ÆõéÃûŠÙõIù†Aç1#¹òÑG™=ûe½! ^"""õ˜×ˆô3û}ÎI§ñãšrFLwÝ^ 6j÷KJØøf)ç?lüu ߟr Ÿy€›Çç’³Îb‰q#Ž>àªädšðÓŽðÓO´;¹ƒÞ¢^¶Ï1£Ê¿½DD¤añv¢}¿i¤4鯒ûRØùIð9w/‡ÌË,Ûó=æääðáš5“ƒuÓML,*âȲe|±p!÷´m YYXú Rðj¡Ë²,Ÿ…/‘†©cVçÜu“—­eßæ¡¬~2-àx\¶ø5ºÎÉÉaéÒ¥X–Åwß}GJJ :u¢ï™gòæÎ_w{2{éMPðª_¡Kb‹ˆH8î°aÓžáÛ÷‡¯ÎCasža{ð×=zàt:ÉÏÏgõêÕdeeaMš4¡{÷î|õÕW*x/….i¸L™Â‰=‡ us^X­þ-Ðà¯ð‹ÓNcþ=÷ðå3Ïpfûö®¹ ²fÍx‚QãúZ]voCªgŠÊCå ²P9Ô²°~1 ³ö°±÷vz\\ –k SëÄn´øíT6¼òlÀ¿µ¼öJÏ>™EEú÷Ÿ9ýH>™§—“™n±å½Ïyrð2Z]÷{’ÜÃÊÇgàÀ3ùgþ6Òºf„ᾸöÚ«¼9|Å"ŒÙyŽaq°ÔöÅTå¡rPY¨º,¦þšïW¯ö4–¿â%¯^wsð¿¹>8xetý.ÜÎù—yã_øx) ïÈgÓŒ;é߬ŒŒ1Çq8v°ýf¤:ˆ±/æ‘Ú¼¹¯Äã–tÛQDD"j€×PÛ½r%…ë|Æúr}Áþ-%ô¹²„áº{NZX3 YrÿræNø¼Å*ø8¦6^"""q¦Ê\ž@…ßãº*YÅ8`ó?çûÕ«U€ ^õ‹{øïÕ†‰ˆHͲàc„L¼:lùÿÛûGDD$VÒ³³É_Ð$òñÀôq¤à%"""‘©œ Òw؉ÎCaËÔm?IDAT+t%µñQðQð//‘„eY–iab‚ ?0*þÃ˰pV•i °,/‘Ú¢á$B0 £JÚµó7¯C—˜r/ õ7‘`t«1…(QðIPºÕ†w[®hkÁüÛƒ‰ˆˆˆ‚—àß >šðe÷9 h¾®»n¢ Aå ²P9¨,T5ò™«à% qÀÔuVP9¨,T* •C4eïÔÆ+ß<I,ªñ Â=l„ÿ²pQðŠ2|Eó7‘@t«QDDDDÁKDDDDÁKDDDD¼DDDD¼DDDD¼TñC=%U*•…ÊAe¡r¨ße¡à%"""¢à%"""¢à%"""" ^""""ñKSÕHæylhsBjî±íþ†Q¯Ê"Òrð~|C>&òü¹õíˆÕ>Çå1a(xÅÅÁìŠä± ­lt,Ô¯²‰vÿü/¬ ­t~4ÌkG}=þc¹Ïñ|LèVcSaѱ oùÚ u]hhÇ€Ý}ŽçrQ—ˆ(tÔ“oÿ*‘ø§à¥ѱ }Oàoÿ*W9(„J¢\7¼jñi´oºû5t! UÏ+…1i¨m¼$1¯™ ^µüTßîEÇBlÏ)•‹ˆ$Ò5Sëãø›¼>Pt,èX¨Z:&De!‰|ÍTW|[¯ÎØ4áßÊFÇBý)µÑ‰¼ê{™©," a¿#Ùçx½f*xÕÑÅÎßêö·a vË¢¾3‘ìk}?.Tº^ÖÇk¦n5Šˆˆˆ(x‰ˆˆˆÄ§ià´ 0]ÿ¶*þs`¹ÒTÅÓ0°°(7¿Žn5Šˆˆˆ„‘œäú1p`bb8Š@–;9 ’Mp``8 /‘hd´s°m÷1Œ$¿Î¸Ú”•YI˜¦‰eZôJwE¬“[¦(x‰ˆÔ&»]Û5„ŒH|ú×ûùüæâ ºuJ‹èyo|ú=#ú´Pð‘úhÂq5PW&’u×õ¶ŠH`¿<÷džÉÛÊÁc¥”–ž®@iIвY#Æ ëe?+x‰Hý`wûD] _"ñ+•®v"8†áúq$á0 0’p8 ¨¸ýèp>_ DÁKDDDÄ®&ÍZàp¤Ääµ¼D¤Þó®ArÿhûP“ÚG:á}°Z+;#¬«ÖK$¾8)üxÐÉÞÃPZ⤴ԤÜtõh4-§é:_MÓi™”›}OM!£}*‡•+x‰ˆ‚˜w¨ 4õH °.TEưDÃÞÃк©ƒ’4¥e&NËÀrZ˜¦A¹Ws:¡´Ì$w íS9¤à%" ]$íÀ£XÖH)t‰$†Ò'%iL§‰Óé Xå5]åNÀ4p‚ëw Œ$׺Ÿ:¼DD"a§÷¤ÝÕP&3©wÁ«ÜôÔt•;+Â`9-JÊ œ¦÷Þà¨8Ç•)x‰ˆD˜býZ `"‰¼ ÊË]39Mˬ­ÞÀÓÆËÂÂÀÀÂᙓ±¨¤â7\ÿ×\""uæüù‹HŸ³¦åšÈiñÈôé×´@GŠ] ê-,ž~ú1ÏŽnåNß/W ^""aR pM`RÈI\e·sÀgÌ ¸Ì"5ÅÄiÀÓO?Tþß´ŒŠà…‚—ˆH4áËû'Ü-Â@Íî먧£H|^,Óâþ;ïò,{â/®õìSy–Ýxë]¸Ú×>‡¼D¤^]Ã-·Û£1POFïŸj]¼cð:"R»œ¦ÓrýÜsÇÝU—;tQºÊ+š€ù0/‘ ‚‘Þ^Tm—Hœ/Ë5`*³ÝsçÝ>ÿÍoï¢ÜÀõc‚iŽX ^""q¾ºDâWy¹«½–Ó ¦ÓÀiÁ5_·Þ~7)É®ÆöNËÒLÌ€¯£á$DDj!|Åòq"R7ç±»¡|’ÃÄYîúBuÛî¢Ôrõz´LÀ¬8—(x‰ˆˆˆDÃ4Mœ¦Ëp`šT aš,Ó¢¼â1¦ FÅðF„Á« îš¾]%.""" Ö€Œ¶í.Æ2 œ^aÊÂÂi%a, ÓÕû±Wº+bµhšd?x™%e*iiÐ>ÛøçöiG·Ni=ïíå?Ó·¥½àUrô°JZDDD¼Þ§4ãe»Ø{¸˜£Ç-Êœe”––‰YQûå݉&%ÙÁ ÍÒ7¬”ý:x ÏéÇ𲈈ˆ4tM1Ë@ù†õò^žbã¹eP´³¢oc3ÏR '!"""RK¼DDDD¼DDDD¼DDDDDÁKDDD$~UéÕ¸ôãe*‘˜¡‚Q µ#vØûµü_3T­]¨ÛÙÇ@‘úÉ;ÛDóÙ6xKuѶ÷ŠÕN‡*ŒX… »Õ ]"""‰œü?Û#É'þµf1¯ñŠe¨Hô€¢€%""RÿÃX¸Ðå}Ç+ÒðUgãxŪöËÿ5µëJ”í‘øèöb 6àáÄd/ÿ°¬ÍV¨¶YÞËÃÝ? Ô`Þ;qÚiɶGò8‰ÿMÖ‰dyTÁ+’•ØYq,^ÏîòpíÑ"ù{u÷[DDDê^<|f×è­Fõö©¥à¡KÁODDDDð‘JÛx-ýx™JFDDD¤¦ƒWÎùÙ*‘Xy¡òWÝj©%Uj¼žš¿S¥RÏÜ:*½Ï"""u¥}ðà;¥LeTOäÎJ ú·[FwU‰ˆˆÔ §ßÝîóïjÝj4ŒQQ=Çý#"""ÒT+xYÖüˆC׸qãXº, 0QðŠ$HEêÕW_eæÌqŒ_5€©6Lê¶o7Ѧm7m[=Þ§úXŽ:GEó¸­Ö$Ù‘Öxy‡¯eË–1s&Ìœ K—Î ;Û7ÔEûú""""ñ(À°ùàYÏm û˜)ׇÿV²lÙ2²½RÖÌ™pà sXæ5në¸qãªÈƒ•úÈέ¿Xí¿÷kzÍD,wÿp忽>(kz?C…Ó@ç€ÝåᎩÙkUC½FI¯páÁ»&*–¡«.ØÝ‡@µc‰|Ñ öa^ÝoŸõá‚i{ªºÚÿPë×6av>k3¨Ø=ìnƒBUÝûz_$!ƒWuäää››KNNNLCW¬j•B=?Ú×®µ]Õù°kèßëjÿëc¹ cµ¹ŸÕ ‚ªI‰Ïk•Þ©·ÁË¿º;€Eº5˜÷5vÇ{Mÿöa¡Ú”y/Ô˜?ÑÃBM| ¬ÕøÕ©)ŠåþGZë¶oï·Už“H=!ílg¤ûR—ï¥ni%îq&R«ÁËΑ°^x)¢ç…[¬q}$¯é:ûDïÉm ×n§¾]°ý÷³®ö?ËÝÎþû‹ý ×9"\™;7ü;›Dú|‰î¼ UžñtŽŠ‚—-vGu›3gsæÌÑ µôaÉ¿ý—Ùù½>”K¤ÃÔäþ‡zìnO¼¼?á¶·&Ë×îûé6Ø-k}Ø×Ì1c·ŒëbQðªSÑÖ€Ù}ÝxÙ?QðŠþ¬¢ý½‚‹Ô¨nÝ{±Ÿý[èµùí8Òm«å­r½RŸŽÛäxÜX­ÚQt´P… ""R‹’q£Ï¸¹µÞ9›.x4èߎ=¦i¨Á«:½ÿÖý}ˆç÷7-×;kñcÇU"""5›nâ7xU÷£5gmÎ$7wˆ˜ ÿóbs‚—µÏT!ˆˆHLÍÿ&%~ƒW,Æ»zpb&fú071{Zl¼eË–‘ ð÷eË–©sNÌ·#’0Ûÿí·¡úWü¿Êï;vpÝ€äíÜÉaC"""‰¼"½Í¸cÇ6ºtéÆm·ÝÀC›·ñ`ææ,77—ÜÜÊðårj"ôÔôëÇRÿþý=ký“OVýûm·±`ýzúOžL^^žÎ ¢>L{U×e 2G¼]ØìpÓò*ü]ºtã¡Í™<´9³ráy•!,BkŸ9Çóã½,Üï¡B˜ÿsü_ß{y¸ÇÅÒº¿týcéÒªpf›—ÇuTy®÷­_Ïë…[_,¶¹ŽAÿã0ÜqY[“£G³m‰hí[m¯Ó{™í öw;ûl‘,·»½‘®+ÖeUÝõ‹Ô7ÉV\lŒ÷Èõ–5?èÿÝÖ¯_ï©õr¯NtéÒ‰; x¨¢â«J Xêª6Ì=µQkæ]ÛENýÝAË‹»¶«ÕùçcYu{ÌÔDè’º ]ÞçtmÔ [§ÿzÃ…‰ê„®@ët¹íô5c]VÕ]¿H½bY`ñ=r}°ÿûÖzÝÌm·Ýá \îðÕ¥K'ZêÀÔj 8áj±Ü¨:AÈn VMÖt¹CLÿ·ßÿÀ¼ÿš¦X²ûú5½àWÛ¬œ]…͘ɓIOO(Ôù‡(ïðîqÁÂ\¼}‡úà©ËZœ`¡!Ôcô!ZwÇT]¬ËÎ6 è"Ò@ƒ—»Ö `âĉPPP@§NÈÈÈ ƒ/ÿ¼:&øëØ­½ò\$µ^ñظ>’Ú®1§žÊŽ;‚Þf¬nP VƒUá+T͒ݹxÙ¶H÷¡¡·¹©­0«õØ NvCW¨š3;_*ììS°šA¯D¹Pžó ¹¹CÈËËã¶ÛîàÜsÏ ##Ãõ€Œ«¸è¢r`¾íPåß>ZÁne{}ïå±ÜŽºtaý¡CÁÿ¾t)‡–.¥Ëå—×xˆ¶Ìÿ¶d¼KÔš@¬’¸á.ÒÐUW爎3QðJ@îäë®BÿþýyòÉ'+ƒpí¹ÉŒ23 „‚…£`-Ô¿Ã-ÕëǪÜÖùõRô¿õØ¿úÿþ÷¤§§Ó¥KvìØüõbÔcÑ;dÕd›®šþV^p ¡Æ \íJMÜÒ­‹ÛÂ5ùZÑ„®P·©k"Ðév¶(xÕ“–“SÀ²³³!ã*2ƒ4°oèük‘Òxœ¿^î eYVÐÐe'ˆj?à¦åA®Á}mÞ† Ô8ݹ»ÇWm7PÕ:k;Ð%BY îç«! ^üË8ÔqSÝ2 ´®PËcùþ„z¾ÚICeÐ~•Ö®1-ŸDᾃÜ}Ñ6r§”ÅõFŸqsëˆjN¼ØC=Dnnnƒ™:èÒG¹uTÕÆðOÍßɼ5Í>'ý‡Ç3&pƒ8ï†õ=ô‡{O«7e¥I²¥&jdT£#Ò°åÎJá¡7Άcû`çòúWã¬6Ç]&ᥧ§{&ÅöÖ¥KÏïëׯWA‰ˆˆD(¹¡ì¨O{¡sôƇò·¿ýÖ­[û-€eË–y~?tè;vì uo•—ÔoÕ­­Rm—ˆ$|ðÒ-!ûrg¥DRss‡ØzœˆˆˆÔóà%5O¡JDDDÁKbH5‡"""µË¡"©ªñjàŒÆ·ºfLp¤AÒ € ÎB0‹*–7†¤V®åÅXeÿPÁ‰ˆˆDA5^ ³˜ñ·\Ï„[¦‚³ˆQ7_Ǩ›§€óão¹žñ·\ÎcŒºù:.¿ñšÊ0&A­#ÊkJ—ê—ʰþËzO£+“†^nªñjðÁë¯þõOŸÿÄíž?UYn91¬â 'N4ÝæíŒž]×x ÐHßõapÎÚ¹>Ø:#}ï«3eN¸ÑÜí,·»½‘®+ÖeUÝõÇË1Ó®5¡Žg ¬à%Õ=©¬bLÓÀáp`:½~²<Ö‰x:©íÌQ'‰}Q¶ÎpÓúØù›ÝoûÖér;Ûékƺ¬ª»þúq»u]Tð’ù µ[³åQ޶ X€Šö"í·öX3ô¡®L¼Ÿãÿ˜`µh ý"î¸ 6§e°åÞϯ‰2 vL„:Ïì¼–m­í d§f-Ô1É9((Ú Ý¡ž_×P;µ’±x¼Ýës´_Vêò¯à%µÊ»ËÎï¡N ÿyÿ«HN»ß–k£æ,Øk‡Zgm^B­+Øûì1º­Pw¯.ÖÉ­ÑXÖrÇ"à۹ƛÈ<šóÇΤèážëkh¨uÇâñv|¸ýŒ¤Üêâ¯à%µÊç–¢ß#­µªî‡Euê"VSÛ‹çE[ëiíFmm³ÂPÍ­'š/1¡–‡úÀ³óe¢¶jÉjë}Ф¦*Òçׯ5´&ÏñX¼N¼\ã¼D¢¸èEzk¡:µI±Þþx 굕Øá.ÒÐ¥ò«ùkU}ÙÖX]+âá_Û†®„ ˜ÃáðÔdÙùÝî ͉a·Z>Ò;.Ô±¼PD[¾‰öáZÇëz,×îµ¢ ]Þ它A¸¶† %tź ªs ­ËëR]mK"Õv¥/‰þVc Æ˜þí¢m((\ø¿®÷òš¼H…zíPíTbÕŽ%šmŒv]µèj³Œ¢]g  z¨6*þËC=?Ô1êx¯Î‡™ÆÔ±zj{Ÿ¢=¦ínÝNÑÞžŒæ麫óx;LbQnµ}¯õ€IûuV£vMh1¸-…ûr÷EÛÈR¦4ROäÎJáÖQéU–?5'¹SÊp8FG¼LóÝ„ú–ªâR—ÇŽ?Ñu¬a—Mî¬zãl8¶v~¦/‰¾W£ˆˆˆDFÁ«‹¦ö*ñ0(ªH]?:þD×1•7Ucˆˆˆˆ(x‰ˆˆˆÔ/ºÕØÐ㲨žWn½£ÂQð’ÈCT¹Ï¿-\ãº%ZAš‘hèV£Ä¥ú88h"ï“F°Í ˜""ªºÎ†§¦Ëû÷H>Piž»xÚ'»ÛTß&±®íTƒ­3Ø‘ƒ‘L:èý´»ÜîöFº®X—Uu×/¢à% "tëVc¸ÛŽuñÁ¯)IêXL–«u†]ÞÎßì›ÁÖér;Ûékƺ¬ª»~‘úH·%`è ¦¯C¶.–ÞS§x/sÿZhî½@Ëkº¦«.öÉ®pÓÚÿÿ{?¦&¶±!ÂPSÊ„{½š8~ƒ·‘n§ÿñmg[5±ºHdTã%€o–;\­ßÔ*âÛŽ¡.ÈÁ>È"]OÈñ²O¡‚B°möÕDÔÝñTëŠäÖ¨Ž/©Å`fN,«Ɇ½oɑܺ‰×Åxܧ@·jÂ=>ÚýVŠÿõØ NvCW¨š3;·íìS}šðXDÁKª¥¯C¬ßÔªÊï®Ð•TÑæ+)ä…ÙÎ…?.ºõqŸ"ýׇcb‡»HCW]œ_:Τ¡Q/ ºÀu«±¯CôïuËr…-ïÛõñ[k¢ìSC¨1Ôö,’Çk ªÉ[̱]ÚFúÚñBEâj¼$`èŠu×(<зàpÈ5uÁ®‹}Šõ6G»ÎÚt±Úîš\g ã,Ø1hy¨ç{oC°íªnëœb§ÓJu×êùj7& •AûuV£vMh1¸-…ûr÷EÛÈR¦’©'rg¥pë¨ô*ËŸš¿“Ü)e$—U¹>lZ7’c6eP}ü¶«oðèýÔñ "^ŸÃ½q6Û;?Ó­F‘Ú¢[R§s/ÖÇšÕnèýÔñ " ^P¬nŠˆˆHxËPAˆˆˆˆÔÃ¸ÔÆKDDD¤–èVcCào«bl.G$˜à,³¨bycHjåZ^\€UöœˆˆHTãÕÐ9‹ËõL¸e*8‹uóuŒºy 81þ–ëËõà<ƨ›¯ãò¯© cbk /mcý¿këù’øÇO¬Ž†>‰}<œÏÕ¡¯¼ñê_ñdðùOÜîùS•å–Ã*ö9hÍÛfwDë`ƒuà±6§W ¶=ñp¡4g¤s7Æó°.ÞçPSCÅzTøpûÉr»Ûéºb]VÕ]M£vÕ1lŽËhÎ[»³ÄKÙÔÄy›è=…¼zê·Š1M‡Ãéôú=ÈòX…†h.T5-Ôhãñ,‘CWm¿ÏÁÖÉèÕ©I´û!n¹íô5c]VÕ]Mï±8ö¢Ù—š<Æã©lDÁKjà¯Éi{¡VÆÎ7ÝÚØ'ÿ)j¢ ‘L'S¯¿„ù0 U[.ÕDY;#ù²í¶ÖÕ—¤HBžÝ2 v…:çíî«wmM õDS[ɺë¢lB-‹ô˜ 6 —ÿëû—M<^˼ħËÎïÕ iáNÖ@'F<|Û v‘uñ¨‰¤p5*væ ·ÜξIͦÚ\W$·Fãí–“÷6y‡ƒ@A9Úyÿ ÍíçhB°Ýs3Þ˦6®#ÁY¼^˼Ä÷–¢ß£­õŠö"ûhbƺg$·Ãêj†jw=Ñ|X†ZêÃÓΗ »×‚êwvkfj󼈗kU¼•M¨šáDoŸªà%ú¬¥íˆä¢“ÕdÕïc»:5]µuÜÅcø´ÁC:ªs‹³:AÏûù‰\æNBp8žš,;¿ÇúÛkC¹%BÍR<…é¿ãõ¸‹å:¢½õe·g\¸vz/×EyDs,DÚ[0Ñ®UuQ6áÂ[$eçnOI»ºx¥/©Ö­F;š‘4â uB×ÕÉêbªñ|¨vmµ½­v—×vÇCEs›.’¶s¡žïÿ¡ª}N´eì<²s~UwÝvÚvÆj¸ÿæ Ñ6µÝÁ–G{­ Ô¼ºeOeS_Ê«û%..î¢Ð~•Ö¾ -ÏnKᾃÜ}Ñ6r§”)Ô¹³R¸uTz•åOÍßIî”2ŽÑ/Ó|W+ Fuk4Ô1!±ß?•Mb¯;ÞÿÜY)<ôÆÙp||·\5^R;½EDDÂ…¤@ê[pVðjàT{%Zu/úªmIì÷OeS{ëncB‚׋ˆˆˆ(x‰ˆˆˆ(x‰ˆˆˆˆ‚—ˆˆˆˆ‚—ˆˆˆˆ(x‰ˆˆˆ(x‰ˆˆˆÔÇàeX*‘c¹—j¼DDDDj‰‚—ˆˆˆˆ‚—ˆˆˆˆ‚—ˆˆˆˆ(x‰ˆˆˆ(x‰ˆˆˆ(x©DDDD¼DDDD¼DDDDDÁKDDDDÁKDDDDÁKDDDD¼DDDD¼DDDDDÁKDDDDÁKDDDDÁKDDDD¼DDDD¼DDDDDÁKDDDDÁKDDDDÁKDDDDjš¥à%"""Rk¼DDDD¼DDDD¼DDDDDÁKDDDDÁKDDDDÁKE """¢à%"""¢à%"""" ^"""" ^"""" ^""""¢à%"""¢à%"""" ^"""" ^"""" ^""""¢à%"""¢à%"""" ^""""q*9ÐÂÜY)*™@ﳈˆHí2h¿ÎjÔ® MNmFr»Æî;ˆUÚ<ê,)IS©Šˆˆˆ¸Û‡vÁ¡]•5^eÇŽaî-Åq¬œÒ⟣qg5kQ,+Q#l5ö¹ZONÌ6¬:*ì:<ÆŒ:ÜîꬻÚåeÔÑñi%ê¡îŠº!^‹â5´NßçºZ·Q‡ï³¥GÁ2ÁH"çw(¤ø€{Ãê:ø$è d5À⪫sè»7˪«°Y‡Ž:ý\ª«÷ª.¯ 0 g»ëêk€×1êúœNLp–òÿ´ \Ïõy‰IEND®B`‚liborigin2-20110117/FORMAT0000644000265600020320000000347311523526505014225 0ustar andreasadminOrigin 7.5 column value display ############################### Numeric, Text&Numeric: Decimal:1000 = 0 Scientific:1E3 = 1 Engeneering:1k = 2 Decimal:1,000 = 3 Time: hh:mm = 0 hh = 1 hh:mm:ss = 2 hh:mm:ss.zz = 3 hh ap = 4 hh:mm ap = 5 mm:ss = 6 mm:ss.zz = 7 hhmm = 8 hhmmss = 9 hh:mm:ss.zzz = 10 Date: dd/MM/yyyy = -128 dd/MM/yyyy HH:mm = -119 dd/MM/yyyy HH:mm:ss = -118 dd.MM.yyyy = 0 y. = 1 (year abbreviation - for instance, 'ã.' in russian) MMM d = 2 M/d = 3 d = 4 ddd = 5 F = 6 (first letter of day of week) yyyy = 7 yy = 8 dd.MM.yyyy hh:mm = 9 dd.MM.yyyy hh:mm:ss = 10 yyMMdd = 11 yyMMdd hh:mm = 12 yyMMdd hh:mm:ss = 13 yyMMdd hhmm = 14 yyMMdd hhmmss = 15 MMM = 16 J = 17 (first letter of month) Q1 = 18 (quartal) M-d-yyyy (Custom1) = 19 hh:mm:ss.zzzz (Custom2) = 20 Month: MMM = 0 MMMM = 1 J = 2 (first letter of month) Day of Week: ddd = 0 dddd = 1 F = 2 (first letter of day of week) Fill Area Patterns none = 0 /// = 1 / / = 2 / = 3 \\\ = 4 \ \ = 5 \ = 6 xxx = 7 x x = 8 x = 9 --- = 10 - - = 11 - = 12 ||| = 13 | | = 14 | = 15 +++ = 16 + + = 17 + = 18 liborigin2-20110117/OriginParser.cpp0000644000265600020320000001715311523526505016422 0ustar andreasadmin/*************************************************************************** File : OriginParser.cpp -------------------------------------------------------------------- Copyright : (C) 2008 Alex Kargovsky Email (use @ for *) : kargovsky*yumr.phys.msu.su Description : Origin file parser base class ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #include "OriginParser.h" #include #include #include #include #include using namespace boost; using namespace boost::algorithm; using namespace Origin; vector::size_type OriginParser::findSpreadByName(const string& name) const { vector::const_iterator it = find_if(speadSheets.begin(), speadSheets.end(), bind(iequals, bind(&SpreadSheet::name, _1), name, locale())); return it != speadSheets.end() ? it - speadSheets.begin() : -1; } vector::size_type OriginParser::findExcelByName(const string& name) const { vector::const_iterator it = find_if(excels.begin(), excels.end(), bind(iequals, bind(&Excel::name, _1), name, locale())); return it != excels.end() ? it - excels.begin() : -1; } vector::size_type OriginParser::findSpreadColumnByName(vector::size_type spread, const string& name) const { vector::const_iterator it = find_if(speadSheets[spread].columns.begin(), speadSheets[spread].columns.end(), bind(&SpreadColumn::name, _1) == name); return it != speadSheets[spread].columns.end() ? it - speadSheets[spread].columns.begin() : -1; } vector::size_type OriginParser::findExcelColumnByName(vector::size_type excel, vector::size_type sheet, const string& name) const { vector::const_iterator it = find_if(excels[excel].sheets[sheet].columns.begin(), excels[excel].sheets[sheet].columns.end(), bind(&SpreadColumn::name, _1) == name); return it != excels[excel].sheets[sheet].columns.end() ? it - excels[excel].sheets[sheet].columns.begin() : -1; } vector::size_type OriginParser::findMatrixByName(const string& name) const { vector::const_iterator it = find_if(matrixes.begin(), matrixes.end(), bind(iequals, bind(&Matrix::name, _1), name, locale())); return it != matrixes.end() ? it - matrixes.begin() : -1; } vector::size_type OriginParser::findFunctionByName(const string& name) const { vector::const_iterator it = find_if(functions.begin(), functions.end(), bind(iequals, bind(&Function::name, _1), name, locale())); return it != functions.end() ? it - functions.begin() : -1; } pair OriginParser::findDataByIndex(unsigned int index) const { for(vector::const_iterator it = speadSheets.begin(); it != speadSheets.end(); ++it) { for(vector::const_iterator it1 = it->columns.begin(); it1 != it->columns.end(); ++it1) { if(it1->index == index) return make_pair("T_" + it->name, it1->name); } } for(vector::const_iterator it = matrixes.begin(); it != matrixes.end(); ++it) { if(it->index == index) return make_pair("M_" + it->name, it->name); } for(vector::const_iterator it = excels.begin(); it != excels.end(); ++it) { for(vector::const_iterator it1 = it->sheets.begin(); it1 != it->sheets.end(); ++it1) { for(vector::const_iterator it2 = it1->columns.begin(); it2 != it1->columns.end(); ++it2) { if(it2->index == index) return make_pair("E_" + it->name, it2->name); } } } for(vector::const_iterator it = functions.begin(); it != functions.end(); ++it) { if(it->index == index) return make_pair("F_" + it->name, it->name); } return pair(); } pair OriginParser::findObjectByIndex(unsigned int index) const { for(vector::const_iterator it = speadSheets.begin(); it != speadSheets.end(); ++it) { if(it->objectID == index) return make_pair(ProjectNode::SpreadSheet, it->name); } for(vector::const_iterator it = matrixes.begin(); it != matrixes.end(); ++it) { if(it->objectID == index) return make_pair(ProjectNode::Matrix, it->name); } for(vector::const_iterator it = excels.begin(); it != excels.end(); ++it) { if(it->objectID == index) return make_pair(ProjectNode::Excel, it->name); } for(vector::const_iterator it = graphs.begin(); it != graphs.end(); ++it) { if(it->objectID == index){ if (it->is3D) return make_pair(ProjectNode::Graph3D, it->name); else return make_pair(ProjectNode::Graph, it->name); } } return pair(); } void OriginParser::convertSpreadToExcel(vector::size_type spread) { //add new Excel sheet excels.push_back(Excel(speadSheets[spread].name, speadSheets[spread].label, speadSheets[spread].maxRows, speadSheets[spread].hidden, speadSheets[spread].loose)); for(vector::iterator it = speadSheets[spread].columns.begin(); it != speadSheets[spread].columns.end(); ++it) { unsigned int index = 0; int pos = it->name.find_last_of("@"); if(pos != -1) { index = lexical_cast(it->name.substr(pos + 1).c_str()) - 1; it->name = it->name.substr(0, pos); } if(excels.back().sheets.size() <= index) excels.back().sheets.resize(index + 1); excels.back().sheets[index].columns.push_back(*it); } speadSheets.erase(speadSheets.begin() + spread); } int OriginParser::findColumnByName(int spread, const string& name) { unsigned int columns = speadSheets[spread].columns.size(); for (unsigned int i = 0; i < columns; i++){ string colName = speadSheets[spread].columns[i].name; if (colName.size() >= 11) colName.resize(11); if (name == colName) return i; } return -1; } liborigin2-20110117/Origin750Parser.h0000644000265600020320000000671611523526505016326 0ustar andreasadmin/*************************************************************************** File : Origin750Parser.h -------------------------------------------------------------------- Copyright : (C) 2007-2008 Alex Kargovsky, Stefan Gerlach, Ion Vasilief Email (use @ for *) : kargovsky*yumr.phys.msu.su, ion_vasilief*yahoo.fr Description : Origin 7.5 file parser class ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #ifndef ORIGIN_750_PARSER_H #define ORIGIN_750_PARSER_H #include "OriginParser.h" #include "endianfstream.hh" #include #include using namespace std; using namespace Origin; class Origin750Parser : public OriginParser { public: Origin750Parser(const string& fileName); bool parse(); protected: void readSpreadInfo(); void readExcelInfo(); void readMatrixInfo(); void readGraphInfo(); unsigned int readGraphAxisInfo(GraphAxis& axis); void readGraphGridInfo(GraphGrid& grid); void readGraphAxisBreakInfo(GraphAxisBreak& axis_break); void readGraphAxisFormatInfo(GraphAxisFormat& format); void readGraphAxisTickLabelsInfo(GraphAxisTick& tick); void readGraphAxisPrefixSuffixInfo(const string& sec_name, unsigned int size, GraphLayer& layer); void readProjectTree(); virtual void readProjectTreeFolder(tree::iterator parent); void readWindowProperties(Window& window, unsigned int size); virtual void readColorMap(ColorMap& colorMap); void skipLine(); inline double stringToDouble(const string& s) { string s1 = s; size_t pos = s.find(","); if (pos != string::npos) s1.replace(pos, 1, "."); return strtod(s1.c_str(), NULL); } inline boost::posix_time::ptime doubleToPosixTime(double jdt) { return boost::posix_time::ptime(boost::gregorian::date(boost::gregorian::gregorian_calendar::from_julian_day_number(jdt+1)), boost::posix_time::seconds((jdt-(int)jdt)*86400)); } unsigned int objectIndex; iendianfstream file; unsigned int d_file_size; unsigned int d_colormap_offset; unsigned int d_start_offset; }; #endif // ORIGIN_750_PARSER_H liborigin2-20110117/Origin600Parser.cpp0000644000265600020320000000434211523526505016644 0ustar andreasadmin/*************************************************************************** File : Origin600Parser.cpp -------------------------------------------------------------------- Copyright : (C) 2010 Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : Origin 6.0 file parser class (uses code from file Origin750Parser.cpp written by Alex Kargovsky) ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #include "Origin600Parser.h" #include #include #include #include #include using namespace boost; Origin600Parser::Origin600Parser(const string& fileName) : Origin610Parser(fileName) { d_start_offset = 0xE; } OriginParser* createOrigin600Parser(const string& fileName) { return new Origin600Parser(fileName); } liborigin2-20110117/readme0000755000265600020320000000204111523526505014463 0ustar andreasadminliborigin2 --------------------- AUTHORS: Ion Vasilief, Alex Kargovsky CONTRIBUTORS: Stefan Gerlach DEPENDENCIES: liborigin2 depends on the BOOST C++ libraries (version >= 1.33.0): http://www.boost.org/, tree.hh: http://tree.phi-sci.com/ and an old version of loglite: http://code.google.com/p/loglite/ --------------------------------------------------------------------------- COMPILING: liborigin2 uses qmake for the building process. qmake is part of a Qt distribution: http://trolltech.com/ qmake reads project files, that contain the options and rules how to build a certain project. A project file ends with the suffix "*.pro". Please read the qmake documentation for more details. After installing qmake, tree.hh and the BOOST C++ libraries on your system, type the following command lines: $ qmake $ make --------------------------------------------------------------------------- FEATURES : * supports the import of 6.0 - 8.1 projects --------------------------------------------------------------------------- liborigin2-20110117/OriginFile.h0000644000265600020320000000676511523526505015521 0ustar andreasadmin/*************************************************************************** File : OriginFile.h -------------------------------------------------------------------- Copyright : (C) 2007-2008 Alex Kargovsky (C) 2008-2011 Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : Origin file import class ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #ifndef ORIGIN_FILE_H #define ORIGIN_FILE_H /* version 0.0 2011-01-17 */ #define LIBORIGIN_VERSION 0x00110117 #define LIBORIGIN_VERSION_STRING "2011-01-17" #include "OriginObj.h" #include "OriginParser.h" #include using namespace std; class OriginFile { public: OriginFile(const string& fileName); bool parse(); //!< parse Origin file double version() const; //!< get version of Origin file vector::size_type spreadCount() const; //!< get number of spreadsheets Origin::SpreadSheet& spread(vector::size_type s) const; //!< get spreadsheet s vector::size_type matrixCount() const; //!< get number of matrices Origin::Matrix& matrix(vector::size_type m) const; //!< get matrix m vector::size_type functionCount() const; //!< get number of functions vector::size_type functionIndex(const string& name) const; //!< get name of function s Origin::Function& function(vector::size_type f) const; //!< get function f vector::size_type graphCount() const; //!< get number of graphs Origin::Graph& graph(vector::size_type g) const; //!< get graph g vector::size_type noteCount() const; //!< get number of notes Origin::Note& note(vector::size_type n) const; //!< get note n const tree* project() const; //!< get project tree string resultsLogString() const; //!< get Results Log private: unsigned int fileVersion, buildVersion; auto_ptr parser; }; #endif // ORIGIN_FILE_H liborigin2-20110117/Origin800Parser.cpp0000644000265600020320000015722211523526505016654 0ustar andreasadmin/*************************************************************************** File : Origin800Parser.cpp -------------------------------------------------------------------- Copyright : (C) 2010 Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : Origin 8.0 file parser class (uses code from file Origin750Parser.cpp written by Alex Kargovsky) ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #include "Origin800Parser.h" #include #include #include #include #include using namespace boost; Origin800Parser::Origin800Parser(const string& fileName) : Origin750Parser(fileName) { d_colormap_offset = 0x25B; d_start_offset = 0x10 + 1; notes_pos_mark = "H"; } bool Origin800Parser::parse() { if (fileVersion >= 2882) d_colormap_offset = 0x25F; unsigned int dataIndex = 0; // get length of file: file.seekg (0, ios::end); d_file_size = file.tellg(); stringstream out; unsigned char c; /////////////////// find column /////////////////////////////////////////////////////////// file.seekg(d_start_offset, ios_base::beg); unsigned int size; file >> size; file.seekg(1 + size + 1 + 5, ios_base::cur); file >> size; file.seekg(1, ios_base::cur); BOOST_LOG_(1, format(" [column found = %d/0x%X @ 0x%X]") % size % size % (unsigned int) file.tellg()); unsigned int colpos = file.tellg(); unsigned int current_col = 1, nr = 0, nbytes = 0; while(size > 0 && size <= 0x8C){// should be 0x72, 0x73 or 0x83 ? //////////////////////////////// COLUMN HEADER ///////////////////////////////////////////// short data_type; char data_type_u; unsigned int oldpos = file.tellg(); file.seekg(oldpos + 0x16, ios_base::beg); file >> data_type; file.seekg(oldpos + 0x3F, ios_base::beg); file >> data_type_u; char valuesize; file.seekg(oldpos + 0x3D, ios_base::beg); file >> valuesize; BOOST_LOG_(1, format(" [valuesize = %d @ 0x%X]") % (int)valuesize % ((unsigned int) file.tellg()-1)); if(valuesize <= 0) { BOOST_LOG_(1, format(" WARNING : found strange valuesize of %d") % (int)valuesize); valuesize = 10; } file.seekg(oldpos + 0x58, ios_base::beg); BOOST_LOG_(1, format(" [Spreadsheet @ 0x%X]") % (unsigned int) file.tellg()); string name(25, 0); file >> name; string::size_type pos = name.find_last_of("_"); string columnname; if(pos != string::npos){ columnname = name.substr(pos + 1); name.resize(pos); } BOOST_LOG_(1, format(" NAME: %s") % name.c_str()); unsigned int spread = 0; if(columnname.empty()){ BOOST_LOG_(1, "NO COLUMN NAME FOUND! Must be a Matrix or Function."); ////////////////////////////// READ matrixes or functions //////////////////////////////////// BOOST_LOG_(1, format(" [position @ 0x%X]") % (unsigned int) file.tellg()); // TODO short signature; file >> signature; BOOST_LOG_(1, format(" SIGNATURE : %02X ") % signature); file.seekg(oldpos + size + 1, ios_base::beg); file >> size; file.seekg(1, ios_base::cur); size /= valuesize; BOOST_LOG_(1, format(" SIZE = %d") % size); switch(signature) { case 0x50CA: case 0x70CA: case 0x50F2: case 0x50E2: case 0x50C8: case 0x50E7: case 0x50DB: case 0x50DC: case 0x70E2: pos = name.find_first_of("@"); if(pos != string::npos){ name.resize(pos); file.seekg(valuesize*size, ios_base::cur); //BOOST_LOG_(1, format("MATRIX %s is multisheet, only first shit will be imported!") % name.c_str()); unsigned int sheets = matrixes.back().sheets; sheets++; matrixes.back().sheets = sheets; dataIndex++; break; } BOOST_LOG_(1, "NEW MATRIX"); matrixes.push_back(Matrix(name, dataIndex)); //BOOST_LOG_(1, format("MATRIX %s has dataIndex: %d") % name.c_str() % dataIndex); ++dataIndex; BOOST_LOG_(1, "VALUES :"); out.str(size > 100 ? "matrix too big..." : string()); switch(data_type) { case 0x6001://double for(unsigned int i = 0; i < size; ++i) { double value; file >> value; matrixes.back().data.push_back((double)value); //if(size < 100) //out << format("%g ") % matrixes.back().data.back(); } //BOOST_LOG_(1, out.str()); break; case 0x6003://float for(unsigned int i = 0; i < size; ++i) { float value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); break; case 0x6801://int if(data_type_u == 8)//unsigned { for(unsigned int i = 0; i < size; ++i) { unsigned int value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } else { for(unsigned int i = 0; i < size; ++i) { int value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } break; case 0x6803://short if(data_type_u == 8)//unsigned { for(unsigned int i = 0; i < size; ++i) { unsigned short value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } else { for(unsigned int i = 0; i < size; ++i) { short value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } break; case 0x6821://char if(data_type_u == 8)//unsigned { for(unsigned int i = 0; i < size; ++i) { unsigned char value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } else { for(unsigned int i = 0; i < size; ++i) { char value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } break; default: BOOST_LOG_(1, format("UNKNOWN MATRIX DATATYPE: %02X SKIP DATA") % data_type); file.seekg(valuesize*size, ios_base::cur); matrixes.pop_back(); } break; case 0x10C8: BOOST_LOG_(1, "NEW FUNCTION"); functions.push_back(Function(name, dataIndex)); ++dataIndex; file >> functions.back().formula.assign(valuesize, 0); oldpos = file.tellg(); short t; file.seekg(colpos + 0xA, ios_base::beg); file >> t; if(t == 0x1194) functions.back().type = Function::Polar; file.seekg(colpos + 0x21, ios_base::beg); file >> functions.back().totalPoints; file >> functions.back().begin; double d; file >> d; functions.back().end = functions.back().begin + d*(functions.back().totalPoints - 1); BOOST_LOG_(1, format("FUNCTION %s : %s") % functions.back().name.c_str() % functions.back().formula.c_str()); BOOST_LOG_(1, format(" interval %g : %g, number of points %d") % functions.back().begin % functions.back().end % functions.back().totalPoints); file.seekg(oldpos, ios_base::beg); break; default: BOOST_LOG_(1, format("UNKNOWN SIGNATURE: %.2X SKIP DATA") % signature); file.seekg(valuesize*size, ios_base::cur); ++dataIndex; if(valuesize != 8 && valuesize <= 16) { file.seekg(2, ios_base::cur); } } } else { // worksheet if(speadSheets.size() == 0 || findSpreadByName(name) == -1) { BOOST_LOG_(1, "NEW SPREADSHEET"); current_col = 1; speadSheets.push_back(SpreadSheet(name)); spread = speadSheets.size() - 1; speadSheets.back().maxRows = 0; } else { spread = findSpreadByName(name); current_col = speadSheets[spread].columns.size(); if(!current_col) current_col = 1; ++current_col; } speadSheets[spread].columns.push_back(SpreadColumn(columnname, dataIndex)); string::size_type sheetpos = speadSheets[spread].columns.back().name.find_last_of("@"); if(sheetpos != string::npos){ unsigned int sheet = lexical_cast(columnname.substr(sheetpos + 1).c_str()); if( sheet > 1){ speadSheets[spread].multisheet = true; speadSheets[spread].columns.back().name = columnname; speadSheets[spread].columns.back().sheet = sheet - 1; if (speadSheets[spread].sheets < sheet) speadSheets[spread].sheets = sheet; } } BOOST_LOG_(1, format("SPREADSHEET = %s SHEET = %d COLUMN NAME = %s (%d) (@0x%X)") % name % speadSheets[spread].columns.back().sheet % columnname % current_col % (unsigned int)file.tellg()); ++dataIndex; ////////////////////////////// SIZE of column ///////////////////////////////////////////// file.seekg(oldpos + size + 1, ios_base::beg); file >> nbytes; if(fmod(nbytes, (double)valuesize)>0) { BOOST_LOG_(1, "WARNING: data section could not be read correct"); } nr = nbytes / valuesize; BOOST_LOG_(1, format(" [number of rows = %d (%d Bytes) @ 0x%X]") % nr % nbytes % (unsigned int)file.tellg()); speadSheets[spread].maxRows> value; out << format("%g ") % value; speadSheets[spread].columns[(current_col-1)].data.push_back(value); } else if((data_type & 0x100) == 0x100) // Text&Numeric { file >> c; file.seekg(1, ios_base::cur); if(c == 0) //value { file >> value; out << format("%g ") % value; speadSheets[spread].columns[(current_col-1)].data.push_back(value); file.seekg(valuesize - 10, ios_base::cur); } else //text { string stmp(valuesize - 2, 0); file >> stmp; if(stmp.find(0x0E) != string::npos) // try find non-printable symbol - garbage test stmp = string(); speadSheets[spread].columns[(current_col-1)].data.push_back(stmp); out << format("%s ") % stmp; } } else //text { string stmp(valuesize, 0); file >> stmp; if(stmp.find(0x0E) != string::npos) // try find non-printable symbol - garbage test stmp = string(); speadSheets[spread].columns[(current_col-1)].data.push_back(stmp); out << format("%s ") % stmp; } } BOOST_LOG_(1, out.str()); } if(nbytes > 0 || columnname.empty()) { file.seekg(1, ios_base::cur); } file >> size; file.seekg(1 + size + (size > 0 ? 1 : 0), ios_base::cur); file >> size; file.seekg(1, ios_base::cur); BOOST_LOG_(1, format(" [column found = %d/0x%X (@ 0x%X)]") % size % size %((unsigned int) file.tellg()-5)); colpos = file.tellg(); } //////////////////////////////////////////////////////////////////////////// ////////////////////// HEADER SECTION ////////////////////////////////////// unsigned int POS = (unsigned int)file.tellg()-11; BOOST_LOG_(1, "\nHEADER SECTION"); BOOST_LOG_(1, format(" nr_spreads = %d") % speadSheets.size()); BOOST_LOG_(1, format(" [position @ 0x%X]") % POS); POS += 0xB; file.seekg(POS, ios_base::beg); while(POS < d_file_size){ POS = file.tellg(); file >> size; if(size == 0) break; file.seekg(POS + 0x7, ios_base::beg); string name(25, 0); file >> name; file.seekg(POS, ios_base::beg); if(findSpreadByName(name) != -1) readSpreadInfo(); else if(findMatrixByName(name) != -1) readMatrixInfo(); else if(findExcelByName(name) != -1) readExcelInfo(); else readGraphInfo(); POS = file.tellg(); } readNotes(); readResultsLog(); file.seekg(1 + 4*5 + 0x10 + 1, ios_base::cur); try { readProjectTree(); } catch(...) {} BOOST_LOG_(1, "Done parsing"); BOOST_LOG_FINALIZE(); return true; } void Origin800Parser::readNotes() { unsigned int pos = findStringPos(notes_pos_mark); file.seekg(pos, ios_base::beg); unsigned int sectionSize; file >> sectionSize; while(pos < d_file_size){ file.seekg(1, ios_base::cur); Rect rect; unsigned int coord; file >> coord; rect.left = coord; file >> coord; rect.top = coord; file >> coord; rect.right = coord; file >> coord; rect.bottom = coord; if (!rect.bottom || !rect.right) break; unsigned char state; file.seekg(0x8, ios_base::cur); file >> state; double creationDate, modificationDate; file.seekg(0x7, ios_base::cur); file >> creationDate; file >> modificationDate; file.seekg(0x8, ios_base::cur); unsigned char c; file >> c; unsigned int labellen; file.seekg(0x3, ios_base::cur); file >> labellen; skipLine(); unsigned int size; file >> size; file.seekg(1, ios_base::cur); string name(size, 0); file >> name; notes.push_back(Note(name)); notes.back().objectID = objectIndex; ++objectIndex; notes.back().frameRect = rect; if (creationDate >= 1e10) return; notes.back().creationDate = doubleToPosixTime(creationDate); if (modificationDate >= 1e10) return; notes.back().modificationDate = doubleToPosixTime(modificationDate); if(c == 0x01) notes.back().title = Window::Label; else if(c == 0x02) notes.back().title = Window::Name; else notes.back().title = Window::Both; if(state == 0x07) notes.back().state = Window::Minimized; else if(state == 0x0b) notes.back().state = Window::Maximized; notes.back().hidden = (state & 0x40); file.seekg(1, ios_base::cur); file >> size; file.seekg(1, ios_base::cur); if(labellen > 1){ file >> notes.back().label.assign(labellen - 1, 0); file.seekg(1, ios_base::cur); } file >> notes.back().text.assign(size - labellen, 0); BOOST_LOG_(1, format("NOTE %d NAME: %s") % notes.size() % notes.back().name); BOOST_LOG_(1, format("NOTE %d LABEL: %s") % notes.size() % notes.back().label); BOOST_LOG_(1, format("NOTE %d TEXT: %s") % notes.size() % notes.back().text); file.seekg(1, ios_base::cur); pos = file.tellg(); file >> size; if(size != sectionSize) break; } } void Origin800Parser::readResultsLog() { int pos = findStringPos("ResultsLog"); if (pos < 0) return; file.seekg(pos + 12, ios_base::beg); unsigned int size; file >> size; file.seekg(1, ios_base::cur); resultsLog.resize(size); file >> resultsLog; BOOST_LOG_(1, format("Results Log: %s") % resultsLog); } void Origin800Parser::readSpreadInfo() { unsigned int POS = file.tellg(); unsigned int size; file >> size; POS += 5; // check spreadsheet name file.seekg(POS + 0x2, ios_base::beg); string name(25, 0); file >> name; BOOST_LOG_(1, format(" SPREADSHEET: %s (@ 0x%X)]") % name % file.tellg()); BOOST_LOG_(1, format(" [Spreadsheet SECTION (@ 0x%X)]") % POS); int spread = findSpreadByName(name); speadSheets[spread].name = name; file.seekg(POS, ios_base::beg); readWindowProperties(speadSheets[spread], size); speadSheets[spread].loose = false; char c = 0; unsigned int LAYER = POS + size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; LAYER += size + 0x6; file.seekg(LAYER, ios_base::beg); file >> size; // LAYER section unsigned int sectionSize = size; while(size && LAYER < d_file_size){ //section_header_size=0x6F(4 bytes) + '\n' LAYER += 0x5; //section_header file.seekg(LAYER + 0x46, ios_base::beg); string sec_name(41, 0); file >> sec_name; BOOST_LOG_(1, format(" SECTION NAME: %s (@ 0x%X)") % sec_name % (LAYER + 0x46)); //section_body_1_size LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_1 LAYER += 0x5; file.seekg(LAYER, ios_base::beg); int col_index = findSpreadColumnByName(spread, sec_name); if(col_index != -1){//check if it is a formula file >> speadSheets[spread].columns[col_index].command.assign(size, 0); BOOST_LOG_(1, format(" Column: %s has formula: %s") % sec_name % speadSheets[spread].columns[col_index].command); } //section_body_2_size LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_2 LAYER += 0x5; //close section 00 00 00 00 0A LAYER += size + (size > 0 ? 0x1 : 0);// + 0x5; file.seekg(LAYER, ios_base::beg); file >> size; if (!size){ LAYER += 0x5; file.seekg(LAYER, ios_base::beg); file >> size; } if(size && size != sectionSize){ LAYER += size + 0x6; file.seekg(LAYER, ios_base::beg); file >> size; //BOOST_LOG_(1, format(" Section size: %d (@ 0x%X)") % size % (LAYER)); } } file.seekg(1, ios_base::cur); file >> size; LAYER += 0x5; sectionSize = size; vector header; while(LAYER < d_file_size){ LAYER += 0x5; file.seekg(LAYER + 0x12, ios_base::beg); name.resize(12); file >> name; BOOST_LOG_(1, format(" Column: %s (@ 0x%X)") % name % (LAYER + 0x12)); file.seekg(LAYER + 0x11, ios_base::beg); file >> c; short width = 0; file.seekg(LAYER + 0x4A, ios_base::beg); file >> width; int col_index = findColumnByName(spread, name); if(col_index != -1){ if (speadSheets[spread].columns[col_index].sheet)//read only column info for first sheet break; SpreadColumn::ColumnType type; switch(c){ case 3: type = SpreadColumn::X; break; case 0: type = SpreadColumn::Y; break; case 5: type = SpreadColumn::Z; break; case 6: type = SpreadColumn::XErr; break; case 2: type = SpreadColumn::YErr; break; case 4: type = SpreadColumn::Label; break; default: type = SpreadColumn::NONE; break; } speadSheets[spread].columns[col_index].type = type; width/=0xA; if(width == 0) width = 8; speadSheets[spread].columns[col_index].width = width; unsigned char c1,c2; file.seekg(LAYER + 0x1E, ios_base::beg); file >> c1; file >> c2; switch(c1){ case 0x00: // Numeric - Dec1000 case 0x09: // Text&Numeric - Dec1000 case 0x10: // Numeric - Scientific case 0x19: // Text&Numeric - Scientific case 0x20: // Numeric - Engeneering case 0x29: // Text&Numeric - Engeneering case 0x30: // Numeric - Dec1,000 case 0x39: // Text&Numeric - Dec1,000 speadSheets[spread].columns[col_index].valueType = (c1%0x10 == 0x9) ? TextNumeric : Numeric; speadSheets[spread].columns[col_index].valueTypeSpecification = c1 / 0x10; if(c2 >= 0x80){ speadSheets[spread].columns[col_index].significantDigits = c2 - 0x80; speadSheets[spread].columns[col_index].numericDisplayType = SignificantDigits; } else if(c2 > 0) { speadSheets[spread].columns[col_index].decimalPlaces = c2 - 0x03; speadSheets[spread].columns[col_index].numericDisplayType = DecimalPlaces; } break; case 0x02: // Time speadSheets[spread].columns[col_index].valueType = Time; speadSheets[spread].columns[col_index].valueTypeSpecification = c2 - 0x80; break; case 0x03: // Date speadSheets[spread].columns[col_index].valueType = Date; speadSheets[spread].columns[col_index].valueTypeSpecification= c2 - 0x80; break; case 0x31: // Text speadSheets[spread].columns[col_index].valueType = Text; break; case 0x4: // Month case 0x34: speadSheets[spread].columns[col_index].valueType = Month; speadSheets[spread].columns[col_index].valueTypeSpecification = c2; break; case 0x5: // Day case 0x35: speadSheets[spread].columns[col_index].valueType = Day; speadSheets[spread].columns[col_index].valueTypeSpecification = c2; break; default: // Text speadSheets[spread].columns[col_index].valueType = Text; break; } } LAYER += sectionSize + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; LAYER += 0x5; if(size > 0){ if(col_index != -1){ file.seekg(LAYER, ios_base::beg); file >> speadSheets[spread].columns[col_index].comment.assign(size, 0); string comment = speadSheets[spread].columns[col_index].comment; string::size_type pos = comment.find_first_of("@"); if(pos != string::npos){ comment.resize(pos); speadSheets[spread].columns[col_index].comment = comment; } } LAYER += size + 0x1; } if(col_index != -1) header.push_back(speadSheets[spread].columns[col_index]); file.seekg(LAYER, ios_base::beg); file >> size; if(size != sectionSize) break; } for (unsigned int i = 0; i < header.size(); i++) speadSheets[spread].columns[i] = header[i]; if (speadSheets[spread].sheets > 1){ file.seekg(findStringPos("__LayerInfoStorage"), ios_base::beg); for (unsigned int i = 0; i < 8; i++) skipLine(); file.seekg(0x5, ios_base::cur); unsigned int columns = speadSheets[spread].columns.size(); for (unsigned int sheet = 1; sheet < speadSheets[spread].sheets; sheet++){ for (unsigned int i = 0; i < columns; i++){ if (speadSheets[spread].columns[i].sheet != sheet) continue; readColumnInfo(spread, i); } } file.seekg(1, ios_base::cur); } file.seekg(1, ios_base::cur); skipObjectInfo(); BOOST_LOG_(1, format(" Done with spreadsheet %d POS (@ 0x%X)") % spread % file.tellg()); } void Origin800Parser::readColumnInfo(int spread, int i) { string colName = speadSheets[spread].columns[i].name; string::size_type sheetpos = colName.find_last_of("@"); if(sheetpos != string::npos) colName.resize(sheetpos); if (colName.size() >= 11) colName.resize(11); BOOST_LOG_(1, format(" Column %s") % colName); unsigned int pos = findStringPos(colName); if (file.eof()) return; file.seekg(pos - 1, ios_base::beg); char c = 0; file >> c; SpreadColumn::ColumnType type; switch(c){ case 3: type = SpreadColumn::X; break; case 0: type = SpreadColumn::Y; break; case 5: type = SpreadColumn::Z; break; case 6: type = SpreadColumn::XErr; break; case 2: type = SpreadColumn::YErr; break; case 4: type = SpreadColumn::Label; break; default: type = SpreadColumn::NONE; break; } speadSheets[spread].columns[i].type = type; //BOOST_LOG_(1, format(" type: %s (@ 0x%X)") % colTypes[type] % (pos - 1)); short width = 0; file.seekg(pos + 0x38, ios_base::beg); file >> width; width /= 0xA; if(width == 0) width = 8; if (width > 1000) return; speadSheets[spread].columns[i].width = width; BOOST_LOG_(1, format(" width: %d (@ 0x%X)") % width % (pos + 0x38)); unsigned char c1, c2; file.seekg(pos + 0xC, ios_base::beg); file >> c1; file >> c2; switch(c1){ case 0x00: // Numeric - Dec1000 case 0x09: // Text&Numeric - Dec1000 case 0x10: // Numeric - Scientific case 0x19: // Text&Numeric - Scientific case 0x20: // Numeric - Engeneering case 0x29: // Text&Numeric - Engeneering case 0x30: // Numeric - Dec1,000 case 0x39: // Text&Numeric - Dec1,000 speadSheets[spread].columns[i].valueType = (c1%0x10 == 0x9) ? TextNumeric : Numeric; speadSheets[spread].columns[i].valueType = Numeric; speadSheets[spread].columns[i].valueTypeSpecification = c1 / 0x10; if(c2 >= 0x80){ speadSheets[spread].columns[i].significantDigits = c2 - 0x80; speadSheets[spread].columns[i].numericDisplayType = SignificantDigits; } else if(c2 > 0){ speadSheets[spread].columns[i].decimalPlaces = c2 - 0x03; speadSheets[spread].columns[i].numericDisplayType = DecimalPlaces; } break; case 0x02: // Time speadSheets[spread].columns[i].valueType = Time; speadSheets[spread].columns[i].valueTypeSpecification = c2 - 0x80; break; case 0x03: // Date speadSheets[spread].columns[i].valueType = Date; speadSheets[spread].columns[i].valueTypeSpecification= c2 - 0x80; break; case 0x31: // Text speadSheets[spread].columns[i].valueType = Text; break; case 0x4: // Month case 0x34: speadSheets[spread].columns[i].valueType = Month; speadSheets[spread].columns[i].valueTypeSpecification = c2; break; case 0x5: // Day case 0x35: speadSheets[spread].columns[i].valueType = Day; speadSheets[spread].columns[i].valueTypeSpecification = c2; break; default: // Text speadSheets[spread].columns[i].valueType = Text; break; } pos += 0x1D8; file.seekg(pos, ios_base::beg); unsigned int size; file >> size; if (size > 1000){ pos += 0x4; file.seekg(pos, ios_base::beg); file >> size; } if(size > 0){ file.seekg(pos + 0x5, ios_base::beg); unsigned char c; file >> c; unsigned int n = 1; while (n < size && c != '@'){ file >> c; n++; } size = file.tellg(); size -= pos + 0x6; file.seekg(pos + 0x5, ios_base::beg); string comment(size, 0); file >> comment; speadSheets[spread].columns[i].comment = comment; BOOST_LOG_(1, format(" comment: %s (@ 0x%X)") % comment % (pos + 0x5)); } } void Origin800Parser::readMatrixInfo() { unsigned int POS = file.tellg(); unsigned int size; file >> size; POS += 5; BOOST_LOG_(1, format("[Matrix SECTION (@ 0x%X)]") % POS); string name(25, 0); file.seekg(POS + 0x2, ios_base::beg); file >> name; int idx = findMatrixByName(name); matrixes[idx].name = name; file.seekg(POS, ios_base::beg); readWindowProperties(matrixes[idx], size); BOOST_LOG_(1, format(" MATRIX %s has %d sheets") % name % matrixes[idx].sheets); unsigned int h; file.seekg(POS + 0x87, ios_base::beg); file >> h; BOOST_LOG_(1, format(" HeaderViewType: %d (@ 0x%X)") % h % (POS + 0x87)); matrixes[idx].header = (h == 194) ? Matrix::XY : Matrix::ColumnRow; unsigned int LAYER = POS; LAYER += size + 0x1; // LAYER section LAYER += 0x5; file.seekg(LAYER + 0x2B, ios_base::beg); file >> matrixes[idx].columnCount; BOOST_LOG_(1, format(" Columns: %d (@ 0x%X)") % matrixes[idx].columnCount % (LAYER + 0x2B)); file.seekg(LAYER + 0x52, ios_base::beg); file >> matrixes[idx].rowCount; BOOST_LOG_(1, format(" Rows: %d (@ 0x%X)") % matrixes[idx].rowCount % (LAYER + 0x52)); file.seekg(LAYER + 0x52 + 0x1F, ios_base::beg); unsigned short view; file >> view; if (view == 3) matrixes[idx].view = Matrix::ImageView; unsigned int maxSearchPos = findStringPos("__WIOTN"); unsigned int stringSize = 47; const char* sectionNames[] = {"Y2", "X2", "Y1", "X1"}; for (int i = 0; i < 4; i++){ if (findSection(sectionNames[i], stringSize, maxSearchPos)){ string s(32, 0); file >> s; matrixes[idx].coordinates[i] = stringToDouble(s); BOOST_LOG_(1, format(" %s: %g cursor pos: 0x%X") % sectionNames[i] % matrixes[idx].coordinates[i] % file.tellg()); } } if (findSection("1", stringSize, maxSearchPos)){ file >> matrixes[idx].command.assign(32, 0); BOOST_LOG_(1, format(" Formula: %s cursor pos: 0x%X") % matrixes[idx].command % file.tellg()); } for (int i = 0; i < matrixes[idx].sheets; i++) findSection("__LayerInfoStorage", 20); for (int i = 0; i < 7; i++) skipLine(); file.seekg(0x5, ios_base::cur); file >> size; POS = file.tellg(); if (size){ file.seekg(0x1, ios_base::cur); LAYER = file.tellg(); unsigned short width; file.seekg(LAYER + 0x2B + 31, ios_base::beg); file >> width; width /= 0xA; if (width == 0) width = 8; matrixes[idx].width = width; unsigned char c1, c2; file.seekg(LAYER + 0x1E, ios_base::beg); file >> c1; file >> c2; matrixes[idx].valueTypeSpecification = c1/0x10; if(c2 >= 0x80){ matrixes[idx].significantDigits = c2-0x80; matrixes[idx].numericDisplayType = SignificantDigits; } else if(c2 > 0){ matrixes[idx].decimalPlaces = c2-0x03; matrixes[idx].numericDisplayType = DecimalPlaces; } } POS += size + 0x2; file.seekg(POS, ios_base::beg); //BOOST_LOG_(1, format("Cursor pos: 0x%X") % POS); file >> size; //BOOST_LOG_(1, format(" size: %d @ 0x%X") % size % file.tellg()); POS += size + 0x2; file.seekg(size, ios_base::cur); //BOOST_LOG_(1, format("Cursor pos: 0x%X") % POS); for (int i = 0; i < 3; i++) skipLine(); skipObjectInfo(); } void Origin800Parser::readGraphInfo() { unsigned int POS = file.tellg(); unsigned int size; file >> size; POS += 5; BOOST_LOG_(1, format(" [Graph SECTION (@ 0x%X)]") % POS); string name(25, 0); file.seekg(POS + 0x02, ios_base::beg); file >> name; BOOST_LOG_(1, format(" GRAPH name: %s cursor pos: 0x%X") % name % file.tellg()); graphs.push_back(Graph(name)); file.seekg(POS, ios_base::beg); readWindowProperties(graphs.back(), size); file.seekg(POS + 0x23, ios_base::beg); file >> graphs.back().width; file >> graphs.back().height; file.seekg(POS + 0x45, ios_base::beg); string templateName(20, 0); file >> templateName; BOOST_LOG_(1, format(" TEMPLATE: %s pos: 0x%X") % templateName % (POS + 0x45)); if (templateName == "LAYOUT") graphs.back().isLayout = true; unsigned int LAYER = POS; LAYER += size + 0x1; while(LAYER < d_file_size)// multilayer loop { graphs.back().layers.push_back(GraphLayer()); GraphLayer& layer(graphs.back().layers.back()); // LAYER section LAYER += 0x05; file.seekg(LAYER + 0x0F, ios_base::beg); file >> layer.xAxis.min; file >> layer.xAxis.max; file >> layer.xAxis.step; file.seekg(LAYER + 0x2B, ios_base::beg); file >> layer.xAxis.majorTicks; file.seekg(LAYER + 0x37, ios_base::beg); file >> layer.xAxis.minorTicks; file >> layer.xAxis.scale; file.seekg(LAYER + 0x3A, ios_base::beg); file >> layer.yAxis.min; file >> layer.yAxis.max; file >> layer.yAxis.step; file.seekg(LAYER + 0x56, ios_base::beg); file >> layer.yAxis.majorTicks; file.seekg(LAYER + 0x62, ios_base::beg); file >> layer.yAxis.minorTicks; file >> layer.yAxis.scale; file.seekg(LAYER + 0x71, ios_base::beg); file.read(reinterpret_cast(&layer.clientRect), sizeof(Rect)); unsigned char border; file.seekg(LAYER + 0x89, ios_base::beg); file >> border; layer.borderType = (BorderType)(border >= 0x80 ? border-0x80 : None); file.seekg(LAYER + 0x105, ios_base::beg); file >> layer.backgroundColor; LAYER += 0x12D + 0x1 + 40; //now structure is next : section_header_size=0x6F(4 bytes) + '\n' + section_header(0x6F bytes) + section_body_1_size(4 bytes) + '\n' + section_body_1 + section_body_2_size(maybe=0)(4 bytes) + '\n' + section_body_2 + '\n' //possible sections: axes, legend, __BC02, _202, _231, _232, __LayerInfoStorage etc //section name starts with 0x46 position while(LAYER < d_file_size) { //section_header_size=0x6F(4 bytes) + '\n' LAYER += 0x5; //section_header string sec_name(41, 0); file.seekg(LAYER + 0x46, ios_base::beg); file >> sec_name; unsigned int sectionNamePos = LAYER + 0x46; BOOST_LOG_(1, format(" SECTION NAME: %s (@ 0x%X)") % sec_name % (LAYER + 0x46)); Rect r; file.seekg(LAYER + 0x03, ios_base::beg); file.read(reinterpret_cast(&r), sizeof(Rect)); unsigned char attach; file.seekg(LAYER + 0x28, ios_base::beg); file >> attach; unsigned char border; file >> border; Color color; file.seekg(LAYER + 0x33, ios_base::beg); file >> color; //section_body_1_size LAYER += 0x6F + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_1 LAYER += 0x5; unsigned int osize = size; unsigned char type; file.seekg(LAYER, ios_base::beg); file >> type; //text properties short rotation; file.seekg(LAYER + 0x02, ios_base::beg); file >> rotation; unsigned char fontSize; file >> fontSize; unsigned char tab; file.seekg(LAYER + 0x0A, ios_base::beg); file >> tab; //line properties unsigned char lineStyle = 0; double width = 0.0; LineVertex begin, end; unsigned int w = 0; file.seekg(LAYER + 0x12, ios_base::beg); file >> lineStyle; unsigned short w1; file >> w1; width = (double)w1/500.0; file.seekg(LAYER + 0x20, ios_base::beg); file >> begin.x; file >> end.x; file.seekg(LAYER + 0x40, ios_base::beg); file >> begin.y; file >> end.y; file.seekg(LAYER + 0x60, ios_base::beg); file >> begin.shapeType; file.seekg(LAYER + 0x64, ios_base::beg); file >> w; begin.shapeWidth = (double)w/500.0; file >> w; begin.shapeLength = (double)w/500.0; file.seekg(LAYER + 0x6C, ios_base::beg); file >> end.shapeType; file.seekg(LAYER + 0x70, ios_base::beg); file >> w; end.shapeWidth = (double)w/500.0; file >> w; end.shapeLength = (double)w/500.0; Figure figure; file.seekg(LAYER + 0x05, ios_base::beg); file >> w1; figure.width = (double)w1/500.0; file.seekg(LAYER + 0x08, ios_base::beg); file >> figure.style; file.seekg(LAYER + 0x42, ios_base::beg); file >> figure.fillAreaColor; file >> w1; figure.fillAreaPatternWidth = (double)w1/500.0; file.seekg(LAYER + 0x4A, ios_base::beg); file >> figure.fillAreaPatternColor; file >> figure.fillAreaPattern; unsigned char h; file.seekg(LAYER + 0x57, ios_base::beg); file >> h; figure.useBorderColor = (h == 0x10); //section_body_2_size LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_2 LAYER += 0x5; //check if it is a axis or legend file.seekg(1, ios_base::cur); if(sec_name == "XB") { string text(size, 0); file >> text; layer.xAxis.position = GraphAxis::Bottom; layer.xAxis.formatAxis[0].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "XT") { string text(size, 0); file >> text; layer.xAxis.position = GraphAxis::Top; layer.xAxis.formatAxis[1].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "YL") { string text(size, 0); file >> text; layer.yAxis.position = GraphAxis::Left; layer.yAxis.formatAxis[0].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "YR") { string text(size, 0); file >> text; layer.yAxis.position = GraphAxis::Right; layer.yAxis.formatAxis[1].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "ZF") { string text(size, 0); file >> text; layer.zAxis.position = GraphAxis::Front; layer.zAxis.formatAxis[0].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "ZB") { string text(size, 0); file >> text; layer.zAxis.position = GraphAxis::Back; layer.zAxis.formatAxis[1].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "3D") { file >> layer.zAxis.min; file >> layer.zAxis.max; file >> layer.zAxis.step; file.seekg(LAYER + 0x1C, ios_base::beg); file >> layer.zAxis.majorTicks; file.seekg(LAYER + 0x28, ios_base::beg); file >> layer.zAxis.minorTicks; file >> layer.zAxis.scale; file.seekg(LAYER + 0x218, ios_base::beg); file >> layer.xLength; file >> layer.yLength; file >> layer.zLength; layer.xLength /= 23.0; layer.yLength /= 23.0; layer.zLength /= 23.0; } else if(sec_name == "Legend") { string text(size, 0); file >> text; layer.legend = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "__BCO2") // histogram { file.seekg(LAYER + 0x10, ios_base::beg); file >> layer.histogramBin; file.seekg(LAYER + 0x20, ios_base::beg); file >> layer.histogramEnd; file >> layer.histogramBegin; unsigned int p = sectionNamePos + 93; file.seekg(p, ios_base::beg); file >> layer.percentile.p1SymbolType; file >> layer.percentile.p99SymbolType; file >> layer.percentile.meanSymbolType; file >> layer.percentile.maxSymbolType; file >> layer.percentile.minSymbolType; file.seekg(sectionNamePos + 106, ios_base::beg); file >> layer.percentile.whiskersRange; file >> layer.percentile.boxRange; file.seekg(sectionNamePos + 141, ios_base::beg); file >> layer.percentile.whiskersCoeff; file >> layer.percentile.boxCoeff; unsigned char h; file >> h; layer.percentile.diamondBox = (h == 0x82) ? true : false; p += 109; file.seekg(p, ios_base::beg); file >> layer.percentile.symbolSize; layer.percentile.symbolSize = layer.percentile.symbolSize/2 + 1; p += 163; file.seekg(p, ios_base::beg); file >> layer.percentile.symbolColor; file >> layer.percentile.symbolFillColor; } else if(sec_name == "vline") // Image profiles vertical cursor { file.seekg(sectionNamePos, ios_base::beg); for (int i = 0; i < 2; i++) skipLine(); file.seekg(0x20, ios_base::cur); file >> layer.vLine; BOOST_LOG_(1, format("vLine: %g") % layer.vLine); layer.imageProfileTool = true; } else if(sec_name == "hline") // Image profiles horizontal cursor { file.seekg(sectionNamePos, ios_base::beg); for (int i = 0; i < 2; i++) skipLine(); file.seekg(0x40, ios_base::cur); file >> layer.hLine; BOOST_LOG_(1, format("hLine: %g @ 0x%X") % layer.hLine % file.tellg()); layer.imageProfileTool = true; } else if(sec_name == "ZCOLORS") { layer.isXYY3D = true; } else if(sec_name == "SPECTRUM1") { layer.isXYY3D = false; unsigned char h; file.seekg(24, ios_base::cur); file >> h; layer.colorScale.reverseOrder = h; file.seekg(7, ios_base::cur); file >> layer.colorScale.colorBarThickness; file >> layer.colorScale.labelGap; file.seekg(56, ios_base::cur); file >> layer.colorScale.labelsColor; } else if(osize == 0x3E) // text { string text(size, 0); file >> text; sec_name.resize(3); if (sec_name == "PIE") layer.pieTexts.push_back(TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach)); else layer.texts.push_back(TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach)); } else if(osize == 0x5E) // rectangle & circle { switch(type) { case 0: case 1: figure.type = Figure::Rectangle; break; case 2: case 3: figure.type = Figure::Circle; break; } figure.clientRect = r; figure.attach = (Attach)attach; figure.color = color; layer.figures.push_back(figure); } else if(osize == 0x78 && type == 2) // line { layer.lines.push_back(Line()); Line& line(layer.lines.back()); line.color = color; line.clientRect = r; line.attach = (Attach)attach; line.width = width; line.style = lineStyle; line.begin = begin; line.end = end; } else if(osize == 0x28) // bitmap { if (type == 4){ unsigned long filesize = size + 14; layer.bitmaps.push_back(Bitmap()); Bitmap& bitmap(layer.bitmaps.back()); bitmap.clientRect = r; bitmap.attach = (Attach)attach; bitmap.size = filesize; bitmap.borderType = (BorderType)(border >= 0x80 ? border-0x80 : None); bitmap.data = new unsigned char[filesize]; unsigned char* data = bitmap.data; //add Bitmap header memcpy(data, "BM", 2); data += 2; memcpy(data, &filesize, 4); data += 4; unsigned int d = 0; memcpy(data, &d, 4); data += 4; d = 0x36; memcpy(data, &d, 4); data += 4; file.read(reinterpret_cast(data), size); } else if (type == 6){ string gname(30, 0); file.seekg(sectionNamePos + 93, ios_base::beg); file >> gname; layer.bitmaps.push_back(Bitmap(gname)); Bitmap& bitmap(layer.bitmaps.back()); bitmap.clientRect = r; bitmap.attach = (Attach)attach; bitmap.size = 0; bitmap.borderType = (BorderType)(border >= 0x80 ? border-0x80 : None); } } //close section 00 00 00 00 0A LAYER += size + (size > 0 ? 0x1 : 0); //section_body_3_size file.seekg(LAYER, ios_base::beg); file >> size; //section_body_3 LAYER += 0x5; //close section 00 00 00 00 0A LAYER += size + (size > 0 ? 0x1 : 0); if(sec_name == "__LayerInfoStorage") break; } LAYER += 0x5; unsigned char h; short w; file.seekg(LAYER, ios_base::beg); file >> size; if(size)//check layer is not empty { while(LAYER < d_file_size){ LAYER += 0x5; layer.curves.push_back(GraphCurve()); GraphCurve& curve(layer.curves.back()); file.seekg(LAYER + 0x4C, ios_base::beg); file >> curve.type; BOOST_LOG_(1, format(" graph %d layer %d curve %d type : %d") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % (int)curve.type); file.seekg(LAYER + 0x04, ios_base::beg); file >> w; pair column = findDataByIndex(w-1); short nColY = w; if(column.first.size() > 0){ curve.dataName = column.first; if(layer.is3D()){ BOOST_LOG_(1, format(" graph %d layer %d curve %d Z : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.zColumnName = column.second; } else { BOOST_LOG_(1, format(" graph %d layer %d curve %d Y : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.yColumnName = column.second; } } file.seekg(LAYER + 0x23, ios_base::beg); file >> w; column = findDataByIndex(w-1); if(column.first.size() > 0){ if(curve.dataName != column.first) BOOST_LOG_(1, format(" graph %d X and Y from different tables") % graphs.size()); if(layer.is3D()){ BOOST_LOG_(1, format(" graph %d layer %d curve %d Y : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.yColumnName = column.second; } else if (layer.isXYY3D){ BOOST_LOG_(1, format(" graph %d layer %d curve %d X : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.xColumnName = column.second; } else { BOOST_LOG_(1, format(" graph %d layer %d curve %d X : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.xColumnName = column.second; } } file.seekg(LAYER + 0x4D, ios_base::beg); file >> w; column = findDataByIndex(w-1); if(column.first.size() > 0 && layer.is3D()){ BOOST_LOG_(1, format(" graph %d layer %d curve %d X : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.xColumnName = column.second; if(curve.dataName != column.first) BOOST_LOG_(1, format(" graph %d X and Y from different tables") % graphs.size()); } if(layer.is3D() || layer.isXYY3D) graphs.back().is3D = true; file.seekg(LAYER + 0x11, ios_base::beg); file >> curve.lineConnect; file >> curve.lineStyle; file.seekg(1, ios_base::cur); file >> curve.boxWidth; file >> w; curve.lineWidth=(double)w/500.0; file.seekg(LAYER + 0x19, ios_base::beg); file >> w; curve.symbolSize=(double)w/500.0; file.seekg(LAYER + 0x1C, ios_base::beg); file >> h; curve.fillArea = (h==2); file.seekg(LAYER + 0x1E, ios_base::beg); file >> curve.fillAreaType; //text if(curve.type == GraphCurve::TextPlot){ file.seekg(LAYER + 0x13, ios_base::beg); file >> curve.text.rotation; curve.text.rotation /= 10; file >> curve.text.fontSize; file.seekg(LAYER + 0x19, ios_base::beg); file >> h; switch(h){ case 26: curve.text.justify = TextProperties::Center; break; case 2: curve.text.justify = TextProperties::Right; break; default: curve.text.justify = TextProperties::Left; break; } file >> h; curve.text.fontUnderline = (h & 0x1); curve.text.fontItalic = (h & 0x2); curve.text.fontBold = (h & 0x8); curve.text.whiteOut = (h & 0x20); char offset; file.seekg(LAYER + 0x37, ios_base::beg); file >> offset; curve.text.xOffset = offset * 5; file >> offset; curve.text.yOffset = offset * 5; } //vector if(curve.type == GraphCurve::FlowVector || curve.type == GraphCurve::Vector){ file.seekg(LAYER + 0x56, ios_base::beg); file >> curve.vector.multiplier; file.seekg(LAYER + 0x5E, ios_base::beg); file >> h; column = findDataByIndex(nColY - 1 + h - 0x64); if(column.first.size() > 0) curve.vector.endXColumnName = column.second; file.seekg(LAYER + 0x62, ios_base::beg); file >> h; column = findDataByIndex(nColY - 1 + h - 0x64); if(column.first.size() > 0) curve.vector.endYColumnName = column.second; file.seekg(LAYER + 0x18, ios_base::beg); file >> h; if(h >= 0x64){ column = findDataByIndex(nColY - 1 + h - 0x64); if(column.first.size() > 0) curve.vector.angleColumnName = column.second; } else if(h <= 0x08) curve.vector.constAngle = 45*h; file >> h; if(h >= 0x64 && h < 0x1F4){ column = findDataByIndex(nColY - 1 + h - 0x64); if(column.first.size() > 0) curve.vector.magnitudeColumnName = column.second; } else curve.vector.constMagnitude = (int)curve.symbolSize; file.seekg(LAYER + 0x66, ios_base::beg); file >> curve.vector.arrowLenght; file >> curve.vector.arrowAngle; file >> h; curve.vector.arrowClosed = !(h & 0x1); file >> w; curve.vector.width=(double)w/500.0; file.seekg(LAYER + 0x142, ios_base::beg); file >> h; switch(h){ case 2: curve.vector.position = VectorProperties::Midpoint; break; case 4: curve.vector.position = VectorProperties::Head; break; default: curve.vector.position = VectorProperties::Tail; break; } } //pie if (curve.type == GraphCurve::Pie){ file.seekg(LAYER + 0x92, ios_base::beg); file >> h; curve.pie.formatPercentages = (h & 0x01); curve.pie.formatValues = (h & 0x02); curve.pie.positionAssociate = (h & 0x08); curve.pie.clockwiseRotation = (h & 0x20); curve.pie.formatCategories = (h & 0x80); file >> curve.pie.formatAutomatic; file >> curve.pie.distance; file >> curve.pie.viewAngle; file.seekg(LAYER + 0x98, ios_base::beg); file >> curve.pie.thickness; file.seekg(LAYER + 0x9A, ios_base::beg); file >> curve.pie.rotation; file.seekg(LAYER + 0x9E, ios_base::beg); file >> curve.pie.displacement; file.seekg(LAYER + 0xA0, ios_base::beg); file >> curve.pie.radius; file >> curve.pie.horizontalOffset; file.seekg(LAYER + 0xA6, ios_base::beg); file >> curve.pie.displacedSectionCount; } //surface if (layer.isXYY3D || curve.type == GraphCurve::Mesh3D){ file.seekg(LAYER + 0x17, ios_base::beg); file >> curve.surface.type; file.seekg(LAYER + 0x1C, ios_base::beg); file >> h; if(h & 0x60 == 0x60) curve.surface.grids = SurfaceProperties::X; else if(h & 0x20) curve.surface.grids = SurfaceProperties::Y; else if(h & 0x40) curve.surface.grids = SurfaceProperties::None; else curve.surface.grids = SurfaceProperties::XY; curve.surface.sideWallEnabled = (h & 0x10); file >> curve.surface.frontColor; file.seekg(LAYER + 0x14C, ios_base::beg); file >> w; curve.surface.gridLineWidth = (double)w/500.0; file >> curve.surface.gridColor; file.seekg(LAYER + 0x13, ios_base::beg); file >> h; curve.surface.backColorEnabled = (h & 0x08); file.seekg(LAYER + 0x15A, ios_base::beg); file >> curve.surface.backColor; file >> curve.surface.xSideWallColor; file >> curve.surface.ySideWallColor; curve.surface.surface.fill = (h & 0x10); curve.surface.surface.contour = (h & 0x40); file.seekg(LAYER + 0x94, ios_base::beg); file >> w; curve.surface.surface.lineWidth = (double)w/500.0; file >> curve.surface.surface.lineColor; curve.surface.topContour.fill = (h & 0x02); curve.surface.topContour.contour = (h & 0x04); file.seekg(LAYER + 0xB4, ios_base::beg); file >> w; curve.surface.topContour.lineWidth = (double)w/500.0; file >> curve.surface.topContour.lineColor; curve.surface.bottomContour.fill = (h & 0x80); curve.surface.bottomContour.contour = (h & 0x01); file.seekg(LAYER + 0xA4, ios_base::beg); file >> w; curve.surface.bottomContour.lineWidth = (double)w/500.0; file >> curve.surface.bottomContour.lineColor; } if (curve.type == GraphCurve::Mesh3D || curve.type == GraphCurve::Contour){ ColorMap& colorMap = (curve.type == GraphCurve::Mesh3D ? curve.surface.colorMap : curve.colorMap); file.seekg(LAYER + 0x13, ios_base::beg); file >> h; colorMap.fillEnabled = (h & 0x82); if (curve.type == GraphCurve::Contour){ file.seekg(102, ios_base::cur); file >> curve.text.fontSize; file.seekg(7, ios_base::cur); file >> h; curve.text.fontUnderline = (h & 0x1); curve.text.fontItalic = (h & 0x2); curve.text.fontBold = (h & 0x8); curve.text.whiteOut = (h & 0x20); file.seekg(2, ios_base::cur); file >> curve.text.color; } file.seekg(LAYER + d_colormap_offset, ios_base::beg); readColorMap(colorMap); } file.seekg(LAYER + 0xC2, ios_base::beg); file >> curve.fillAreaColor; file >> w; curve.fillAreaPatternWidth=(double)w/500.0; file.seekg(LAYER + 0xCA, ios_base::beg); file >> curve.fillAreaPatternColor; file >> curve.fillAreaPattern; file >> curve.fillAreaPatternBorderStyle; file >> w; curve.fillAreaPatternBorderWidth=(double)w/500.0; file >> curve.fillAreaPatternBorderColor; file.seekg(LAYER + 0x16A, ios_base::beg); file >> curve.lineColor; if (curve.type != GraphCurve::Contour) curve.text.color = curve.lineColor; file.seekg(LAYER + 0x17, ios_base::beg); file >> curve.symbolType; file.seekg(LAYER + 0x12E, ios_base::beg); file >> curve.symbolFillColor; file >> curve.symbolColor; curve.vector.color = curve.symbolColor; file >> h; curve.symbolThickness = (h == 255 ? 1 : h); file >> curve.pointOffset; file.seekg(LAYER + 0x143, ios_base::beg); file >> h; curve.connectSymbols = (h&0x8); LAYER += size + 0x1; int newSize; file.seekg(LAYER, ios_base::beg); file >> newSize; LAYER += newSize + (newSize > 0 ? 0x1 : 0) + 0x5; file.seekg(LAYER, ios_base::beg); file >> newSize; if(newSize != size) break; } } LAYER += 0x5; //read axis breaks while(LAYER < d_file_size) { file.seekg(LAYER, ios_base::beg); file >> size; if(size == 0x2D) { LAYER += 0x5; file.seekg(LAYER + 2, ios_base::beg); file >> h; if(h == 2) { layer.xAxisBreak.minorTicksBefore = layer.xAxis.minorTicks; layer.xAxisBreak.scaleIncrementBefore = layer.xAxis.step; file.seekg(LAYER, ios_base::beg); readGraphAxisBreakInfo(layer.xAxisBreak); } else if(h == 4) { layer.yAxisBreak.minorTicksBefore = layer.yAxis.minorTicks; layer.yAxisBreak.scaleIncrementBefore = layer.yAxis.step; file.seekg(LAYER, ios_base::beg); readGraphAxisBreakInfo(layer.yAxisBreak); } LAYER += 0x2D + 0x1; } else break; } LAYER += 0x5; file.seekg(LAYER, ios_base::beg); size = readGraphAxisInfo(layer.xAxis); LAYER += size*0x6; LAYER += 0x5; file.seekg(LAYER, ios_base::beg); readGraphAxisInfo(layer.yAxis); LAYER += size*0x6; LAYER += 0x5; file.seekg(LAYER, ios_base::beg); readGraphAxisInfo(layer.zAxis); LAYER += size*0x6; LAYER += 0x5; //LAYER += 0x2*0x5 + 0x1ED*0x6; file.seekg(LAYER, ios_base::beg); file >> size; if(size == 0) break; } file.seekg(LAYER + 0x5, ios_base::beg); } void Origin800Parser::skipObjectInfo() { unsigned int POS = file.tellg(); unsigned int size; file >> size; while (POS < d_file_size && !size){ skipLine(); file >> size; POS = file.tellg(); } unsigned int nextSize = size; //BOOST_LOG_(1, format(" skipObjectInfo() size: %d (0x%X) @ 0x%X") % size % size % POS); while (POS < d_file_size && nextSize == size){ POS += nextSize + 0x2; file.seekg(POS, ios_base::beg); file >> nextSize; POS += 0x4; //BOOST_LOG_(1, format(" next size: %d (0x%X) @ 0x%X") % nextSize % nextSize % POS); if (!nextSize){ POS += 0x1; file.seekg(1, ios_base::cur); file >> nextSize; if (nextSize == size) POS += 0x4; } else if (nextSize > 1e6){ file >> nextSize; if (nextSize == size) POS += 0x4; } } file.seekg(1, ios_base::cur); //BOOST_LOG_(1, format(" skipObjectInfo() pos: 0x%X") % file.tellg()); } OriginParser* createOrigin800Parser(const string& fileName) { return new Origin800Parser(fileName); } unsigned int Origin800Parser::findStringPos(const string& name) { char c = 0; unsigned int startPos = file.tellg(); unsigned int pos = startPos; while(pos < d_file_size){ file >> c; if (c == name[0]){ pos = file.tellg(); file.seekg(pos - 0x3, ios_base::beg); file >> c; file.seekg(pos - 0x1, ios_base::beg); string s = string(name.size(), 0); file >> s; char end; file >> end; if (!c && !end && name == s){ pos -= 0x1; file.seekg(startPos, ios_base::beg); //BOOST_LOG_(1, format("Found string: %s (@ 0x%X)") % name % pos); return pos; } } pos++; } return pos; } bool Origin800Parser::findSection(const string& name, int length, int maxLength) { if (!maxLength) maxLength = d_file_size - 16; char c = 0; unsigned int pos = file.tellg(); unsigned int startPos = pos; while(pos < maxLength){ file >> c; if (c == name[0]){ pos = file.tellg(); file.seekg(pos - 0x2, ios_base::beg); file >> c; string s = string(name.size(), 0); file >> s; char end; file >> end; if (!c && !end && name == s){ pos -= 0x1; file.seekg(pos + length, ios_base::beg); //BOOST_LOG_(1, format("Found section %s at: 0x%X") % name % pos); return true; } } else pos++; } file.seekg(startPos, ios_base::beg); return false; } liborigin2-20110117/endianfstream.hh0000644000265600020320000001364711523526505016457 0ustar andreasadmin/*************************************************************************** File : endianfstream.hh -------------------------------------------------------------------- Copyright : (C) 2008 Alex Kargovsky Email (use @ for *) : kargovsky*yumr.phys.msu.su Description : Endianless file stream class ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #ifndef ENDIAN_FSTREAM_H #define ENDIAN_FSTREAM_H #include #include "OriginObj.h" namespace std { class iendianfstream : public ifstream { public: iendianfstream(const char *_Filename, ios_base::openmode _Mode = ios_base::in) : ifstream(_Filename, _Mode) { short word = 0x4321; bigEndian = (*(char*)& word) != 0x21; }; iendianfstream& operator>>(bool& value) { char c; get(c); value = (c != 0); return *this; } iendianfstream& operator>>(char& value) { get(value); return *this; } iendianfstream& operator>>(unsigned char& value) { get(reinterpret_cast(value)); return *this; } iendianfstream& operator>>(short& value) { read(reinterpret_cast(&value), sizeof(value)); if(bigEndian) swap_bytes(reinterpret_cast(&value), sizeof(value)); return *this; } iendianfstream& operator>>(unsigned short& value) { read(reinterpret_cast(&value), sizeof(value)); if(bigEndian) swap_bytes(reinterpret_cast(&value), sizeof(value)); return *this; } iendianfstream& operator>>(int& value) { read(reinterpret_cast(&value), sizeof(value)); if(bigEndian) swap_bytes(reinterpret_cast(&value), sizeof(value)); return *this; } iendianfstream& operator>>(unsigned int& value) { read(reinterpret_cast(&value), sizeof(value)); if(bigEndian) swap_bytes(reinterpret_cast(&value), sizeof(value)); return *this; } iendianfstream& operator>>(long& value) { read(reinterpret_cast(&value), sizeof(value)); if(bigEndian) swap_bytes(reinterpret_cast(&value), sizeof(value)); return *this; } iendianfstream& operator>>(unsigned long& value) { read(reinterpret_cast(&value), sizeof(value)); if(bigEndian) swap_bytes(reinterpret_cast(&value), sizeof(value)); return *this; } iendianfstream& operator>>(float& value) { read(reinterpret_cast(&value), sizeof(value)); if(bigEndian) swap_bytes(reinterpret_cast(&value), sizeof(value)); return *this; } iendianfstream& operator>>(double& value) { read(reinterpret_cast(&value), sizeof(value)); if(bigEndian) swap_bytes(reinterpret_cast(&value), sizeof(value)); return *this; } iendianfstream& operator>>(long double& value) { read(reinterpret_cast(&value), sizeof(value)); if(bigEndian) swap_bytes(reinterpret_cast(&value), sizeof(value)); return *this; } iendianfstream& operator>>(string& value) { read(reinterpret_cast(&value[0]), value.size()); string::size_type pos = value.find_first_of('\0'); if(pos != string::npos) value.resize(pos); return *this; } iendianfstream& operator>>(Origin::Color& value) { unsigned char color[4]; read(reinterpret_cast(&color), sizeof(color)); switch(color[3]) { case 0: if(color[0] < 0x64) { value.type = Origin::Color::Regular; value.regular = color[0]; } else { switch(color[2]) { case 0: value.type = Origin::Color::Indexing; break; case 0x40: value.type = Origin::Color::Mapping; break; case 0x80: value.type = Origin::Color::RGB; break; } value.column = color[0] - 0x64; } break; case 1: value.type = Origin::Color::Custom; for(int i = 0; i < 3; ++i) value.custom[i] = color[i]; break; case 0x20: value.type = Origin::Color::Increment; value.starting = color[1]; break; case 0xFF: if(color[0] == 0xFC) value.type = Origin::Color::None; else if(color[0] == 0xF7) value.type = Origin::Color::Automatic; break; default: value.type = Origin::Color::Regular; value.regular = color[0]; break; } return *this; } private: bool bigEndian; void swap_bytes(unsigned char* data, int size) { register int i = 0; register int j = size - 1; while(i < j) { std::swap(data[i], data[j]); ++i, --j; } } }; } #endif // ENDIAN_FSTREAM_H liborigin2-20110117/Origin810Parser.cpp0000644000265600020320000001132611523526505016647 0ustar andreasadmin/*************************************************************************** File : Origin810Parser.cpp -------------------------------------------------------------------- Copyright : (C) 2010 Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : Origin 8.1 file parser class (uses code from file Origin750Parser.cpp written by Alex Kargovsky) ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #include "Origin810Parser.h" #include #include #include #include #include using namespace boost; Origin810Parser::Origin810Parser(const string& fileName) : Origin800Parser(fileName) { d_colormap_offset = 0x25F; d_start_offset = 0x10; notes_pos_mark = "P"; } void Origin810Parser::readProjectTreeFolder(tree::iterator parent) { unsigned int POS = file.tellg(); double creationDate, modificationDate; POS += 5; file.seekg(POS + 0x10, ios_base::beg); file >> creationDate; if (creationDate >= 1e10) return; file >> modificationDate; if (modificationDate >= 1e10) return; POS += 0x20 + 1 + 5; unsigned int size; file.seekg(POS, ios_base::beg); file >> size; POS += 5; // read folder name string name(size, 0); file.seekg(POS, ios_base::beg); file >> name; tree::iterator current_folder = projectTree.append_child(parent, ProjectNode(name, ProjectNode::Folder, doubleToPosixTime(creationDate), doubleToPosixTime(modificationDate))); file.seekg(1, ios_base::cur); for (int i = 0; i < 6; i++) skipLine(); POS = file.tellg(); unsigned int objectcount; file >> objectcount; POS += 5 + 5; for (unsigned int i = 0; i < objectcount; ++i){ POS += 5; char c; file.seekg(POS + 0x2, ios_base::beg); file >> c; unsigned int objectID; file.seekg(POS + 0x4, ios_base::beg); file >> objectID; if(c == 0x10){ projectTree.append_child(current_folder, ProjectNode(notes[objectID].name, ProjectNode::Note)); } else { pair object = findObjectByIndex(objectID); projectTree.append_child(current_folder, ProjectNode(object.second, object.first)); } POS += 8 + 1 + 5 + 5; } file.seekg(POS, ios_base::beg); file >> objectcount; file.seekg(1, ios_base::cur); for(unsigned int i = 0; i < objectcount; ++i) readProjectTreeFolder(current_folder); } void Origin810Parser::readColorMap(ColorMap& colorMap) { unsigned char h; short w; unsigned int colorMapSize; file >> colorMapSize; file.seekg(0x140, ios_base::cur); for(unsigned int i = 0; i < colorMapSize + 3; ++i){ ColorMapLevel level; file >> level.fillPattern; file.seekg(0x03, ios_base::cur); file >> level.fillPatternColor; file >> w; level.fillPatternLineWidth = (double)w/500.0; file.seekg(0x06, ios_base::cur); file >> level.lineStyle; file.seekg(0x01, ios_base::cur); file >> w; level.lineWidth = (double)w/500.0; file >> level.lineColor; file.seekg(0x02, ios_base::cur); file >> h; level.labelVisible = (h & 0x1); level.lineVisible = !(h & 0x2); file.seekg(0x0D, ios_base::cur); file >> level.fillColor; file.seekg(0x04, ios_base::cur); double value; file >> value; colorMap.levels.push_back(make_pair(value, level)); } } OriginParser* createOrigin810Parser(const string& fileName) { return new Origin810Parser(fileName); } liborigin2-20110117/Origin610Parser.cpp0000644000265600020320000014626611523526505016661 0ustar andreasadmin/*************************************************************************** File : Origin610Parser.cpp -------------------------------------------------------------------- Copyright : (C) 2010 Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : Origin 6.1 file parser class (uses code from file Origin750Parser.cpp written by Alex Kargovsky) ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #include "Origin610Parser.h" #include #include #include #include #include using namespace boost; Origin610Parser::Origin610Parser(const string& fileName) : Origin800Parser(fileName) { d_start_offset = 0x10 + 1; } bool Origin610Parser::parse() { unsigned int dataIndex = 0; // get length of file: file.seekg (0, ios::end); d_file_size = file.tellg(); stringstream out; unsigned char c; /////////////////// find column /////////////////////////////////////////////////////////// file.seekg(d_start_offset, ios_base::beg); unsigned int size; file >> size; file.seekg(1 + size + 1 + 5, ios_base::cur); file >> size; file.seekg(1, ios_base::cur); BOOST_LOG_(1, format(" [column found = %d/0x%X @ 0x%X]") % size % size % (unsigned int) file.tellg()); unsigned int colpos = file.tellg(); unsigned int current_col = 1, nr = 0, nbytes = 0; while(size > 0 && size <= 0x8C){// should be 0x72, 0x73 or 0x83 ? //////////////////////////////// COLUMN HEADER ///////////////////////////////////////////// short data_type; char data_type_u; unsigned int oldpos = file.tellg(); file.seekg(oldpos + 0x16, ios_base::beg); file >> data_type; file.seekg(oldpos + 0x3F, ios_base::beg); file >> data_type_u; char valuesize; file.seekg(oldpos + 0x3D, ios_base::beg); file >> valuesize; BOOST_LOG_(1, format(" [valuesize = %d @ 0x%X]") % (int)valuesize % ((unsigned int) file.tellg()-1)); if(valuesize <= 0) { BOOST_LOG_(1, format(" WARNING : found strange valuesize of %d") % (int)valuesize); valuesize = 10; } file.seekg(oldpos + 0x58, ios_base::beg); BOOST_LOG_(1, format(" [Spreadsheet @ 0x%X]") % (unsigned int) file.tellg()); string name(25, 0); file >> name; string::size_type pos = name.find_last_of("_"); string columnname; if(pos != string::npos){ columnname = name.substr(pos + 1); name.resize(pos); } BOOST_LOG_(1, format(" NAME: %s") % name.c_str()); unsigned int spread = 0; if(columnname.empty()){ BOOST_LOG_(1, "NO COLUMN NAME FOUND! Must be a Matrix or Function."); ////////////////////////////// READ matrixes or functions //////////////////////////////////// BOOST_LOG_(1, format(" [position @ 0x%X]") % (unsigned int) file.tellg()); // TODO short signature; file >> signature; BOOST_LOG_(1, format(" SIGNATURE : %02X ") % signature); file.seekg(oldpos + size + 1, ios_base::beg); file >> size; file.seekg(1, ios_base::cur); size /= valuesize; BOOST_LOG_(1, format(" SIZE = %d") % size); switch(signature) { case 0x50CA: case 0x70CA: case 0x50F2: case 0x50E2: case 0x50C8: case 0x50E7: case 0x50DB: case 0x50DC: case 0xAE2: case 0xAF2: case 0xACA: if (size){ BOOST_LOG_(1, "NEW MATRIX"); matrixes.push_back(Matrix(name, dataIndex)); //BOOST_LOG_(1, format("MATRIX %s has dataIndex: %d") % name.c_str() % dataIndex); } ++dataIndex; BOOST_LOG_(1, "VALUES :"); out.str(size > 100 ? "matrix too big..." : string()); switch(data_type) { case 0x6001://double for(unsigned int i = 0; i < size; ++i) { double value; file >> value; matrixes.back().data.push_back((double)value); //if(size < 100) //out << format("%g ") % matrixes.back().data.back(); } //BOOST_LOG_(1, out.str()); break; case 0x6003://float for(unsigned int i = 0; i < size; ++i) { float value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); break; case 0x6801://int if(data_type_u == 8)//unsigned { for(unsigned int i = 0; i < size; ++i) { unsigned int value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } else { for(unsigned int i = 0; i < size; ++i) { int value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } break; case 0x6803://short if(data_type_u == 8)//unsigned { for(unsigned int i = 0; i < size; ++i) { unsigned short value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } else { for(unsigned int i = 0; i < size; ++i) { short value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } break; case 0x6821://char if(data_type_u == 8)//unsigned { for(unsigned int i = 0; i < size; ++i) { unsigned char value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } else { for(unsigned int i = 0; i < size; ++i) { char value; file >> value; matrixes.back().data.push_back((double)value); if(size < 100) out << format("%g ") % matrixes.back().data.back(); } BOOST_LOG_(1, out.str()); } break; default: BOOST_LOG_(1, format("UNKNOWN MATRIX DATATYPE: %02X SKIP DATA") % data_type); file.seekg(valuesize*size, ios_base::cur); matrixes.pop_back(); } break; case 0x10C8: BOOST_LOG_(1, "NEW FUNCTION"); functions.push_back(Function(name, dataIndex)); ++dataIndex; file >> functions.back().formula.assign(valuesize, 0); oldpos = file.tellg(); short t; file.seekg(colpos + 0xA, ios_base::beg); file >> t; if(t == 0x1194) functions.back().type = Function::Polar; file.seekg(colpos + 0x21, ios_base::beg); file >> functions.back().totalPoints; file >> functions.back().begin; double d; file >> d; functions.back().end = functions.back().begin + d*(functions.back().totalPoints - 1); BOOST_LOG_(1, format("FUNCTION %s : %s") % functions.back().name.c_str() % functions.back().formula.c_str()); BOOST_LOG_(1, format(" interval %g : %g, number of points %d") % functions.back().begin % functions.back().end % functions.back().totalPoints); file.seekg(oldpos, ios_base::beg); break; default: BOOST_LOG_(1, format("UNKNOWN SIGNATURE: %.2X SKIP DATA") % signature); file.seekg(valuesize*size, ios_base::cur); ++dataIndex; if(valuesize != 8 && valuesize <= 16) file.seekg(2, ios_base::cur); } } else { // worksheet if(speadSheets.size() == 0 || findSpreadByName(name) == -1) { BOOST_LOG_(1, "NEW SPREADSHEET"); current_col = 1; speadSheets.push_back(SpreadSheet(name)); spread = speadSheets.size() - 1; speadSheets.back().maxRows = 0; } else { spread = findSpreadByName(name); current_col = speadSheets[spread].columns.size(); if(!current_col) current_col = 1; ++current_col; } speadSheets[spread].columns.push_back(SpreadColumn(columnname, dataIndex)); string::size_type sheetpos = speadSheets[spread].columns.back().name.find_last_of("@"); if(sheetpos != string::npos){ unsigned int sheet = lexical_cast(columnname.substr(sheetpos + 1).c_str()); if( sheet > 1){ speadSheets[spread].multisheet = true; speadSheets[spread].columns.back().name = columnname; speadSheets[spread].columns.back().sheet = sheet - 1; if (speadSheets[spread].sheets < sheet) speadSheets[spread].sheets = sheet; } } BOOST_LOG_(1, format("SPREADSHEET = %s SHEET = %d COLUMN NAME = %s (%d) (@0x%X)") % name % speadSheets[spread].columns.back().sheet % columnname % current_col % (unsigned int)file.tellg()); ++dataIndex; ////////////////////////////// SIZE of column ///////////////////////////////////////////// file.seekg(oldpos + size + 1, ios_base::beg); file >> nbytes; if(fmod(nbytes, (double)valuesize)>0) { BOOST_LOG_(1, "WARNING: data section could not be read correct"); } nr = nbytes / valuesize; BOOST_LOG_(1, format(" [number of rows = %d (%d Bytes) @ 0x%X]") % nr % nbytes % (unsigned int)file.tellg()); speadSheets[spread].maxRows> value; out << format("%g ") % value; speadSheets[spread].columns[(current_col-1)].data.push_back(value); } else if((data_type & 0x100) == 0x100) // Text&Numeric { file >> c; file.seekg(1, ios_base::cur); if(c == 0) //value { file >> value; out << format("%g ") % value; speadSheets[spread].columns[(current_col-1)].data.push_back(value); file.seekg(valuesize - 10, ios_base::cur); } else //text { string stmp(valuesize - 2, 0); file >> stmp; if(stmp.find(0x0E) != string::npos) // try find non-printable symbol - garbage test stmp = string(); speadSheets[spread].columns[(current_col-1)].data.push_back(stmp); out << format("%s ") % stmp; } } else //text { string stmp(valuesize, 0); file >> stmp; if(stmp.find(0x0E) != string::npos) // try find non-printable symbol - garbage test stmp = string(); speadSheets[spread].columns[(current_col-1)].data.push_back(stmp); out << format("%s ") % stmp; } } BOOST_LOG_(1, out.str()); } if(nbytes > 0 || (columnname.empty() && size)) { file.seekg(1, ios_base::cur); } file >> size; file.seekg(1 + size + (size > 0 ? 1 : 0), ios_base::cur); file >> size; file.seekg(1, ios_base::cur); BOOST_LOG_(1, format(" [column found = %d/0x%X (@ 0x%X)]") % size % size %((unsigned int) file.tellg()-5)); colpos = file.tellg(); } //////////////////////////////////////////////////////////////////////////// ////////////////////// HEADER SECTION ////////////////////////////////////// unsigned int POS = (unsigned int)file.tellg()-11; BOOST_LOG_(1, "\nHEADER SECTION"); BOOST_LOG_(1, format(" [position @ 0x%X]") % POS); POS += 0xB; file.seekg(POS, ios_base::beg); unsigned int tableId = 0; while(POS < d_file_size){ POS = file.tellg(); file >> size; if(size == 0) break; file.seekg(POS + 0x7, ios_base::beg); string name(25, 0); file >> name; file.seekg(POS, ios_base::beg); if(findSpreadByName(name) != -1){ readSpreadInfo(); tableId++; } else if(findMatrixByName(name) != -1) readMatrixInfo(); else if(findExcelByName(name) != -1) readExcelInfo(); else if (!readGraphInfo()){ BOOST_LOG_(1, format(" %s is NOT A GRAPH, trying to read next SPREADSHEET...") % name); findObjectInfoSectionByName(POS, speadSheets[tableId].name); readSpreadInfo(); tableId++; } POS = file.tellg(); } readNotes(); readResultsLog(); file.seekg(1 + 4*5 + 0x10 + 1, ios_base::cur); try { readProjectTree(); } catch(...) {} BOOST_LOG_(1, "Done parsing"); BOOST_LOG_FINALIZE(); return true; } void Origin610Parser::readNotes() { unsigned int pos = findStringPos("@"); file.seekg(pos, ios_base::beg); unsigned int sectionSize; file >> sectionSize; while(pos < d_file_size){ file.seekg(1, ios_base::cur); Rect rect; unsigned int coord; file >> coord; rect.left = coord; file >> coord; rect.top = coord; file >> coord; rect.right = coord; file >> coord; rect.bottom = coord; if (!rect.bottom || !rect.right) break; unsigned char state; file.seekg(0x8, ios_base::cur); file >> state; double creationDate, modificationDate; file.seekg(0x7, ios_base::cur); file >> creationDate; file >> modificationDate; file.seekg(0x8, ios_base::cur); unsigned char c; file >> c; unsigned int labellen; file.seekg(0x3, ios_base::cur); file >> labellen; skipLine(); unsigned int size; file >> size; file.seekg(1, ios_base::cur); string name(size, 0); file >> name; notes.push_back(Note(name)); notes.back().objectID = objectIndex; ++objectIndex; notes.back().frameRect = rect; if (creationDate >= 1e10) return; notes.back().creationDate = doubleToPosixTime(creationDate); if (modificationDate >= 1e10) return; notes.back().modificationDate = doubleToPosixTime(modificationDate); if (c == 0x01) notes.back().title = Window::Label; else if (c == 0x02) notes.back().title = Window::Name; else notes.back().title = Window::Both; if(state == 0x04) notes.back().state = Window::Minimized; notes.back().hidden = (state & 0x40); file.seekg(1, ios_base::cur); file >> size; file.seekg(1, ios_base::cur); if(labellen > 1){ file >> notes.back().label.assign(labellen - 1, 0); file.seekg(1, ios_base::cur); } file >> notes.back().text.assign(size - labellen, 0); BOOST_LOG_(1, format("NOTE %d NAME: %s") % notes.size() % notes.back().name); BOOST_LOG_(1, format("NOTE %d LABEL: %s") % notes.size() % notes.back().label); BOOST_LOG_(1, format("NOTE %d TEXT: %s") % notes.size() % notes.back().text); file.seekg(1, ios_base::cur); pos = file.tellg(); file >> size; if(size != sectionSize) break; } } void Origin610Parser::readResultsLog() { int pos = findStringPos("ResultsLog"); if (pos < 0) return; file.seekg(pos + 12, ios_base::beg); unsigned int size; file >> size; file.seekg(1, ios_base::cur); resultsLog.resize(size); file >> resultsLog; BOOST_LOG_(1, format("Results Log: %s") % resultsLog); } void Origin610Parser::readSpreadInfo() { unsigned int POS = file.tellg(); unsigned int size; file >> size; POS += 5; // check spreadsheet name file.seekg(POS + 0x2, ios_base::beg); string name(25, 0); file >> name; BOOST_LOG_(1, format(" SPREADSHEET: %s (@ 0x%X)]") % name % file.tellg()); BOOST_LOG_(1, format(" [Spreadsheet SECTION (@ 0x%X)]") % POS); int spread = findSpreadByName(name); speadSheets[spread].name = name; file.seekg(POS, ios_base::beg); readWindowProperties(speadSheets[spread], size); speadSheets[spread].loose = false; char c = 0; unsigned int LAYER = POS + size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; LAYER += size + 0x6; file.seekg(LAYER, ios_base::beg); file >> size; // LAYER section unsigned int sectionSize = size; while(LAYER < d_file_size){ //section_header_size=0x6F(4 bytes) + '\n' LAYER += 0x5; //section_header file.seekg(LAYER + 0x46, ios_base::beg); string sec_name(41, 0); file >> sec_name; BOOST_LOG_(1, format(" SECTION NAME: %s (@ 0x%X)") % sec_name % (LAYER + 0x46)); //section_body_1_size LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_1 LAYER += 0x5; file.seekg(LAYER, ios_base::beg); int col_index = findSpreadColumnByName(spread, sec_name); if(col_index != -1){//check if it is a formula file >> speadSheets[spread].columns[col_index].command.assign(size, 0); BOOST_LOG_(1, format(" Column: %s has formula: %s") % sec_name % speadSheets[spread].columns[col_index].command); } //section_body_2_size LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_2 LAYER += 0x5; //close section 00 00 00 00 0A LAYER += size + (size > 0 ? 0x1 : 0) + 0x5; file.seekg(LAYER, ios_base::beg); file >> size; if(size != sectionSize) break; } file.seekg(1, ios_base::cur); file >> size; LAYER += 0x5; sectionSize = size; vector header; while(LAYER < d_file_size){ LAYER += 0x5; file.seekg(LAYER + 0x12, ios_base::beg); name.resize(12); file >> name; BOOST_LOG_(1, format(" Column: %s (@ 0x%X)") % name % (LAYER + 0x12)); file.seekg(LAYER + 0x11, ios_base::beg); file >> c; short width = 0; file.seekg(LAYER + 0x4A, ios_base::beg); file >> width; int col_index = findColumnByName(spread, name); if(col_index != -1){ SpreadColumn::ColumnType type; switch(c){ case 3: type = SpreadColumn::X; break; case 0: type = SpreadColumn::Y; break; case 5: type = SpreadColumn::Z; break; case 6: type = SpreadColumn::XErr; break; case 2: type = SpreadColumn::YErr; break; case 4: type = SpreadColumn::Label; break; default: type = SpreadColumn::NONE; break; } speadSheets[spread].columns[col_index].type = type; width/=0xA; if(width == 0) width = 8; speadSheets[spread].columns[col_index].width = width; unsigned char c1,c2; file.seekg(LAYER + 0x1E, ios_base::beg); file >> c1; file >> c2; switch(c1){ case 0x00: // Numeric - Dec1000 case 0x09: // Text&Numeric - Dec1000 case 0x10: // Numeric - Scientific case 0x19: // Text&Numeric - Scientific case 0x20: // Numeric - Engeneering case 0x29: // Text&Numeric - Engeneering case 0x30: // Numeric - Dec1,000 case 0x39: // Text&Numeric - Dec1,000 speadSheets[spread].columns[col_index].valueType = (c1%0x10 == 0x9) ? TextNumeric : Numeric; speadSheets[spread].columns[col_index].valueTypeSpecification = c1 / 0x10; if(c2 >= 0x80){ speadSheets[spread].columns[col_index].significantDigits = c2 - 0x80; speadSheets[spread].columns[col_index].numericDisplayType = SignificantDigits; } else if(c2 > 0) { speadSheets[spread].columns[col_index].decimalPlaces = c2 - 0x03; speadSheets[spread].columns[col_index].numericDisplayType = DecimalPlaces; } break; case 0x02: // Time speadSheets[spread].columns[col_index].valueType = Time; speadSheets[spread].columns[col_index].valueTypeSpecification = c2 - 0x80; break; case 0x03: // Date speadSheets[spread].columns[col_index].valueType = Date; speadSheets[spread].columns[col_index].valueTypeSpecification= c2 - 0x80; break; case 0x31: // Text speadSheets[spread].columns[col_index].valueType = Text; break; case 0x4: // Month case 0x34: speadSheets[spread].columns[col_index].valueType = Month; speadSheets[spread].columns[col_index].valueTypeSpecification = c2; break; case 0x5: // Day case 0x35: speadSheets[spread].columns[col_index].valueType = Day; speadSheets[spread].columns[col_index].valueTypeSpecification = c2; break; default: // Text speadSheets[spread].columns[col_index].valueType = Text; break; } } LAYER += sectionSize + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; LAYER += 0x5; if(size > 0){ if(col_index != -1){ file.seekg(LAYER, ios_base::beg); file >> speadSheets[spread].columns[col_index].comment.assign(size, 0); } LAYER += size + 0x1; } if(col_index != -1) header.push_back(speadSheets[spread].columns[col_index]); file.seekg(LAYER, ios_base::beg); file >> size; if(size != sectionSize) break; } for (unsigned int i = 0; i < header.size(); i++) speadSheets[spread].columns[i] = header[i]; file.seekg(1, ios_base::cur); skipObjectInfo(); BOOST_LOG_(1, format(" Done with spreadsheet %d POS (@ 0x%X)") % spread % file.tellg()); } void Origin610Parser::readMatrixInfo() { unsigned int POS = file.tellg(); unsigned int size; file >> size; POS+=5; BOOST_LOG_(1, format(" [Matrix SECTION (@ 0x%X)]") % POS); string name(25, 0); file.seekg(POS + 0x2, ios_base::beg); file >> name; BOOST_LOG_(1, format(" MATRIX %s (@ 0x%X)]") % name % POS); int idx = findMatrixByName(name); matrixes[idx].name = name; file.seekg(POS, ios_base::beg); readWindowProperties(matrixes[idx], size); unsigned int LAYER = POS; LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; // LAYER section LAYER += 0x5; unsigned short width; file.seekg(LAYER + 0x27, ios_base::beg); file >> width; if (width == 0) width = 8; matrixes[idx].width = width; BOOST_LOG_(1, format(" Width: %d (@ 0x%X)") % matrixes[idx].width % (LAYER + 0x27)); file.seekg(LAYER + 0x2B, ios_base::beg); file >> matrixes[idx].columnCount; BOOST_LOG_(1, format(" Columns: %d (@ 0x%X)") % matrixes[idx].columnCount % (LAYER + 0x2B)); file.seekg(LAYER + 0x52, ios_base::beg); file >> matrixes[idx].rowCount; BOOST_LOG_(1, format(" Rows: %d (@ 0x%X)") % matrixes[idx].rowCount % (LAYER + 0x52)); LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; unsigned int sectionSize = size; while(LAYER < d_file_size){ //section_header_size=0x6F(4 bytes) + '\n' LAYER += 0x5; //section_header string sec_name(30, 0); file.seekg(LAYER + 0x46, ios_base::beg); file >> sec_name; BOOST_LOG_(1, format(" SECTION NAME: %s (@ 0x%X)") % sec_name % (LAYER + 0x46)); //section_body_1_size file >> size; //section_body_1 LAYER = file.tellg(); file.seekg(1, ios_base::cur); if (sec_name == "MV"){//check if it is a formula file >> matrixes[idx].command.assign(size, 0); BOOST_LOG_(1, format(" FORMULA: %s") % matrixes[idx].command); } else if (sec_name == "Y2"){ string s(size, 0); file >> s; matrixes[idx].coordinates[0] = stringToDouble(s); BOOST_LOG_(1, format(" Y2: %g") % matrixes[idx].coordinates[0]); } else if (sec_name == "X2"){ string s(size, 0); file >> s; matrixes[idx].coordinates[1] = stringToDouble(s); BOOST_LOG_(1, format(" X2: %g") % matrixes[idx].coordinates[1]); } else if (sec_name == "Y1"){ string s(size, 0); file >> s; matrixes[idx].coordinates[2] = stringToDouble(s); BOOST_LOG_(1, format(" Y1: %g") % matrixes[idx].coordinates[2]); } else if (sec_name == "X1"){ string s(size, 0); file >> s; matrixes[idx].coordinates[3] = stringToDouble(s); BOOST_LOG_(1, format(" X1: %g") % matrixes[idx].coordinates[3]); } //section_body_2_size LAYER += size + 0x2; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_2 LAYER += 0x5; //close section 00 00 00 00 0A LAYER += size + (size > 0 ? 0x1 : 0) + 0x5; file.seekg(LAYER, ios_base::beg); file >> size; if(size != sectionSize) break; } file.seekg(1, ios_base::cur); LAYER = file.tellg(); file >> size; unsigned char c1, c2; file.seekg(LAYER + 0x23, ios_base::beg); file >> c1; file >> c2; matrixes[idx].valueTypeSpecification = c1/0x10; if(c2 >= 0x80){ matrixes[idx].significantDigits = c2 - 0x80; matrixes[idx].numericDisplayType = SignificantDigits; } else if(c2 > 0){ matrixes[idx].decimalPlaces = c2 - 0x03; matrixes[idx].numericDisplayType = DecimalPlaces; } LAYER += size + 0x06; file.seekg(LAYER, ios_base::beg); skipObjectInfo(); BOOST_LOG_(1, format(" Done with matrix, pos @ 0x%X") % file.tellg()); } bool Origin610Parser::readGraphInfo() { unsigned int POS = file.tellg(); unsigned int size; file >> size; POS += 5; string name(25, 0); file.seekg(POS + 0x02, ios_base::beg); file >> name; BOOST_LOG_(1, format(" GRAPH name: %s cursor pos: 0x%X") % name % file.tellg()); graphs.push_back(Graph(name)); file.seekg(POS, ios_base::beg); readWindowProperties(graphs.back(), size); file.seekg(POS + 0x23, ios_base::beg); file >> graphs.back().width; file >> graphs.back().height; unsigned int LAYER = POS; LAYER += size + 0x1; vector sectionNames; while(LAYER < d_file_size){// multilayer loop graphs.back().layers.push_back(GraphLayer()); GraphLayer& layer(graphs.back().layers.back()); // LAYER section file.seekg(LAYER, ios_base::beg); file >> size; LAYER += 0x05; file.seekg(LAYER + 0x0F, ios_base::beg); file >> layer.xAxis.min; file >> layer.xAxis.max; file >> layer.xAxis.step; file.seekg(LAYER + 0x2B, ios_base::beg); file >> layer.xAxis.majorTicks; file.seekg(LAYER + 0x37, ios_base::beg); file >> layer.xAxis.minorTicks; file >> layer.xAxis.scale; file.seekg(LAYER + 0x3A, ios_base::beg); file >> layer.yAxis.min; file >> layer.yAxis.max; file >> layer.yAxis.step; file.seekg(LAYER + 0x56, ios_base::beg); file >> layer.yAxis.majorTicks; file.seekg(LAYER + 0x62, ios_base::beg); file >> layer.yAxis.minorTicks; file >> layer.yAxis.scale; file.seekg(LAYER + 0x71, ios_base::beg); file.read(reinterpret_cast(&layer.clientRect), sizeof(Rect)); unsigned char border; file.seekg(LAYER + 0x89, ios_base::beg); file >> border; layer.borderType = (BorderType)(border >= 0x80 ? border-0x80 : None); unsigned char col; file.seekg(LAYER + 0xA7, ios_base::beg); file >> col; layer.backgroundColor.type = (col & 0x01) ? Origin::Color::None : Origin::Color::Regular; file >> col; layer.backgroundColor.regular = col; LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); unsigned int sectionSize; file >> size; sectionSize = size; //now structure is next : section_header_size=0x6F(4 bytes) + '\n' + section_header(0x6F bytes) + section_body_1_size(4 bytes) + '\n' + section_body_1 + section_body_2_size(maybe=0)(4 bytes) + '\n' + section_body_2 + '\n' //possible sections: axes, legend, __BC02, _202, _231, _232, etc //section name starts with 0x46 position while(LAYER < d_file_size){ //section_header_size=0x6F(4 bytes) + '\n' LAYER += 0x5; //section_header string sec_name(41, 0); file.seekg(LAYER + 0x46, ios_base::beg); file >> sec_name; //if (!QString(sec_name.c_str()).trimmed().isEmpty()) if (!sec_name.empty()) sectionNames.push_back(sec_name); else break; unsigned int sectionNamePos = LAYER + 0x46; BOOST_LOG_(1, format(" SECTION NAME: %s (@ 0x%X)") % sec_name % (LAYER + 0x46)); Rect r; file.seekg(LAYER + 0x03, ios_base::beg); file.read(reinterpret_cast(&r), sizeof(Rect)); unsigned char attach; file.seekg(LAYER + 0x28, ios_base::beg); file >> attach; unsigned char border; file >> border; Color color; file.seekg(LAYER + 0x33, ios_base::beg); file >> color; LAYER += size + 0x01; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_1 LAYER += 0x5; unsigned int osize = size; file.seekg(LAYER, ios_base::beg); readGraphAxisPrefixSuffixInfo(sec_name, size, layer); unsigned char type; file >> type; //text properties short rotation; file.seekg(LAYER + 0x02, ios_base::beg); file >> rotation; unsigned char fontSize; file >> fontSize; unsigned char tab; file.seekg(LAYER + 0x0A, ios_base::beg); file >> tab; //line properties unsigned char lineStyle = 0; double width = 0.0; LineVertex begin, end; file.seekg(LAYER + 0x12, ios_base::beg); file >> lineStyle; unsigned short w1; file >> w1; width = (double)w1/500.0; file.seekg(LAYER + 0x20, ios_base::beg); file >> begin.x; file >> end.x; file.seekg(LAYER + 0x40, ios_base::beg); file >> begin.y; file >> end.y; unsigned char arrows; file.seekg(sectionNamePos + 52, ios_base::beg); file >> arrows; switch (arrows){ case 0: begin.shapeType = 0; end.shapeType = 0; break; case 1: begin.shapeType = 1; end.shapeType = 0; break; case 2: begin.shapeType = 0; end.shapeType = 1; break; case 3: begin.shapeType = 1; end.shapeType = 1; break; } unsigned char sw; file.seekg(sectionNamePos + 56, ios_base::beg); file >> sw; end.shapeWidth = (double)sw/10.0; file >> sw; end.shapeLength = (double)sw/10.0; Figure figure; file.seekg(LAYER + 0x05, ios_base::beg); file >> w1; figure.width = (double)w1/500.0; file.seekg(LAYER + 0x08, ios_base::beg); file >> figure.style; unsigned char fillIndex, fillType; file.seekg(sectionNamePos + 42, ios_base::beg); file >> fillIndex; file.seekg(sectionNamePos + 44, ios_base::beg); file >> fillType; switch(fillType){ case 0: figure.useBorderColor = (fillIndex >= 5); if (fillIndex < 5){ figure.fillAreaPattern = Origin::NoFill; figure.fillAreaColor.type = Origin::Color::Regular; if (fillIndex == 0) figure.fillAreaColor.regular = 0; else if (fillIndex == 1) figure.fillAreaColor.regular = 18; else if (fillIndex == 2) figure.fillAreaColor.regular = 23; else if (fillIndex == 3) figure.fillAreaColor.regular = 17; else figure.fillAreaColor.regular = 19; } else { if (fillIndex == 0x05) figure.fillAreaPattern = Origin::BDiagMedium; else if (fillIndex == 0x06) figure.fillAreaPattern = Origin::DiagCrossMedium; else if (fillIndex == 0x07) figure.fillAreaPattern = Origin::FDiagMedium; else if (fillIndex == 0x08) figure.fillAreaPattern = Origin::HorizontalMedium; else if (fillIndex == 0x09) figure.fillAreaPattern = Origin::VerticalMedium; } break; case 1: figure.fillAreaColor.regular = fillIndex; figure.fillAreaColor.type = Origin::Color::Regular; break; case 2: figure.fillAreaColor.type = Origin::Color::None; figure.fillAreaPatternColor.type = Origin::Color::None; figure.useBorderColor = false; figure.fillAreaPattern = Origin::NoFill; break; } //section_body_2_size LAYER += size + 0x1; file.seekg(LAYER, ios_base::beg); file >> size; //section_body_2 LAYER += 0x5; //check if it is an axis or a legend file.seekg(1, ios_base::cur); if(sec_name == "XB") { string text(size, 0); file >> text; layer.xAxis.position = GraphAxis::Bottom; layer.xAxis.formatAxis[0].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "XT") { string text(size, 0); file >> text; layer.xAxis.position = GraphAxis::Top; layer.xAxis.formatAxis[1].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "YL") { string text(size, 0); file >> text; layer.yAxis.position = GraphAxis::Left; layer.yAxis.formatAxis[0].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "YR") { string text(size, 0); file >> text; layer.yAxis.position = GraphAxis::Right; layer.yAxis.formatAxis[1].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "ZF") { string text(size, 0); file >> text; layer.zAxis.position = GraphAxis::Front; layer.zAxis.formatAxis[0].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "ZB") { string text(size, 0); file >> text; layer.zAxis.position = GraphAxis::Back; layer.zAxis.formatAxis[1].label = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "3D") { file >> layer.zAxis.min; file >> layer.zAxis.max; file >> layer.zAxis.step; file.seekg(LAYER + 0x1C, ios_base::beg); file >> layer.zAxis.majorTicks; file.seekg(LAYER + 0x28, ios_base::beg); file >> layer.zAxis.minorTicks; file >> layer.zAxis.scale; file.seekg(LAYER + 0x218, ios_base::beg); file >> layer.xLength; file >> layer.yLength; file >> layer.zLength; layer.xLength /= 23.0; layer.yLength /= 23.0; layer.zLength /= 23.0; } else if(sec_name == "Legend") { string text(size, 0); file >> text; layer.legend = TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach); } else if(sec_name == "__BCO2") // histogram { file.seekg(LAYER + 0x10, ios_base::beg); file >> layer.histogramBin; file.seekg(LAYER + 0x20, ios_base::beg); file >> layer.histogramEnd; file >> layer.histogramBegin; unsigned int p = sectionNamePos + 81; file.seekg(p, ios_base::beg); file >> layer.percentile.p1SymbolType; file >> layer.percentile.p99SymbolType; file >> layer.percentile.meanSymbolType; file >> layer.percentile.maxSymbolType; file >> layer.percentile.minSymbolType; file.seekg(sectionNamePos + 94, ios_base::beg); file >> layer.percentile.whiskersRange; file >> layer.percentile.boxRange; file.seekg(sectionNamePos + 129, ios_base::beg); file >> layer.percentile.whiskersCoeff; file >> layer.percentile.boxCoeff; unsigned char h; file >> h; layer.percentile.diamondBox = (h == 0x82) ? true : false; p += 109; file.seekg(p, ios_base::beg); file >> layer.percentile.symbolSize; layer.percentile.symbolSize = layer.percentile.symbolSize/2 + 1; p += 163; file.seekg(p, ios_base::beg); file >> layer.percentile.symbolColor; file >> layer.percentile.symbolFillColor; } else if(sec_name == "vline") // Image profiles vertical cursor { file.seekg(sectionNamePos, ios_base::beg); for (int i = 0; i < 2; i++) skipLine(); file.seekg(0x20, ios_base::cur); file >> layer.vLine; BOOST_LOG_(1, format("vLine: %g") % layer.vLine); layer.imageProfileTool = true; } else if(sec_name == "hline") // Image profiles horizontal cursor { file.seekg(sectionNamePos, ios_base::beg); for (int i = 0; i < 2; i++) skipLine(); file.seekg(0x40, ios_base::cur); file >> layer.hLine; BOOST_LOG_(1, format("hLine: %g @ 0x%X") % layer.hLine % file.tellg()); layer.imageProfileTool = true; } else if(sec_name == "ZCOLORS") { layer.isXYY3D = true; } else if(sec_name == "SPECTRUM1") { layer.isXYY3D = false; unsigned char h; file.seekg(24, ios_base::cur); file >> h; layer.colorScale.reverseOrder = h; file.seekg(7, ios_base::cur); file >> layer.colorScale.colorBarThickness; file >> layer.colorScale.labelGap; file.seekg(56, ios_base::cur); file >> layer.colorScale.labelsColor; } else if(size && !type) { string text(size, 0); file >> text; sec_name.resize(3); if (sec_name == "PIE") layer.pieTexts.push_back(TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach)); else layer.texts.push_back(TextBox(text, r, color, fontSize, rotation/10, tab, (BorderType)(border >= 0x80 ? border-0x80 : None), (Attach)attach)); } else if(osize == 0xA) // rectangle & circle { switch(type){ case 0: case 1: figure.type = Figure::Rectangle; break; case 2: case 3: figure.type = Figure::Circle; break; } figure.clientRect = r; figure.attach = (Attach)attach; figure.color = color; layer.figures.push_back(figure); } else if(osize == 0x60 && type == 2) // line { layer.lines.push_back(Line()); Line& line(layer.lines.back()); line.color = color; line.clientRect = r; line.attach = (Attach)attach; line.width = width; line.style = lineStyle; line.begin = begin; line.end = end; } else if(osize == 0x28) // bitmap { if (type == 4){ unsigned long filesize = size + 14; layer.bitmaps.push_back(Bitmap()); Bitmap& bitmap(layer.bitmaps.back()); bitmap.clientRect = r; bitmap.attach = (Attach)attach; bitmap.size = filesize; bitmap.borderType = (BorderType)(border >= 0x80 ? border-0x80 : None); bitmap.data = new unsigned char[filesize]; unsigned char* data = bitmap.data; //add Bitmap header memcpy(data, "BM", 2); data += 2; memcpy(data, &filesize, 4); data += 4; unsigned int d = 0; memcpy(data, &d, 4); data += 4; d = 0x36; memcpy(data, &d, 4); data += 4; file.read(reinterpret_cast(data), size); } else if (type == 6){ string gname(30, 0); file.seekg(sectionNamePos + 81, ios_base::beg); file >> gname; layer.bitmaps.push_back(Bitmap(gname)); Bitmap& bitmap(layer.bitmaps.back()); bitmap.clientRect = r; bitmap.attach = (Attach)attach; bitmap.size = 0; bitmap.borderType = (BorderType)(border >= 0x80 ? border-0x80 : None); } } //close section 00 00 00 00 0A LAYER += size + (size > 0 ? 0x1 : 0); //section_body_3_size file.seekg(LAYER, ios_base::beg); file >> size; //section_body_3 LAYER += 0x5; //close section 00 00 00 00 0A LAYER += size + (size > 0 ? 0x1 : 0); file.seekg(LAYER, ios_base::beg); file >> size; if (!size || size != sectionSize) break; } if (sectionNames.empty()){ objectIndex--; graphs.pop_back(); file.seekg(POS, ios_base::beg); return false; } LAYER += 0x5; unsigned char h; short w; file.seekg(LAYER, ios_base::beg); file >> size; if(size)//check layer is not empty { while(LAYER < d_file_size){ LAYER += 0x5; layer.curves.push_back(GraphCurve()); GraphCurve& curve(layer.curves.back()); file.seekg(LAYER + 0x4C, ios_base::beg); file >> curve.type; BOOST_LOG_(1, format(" graph %d layer %d curve %d type : %d") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % (int)curve.type); if (curve.type == GraphCurve::Mesh3D || curve.type == GraphCurve::Contour) layer.isXYY3D = false; file.seekg(LAYER + 0x04, ios_base::beg); file >> w; pair column = findDataByIndex(w-1); short nColY = w; if(column.first.size() > 0){ curve.dataName = column.first; if(layer.is3D()){ BOOST_LOG_(1, format(" graph %d layer %d curve %d Z : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.zColumnName = column.second; } else { BOOST_LOG_(1, format(" graph %d layer %d curve %d Y : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.yColumnName = column.second; } } file.seekg(LAYER + 0x23, ios_base::beg); file >> w; column = findDataByIndex(w-1); if(column.first.size() > 0){ if(curve.dataName != column.first) BOOST_LOG_(1, format(" graph %d X and Y from different tables") % graphs.size()); if(layer.is3D()){ BOOST_LOG_(1, format(" graph %d layer %d curve %d Y : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.yColumnName = column.second; } else if (layer.isXYY3D){ BOOST_LOG_(1, format(" graph %d layer %d curve %d X : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.xColumnName = column.second; } else { BOOST_LOG_(1, format(" graph %d layer %d curve %d X : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.xColumnName = column.second; } } file.seekg(LAYER + 0x4D, ios_base::beg); file >> w; column = findDataByIndex(w-1); if(column.first.size() > 0 && layer.is3D()){ BOOST_LOG_(1, format(" graph %d layer %d curve %d X : %s.%s") % graphs.size() % graphs.back().layers.size() % layer.curves.size() % column.first.c_str() % column.second.c_str()); curve.xColumnName = column.second; if(curve.dataName != column.first) BOOST_LOG_(1, format(" graph %d X and Y from different tables") % graphs.size()); } if(layer.is3D() || layer.isXYY3D) graphs.back().is3D = true; file.seekg(LAYER + 0x11, ios_base::beg); file >> curve.lineConnect; file >> curve.lineStyle; file.seekg(1, ios_base::cur); file >> curve.boxWidth; file >> w; curve.lineWidth=(double)w/500.0; file.seekg(LAYER + 0x19, ios_base::beg); file >> w; curve.symbolSize=(double)w/500.0; file.seekg(LAYER + 0x1C, ios_base::beg); file >> h; curve.fillArea = (h==2); file.seekg(LAYER + 0x1E, ios_base::beg); file >> curve.fillAreaType; //text if(curve.type == GraphCurve::TextPlot){ file.seekg(LAYER + 0x13, ios_base::beg); file >> curve.text.rotation; curve.text.rotation /= 10; file >> curve.text.fontSize; file.seekg(LAYER + 0x19, ios_base::beg); file >> h; switch(h){ case 26: curve.text.justify = TextProperties::Center; break; case 2: curve.text.justify = TextProperties::Right; break; default: curve.text.justify = TextProperties::Left; break; } file >> h; curve.text.fontUnderline = (h & 0x1); curve.text.fontItalic = (h & 0x2); curve.text.fontBold = (h & 0x8); curve.text.whiteOut = (h & 0x20); char offset; file.seekg(LAYER + 0x37, ios_base::beg); file >> offset; curve.text.xOffset = offset * 5; file >> offset; curve.text.yOffset = offset * 5; } //vector if(curve.type == GraphCurve::FlowVector || curve.type == GraphCurve::Vector){ file.seekg(LAYER + 0x56, ios_base::beg); file >> curve.vector.multiplier; file.seekg(LAYER + 0x5E, ios_base::beg); file >> h; column = findDataByIndex(nColY - 1 + h - 0x64); if(column.first.size() > 0) curve.vector.endXColumnName = column.second; file.seekg(LAYER + 0x62, ios_base::beg); file >> h; column = findDataByIndex(nColY - 1 + h - 0x64); if(column.first.size() > 0) curve.vector.endYColumnName = column.second; file.seekg(LAYER + 0x18, ios_base::beg); file >> h; if(h >= 0x64){ column = findDataByIndex(nColY - 1 + h - 0x64); if(column.first.size() > 0) curve.vector.angleColumnName = column.second; } else if(h <= 0x08) curve.vector.constAngle = 45*h; file >> h; if(h >= 0x64 && h < 0x1F4){ column = findDataByIndex(nColY - 1 + h - 0x64); if(column.first.size() > 0) curve.vector.magnitudeColumnName = column.second; } else curve.vector.constMagnitude = (int)curve.symbolSize; file.seekg(LAYER + 0x66, ios_base::beg); file >> curve.vector.arrowLenght; file >> curve.vector.arrowAngle; file >> h; curve.vector.arrowClosed = !(h & 0x1); file >> w; curve.vector.width=(double)w/500.0; file.seekg(LAYER + 0x142, ios_base::beg); file >> h; switch(h){ case 2: curve.vector.position = VectorProperties::Midpoint; break; case 4: curve.vector.position = VectorProperties::Head; break; default: curve.vector.position = VectorProperties::Tail; break; } } //pie if (curve.type == GraphCurve::Pie){ file.seekg(LAYER + 0x92, ios_base::beg); file >> h; curve.pie.formatPercentages = (h & 0x01); curve.pie.formatValues = (h & 0x02); curve.pie.positionAssociate = (h & 0x08); curve.pie.clockwiseRotation = (h & 0x20); curve.pie.formatCategories = (h & 0x80); file >> curve.pie.formatAutomatic; file >> curve.pie.distance; file >> curve.pie.viewAngle; file.seekg(LAYER + 0x98, ios_base::beg); file >> curve.pie.thickness; file.seekg(LAYER + 0x9A, ios_base::beg); file >> curve.pie.rotation; file.seekg(LAYER + 0x9E, ios_base::beg); file >> curve.pie.displacement; file.seekg(LAYER + 0xA0, ios_base::beg); file >> curve.pie.radius; file >> curve.pie.horizontalOffset; file.seekg(LAYER + 0xA6, ios_base::beg); file >> curve.pie.displacedSectionCount; } //surface if (layer.isXYY3D || curve.type == GraphCurve::Mesh3D){ file.seekg(LAYER + 0x17, ios_base::beg); file >> curve.surface.type; file.seekg(LAYER + 0x1C, ios_base::beg); file >> h; if(h & 0x60 == 0x60) curve.surface.grids = SurfaceProperties::X; else if(h & 0x20) curve.surface.grids = SurfaceProperties::Y; else if(h & 0x40) curve.surface.grids = SurfaceProperties::None; else curve.surface.grids = SurfaceProperties::XY; curve.surface.sideWallEnabled = (h & 0x10); file >> curve.surface.frontColor; file.seekg(LAYER + 0x14C, ios_base::beg); file >> w; curve.surface.gridLineWidth = (double)w/500.0; file >> curve.surface.gridColor; file.seekg(LAYER + 0x13, ios_base::beg); file >> h; curve.surface.backColorEnabled = (h & 0x08); file.seekg(LAYER + 0x15A, ios_base::beg); file >> curve.surface.backColor; file >> curve.surface.xSideWallColor; file >> curve.surface.ySideWallColor; curve.surface.surface.fill = (h & 0x10); curve.surface.surface.contour = (h & 0x40); file.seekg(LAYER + 0x94, ios_base::beg); file >> w; curve.surface.surface.lineWidth = (double)w/500.0; file >> curve.surface.surface.lineColor; curve.surface.topContour.fill = (h & 0x02); curve.surface.topContour.contour = (h & 0x04); file.seekg(LAYER + 0xB4, ios_base::beg); file >> w; curve.surface.topContour.lineWidth = (double)w/500.0; file >> curve.surface.topContour.lineColor; curve.surface.bottomContour.fill = (h & 0x80); curve.surface.bottomContour.contour = (h & 0x01); file.seekg(LAYER + 0xA4, ios_base::beg); file >> w; curve.surface.bottomContour.lineWidth = (double)w/500.0; file >> curve.surface.bottomContour.lineColor; } if (curve.type == GraphCurve::Mesh3D || curve.type == GraphCurve::Contour){ ColorMap& colorMap = (curve.type == GraphCurve::Mesh3D ? curve.surface.colorMap : curve.colorMap); file.seekg(LAYER + 0x13, ios_base::beg); file >> h; colorMap.fillEnabled = (h & 0x82); if (curve.type == GraphCurve::Contour){ file.seekg(102, ios_base::cur); file >> curve.text.fontSize; file.seekg(7, ios_base::cur); file >> h; curve.text.fontUnderline = (h & 0x1); curve.text.fontItalic = (h & 0x2); curve.text.fontBold = (h & 0x8); curve.text.whiteOut = (h & 0x20); file.seekg(2, ios_base::cur); file >> curve.text.color; } file.seekg(LAYER + 0x254, ios_base::beg); readColorMap(colorMap); } file.seekg(LAYER + 0xC2, ios_base::beg); file >> curve.fillAreaColor; file >> w; curve.fillAreaPatternWidth=(double)w/500.0; file.seekg(LAYER + 0xCA, ios_base::beg); file >> curve.fillAreaPatternColor; file >> curve.fillAreaPattern; file >> curve.fillAreaPatternBorderStyle; file >> w; curve.fillAreaPatternBorderWidth=(double)w/500.0; file >> curve.fillAreaPatternBorderColor; file.seekg(LAYER + 0x16A, ios_base::beg); file >> curve.lineColor; if (curve.type != GraphCurve::Contour) curve.text.color = curve.lineColor; file.seekg(LAYER + 0x17, ios_base::beg); file >> curve.symbolType; file.seekg(LAYER + 0x12E, ios_base::beg); file >> curve.symbolFillColor; file >> curve.symbolColor; curve.vector.color = curve.symbolColor; file >> h; curve.symbolThickness = (h == 255 ? 1 : h); file >> curve.pointOffset; file.seekg(LAYER + 0x143, ios_base::beg); file >> h; curve.connectSymbols = (h&0x8); LAYER += size + 0x1; int newSize; file.seekg(LAYER, ios_base::beg); file >> newSize; LAYER += newSize + (newSize > 0 ? 0x1 : 0) + 0x5; file.seekg(LAYER, ios_base::beg); file >> newSize; if(newSize != size) break; } } LAYER += 0x5; //read axis breaks while(LAYER < d_file_size){ file.seekg(LAYER, ios_base::beg); file >> size; if(size == 0x2D){ LAYER += 0x5; file.seekg(LAYER + 2, ios_base::beg); file >> h; if(h == 2) { layer.xAxisBreak.minorTicksBefore = layer.xAxis.minorTicks; layer.xAxisBreak.scaleIncrementBefore = layer.xAxis.step; file.seekg(LAYER, ios_base::beg); readGraphAxisBreakInfo(layer.xAxisBreak); } else if(h == 4){ layer.yAxisBreak.minorTicksBefore = layer.yAxis.minorTicks; layer.yAxisBreak.scaleIncrementBefore = layer.yAxis.step; file.seekg(LAYER, ios_base::beg); readGraphAxisBreakInfo(layer.yAxisBreak); } LAYER += 0x2D + 0x1; } else break; } LAYER += 0x5; file.seekg(LAYER, ios_base::beg); size = readGraphAxisInfo(layer.xAxis); LAYER += size*0x6; LAYER += 0x5; file.seekg(LAYER, ios_base::beg); readGraphAxisInfo(layer.yAxis); LAYER += size*0x6; LAYER += 0x5; file.seekg(LAYER, ios_base::beg); readGraphAxisInfo(layer.zAxis); LAYER += size*0x6; LAYER += 0x5; file.seekg(LAYER, ios_base::beg); file >> size; if(size == 0) break; } file.seekg(LAYER + 0x5, ios_base::beg); return true; } OriginParser* createOrigin610Parser(const string& fileName) { return new Origin610Parser(fileName); } int Origin610Parser::findObjectInfoSectionByName(unsigned int start, const string& name) { file.seekg(start, ios_base::beg); char c = 0; unsigned int pos = start; while(pos != ios_base::end){ file >> c; if (c == name[0]){ pos = file.tellg(); file.seekg(pos - 0x2, ios_base::beg); file >> c; string s = string(name.size(), 0); file >> s; char end; file >> end; if (!c && !end && name == s){ pos -= 0x8; file.seekg(pos, ios_base::beg); //BOOST_LOG_(1, format(" Object info section starts at: 0x%X") % pos); return pos; } } } return 0; } liborigin2-20110117/OriginDefaultParser.h0000644000265600020320000000426511523526505017374 0ustar andreasadmin/*************************************************************************** File : OriginDefaultParser.h -------------------------------------------------------------------- Copyright : (C) 2005-2007 Stefan Gerlach (C) 2007-2008 Alex Kargovsky, Ion Vasilief Email (use @ for *) : kargovsky*yumr.phys.msu.su, ion_vasilief*yahoo.fr Description : Default Origin file parser class ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #ifndef ORIGIN_DEFAULT_PARSER_H #define ORIGIN_DEFAULT_PARSER_H #include "OriginParser.h" using namespace std; class OriginDefaultParser : public OriginParser { public: OriginDefaultParser(const string& fileName); bool parse(); private: string fileName; }; #endif // ORIGIN_DEFAULT_PARSER_H liborigin2-20110117/OriginObj.h0000644000265600020320000004163311523526505015345 0ustar andreasadmin/*************************************************************************** File : OriginObj.h -------------------------------------------------------------------- Copyright : (C) 2005-2007 Stefan Gerlach (C) 2007-2008 Alex Kargovsky, Ion Vasilief Email (use @ for *) : kargovsky*yumr.phys.msu.su, ion_vasilief*yahoo.fr Description : Origin internal object classes ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #ifndef ORIGIN_OBJ_H #define ORIGIN_OBJ_H #include #include #include "boost/variant.hpp" #include "boost/bind.hpp" #include "boost/date_time/posix_time/ptime.hpp" using namespace std; #define _ONAN (-1.23456789E-300) namespace Origin { enum ValueType {Numeric = 0, Text = 1, Time = 2, Date = 3, Month = 4, Day = 5, ColumnHeading = 6, TickIndexedDataset = 7, TextNumeric = 9, Categorical = 10}; enum NumericDisplayType {DefaultDecimalDigits = 0, DecimalPlaces = 1, SignificantDigits = 2}; enum Attach {Frame = 0, Page = 1, Scale = 2}; enum BorderType {BlackLine = 0, Shadow = 1, DarkMarble = 2, WhiteOut = 3, BlackOut = 4, None = -1}; enum FillPattern {NoFill, BDiagDense, BDiagMedium, BDiagSparse, FDiagDense, FDiagMedium, FDiagSparse, DiagCrossDense, DiagCrossMedium, DiagCrossSparse, HorizontalDense, HorizontalMedium, HorizontalSparse, VerticalDense, VerticalMedium, VerticalSparse, CrossDense, CrossMedium, CrossSparse}; struct Color { enum ColorType {None, Automatic, Regular, Custom, Increment, Indexing, RGB, Mapping}; enum RegularColor {Black = 0, Red = 1, Green = 2, Blue = 3, Cyan = 4, Magenta = 5, Yellow = 6, DarkYellow = 7, Navy = 8, Purple = 9, Wine = 10, Olive = 11, DarkCyan = 12, Royal= 13, Orange = 14, Violet = 15, Pink = 16, White = 17, LightGray = 18, Gray = 19, LTYellow = 20, LTCyan = 21, LTMagenta = 22, DarkGray = 23/*, Custom = 255*/}; ColorType type; union { unsigned char regular; unsigned char custom[3]; unsigned char starting; unsigned char column; }; }; struct Rect { short left; short top; short right; short bottom; Rect(short width = 0, short height = 0) : left(0) , top(0) , right(width) , bottom(height) { }; int height() const { return bottom - top; }; int width() const { return right - left; }; bool isValid() const { return height() > 0 && width() > 0; } }; struct ColorMapLevel { Color fillColor; unsigned char fillPattern; Color fillPatternColor; double fillPatternLineWidth; bool lineVisible; Color lineColor; unsigned char lineStyle; double lineWidth; bool labelVisible; }; typedef vector > ColorMapVector; struct ColorMap { bool fillEnabled; ColorMapVector levels; }; struct Window { enum State {Normal, Minimized, Maximized}; enum Title {Name, Label, Both}; string name; string label; int objectID; bool hidden; State state; Title title; Rect frameRect; boost::posix_time::ptime creationDate; boost::posix_time::ptime modificationDate; Window(const string& _name= "", const string& _label = "", bool _hidden = false) : name(_name) , label(_label) , objectID(-1) , hidden(_hidden) , state(Normal) , title(Both) {}; }; typedef boost::variant variant; struct SpreadColumn { enum ColumnType {X, Y, Z, XErr, YErr, Label, NONE}; string name; ColumnType type; ValueType valueType; int valueTypeSpecification; int significantDigits; int decimalPlaces; NumericDisplayType numericDisplayType; string command; string comment; int width; unsigned int index; unsigned int sheet; vector data; SpreadColumn(const string& _name = "", unsigned int _index = 0) : name(_name) , index(_index) , command("") , comment("") , valueType(Numeric) , valueTypeSpecification(0) , significantDigits(6) , decimalPlaces(6) , width(8) , numericDisplayType(DefaultDecimalDigits) , sheet(0) {}; }; struct SpreadSheet : public Window { unsigned int maxRows; bool loose; bool multisheet; unsigned int sheets; vector columns; SpreadSheet(const string& _name = "") : Window(_name) , loose(true) , multisheet(false) , sheets(1) {}; }; struct Excel : public Window { unsigned int maxRows; bool loose; vector sheets; Excel(const string& _name = "", const string& _label = "", int _maxRows = 0, bool _hidden = false, bool _loose = true) : Window(_name, _label, _hidden) , maxRows(_maxRows) , loose(_loose) { }; }; struct Matrix : public Window { enum ViewType {DataView, ImageView}; enum HeaderViewType {ColumnRow, XY}; unsigned short rowCount; unsigned short columnCount; int valueTypeSpecification; int significantDigits; int decimalPlaces; NumericDisplayType numericDisplayType; string command; int width; unsigned int index; unsigned int sheets; ViewType view; HeaderViewType header; ColorMap colorMap; vector data; vector coordinates; Matrix(const string& _name = "", unsigned int _index = 0) : Window(_name) , index(_index) , sheets(1) , command("") , valueTypeSpecification(0) , significantDigits(6) , decimalPlaces(6) , width(8) , numericDisplayType(DefaultDecimalDigits) , view(DataView) , header(ColumnRow) {coordinates.push_back(10.0);coordinates.push_back(10.0);coordinates.push_back(1.0);coordinates.push_back(1.0);}; }; struct Function { enum FunctionType {Normal, Polar}; string name; FunctionType type; string formula; double begin; double end; int totalPoints; unsigned int index; Function(const string& _name = "", unsigned int _index = 0) : name(_name) , index(_index) , type(Normal) , formula("") , begin(0.0) , end(0.0) , totalPoints(0) {}; }; struct TextBox { string text; Rect clientRect; Color color; unsigned short fontSize; int rotation; int tab; BorderType borderType; Attach attach; TextBox(const string& _text = "") : text(_text) {}; TextBox(const string& _text, const Rect& _clientRect, const Color& _color, unsigned short _fontSize, int _rotation, int _tab, BorderType _borderType, Attach _attach) : text(_text) , clientRect(_clientRect) , color(_color) , fontSize(_fontSize) , rotation(_rotation) , tab(_tab) , borderType(_borderType) , attach(_attach) {}; }; struct PieProperties { unsigned char viewAngle; unsigned char thickness; bool clockwiseRotation; short rotation; unsigned short radius; unsigned short horizontalOffset; unsigned long displacedSectionCount; // maximum - 32 sections unsigned short displacement; //labels bool formatAutomatic; bool formatValues; bool formatPercentages; bool formatCategories; bool positionAssociate; unsigned short distance; PieProperties() : clockwiseRotation(false) , formatAutomatic(false) , formatValues(false) , formatPercentages(false) , formatCategories(false) , positionAssociate(false) {}; }; struct VectorProperties { enum VectorPosition {Tail, Midpoint, Head}; Color color; double width; unsigned short arrowLenght; unsigned char arrowAngle; bool arrowClosed; string endXColumnName; string endYColumnName; VectorPosition position; string angleColumnName; string magnitudeColumnName; float multiplier; int constAngle; int constMagnitude; VectorProperties() : arrowClosed(false) , position(Tail) , multiplier(1.0) , constAngle(0) , constMagnitude(0) {}; }; struct TextProperties { enum Justify {Left, Center, Right}; Color color; bool fontBold; bool fontItalic; bool fontUnderline; bool whiteOut; Justify justify; short rotation; short xOffset; short yOffset; unsigned short fontSize; }; struct SurfaceProperties { struct SurfaceColoration { bool fill; bool contour; Color lineColor; double lineWidth; }; enum Type {ColorMap3D, ColorFill, WireFrame, Bars}; enum Grids {None, X, Y, XY}; unsigned char type; Grids grids; double gridLineWidth; Color gridColor; bool backColorEnabled; Color frontColor; Color backColor; bool sideWallEnabled; Color xSideWallColor; Color ySideWallColor; SurfaceColoration surface; SurfaceColoration topContour; SurfaceColoration bottomContour; ColorMap colorMap; }; struct PercentileProperties { unsigned char maxSymbolType; unsigned char p99SymbolType; unsigned char meanSymbolType; unsigned char p1SymbolType; unsigned char minSymbolType; Color symbolColor; Color symbolFillColor; unsigned short symbolSize; unsigned char boxRange; unsigned char whiskersRange; double boxCoeff; double whiskersCoeff; bool diamondBox; }; struct GraphCurve { enum Plot {Line = 200, Scatter=201, LineSymbol=202, Column = 203, Area = 204, HiLoClose = 205, Box = 206, ColumnFloat = 207, Vector = 208, PlotDot = 209, Wall3D = 210, Ribbon3D = 211, Bar3D = 212, ColumnStack = 213, AreaStack = 214, Bar = 215, BarStack = 216, FlowVector = 218, Histogram = 219, MatrixImage = 220, Pie = 225, Contour = 226, Unknown = 230, ErrorBar = 231, TextPlot = 232, XErrorBar = 233, SurfaceColorMap = 236, SurfaceColorFill = 237, SurfaceWireframe = 238, SurfaceBars = 239, Line3D = 240, Text3D = 241, Mesh3D = 242, XYZContour = 243, XYZTriangular = 245, LineSeries = 246, YErrorBar = 254, XYErrorBar = 255, GraphScatter3D = 0x8AF0, GraphTrajectory3D = 0x8AF1, Polar = 0x00020000, SmithChart = 0x00040000, FillArea = 0x00800000}; enum LineStyle {Solid = 0, Dash = 1, Dot = 2, DashDot = 3, DashDotDot = 4, ShortDash = 5, ShortDot = 6, ShortDashDot = 7}; enum LineConnect {NoLine = 0, Straight = 1, TwoPointSegment = 2, ThreePointSegment = 3, BSpline = 8, Spline = 9, StepHorizontal = 11, StepVertical = 12, StepHCenter = 13, StepVCenter = 14, Bezier = 15}; unsigned char type; string dataName; string xColumnName; string yColumnName; string zColumnName; Color lineColor; unsigned char lineStyle; unsigned char lineConnect; unsigned char boxWidth; double lineWidth; bool fillArea; unsigned char fillAreaType; unsigned char fillAreaPattern; Color fillAreaColor; Color fillAreaPatternColor; double fillAreaPatternWidth; unsigned char fillAreaPatternBorderStyle; Color fillAreaPatternBorderColor; double fillAreaPatternBorderWidth; unsigned short symbolType; Color symbolColor; Color symbolFillColor; double symbolSize; unsigned char symbolThickness; unsigned char pointOffset; bool connectSymbols; //pie PieProperties pie; //vector VectorProperties vector; //text TextProperties text; //surface SurfaceProperties surface; //contour ColorMap colorMap; }; struct GraphAxisBreak { bool show; bool log10; double from; double to; double position; double scaleIncrementBefore; double scaleIncrementAfter; unsigned char minorTicksBefore; unsigned char minorTicksAfter; GraphAxisBreak() : show(false) {}; }; struct GraphGrid { bool hidden; unsigned char color; unsigned char style; double width; }; struct GraphAxisFormat { bool hidden; unsigned char color; double thickness; double majorTickLength; int majorTicksType; int minorTicksType; int axisPosition; double axisPositionValue; TextBox label; string prefix; string suffix; }; struct GraphAxisTick { bool hidden; unsigned char color; ValueType valueType; int valueTypeSpecification; int decimalPlaces; unsigned short fontSize; bool fontBold; string dataName; string columnName; int rotation; }; struct GraphAxis { enum AxisPosition {Left = 0, Bottom, Right, Top, Front, Back}; enum Scale {Linear = 0, Log10 = 1, Probability = 2, Probit = 3, Reciprocal = 4, OffsetReciprocal = 5, Logit = 6, Ln = 7, Log2 = 8}; AxisPosition position; double min; double max; double step; unsigned char majorTicks; unsigned char minorTicks; unsigned char scale; GraphGrid majorGrid; GraphGrid minorGrid; GraphAxisFormat formatAxis[2]; GraphAxisTick tickAxis[2]; //bottom-top, left-right }; struct Figure { enum FigureType {Rectangle, Circle}; FigureType type; Rect clientRect; Attach attach; Color color; unsigned char style; double width; Color fillAreaColor; unsigned char fillAreaPattern; Color fillAreaPatternColor; double fillAreaPatternWidth; bool useBorderColor; Figure(FigureType _type = Rectangle) : type(_type) { }; }; struct LineVertex { unsigned char shapeType; double shapeWidth; double shapeLength; double x; double y; LineVertex() : shapeType(0) , shapeWidth(0.0) , shapeLength(0.0) , x(0.0) , y(0.0) {}; }; struct Line { Rect clientRect; Color color; Attach attach; double width; unsigned char style; LineVertex begin; LineVertex end; }; struct Bitmap { Rect clientRect; Attach attach; unsigned long size; string windowName; BorderType borderType; unsigned char* data; Bitmap(const string& _name = "") : size(0) , data(0) , windowName(_name) , borderType(Origin::None) { }; Bitmap(const Bitmap& bitmap) : clientRect(bitmap.clientRect) , attach(bitmap.attach) , size(bitmap.size) , windowName(bitmap.windowName) , borderType(bitmap.borderType) { if(size > 0) { data = new unsigned char[size]; memcpy(data, bitmap.data, size); } }; ~Bitmap() { if(size > 0) delete data; }; }; struct ColorScale { bool reverseOrder; unsigned short labelGap; unsigned short colorBarThickness; Color labelsColor; }; struct GraphLayer { Rect clientRect; TextBox legend; Color backgroundColor; BorderType borderType; GraphAxis xAxis; GraphAxis yAxis; GraphAxis zAxis; GraphAxisBreak xAxisBreak; GraphAxisBreak yAxisBreak; GraphAxisBreak zAxisBreak; double histogramBin; double histogramBegin; double histogramEnd; PercentileProperties percentile; ColorScale colorScale; vector texts; vector pieTexts; vector lines; vector
figures; vector bitmaps; vector curves; float xLength; float yLength; float zLength; bool imageProfileTool; double vLine; double hLine; bool isXYY3D; GraphLayer() : imageProfileTool(false) , isXYY3D(false) {}; //bool threeDimensional; bool is3D() const { return curves.end() != find_if(curves.begin(), curves.end(), boost::bind(logical_or(), boost::bind(&GraphCurve::type, _1) == GraphCurve::Line3D, boost::bind(&GraphCurve::type, _1) == GraphCurve::Mesh3D)); } }; struct GraphLayerRange { double min; double max; double step; GraphLayerRange(double _min = 0.0, double _max = 0.0, double _step = 0.0) : min(_min) , max(_max) , step(_step) {}; }; struct Graph : public Window { vector layers; unsigned short width; unsigned short height; bool is3D; bool isLayout; Graph(const string& _name = "") : Window(_name) , is3D(false) , isLayout(false) {}; }; struct Note : public Window { string text; Note(const string& _name = "") : Window(_name) {}; }; struct ProjectNode { enum NodeType {SpreadSheet, Matrix, Excel, Graph, Graph3D, Note, Folder}; NodeType type; string name; boost::posix_time::ptime creationDate; boost::posix_time::ptime modificationDate; ProjectNode(const string& _name = "", NodeType _type = Folder, const boost::posix_time::ptime& _creationDate = boost::posix_time::ptime(), const boost::posix_time::ptime& _modificationDate = boost::posix_time::ptime()) : name(_name) , type(_type) , creationDate(_creationDate) , modificationDate(_modificationDate) {}; }; } #endif // ORIGIN_OBJ_H liborigin2-20110117/logging.hpp0000644000265600020320000005147511523526505015456 0ustar andreasadmin// Boost general library logging.hpp header file ---------------------------// // (C) Copyright Jean-Daniel Michaud 2007. Permission to copy, use, modify, // sell and distribute this software is granted provided this copyright notice // appears in all copies. This software is provided "as is" without express or // implied warranty, and with no claim as to its suitability for any purpose. // See http://www.boost.org/LICENSE_1_0.txt for licensing. // See http://code.google.com/p/loglite/ for library home page. #ifndef BOOST_LOGGING_HPP #define BOOST_LOGGING_HPP #include #include #include #include #include #include #include #include #include #include #ifndef BOOST_CONFIG_HPP # include #endif #if defined(BOOST_HAS_THREADS) # include # include #endif // BOOST_HAS_THREADS #include #include #include #ifndef BOOST_NO_CODE_GENERATION_FOR_LOG #define BOOST_LOG_INIT( format ) \ { \ boost::logging::logger *l = boost::logging::logger::get_instance(); \ assert(l); \ l->add_format(format); \ } #define BOOST_LOG_ADD_OUTPUT_STREAM( sink ) \ { \ boost::logging::logger *l = boost::logging::logger::get_instance(); \ assert(l); \ l->add_sink(sink); \ } #define BOOST_LOG(level, qualifier, _trace) \ { \ boost::logging::logger *l = boost::logging::logger::get_instance(); \ assert(l); \ if (l->get_global_max_log_level() >= level) \ { \ if (l->m_string_stream.str() != "") \ l->m_string_stack.push(l->m_string_stream.str()); \ \ l->m_string_stream.str(""); \ l->m_string_stream << _trace; \ l->trace(level, qualifier, l->m_string_stream.str(), __FILE__, __LINE__); \ if (!l->m_string_stack.empty()) \ { \ l->m_string_stream.str(l->m_string_stack.top()); \ l->m_string_stack.pop(); \ } \ } \ } #define BOOST_LOG_( level, _trace ) \ { BOOST_LOG(level, boost::logging::log, _trace) } #define BOOST_LOG_UNFORMATTED(level, qualifier, _trace) \ { \ boost::logging::logger *l = boost::logging::logger::get_instance(); \ assert(l); \ if (l->get_global_max_log_level() >= level) \ { \ if (l->m_string_stream.str() != "") \ l->m_string_stack.push(l->m_string_stream.str()); \ \ l->m_string_stream.str(""); \ l->m_string_stream << _trace; \ l->unformatted_trace(level, qualifier, \ l->m_string_stream.str(), __FILE__, __LINE__); \ if (!l->m_string_stack.empty()) \ { \ l->m_string_stream.str(l->m_string_stack.top()); \ l->m_string_stack.pop(); \ } \ } \ } #define BOOST_LOG_FINALIZE() \ { \ boost::logging::logger *l = boost::logging::logger::get_instance(); \ assert(l); \ l->clear(); \ } #else // !BOOST_NO_CODE_GENERATION_FOR_LOG #define BOOST_LOG_INIT( format ) #define BOOST_LOG_ADD_OUTPUT_STREAM( sink ) #define BOOST_LOG(level, qualifier, _trace) #define BOOST_LOG_( level, _trace ) #define BOOST_LOG_UNFORMATTED(level, qualifier, _trace) #endif // BOOST_NO_CODE_GENERATION_FOR_LOG #define BOOST_MAX_LINE_STR_SIZE 20 // log(2^64) #define BOOST_LEVEL_UP_LIMIT 999 namespace boost { namespace logging { // Logging forward declarations ---------------------------------------------// class log_element; class level_element; class qualifier; class trace_element; class format; class sink; class logger; // Logging typedefs declarations --------------------------------------------// typedef enum { LEVEL = 0, QUALIFIER, TRACE, FILENAME, LINE } param_e; typedef enum { SINK = 0, FORMAT } sink_format_assoc_e; typedef std::list > element_list_t; typedef std::list > stream_list_t; typedef unsigned short level_t; typedef tuple log_param_t; typedef std::list format_list_t; typedef tuple sink_format_assoc_t; typedef std::list sink_format_assoc_list_t; typedef std::list qualifier_list_t; // Used for shared_ptr() on statically allocated log_element ----------------// struct null_deleter { void operator()(void const *) const {} }; // Qualifier class declaration ----------------------------------------------// class qualifier { public: qualifier() {} inline std::string to_string() const { return m_identifier; } virtual bool operator==(const qualifier &q) { return false; } protected: std::string m_identifier; }; class log_qualifier : public qualifier { public: log_qualifier() { m_identifier = "log"; } bool operator==(const qualifier &q) { return (dynamic_cast(&q) != NULL); } }; class notice_qualifier : public qualifier { public: notice_qualifier() { m_identifier = "notice"; } bool operator==(const qualifier &q) { return (dynamic_cast(&q) != NULL); } }; class warning_qualifier : public qualifier { public: warning_qualifier() { m_identifier = "warning"; } bool operator==(const qualifier &q) { return (dynamic_cast(&q) != NULL); } }; class error_qualifier : public qualifier { public: error_qualifier() { m_identifier = "error"; } bool operator==(const qualifier &q) { return (dynamic_cast(&q) != NULL); } }; // Element classes declaration ---------------------------------------------// class log_element { public: virtual std::string to_string() { assert(0); return ""; }; virtual std::string visit(format &f, const log_param_t &log_param); }; class level_element : public log_element { public: std::string to_string(level_t l) { return str(boost::format("%i") % l); }; std::string visit(format &f, const log_param_t &log_param); }; class filename_element : public log_element { public: std::string to_string(const std::string &f) { return f; } std::string visit(format &f, const log_param_t &log_param); }; class line_element : public log_element { public: std::string to_string(unsigned int l) { return str(boost::format("%i") % l); } std::string visit(format &f, const log_param_t &log_param); }; class date_element : public log_element { public: std::string to_string() { boost::gregorian::date d(boost::gregorian::day_clock::local_day()); return boost::gregorian::to_iso_extended_string(d); } }; class time_element : public log_element { public: std::string to_string() { boost::posix_time::ptime t(boost::posix_time::microsec_clock::local_time()); return boost::posix_time::to_simple_string(t); }; }; class trace_element : public log_element { public: std::string to_string(const std::string& s) { return s; }; std::string visit(format &f, const log_param_t &log_param); }; class eol_element : public log_element { public: std::string to_string() { return "\n"; }; }; class literal_element : public log_element { public: explicit literal_element(const std::string &l) : m_literal(l) {} std::string to_string() { return m_literal; }; private: std::string m_literal; }; class qualifier_element : public log_element { public: qualifier_element(const qualifier &lq) { m_qualifier_identifier = lq.to_string(); } std::string to_string() { return m_qualifier_identifier; }; private: std::string m_qualifier_identifier; }; // Format class declatation -------------------------------------------------// class format { public: format(log_element &e) : m_identifier("unnamed") { boost::shared_ptr p(&e, null_deleter()); m_element_list.push_back(p); } format(log_element &e, const std::string &identifier) : m_identifier(identifier) { boost::shared_ptr p(&e, null_deleter()); m_element_list.push_back(p); } format(element_list_t e) : m_element_list(e), m_identifier("unnamed") {} format(element_list_t e, const std::string &identifier) : m_element_list(e), m_identifier(identifier) {} std::string produce_trace(const log_param_t &log_param) { element_list_t::iterator e_it = m_element_list.begin(); std::stringstream str_stream; for (; e_it != m_element_list.end(); ++e_it) { str_stream << (*e_it)->visit(*this, log_param); } return str_stream.str(); } // Visitors for the log elements std::string accept(log_element &e) { return e.to_string(); } std::string accept(level_element &e, level_t l) { return e.to_string(l); } std::string accept(trace_element &e, const std::string& s) { return e.to_string(s); } std::string accept(filename_element &e, const std::string& s) { return e.to_string(s); } std::string accept(line_element &e, unsigned int l) { return e.to_string(l); } private: element_list_t m_element_list; std::string m_identifier; }; // Sink class declaration ---------------------------------------------------// class sink { public: sink(std::ostream *s, level_t max_log_level = 1) { if (s) if (*s == std::cout || *s == std::cerr || *s == std::clog) m_output_stream.reset(s, null_deleter()); else m_output_stream.reset(s); set_max_log_level(max_log_level); } void set_max_log_level(level_t max_log_level) { m_max_log_level = ((BOOST_LEVEL_UP_LIMIT < max_log_level) ? BOOST_LEVEL_UP_LIMIT : max_log_level); } inline level_t get_max_log_level() const { return m_max_log_level; } void consume_trace(format &f, const log_param_t &log_param) { /* make here check to avoid producing a useless trace */ if (get(log_param) > m_max_log_level) return ; qualifier_list_t::const_iterator it = m_qualifier_list.begin(); bool qualifier_present = false; for ( ; !qualifier_present && it != m_qualifier_list.end(); ++it) qualifier_present = (**it == *get(log_param)); if (!qualifier_present) return ; *m_output_stream << f.produce_trace(log_param); } void attach_qualifier(qualifier &q) { m_qualifier_list.push_back(&q); } private: level_t m_max_log_level; shared_ptr m_output_stream; qualifier_list_t m_qualifier_list; }; // Element static instantiations --------------------------------------------// static level_element level = level_element(); static filename_element filename = filename_element(); static line_element line = line_element(); static date_element date = date_element(); static time_element time = time_element(); static trace_element trace = trace_element(); static eol_element eol = eol_element(); static log_qualifier log = log_qualifier(); static notice_qualifier notice = notice_qualifier(); static warning_qualifier warning = warning_qualifier(); static error_qualifier error = error_qualifier(); // Logger class declaration ------------------------------------------------// class logger { public: logger() : m_global_max_log_level(0) {} void clear() { m_format_list.clear(); m_sink_format_assoc.clear(); } static logger *get_instance() { #if defined(BOOST_HAS_THREADS) static boost::mutex m_inst_mutex; boost::mutex::scoped_lock scoped_lock(m_inst_mutex); #endif // BOOST_HAS_THREADS static logger *l = NULL; if (!l) { l = new logger(); static shared_ptr s_ptr_l(l); } return l; } void add_format(const format &f) { m_format_list.push_back(f); } void add_sink(const sink &s) { if (m_format_list.begin() == m_format_list.end()) throw "no format defined"; // Updating global_max_level used for full lazy evaluation m_global_max_log_level = (m_global_max_log_level < s.get_max_log_level()) ? s.get_max_log_level() : m_global_max_log_level; m_sink_format_assoc.push_back ( sink_format_assoc_t(s, *m_format_list.begin()) ); } void add_sink(const sink &s, format &f) { // Updating global_max_level used for full lazy evaluation m_global_max_log_level = (m_global_max_log_level < s.get_max_log_level()) ? s.get_max_log_level() : m_global_max_log_level; m_sink_format_assoc.push_back(sink_format_assoc_t(s, f)); } inline level_t get_global_max_log_level() { return m_global_max_log_level; } void trace(unsigned short l, const qualifier &q, const std::string &t, const std::string &f, unsigned int ln) { #if defined(BOOST_HAS_THREADS) boost::mutex::scoped_lock scoped_lock(m_mutex); #endif // BOOST_HAS_THREADS log_param_t log_param(l, &q, t, f, ln); sink_format_assoc_list_t::iterator s_it = m_sink_format_assoc.begin(); for (; s_it != m_sink_format_assoc.end(); ++s_it) { get(*s_it).consume_trace(get(*s_it), log_param); } } void unformatted_trace(unsigned short l, const qualifier &q, const std::string &t, const std::string &f, unsigned int ln); public: std::stringstream m_string_stream; std::stack m_string_stack; private: format_list_t m_format_list; sink_format_assoc_list_t m_sink_format_assoc; // The global max log level is the highest log level on all the link // added to the logger. If no sink as a log level high enougth for // a trace, the trace does not need to be evaluated. level_t m_global_max_log_level; #if defined(BOOST_HAS_THREADS) boost::mutex m_mutex; #endif // BOOST_HAS_THREADS }; // logger // Element functions definition ---------------------------------------------// inline std::string log_element::visit(format &f, const log_param_t &log_param) { return f.accept(*this); } inline std::string level_element::visit(format &f, const log_param_t &log_param) { return f.accept(*this, get(log_param)); } inline std::string trace_element::visit(format &f, const log_param_t &log_param) { return f.accept(*this, get(log_param)); } inline std::string filename_element::visit(format &f, const log_param_t &log_param) { return f.accept(*this, get(log_param)); } inline std::string line_element::visit(format &f, const log_param_t &log_param) { return f.accept(*this, get(log_param)); } } // !namespace logging } // !namespace boost // Element global operators -------------------------------------------------// inline boost::logging::element_list_t operator>>( boost::logging::log_element &lhs, boost::logging::log_element &rhs) { boost::logging::element_list_t l; l.push_back(boost::shared_ptr (&lhs, boost::logging::null_deleter())); l.push_back(boost::shared_ptr (&rhs, boost::logging::null_deleter())); return l; } inline boost::logging::element_list_t operator>>( boost::logging::element_list_t lhs, boost::logging::log_element &rhs) { lhs.push_back(boost::shared_ptr (&rhs, boost::logging::null_deleter())); return lhs; } inline boost::logging::element_list_t operator>>( const std::string &s, boost::logging::log_element &rhs) { boost::logging::element_list_t l; boost::shared_ptr p(new boost::logging::literal_element(s)); l.push_back(p); l.push_back(boost::shared_ptr (&rhs, boost::logging::null_deleter())); return l; } inline boost::logging::element_list_t operator>>( boost::logging::element_list_t lhs, const std::string &s) { boost::shared_ptr p(new boost::logging::literal_element(s)); lhs.push_back(p); return lhs; } inline void boost::logging::logger::unformatted_trace(unsigned short l, const qualifier &q, const std::string &t, const std::string &f, unsigned int ln) { #if defined(BOOST_HAS_THREADS) boost::mutex::scoped_lock scoped_lock(m_mutex); #endif // BOOST_HAS_THREADS log_param_t log_param(l, &q, t, f, ln); sink_format_assoc_list_t::iterator s_it = m_sink_format_assoc.begin(); for (; s_it != m_sink_format_assoc.end(); ++s_it) { boost::logging::format f(boost::logging::trace); get(*s_it).consume_trace(f, log_param); } } #endif // !BOOST_LOGGING_HPP