├── .gitignore ├── Stdf_V4_Reader ├── stdf_v4.rc ├── stdfv4.ico ├── main.cpp ├── Stdf_V4_Reader.pro ├── debug_api │ ├── debug_api.h │ └── debug_api.cpp ├── stdf_file │ ├── stdf_v4_file.h │ └── stdf_v4_file.cpp ├── ui │ ├── stdf_window.h │ ├── mainwindow.ui │ └── stdf_window.cpp ├── Stdf_V4_Reader.pro.user └── stdf_api │ └── stdf_v4_api.h ├── README.md └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Stdf_V4_Reader/stdf_v4.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guyanqiu/STDF-Reader/HEAD/Stdf_V4_Reader/stdf_v4.rc -------------------------------------------------------------------------------- /Stdf_V4_Reader/stdfv4.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guyanqiu/STDF-Reader/HEAD/Stdf_V4_Reader/stdfv4.ico -------------------------------------------------------------------------------- /Stdf_V4_Reader/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ui/stdf_window.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | MainWindow w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Describtion 2 | * STDF is Standard Test Data Format for ATE(Automatic Test Equipment). 3 | * I Create A library for Read and Write STDF File. 4 | * For Test, I Create A GUI Program for STDF file reader. 5 | 6 | ## 2017-07-19 7 | * Reorganize folders 8 | * Add Right Click to Save Record to CSV 9 | 10 | ## 2017-07-25 11 | * Refactoring the DebugMessage Codes 12 | 13 | ## 2017-07-26 14 | * Refactoring the STDF Record Show Codes 15 | 16 | ## 2018-03-01 17 | * Add Part ID for PTRs table 18 | 19 | ## 2019-06-17 20 | * Optimized the code about QTableWidgets 21 | -------------------------------------------------------------------------------- /Stdf_V4_Reader/Stdf_V4_Reader.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2016-04-07T09:48:14 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = Stdf_V4_Reader 12 | TEMPLATE = app 13 | QMAKE_CXXFLAGS += -std=c++11 14 | 15 | SOURCES += \ 16 | stdf_api/stdf_v4_api.cpp \ 17 | stdf_api/stdf_v4_internal.cpp \ 18 | stdf_file/stdf_v4_file.cpp \ 19 | ui/stdf_window.cpp \ 20 | debug_api/debug_api.cpp \ 21 | main.cpp 22 | 23 | HEADERS += \ 24 | stdf_api/stdf_v4_api.h \ 25 | stdf_api/stdf_v4_internal.h \ 26 | stdf_file/stdf_v4_file.h \ 27 | ui/stdf_window.h \ 28 | debug_api/debug_api.h \ 29 | stdf_v4.rc 30 | 31 | FORMS += \ 32 | ui/mainwindow.ui 33 | 34 | RC_FILE += stdf_v4.rc 35 | 36 | DISTFILES += \ 37 | stdfv4.ico 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Gu Yanqiu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Stdf_V4_Reader/debug_api/debug_api.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * For debug and test, when stat the program for terminal, 3 | * this can show the debug message. 4 | *************************************************************************/ 5 | #ifndef _DEBUG_API_H_ 6 | #define _DEBUG_API_H_ 7 | #include 8 | #include 9 | #include 10 | 11 | #ifndef __FUNCDNAME__ 12 | #define __FUNCDNAME__ __func__ 13 | #endif 14 | #define INDEX_OVER_RANGE(range, index) IndexOverRangeError(range, index, __FILE__, __FUNCDNAME__, __LINE__) 15 | #define MEMORY_ALLOCATED_ERROR() MemoryAllocatedError(__FILE__, __FUNCDNAME__, __LINE__) 16 | #define SHOW_INDEX_ERROR(range, index) ShowIndexErrorMessage(range, index, __FILE__, __FUNCDNAME__, __LINE__) 17 | #define SHOW_MEMORY_ERROR() ShowMemoryErrorMessage(__FILE__, __FUNCDNAME__, __LINE__) 18 | 19 | 20 | void ShowIndexErrorMessage(unsigned int range, unsigned int index, const char* file_name, const char* function_name, int line_number); 21 | void ShowMemoryErrorMessage(const char* file_name, const char* function_name, int line_number); 22 | 23 | class DebugMessage 24 | { 25 | public: 26 | virtual void show_message(std::ostream& os){ os<<"Error."< 9 | 10 | #define STDF_V4_RECORD_COUNT 25 11 | 12 | enum STDF_FILE_ERROR : int 13 | { 14 | STDF_OPERATE_OK = 0, 15 | READ_ERROR = -1, 16 | FORMATE_ERROR = -2, 17 | STDF_CPU_TYPE_NOT_SUPPORT = -3, 18 | STDF_VERSION_NOT_SUPPORT = -4, 19 | WRITE_ERROR = -5, 20 | }; 21 | 22 | class STDF_FILE 23 | { 24 | public: 25 | STDF_FILE(); 26 | ~STDF_FILE(); 27 | 28 | STDF_FILE_ERROR read(const char* filename); 29 | STDF_FILE_ERROR write(const char* filename, STDF_TYPE type); 30 | STDF_FILE_ERROR write(const char* filename); 31 | STDF_FILE_ERROR save(const char* filename); 32 | const char* get_name(STDF_TYPE type); 33 | unsigned int get_count(STDF_TYPE type); 34 | StdfRecord* get_record(STDF_TYPE type, unsigned int index); 35 | unsigned int get_total_count(); 36 | StdfRecord* get_record(unsigned int index); 37 | 38 | private: 39 | void append_record_by_type(StdfRecord* record); 40 | STDF_FILE(const STDF_FILE& src); 41 | STDF_FILE& operator=(const STDF_FILE& src); 42 | 43 | private: 44 | std::vector Record_Vector; 45 | std::vector StdfFAR_Vector; 46 | std::vector StdfATR_Vector; 47 | std::vector StdfMIR_Vector; 48 | std::vector StdfMRR_Vector; 49 | std::vector StdfPCR_Vector; 50 | std::vector StdfHBR_Vector; 51 | std::vector StdfSBR_Vector; 52 | std::vector StdfPMR_Vector; 53 | std::vector StdfPGR_Vector; 54 | std::vector StdfPLR_Vector; 55 | std::vector StdfRDR_Vector; 56 | std::vector StdfSDR_Vector; 57 | std::vector StdfWIR_Vector; 58 | std::vector StdfWRR_Vector; 59 | std::vector StdfWCR_Vector; 60 | std::vector StdfPIR_Vector; 61 | std::vector StdfPRR_Vector; 62 | std::vector StdfTSR_Vector; 63 | std::vector StdfPTR_Vector; 64 | std::vector StdfMPR_Vector; 65 | std::vector StdfFTR_Vector; 66 | std::vector StdfBPS_Vector; 67 | std::vector StdfEPS_Vector; 68 | std::vector StdfGDR_Vector; 69 | std::vector StdfDTR_Vector; 70 | 71 | }; 72 | 73 | #endif//_STDF_V4_AUX_FILE_H_ 74 | -------------------------------------------------------------------------------- /Stdf_V4_Reader/ui/stdf_window.h: -------------------------------------------------------------------------------- 1 | #ifndef STDF_WINDOW_H 2 | #define STDF_WINDOW_H 3 | 4 | #include 5 | #include 6 | #include "../stdf_file/stdf_v4_file.h" 7 | #include 8 | #include 9 | 10 | namespace Ui { 11 | class MainWindow; 12 | } 13 | 14 | class MainWindow : public QMainWindow 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit MainWindow(QWidget *parent = 0); 20 | ~MainWindow(); 21 | 22 | private slots: 23 | void on_OpenButton_clicked(); 24 | void on_ClearButton_clicked(); 25 | void on_CloseButton_clicked(); 26 | void on_RecordListWidget_clicked(const QModelIndex &index); 27 | void on_SaveButton_clicked(); 28 | 29 | void on_actionAbout_triggered(); 30 | void on_actionHelp_triggered(); 31 | void on_SaveChangeButton_clicked(); 32 | void SaveTableToFile(); 33 | 34 | private: 35 | void UpdateUi(); 36 | void ShowRecordTable(STDF_TYPE type); 37 | void ShowStdfFAR(); 38 | void ShowStdfATR(); 39 | void ShowStdfMIR(); 40 | void ShowStdfMRR(); 41 | void ShowStdfPCR(); 42 | void ShowStdfHBR(); 43 | void ShowStdfSBR(); 44 | void ShowStdfPMR(); 45 | void ShowStdfPGR(); 46 | void ShowStdfPLR(); 47 | void ShowStdfRDR(); 48 | void ShowStdfSDR(); 49 | void ShowStdfWIR(); 50 | void ShowStdfWRR(); 51 | void ShowStdfWCR(); 52 | void ShowStdfPIR(); 53 | void ShowStdfPRR(); 54 | void ShowStdfTSR(); 55 | void ShowStdfPTR(); 56 | void ShowStdfMPR(); 57 | void ShowStdfFTR(); 58 | void ShowStdfBPS(); 59 | void ShowStdfEPS(); 60 | void ShowStdfGDR(); 61 | void ShowStdfDTR(); 62 | 63 | private: 64 | Ui::MainWindow *ui; 65 | STDF_FILE *stdf_file; 66 | QString filename; 67 | QAction *save_action; 68 | std::vector stdf_types; 69 | void table_set_value(int row, int col, unsigned int value); 70 | void table_set_value(int row, int col, int value); 71 | void table_set_value(int row, int col, unsigned short value); 72 | void table_set_value(int row, int col, const char* value); 73 | void table_set_value(int row, int col, time_t value); 74 | void table_set_value(int row, int col, char value); 75 | void table_set_value(int row, int col, unsigned char value); 76 | void table_set_value(int row, int col, signed char value); 77 | void table_set_value(int row, int col, float value); 78 | void table_set_value(int row, int col, short value); 79 | void table_set_value(int row, int col, QString value); 80 | void table_set_flag(int row, int col, unsigned char flag); 81 | }; 82 | 83 | #endif // STDF_WINDOW_H 84 | -------------------------------------------------------------------------------- /Stdf_V4_Reader/debug_api/debug_api.cpp: -------------------------------------------------------------------------------- 1 | #include "debug_api.h" 2 | 3 | 4 | static std::string GetFileNameOnly(const char* name) 5 | { 6 | std::string temp_name(name); 7 | std::string name_only; 8 | if(!name) return name_only; 9 | std::string::size_type pos = temp_name.find_last_of('\\'); 10 | if(pos != std::string::npos) 11 | name_only = temp_name.substr(pos+1); 12 | else 13 | { 14 | pos = temp_name.find_last_of('/'); 15 | if(pos != std::string::npos) 16 | name_only = temp_name.substr(pos+1); 17 | else 18 | name_only.assign(name); 19 | } 20 | return name_only; 21 | } 22 | 23 | void ShowIndexErrorMessage(unsigned int range, unsigned int index, const char* file_name, const char* function_name, int line_number) 24 | { 25 | std::string file_name_only = GetFileNameOnly(file_name); 26 | std::cout<<"In File :"< 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 972 10 | 705 11 | 12 | 13 | 14 | STDF V4 Reader 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 0 25 | 0 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | QAbstractItemView::NoEditTriggers 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | Qt::Horizontal 45 | 46 | 47 | 48 | 40 49 | 20 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | Save As 58 | 59 | 60 | 61 | 62 | 63 | 64 | Open 65 | 66 | 67 | 68 | 69 | 70 | 71 | Save TXT 72 | 73 | 74 | 75 | 76 | 77 | 78 | Clear 79 | 80 | 81 | 82 | 83 | 84 | 85 | Close 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 0 101 | 0 102 | 972 103 | 23 104 | 105 | 106 | 107 | 108 | About 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | About 119 | 120 | 121 | 122 | 123 | Help 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /Stdf_V4_Reader/stdf_file/stdf_v4_file.cpp: -------------------------------------------------------------------------------- 1 | #include "stdf_v4_file.h" 2 | #include 3 | 4 | const char* REC_NAME[STDF_V4_RECORD_COUNT] = 5 | { 6 | "FAR(File Attributes Record)", 7 | "ATR(Audit Trail Record)", 8 | "MIR(Master Information Record)", 9 | "MRR(Master Results Record)", 10 | "PCR(Part Count Record)", 11 | "HBR(Hardware Bin Record)", 12 | "SBR(Software Bin Record)", 13 | "PMR(Pin Map Record)", 14 | "PGR(Pin Group Record)", 15 | "PLR(Pin List Record)", 16 | "RDR(Retest Data Record)", 17 | "SDR(Site Description Record)", 18 | "WIR(Wafer Information Record)", 19 | "WRR(Wafer Results Record)", 20 | "WCR(Wafer Configuration Record)", 21 | "PIR(Part Information Record)", 22 | "PRR(Part Results Record)", 23 | "TSR(Test Synopsis Record)", 24 | "PTR(Parametric Test Record)", 25 | "MPR(Multiple-Result Parametric Record)", 26 | "FTR(Functional Test Record)", 27 | "BPS(Begin Program Section Record)", 28 | "EPS(End Program Section Record)", 29 | "GDR(Generic Data Record)", 30 | "DTR(Datalog Text Record)" 31 | }; 32 | 33 | ////////////////////////////////////////////////////////////////////////// 34 | static std::string to_string(STDF_TYPE type) 35 | { 36 | switch(type) 37 | { 38 | case FAR_TYPE: return "\nFAR----File Attributes Record "; break; 39 | case ATR_TYPE: return "\nATR----Audit Trail Record "; break; 40 | case MIR_TYPE: return "\nMIR----Master Information Record "; break; 41 | case MRR_TYPE: return "\nMRR----Master Result Record "; break; 42 | case PCR_TYPE: return "\nPCR----Part Count Record "; break; 43 | case HBR_TYPE: return "\nHBR----Hardware Bin Record "; break; 44 | case SBR_TYPE: return "\nSBR----Software Bin Record "; break; 45 | case PMR_TYPE: return "\nPMR----Pin Map Record "; break; 46 | case PGR_TYPE: return "\nPGR----Pin Group Record "; break; 47 | case PLR_TYPE: return "\nPLR----Pin List Record "; break; 48 | case RDR_TYPE: return "\nRDR----Reset Data Record "; break; 49 | case SDR_TYPE: return "\nSDR----Site Description Record "; break; 50 | case WIR_TYPE: return "\nWIR----Wafer Information Record "; break; 51 | case WRR_TYPE: return "\nWRR----Wafer Result Record "; break; 52 | case WCR_TYPE: return "\nWCR----Wafer Configuration Record "; break; 53 | case PIR_TYPE: return "\nPIR----Part Information Record "; break; 54 | case PRR_TYPE: return "\nPRR----Part Result Record "; break; 55 | case TSR_TYPE: return "\nTSR----Test Synopsis Record "; break; 56 | case PTR_TYPE: return "\nPTR----Parametric Test Record "; break; 57 | case MPR_TYPE: return "\nMPR----Multiple-Result Parametric Record"; break; 58 | case FTR_TYPE: return "\nFTR----Functional Test Record "; break; 59 | case BPS_TYPE: return "\nBPS----Begin Program Section Record "; break; 60 | case EPS_TYPE: return "\nEPS----End Program Section Record "; break; 61 | case GDR_TYPE: return "\nGDR----Generic Data Record "; break; 62 | case DTR_TYPE: return "\nDTR----Datalog Text Record "; break; 63 | default: return "\nUNKONWN----Unkown Record Type"; break; 64 | } 65 | } 66 | 67 | STDF_FILE::STDF_FILE() 68 | { 69 | } 70 | 71 | STDF_FILE::~STDF_FILE() 72 | { 73 | for(unsigned int i = 0; i < Record_Vector.size(); i++) 74 | { 75 | delete Record_Vector[i]; 76 | } 77 | } 78 | 79 | STDF_FILE_ERROR STDF_FILE::read(const char* filename) 80 | { 81 | std::ifstream in(filename, std::ios::in | std::ios::binary); 82 | if(!in) return READ_ERROR; 83 | 84 | StdfHeader header; 85 | STDF_TYPE type = header.read(in); 86 | if(type != FAR_TYPE) return FORMATE_ERROR; 87 | 88 | StdfFAR* far_record = new StdfFAR(); 89 | far_record->parse(header); 90 | 91 | unsigned char cpu_type = far_record->get_cpu_type(); 92 | if(cpu_type != 2) return STDF_CPU_TYPE_NOT_SUPPORT; 93 | 94 | unsigned char stdf_version = far_record->get_stdf_version(); 95 | if(stdf_version != 4) return STDF_VERSION_NOT_SUPPORT; 96 | 97 | Record_Vector.push_back(far_record); 98 | append_record_by_type(far_record); 99 | 100 | while(!in.eof()) 101 | { 102 | type = header.read(in); 103 | StdfRecord* record = header.create_record(type); 104 | if(record) 105 | { 106 | record->parse(header); 107 | Record_Vector.push_back(record); 108 | append_record_by_type(record); 109 | } 110 | if(type == MRR_TYPE) break; 111 | } 112 | in.close(); 113 | return STDF_OPERATE_OK; 114 | } 115 | 116 | STDF_FILE_ERROR STDF_FILE::write(const char* filename) 117 | { 118 | std::ofstream out(filename, std::ios::out ); 119 | if(!out) return WRITE_ERROR; 120 | 121 | for(unsigned int i = 0; i < Record_Vector.size(); i++) 122 | { 123 | StdfRecord* record = Record_Vector[i]; 124 | out<type())<<"\n"; 125 | //record->print(out); 126 | out<<(*record); 127 | } 128 | out.close(); 129 | return STDF_OPERATE_OK; 130 | } 131 | 132 | STDF_FILE_ERROR STDF_FILE::save(const char* filename) 133 | { 134 | std::ofstream out(filename, std::ios::binary ); 135 | if(!out) return WRITE_ERROR; 136 | 137 | StdfHeader header; 138 | for(unsigned int i = 0; i < Record_Vector.size(); i++) 139 | { 140 | if(i == 1) 141 | { 142 | StdfATR* atr = new StdfATR(); 143 | atr->set_command_line("Save As By STDF Reader"); 144 | atr->set_modify_time(time(NULL)); 145 | atr->unparse(header); 146 | header.write(out); 147 | } 148 | StdfRecord* record = Record_Vector[i]; 149 | record->unparse(header); 150 | header.write(out); 151 | } 152 | out.close(); 153 | return STDF_OPERATE_OK; 154 | } 155 | 156 | 157 | STDF_FILE_ERROR STDF_FILE::write(const char* filename, STDF_TYPE type) 158 | { 159 | std::ofstream out(filename, std::ios::out ); 160 | if(!out) return WRITE_ERROR; 161 | 162 | unsigned int count = get_count(type); 163 | for(unsigned int i = 0; i < count; i++) 164 | { 165 | StdfRecord* record = get_record(type, i); 166 | if(record) 167 | { 168 | out<= STDF_V4_RECORD_COUNT) return nullptr; 178 | else return REC_NAME[type]; 179 | } 180 | 181 | unsigned int STDF_FILE::get_count(STDF_TYPE type) 182 | { 183 | unsigned int count = 0; 184 | switch(type) 185 | { 186 | case FAR_TYPE: count = StdfFAR_Vector.size(); break; 187 | case ATR_TYPE: count = StdfATR_Vector.size(); break; 188 | case MIR_TYPE: count = StdfMIR_Vector.size(); break; 189 | case MRR_TYPE: count = StdfMRR_Vector.size(); break; 190 | case PCR_TYPE: count = StdfPCR_Vector.size(); break; 191 | case HBR_TYPE: count = StdfHBR_Vector.size(); break; 192 | case SBR_TYPE: count = StdfSBR_Vector.size(); break; 193 | case PMR_TYPE: count = StdfPMR_Vector.size(); break; 194 | case PGR_TYPE: count = StdfPGR_Vector.size(); break; 195 | case PLR_TYPE: count = StdfPLR_Vector.size(); break; 196 | case RDR_TYPE: count = StdfRDR_Vector.size(); break; 197 | case SDR_TYPE: count = StdfSDR_Vector.size(); break; 198 | case WIR_TYPE: count = StdfWIR_Vector.size(); break; 199 | case WRR_TYPE: count = StdfWRR_Vector.size(); break; 200 | case WCR_TYPE: count = StdfWCR_Vector.size(); break; 201 | case PIR_TYPE: count = StdfPIR_Vector.size(); break; 202 | case PRR_TYPE: count = StdfPRR_Vector.size(); break; 203 | case TSR_TYPE: count = StdfTSR_Vector.size(); break; 204 | case PTR_TYPE: count = StdfPTR_Vector.size(); break; 205 | case MPR_TYPE: count = StdfMPR_Vector.size(); break; 206 | case FTR_TYPE: count = StdfFTR_Vector.size(); break; 207 | case BPS_TYPE: count = StdfBPS_Vector.size(); break; 208 | case EPS_TYPE: count = StdfEPS_Vector.size(); break; 209 | case GDR_TYPE: count = StdfGDR_Vector.size(); break; 210 | case DTR_TYPE: count = StdfDTR_Vector.size(); break; 211 | default: count = 0; break; 212 | } 213 | return count; 214 | } 215 | 216 | unsigned int STDF_FILE::get_total_count() 217 | { 218 | return Record_Vector.size(); 219 | } 220 | 221 | StdfRecord* STDF_FILE::get_record(unsigned int index) 222 | { 223 | StdfRecord* record = nullptr; 224 | if(index < Record_Vector.size()) record = Record_Vector[index]; 225 | return record; 226 | } 227 | 228 | StdfRecord* STDF_FILE::get_record(STDF_TYPE type, unsigned int index) 229 | { 230 | StdfRecord* record = nullptr; 231 | switch(type) 232 | { 233 | case FAR_TYPE: if(index < StdfFAR_Vector.size()) record = StdfFAR_Vector[index]; break; 234 | case ATR_TYPE: if(index < StdfATR_Vector.size()) record = StdfATR_Vector[index]; break; 235 | case MIR_TYPE: if(index < StdfMIR_Vector.size()) record = StdfMIR_Vector[index]; break; 236 | case MRR_TYPE: if(index < StdfMRR_Vector.size()) record = StdfMRR_Vector[index]; break; 237 | case PCR_TYPE: if(index < StdfPCR_Vector.size()) record = StdfPCR_Vector[index]; break; 238 | case HBR_TYPE: if(index < StdfHBR_Vector.size()) record = StdfHBR_Vector[index]; break; 239 | case SBR_TYPE: if(index < StdfSBR_Vector.size()) record = StdfSBR_Vector[index]; break; 240 | case PMR_TYPE: if(index < StdfPMR_Vector.size()) record = StdfPMR_Vector[index]; break; 241 | case PGR_TYPE: if(index < StdfPGR_Vector.size()) record = StdfPGR_Vector[index]; break; 242 | case PLR_TYPE: if(index < StdfPLR_Vector.size()) record = StdfPLR_Vector[index]; break; 243 | case RDR_TYPE: if(index < StdfRDR_Vector.size()) record = StdfRDR_Vector[index]; break; 244 | case SDR_TYPE: if(index < StdfSDR_Vector.size()) record = StdfSDR_Vector[index]; break; 245 | case WIR_TYPE: if(index < StdfWIR_Vector.size()) record = StdfWIR_Vector[index]; break; 246 | case WRR_TYPE: if(index < StdfWRR_Vector.size()) record = StdfWRR_Vector[index]; break; 247 | case WCR_TYPE: if(index < StdfWCR_Vector.size()) record = StdfWCR_Vector[index]; break; 248 | case PIR_TYPE: if(index < StdfPIR_Vector.size()) record = StdfPIR_Vector[index]; break; 249 | case PRR_TYPE: if(index < StdfPRR_Vector.size()) record = StdfPRR_Vector[index]; break; 250 | case TSR_TYPE: if(index < StdfTSR_Vector.size()) record = StdfTSR_Vector[index]; break; 251 | case PTR_TYPE: if(index < StdfPTR_Vector.size()) record = StdfPTR_Vector[index]; break; 252 | case MPR_TYPE: if(index < StdfMPR_Vector.size()) record = StdfMPR_Vector[index]; break; 253 | case FTR_TYPE: if(index < StdfFTR_Vector.size()) record = StdfFTR_Vector[index]; break; 254 | case BPS_TYPE: if(index < StdfBPS_Vector.size()) record = StdfBPS_Vector[index]; break; 255 | case EPS_TYPE: if(index < StdfEPS_Vector.size()) record = StdfEPS_Vector[index]; break; 256 | case GDR_TYPE: if(index < StdfGDR_Vector.size()) record = StdfGDR_Vector[index]; break; 257 | case DTR_TYPE: if(index < StdfDTR_Vector.size()) record = StdfDTR_Vector[index]; break; 258 | default: record = nullptr; break; 259 | } 260 | return record; 261 | } 262 | 263 | void STDF_FILE::append_record_by_type(StdfRecord* record) 264 | { 265 | STDF_TYPE type = record->type(); 266 | switch(type) 267 | { 268 | case FAR_TYPE: StdfFAR_Vector.push_back(static_cast(record)) ; break; 269 | case ATR_TYPE: StdfATR_Vector.push_back(static_cast(record)) ; break; 270 | case MIR_TYPE: StdfMIR_Vector.push_back(static_cast(record)) ; break; 271 | case MRR_TYPE: StdfMRR_Vector.push_back(static_cast(record)) ; break; 272 | case PCR_TYPE: StdfPCR_Vector.push_back(static_cast(record)) ; break; 273 | case HBR_TYPE: StdfHBR_Vector.push_back(static_cast(record)) ; break; 274 | case SBR_TYPE: StdfSBR_Vector.push_back(static_cast(record)) ; break; 275 | case PMR_TYPE: StdfPMR_Vector.push_back(static_cast(record)) ; break; 276 | case PGR_TYPE: StdfPGR_Vector.push_back(static_cast(record)) ; break; 277 | case PLR_TYPE: StdfPLR_Vector.push_back(static_cast(record)) ; break; 278 | case RDR_TYPE: StdfRDR_Vector.push_back(static_cast(record)) ; break; 279 | case SDR_TYPE: StdfSDR_Vector.push_back(static_cast(record)) ; break; 280 | case WIR_TYPE: StdfWIR_Vector.push_back(static_cast(record)) ; break; 281 | case WRR_TYPE: StdfWRR_Vector.push_back(static_cast(record)) ; break; 282 | case WCR_TYPE: StdfWCR_Vector.push_back(static_cast(record)) ; break; 283 | case PIR_TYPE: StdfPIR_Vector.push_back(static_cast(record)) ; break; 284 | case PRR_TYPE: StdfPRR_Vector.push_back(static_cast(record)) ; break; 285 | case TSR_TYPE: StdfTSR_Vector.push_back(static_cast(record)) ; break; 286 | case PTR_TYPE: StdfPTR_Vector.push_back(static_cast(record)) ; break; 287 | case MPR_TYPE: StdfMPR_Vector.push_back(static_cast(record)) ; break; 288 | case FTR_TYPE: StdfFTR_Vector.push_back(static_cast(record)) ; break; 289 | case BPS_TYPE: StdfBPS_Vector.push_back(static_cast(record)) ; break; 290 | case EPS_TYPE: StdfEPS_Vector.push_back(static_cast(record)) ; break; 291 | case GDR_TYPE: StdfGDR_Vector.push_back(static_cast(record)) ; break; 292 | case DTR_TYPE: StdfDTR_Vector.push_back(static_cast(record)) ; break; 293 | default : break; 294 | } 295 | } 296 | -------------------------------------------------------------------------------- /Stdf_V4_Reader/Stdf_V4_Reader.pro.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {c76ba190-0978-4a74-b034-32c0110d9486} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | UTF-8 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | 0 45 | 8 46 | true 47 | 1 48 | true 49 | true 50 | true 51 | false 52 | 53 | 54 | 55 | ProjectExplorer.Project.PluginSettings 56 | 57 | 58 | 59 | ProjectExplorer.Project.Target.0 60 | 61 | 桌面 62 | 桌面 63 | {37492f71-364e-461f-9d2a-9f6633b54a49} 64 | 0 65 | 0 66 | 0 67 | 68 | /home/guyanqiu/QtExercise/Stdf_V4_Reader/build-Stdf_V4_Reader-unknown-Debug 69 | 70 | 71 | true 72 | qmake 73 | 74 | QtProjectManager.QMakeBuildStep 75 | false 76 | true 77 | 78 | false 79 | false 80 | false 81 | 82 | 83 | true 84 | Make 85 | 86 | Qt4ProjectManager.MakeStep 87 | 88 | -w 89 | -r 90 | 91 | false 92 | 93 | 94 | 95 | 2 96 | 构建 97 | 98 | ProjectExplorer.BuildSteps.Build 99 | 100 | 101 | 102 | true 103 | Make 104 | 105 | Qt4ProjectManager.MakeStep 106 | 107 | -w 108 | -r 109 | 110 | true 111 | clean 112 | 113 | 114 | 1 115 | 清理 116 | 117 | ProjectExplorer.BuildSteps.Clean 118 | 119 | 2 120 | false 121 | 122 | Debug 123 | 124 | Qt4ProjectManager.Qt4BuildConfiguration 125 | 2 126 | true 127 | 128 | 129 | /home/guyanqiu/QtExercise/Stdf_V4_Reader/build-Stdf_V4_Reader-unknown-Release 130 | 131 | 132 | true 133 | qmake 134 | 135 | QtProjectManager.QMakeBuildStep 136 | false 137 | true 138 | 139 | false 140 | false 141 | false 142 | 143 | 144 | true 145 | Make 146 | 147 | Qt4ProjectManager.MakeStep 148 | 149 | -w 150 | -r 151 | 152 | false 153 | 154 | 155 | 156 | 2 157 | 构建 158 | 159 | ProjectExplorer.BuildSteps.Build 160 | 161 | 162 | 163 | true 164 | Make 165 | 166 | Qt4ProjectManager.MakeStep 167 | 168 | -w 169 | -r 170 | 171 | true 172 | clean 173 | 174 | 175 | 1 176 | 清理 177 | 178 | ProjectExplorer.BuildSteps.Clean 179 | 180 | 2 181 | false 182 | 183 | Release 184 | 185 | Qt4ProjectManager.Qt4BuildConfiguration 186 | 0 187 | true 188 | 189 | 2 190 | 191 | 192 | 0 193 | 部署 194 | 195 | ProjectExplorer.BuildSteps.Deploy 196 | 197 | 1 198 | 在本地部署 199 | 200 | ProjectExplorer.DefaultDeployConfiguration 201 | 202 | 1 203 | 204 | 205 | 206 | false 207 | false 208 | false 209 | false 210 | true 211 | 0.01 212 | 10 213 | true 214 | 1 215 | 25 216 | 217 | 1 218 | true 219 | false 220 | true 221 | valgrind 222 | 223 | 0 224 | 1 225 | 2 226 | 3 227 | 4 228 | 5 229 | 6 230 | 7 231 | 8 232 | 9 233 | 10 234 | 11 235 | 12 236 | 13 237 | 14 238 | 239 | 2 240 | 241 | Stdf_V4_Reader 242 | 243 | Qt4ProjectManager.Qt4RunConfiguration:/home/guyanqiu/QtExercise/Stdf_V4_Reader/Stdf_V4_Reader/Stdf_V4_Reader.pro 244 | 245 | Stdf_V4_Reader.pro 246 | false 247 | false 248 | 249 | 3768 250 | false 251 | true 252 | false 253 | false 254 | true 255 | 256 | 1 257 | 258 | 259 | 260 | ProjectExplorer.Project.TargetCount 261 | 1 262 | 263 | 264 | ProjectExplorer.Project.Updater.FileVersion 265 | 18 266 | 267 | 268 | Version 269 | 18 270 | 271 | 272 | -------------------------------------------------------------------------------- /Stdf_V4_Reader/stdf_api/stdf_v4_api.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * For read and write stdf v4 file for cpu type is 2. 3 | * Some stdf records tested, some not. 4 | *************************************************************************/ 5 | #ifndef _STDFV4_API_H_ 6 | #define _STDFV4_API_H_ 7 | #include 8 | #include 9 | #include 10 | 11 | enum STDF_TYPE : int 12 | { 13 | FAR_TYPE = 0, // File Attributes Record 14 | ATR_TYPE = 1, // Audit Trail Record 15 | MIR_TYPE = 2, // Master Information Record 16 | MRR_TYPE = 3, // Master Result Record 17 | PCR_TYPE = 4, // Part Count Record 18 | HBR_TYPE = 5, // Hardware Bin Record 19 | SBR_TYPE = 6, // Software Bin Record 20 | PMR_TYPE = 7, // Pin Map Record 21 | PGR_TYPE = 8, // Pin Group Record 22 | PLR_TYPE = 9, // Pin List Record 23 | RDR_TYPE = 10, // Reset Data Record 24 | SDR_TYPE = 11, // Site Description Record 25 | WIR_TYPE = 12, // Wafer Information Record 26 | WRR_TYPE = 13, // Wafer Result Record 27 | WCR_TYPE = 14, // Wafer Configuration Record 28 | PIR_TYPE = 15, // Part Information Record 29 | PRR_TYPE = 16, // Part Result Record 30 | TSR_TYPE = 17, // Test Synopsis Record 31 | PTR_TYPE = 18, // Parametric Test Record 32 | MPR_TYPE = 19, // Multiple-Result Parametric Record 33 | FTR_TYPE = 20, // Functional Test Record 34 | BPS_TYPE = 21, // Begin Program Section Record 35 | EPS_TYPE = 22, // End Program Section Record 36 | GDR_TYPE = 23, // Generic Data Record 37 | DTR_TYPE = 24, // Datalog Text Record 38 | UNKNOWN_TYPE = 25, // Other Types 39 | }; 40 | 41 | class StdfRecord; 42 | class StdfHeader 43 | { 44 | friend class StdfFAR; 45 | friend class StdfATR ; 46 | friend class StdfMIR ; 47 | friend class StdfMRR ; 48 | friend class StdfPCR ; 49 | friend class StdfHBR ; 50 | friend class StdfSBR ; 51 | friend class StdfPMR ; 52 | friend class StdfPGR ; 53 | friend class StdfPLR ; 54 | friend class StdfRDR ; 55 | friend class StdfSDR ; 56 | friend class StdfWIR ; 57 | friend class StdfWRR ; 58 | friend class StdfWCR ; 59 | friend class StdfPIR ; 60 | friend class StdfPRR ; 61 | friend class StdfTSR ; 62 | friend class StdfPTR ; 63 | friend class StdfMPR ; 64 | friend class StdfFTR ; 65 | friend class StdfBPS ; 66 | friend class StdfEPS ; 67 | friend class StdfGDR ; 68 | friend class StdfDTR ; 69 | public: 70 | StdfHeader(); 71 | ~StdfHeader(); 72 | 73 | STDF_TYPE read(std::ifstream& file_stream); 74 | int write(std::ofstream& file_stream); 75 | 76 | StdfRecord* create_record(STDF_TYPE type); 77 | // getter 78 | STDF_TYPE get_type() const; 79 | unsigned short get_length() const; 80 | unsigned char get_main_type() const; 81 | unsigned char get_sub_type() const; 82 | 83 | private: 84 | typedef class RecordHeader Impl; 85 | Impl* header; 86 | StdfHeader(const StdfHeader& ); 87 | StdfHeader& operator=(const StdfHeader& src); 88 | void * operator new(size_t size); 89 | }; 90 | 91 | class StdfRecord 92 | { 93 | protected: 94 | char m_name[4]; 95 | STDF_TYPE m_type; 96 | public: 97 | virtual unsigned int parse(const StdfHeader& record) = 0; 98 | virtual unsigned int unparse(StdfHeader& record) = 0; 99 | virtual void print(std::ostream& os) const = 0; 100 | friend std::ostream& operator << (std::ostream& os, const StdfRecord& record); 101 | 102 | const char* name() ; 103 | STDF_TYPE type(); 104 | StdfRecord(const char* name, STDF_TYPE type); 105 | virtual ~StdfRecord(); 106 | private: 107 | StdfRecord(const StdfRecord& ); 108 | StdfRecord& operator=(const StdfRecord& src); 109 | }; 110 | 111 | class StdfFAR : public StdfRecord 112 | { 113 | public: 114 | StdfFAR(); 115 | ~StdfFAR(); 116 | 117 | unsigned char get_cpu_type() const; 118 | unsigned char get_stdf_version() const; 119 | 120 | // Just Support CPU Type = 2 and STDF Version = 4. 121 | //int set_cpu_type(unsigned char type); 122 | //int set_stdf_version(unsigned char version); 123 | 124 | unsigned int parse(const StdfHeader& record); 125 | unsigned int unparse(StdfHeader& record); 126 | void print(std::ostream& os) const; 127 | 128 | private: 129 | typedef class FileAttributes Impl; 130 | Impl *impl; 131 | }; 132 | 133 | 134 | class StdfATR : public StdfRecord 135 | { 136 | public: 137 | StdfATR(); 138 | ~StdfATR(); 139 | 140 | const char* get_command_line() const; 141 | time_t get_modify_time()const; 142 | 143 | void set_command_line(const char* command); 144 | void set_modify_time(time_t t); 145 | 146 | unsigned int parse(const StdfHeader& record); 147 | unsigned int unparse(StdfHeader& record); 148 | void print(std::ostream& os) const ; 149 | 150 | private: 151 | typedef class AuditTrail Impl; 152 | Impl *impl; 153 | }; 154 | 155 | enum ModeCode : char 156 | { 157 | Automatic_Edge_Lock = 'A', 158 | Checker = 'C', 159 | Development = 'D', 160 | Debug = 'D', 161 | Engineering = 'E', 162 | Maintenance = 'M', 163 | Production_Test = 'P', 164 | Quality_Control = 'Q', 165 | }; 166 | 167 | class StdfMIR : public StdfRecord 168 | { 169 | public: 170 | StdfMIR(); 171 | ~StdfMIR(); 172 | 173 | //getter 174 | time_t get_setup_time() const; 175 | time_t get_start_time() const; 176 | unsigned char get_station_number() const; 177 | char get_mode_code() const; 178 | char get_retest_code() const; 179 | char get_protection_code() const; 180 | unsigned short get_burn_time() const; 181 | char get_command_code() const; 182 | const char* get_lot_id() const; 183 | const char* get_part_type() const; 184 | const char* get_node_name() const; 185 | const char* get_tester_type() const; 186 | const char* get_program_name() const; 187 | const char* get_program_revision() const; 188 | const char* get_sublot_id() const; 189 | const char* get_operator_id() const; 190 | const char* get_exec_file_type() const; 191 | const char* get_exec_file_version() const; 192 | const char* get_test_code() const; 193 | const char* get_test_temperature() const; 194 | const char* get_user_text() const; 195 | const char* get_auxiliary_filename() const; 196 | const char* get_package_type() const; 197 | const char* get_family_id() const; 198 | const char* get_date_code() const; 199 | const char* get_facility_id() const; 200 | const char* get_floor_id() const; 201 | const char* get_process_id() const; 202 | const char* get_operation_freq() const; 203 | const char* get_spec_name() const; 204 | const char* get_spec_version() const; 205 | const char* get_testflow_id() const; 206 | const char* get_setup_id() const; 207 | const char* get_design_version() const; 208 | const char* get_engineering_id() const; 209 | const char* get_rom_id() const; 210 | const char* get_tester_number() const; 211 | const char* get_supervisor_name() const; 212 | //setter 213 | void set_setup_time(time_t t); 214 | void set_start_time(time_t t); 215 | void set_station_number(unsigned char number); 216 | void set_mode_code(ModeCode code); 217 | void set_retest_code(char code); 218 | void set_protection_code(char code); 219 | void set_burn_time(unsigned short t); 220 | void set_command_code(char code); 221 | void set_lot_id(const char * id); 222 | void set_part_type(const char *type); 223 | void set_node_name(const char *name); 224 | void set_tester_type(const char *type); 225 | void set_program_name(const char *name); 226 | void set_program_revision(const char *revision); 227 | void set_sublot_id(const char *id); 228 | void set_operator_id(const char *id); 229 | void set_exec_file_type(const char *type); 230 | void set_exec_file_version(const char *version); 231 | void set_test_code(const char *code); 232 | void set_test_temperature(const char *temp); 233 | void set_user_text(const char *text); 234 | void set_auxiliary_filename(const char *filename); 235 | void set_package_type(const char *package); 236 | void set_family_id(const char *id); 237 | void set_date_code(const char *date); 238 | void set_facility_id(const char *id); 239 | void set_floor_id(const char *id); 240 | void set_process_id(const char *id); 241 | void set_operation_freq(const char *freq); 242 | void set_spec_name(const char *name); 243 | void set_spec_version(const char *version); 244 | void set_testflow_id(const char *id); 245 | void set_setup_id(const char *id); 246 | void set_design_version(const char *version); 247 | void set_engineering_id(const char *lot_id); 248 | void set_rom_id(const char *rom_id); 249 | void set_tester_number(const char *serial_number); 250 | void set_supervisor_name(const char *name); 251 | 252 | unsigned int parse(const StdfHeader& record); 253 | unsigned int unparse(StdfHeader& record); 254 | void print(std::ostream& os) const; 255 | 256 | private: 257 | typedef class MasterInformation Impl; 258 | Impl *impl; 259 | }; 260 | 261 | 262 | class StdfMRR : public StdfRecord 263 | { 264 | public: 265 | StdfMRR(); 266 | ~StdfMRR(); 267 | 268 | time_t get_finish_time() const; 269 | char get_disposition_code() const; 270 | const char* get_user_discription() const; 271 | const char* get_exec_discription() const; 272 | 273 | void set_finish_time(time_t t); 274 | void set_disposition_code(char code); 275 | void set_user_discription(const char* discription); 276 | void set_exec_discription(const char* discription); 277 | 278 | unsigned int parse(const StdfHeader& record); 279 | unsigned int unparse(StdfHeader& record); 280 | void print(std::ostream& os) const; 281 | 282 | private: 283 | typedef class MasterResults Impl; 284 | Impl *impl; 285 | }; 286 | 287 | 288 | class StdfPCR : public StdfRecord 289 | { 290 | public: 291 | StdfPCR(); 292 | ~StdfPCR(); 293 | 294 | unsigned char get_head_number() const; 295 | unsigned char get_site_number() const; 296 | unsigned int get_part_count() const; 297 | unsigned int get_retest_count() const; 298 | unsigned int get_abort_count() const; 299 | unsigned int get_passed_count() const; 300 | unsigned int get_func_test_count() const; 301 | 302 | void set_head_number(unsigned char number); 303 | void set_site_number(unsigned char number); 304 | void set_part_count(unsigned int count); 305 | void set_retest_count(unsigned int count); 306 | void set_abort_count(unsigned int count); 307 | void set_passed_count(unsigned int count); 308 | void set_func_test_count(unsigned int count); 309 | 310 | unsigned int parse(const StdfHeader& record); 311 | unsigned int unparse(StdfHeader& record); 312 | void print(std::ostream& os) const; 313 | 314 | private: 315 | typedef class PartCount Impl; 316 | Impl *impl; 317 | }; 318 | 319 | 320 | class StdfHBR : public StdfRecord 321 | { 322 | public: 323 | StdfHBR(); 324 | ~StdfHBR(); 325 | 326 | unsigned char get_head_number() const; 327 | unsigned char get_site_number() const; 328 | unsigned short get_hardbin_number() const; 329 | unsigned int get_hardbin_count() const; 330 | char get_hardbin_indication() const; 331 | const char* get_hardbin_name() const; 332 | 333 | void set_head_number(unsigned char number); 334 | void set_site_number(unsigned char number); 335 | void set_hardbin_number(unsigned short number); 336 | void set_hardbin_count(unsigned int count); 337 | void set_hardbin_indication(char pass_fail); 338 | void set_hardbin_name(const char* name); 339 | 340 | unsigned int parse(const StdfHeader& record); 341 | unsigned int unparse(StdfHeader& record); 342 | void print(std::ostream& os) const; 343 | 344 | private: 345 | typedef class HardwareBin Impl; 346 | Impl *impl; 347 | }; 348 | 349 | 350 | class StdfSBR : public StdfRecord 351 | { 352 | public: 353 | StdfSBR(); 354 | ~StdfSBR(); 355 | 356 | unsigned char get_head_number() const; 357 | unsigned char get_site_number() const; 358 | unsigned short get_softbin_number() const; 359 | unsigned int get_softbin_count() const; 360 | char get_softbin_indication() const; 361 | const char* get_softbin_name() const; 362 | 363 | void set_head_number(unsigned char number); 364 | void set_site_number(unsigned char number); 365 | void set_softbin_number(unsigned short number); 366 | void set_softbin_count(unsigned int count); 367 | void set_softbin_indication(char pass_fail); 368 | void set_softbin_name(const char* name); 369 | 370 | unsigned int parse(const StdfHeader& record); 371 | unsigned int unparse(StdfHeader& record); 372 | void print(std::ostream& os) const; 373 | 374 | private: 375 | typedef class SoftwareBin Impl; 376 | Impl *impl; 377 | }; 378 | 379 | 380 | class StdfPMR : public StdfRecord 381 | { 382 | public: 383 | StdfPMR(); 384 | ~StdfPMR(); 385 | 386 | unsigned short get_pin_index() const; 387 | unsigned short get_channel_type() const; 388 | const char* get_channel_name() const; 389 | const char* get_physical_name() const; 390 | const char* get_logical_name() const ; 391 | unsigned char get_head_number() const; 392 | unsigned char get_site_number() const; 393 | 394 | void set_pin_index(unsigned short index); 395 | void set_channel_type(unsigned short type); 396 | void set_channel_name(const char* name); 397 | void set_physical_name(const char* name); 398 | void set_logical_name(const char* name); 399 | void set_head_number(unsigned char number); 400 | void set_site_number(unsigned char number); 401 | 402 | unsigned int parse(const StdfHeader& record); 403 | unsigned int unparse(StdfHeader& record); 404 | void print(std::ostream& os) const; 405 | 406 | private: 407 | typedef class PinMap Impl; 408 | Impl *impl; 409 | }; 410 | 411 | 412 | class StdfPGR : public StdfRecord 413 | { 414 | public: 415 | StdfPGR(); 416 | ~StdfPGR(); 417 | 418 | unsigned short get_group_index() const; 419 | const char* get_group_name() const; 420 | unsigned short get_pin_count() const; 421 | unsigned short get_pin_number(unsigned short index) const; 422 | 423 | void set_group_index(unsigned short index); 424 | void set_group_name(const char* name); 425 | void set_pin_count(unsigned short count); 426 | void set_pin_number(unsigned short index, unsigned short pin_number); 427 | 428 | unsigned int parse(const StdfHeader& record); 429 | unsigned int unparse(StdfHeader& record); 430 | void print(std::ostream& os) const; 431 | 432 | private: 433 | typedef class PinGroup Impl; 434 | Impl *impl; 435 | }; 436 | 437 | enum GroupMode : unsigned short 438 | { 439 | UnknownMode = 0, 440 | NormalMode = 10, 441 | SCIO = 20, 442 | SCIO_Midband = 21, 443 | SCIO_Valid = 22, 444 | SCIO_Window_Sustain = 23, 445 | Dual_drive = 30, 446 | Dual_drive_Midband = 31, 447 | Dual_drive_Valid = 32, 448 | Dual_drive_Window_Sustain = 33 449 | }; 450 | enum GroupRadix : unsigned char 451 | { 452 | DefaultRadix = 0, 453 | BinaryRadix = 2, 454 | OctalRadix = 8, 455 | DecimalRadix = 10, 456 | HexadecimalRadix = 16, 457 | SymbolicRadix = 20, 458 | }; 459 | 460 | class StdfPLR : public StdfRecord 461 | { 462 | public: 463 | StdfPLR(); 464 | ~StdfPLR(); 465 | 466 | unsigned short get_group_count() const; 467 | unsigned short get_group_number(unsigned short index) const; 468 | unsigned short get_group_mode(unsigned short index) const; 469 | unsigned char get_group_radix(unsigned short index) const; 470 | const char* get_program_state_right(unsigned short index) const; 471 | const char* get_return_state_right(unsigned short index) const; 472 | const char* get_program_state_left(unsigned short index) const; 473 | const char* get_return_state_left(unsigned short index) const; 474 | 475 | void set_group_count(unsigned short count); 476 | void set_group_number(unsigned short index, unsigned short number); 477 | void set_group_mode(unsigned short index, GroupMode mode); 478 | void set_group_radix(unsigned short index, GroupRadix radix); 479 | void set_program_state_right(unsigned short index, const char* state); 480 | void set_return_state_right(unsigned short index, const char* state); 481 | void set_program_state_left(unsigned short index, const char* state); 482 | void set_return_state_left(unsigned short index, const char* state); 483 | 484 | unsigned int parse(const StdfHeader& record); 485 | unsigned int unparse(StdfHeader& record); 486 | void print(std::ostream& os) const; 487 | 488 | private: 489 | typedef class PinList Impl; 490 | Impl *impl; 491 | }; 492 | 493 | 494 | class StdfRDR : public StdfRecord 495 | { 496 | public: 497 | StdfRDR(); 498 | ~StdfRDR(); 499 | unsigned short get_bin_count() const; 500 | unsigned short get_bin_number(unsigned short index) const; 501 | 502 | void set_bin_count(unsigned short count); 503 | void set_bin_number(unsigned short index, unsigned short bin_number); 504 | 505 | unsigned int parse(const StdfHeader& record); 506 | unsigned int unparse(StdfHeader& record); 507 | void print(std::ostream& os) const; 508 | 509 | private: 510 | typedef class RetestData Impl; 511 | Impl *impl; 512 | }; 513 | 514 | 515 | class StdfSDR : public StdfRecord 516 | { 517 | public: 518 | StdfSDR(); 519 | ~StdfSDR(); 520 | 521 | unsigned char get_head_number() const; 522 | unsigned char get_site_group_number() const; 523 | unsigned char get_site_count() const; 524 | unsigned char get_site_number(unsigned char index) const; 525 | const char* get_handler_type() const; 526 | const char* get_handler_id() const; 527 | const char* get_probecard_type() const; 528 | const char* get_probecard_id() const; 529 | const char* get_loadboard_type() const; 530 | const char* get_loadboard_id() const; 531 | const char* get_dibboard_type() const; 532 | const char* get_dibboard_id() const; 533 | const char* get_cable_type() const; 534 | const char* get_cable_id() const; 535 | const char* get_contactor_type() const; 536 | const char* get_contactor_id() const; 537 | const char* get_laser_type() const; 538 | const char* get_laser_id() const; 539 | const char* get_equipment_type() const; 540 | const char* get_equipment_id() const; 541 | 542 | void set_head_number(unsigned char number); 543 | void set_site_group_number(unsigned char number); 544 | void set_site_count(unsigned char count); 545 | void set_site_number(unsigned char index, unsigned char site_number); 546 | void set_handler_type(const char* type); 547 | void set_handler_id(const char* id); 548 | void set_probecard_type(const char* type); 549 | void set_probecard_id(const char* id); 550 | void set_loadboard_type(const char* type); 551 | void set_loadboard_id(const char* id); 552 | void set_dibboard_type(const char* type); 553 | void set_dibboard_id(const char* id); 554 | void set_cable_type(const char* type); 555 | void set_cable_id(const char* id); 556 | void set_contactor_type(const char* type); 557 | void set_contactor_id(const char* id); 558 | void set_laser_type(const char* type); 559 | void set_laser_id(const char* id); 560 | void set_equipment_type(const char* type); 561 | void set_equipment_id(const char* id); 562 | 563 | unsigned int parse(const StdfHeader& record); 564 | unsigned int unparse(StdfHeader& record); 565 | void print(std::ostream& os) const; 566 | 567 | private: 568 | typedef class SiteDescription Impl; 569 | Impl *impl; 570 | }; 571 | 572 | 573 | class StdfWIR : public StdfRecord 574 | { 575 | public: 576 | StdfWIR(); 577 | ~StdfWIR(); 578 | 579 | unsigned char get_head_number() const; 580 | unsigned char get_group_number() const; 581 | time_t get_start_time() const; 582 | const char* get_wafer_id() const; 583 | 584 | void set_head_number(unsigned char number); 585 | void set_group_number(unsigned char number); 586 | void set_start_time(time_t t); 587 | void set_wafer_id(const char* id); 588 | 589 | unsigned int parse(const StdfHeader& record); 590 | unsigned int unparse(StdfHeader& record); 591 | void print(std::ostream& os) const; 592 | 593 | private: 594 | typedef class WaferInformation Impl; 595 | Impl *impl; 596 | }; 597 | 598 | 599 | class StdfWRR : public StdfRecord 600 | { 601 | public: 602 | StdfWRR(); 603 | ~StdfWRR(); 604 | 605 | unsigned char get_head_number() const; 606 | unsigned char get_group_number() const; 607 | time_t get_finish_time() const; 608 | unsigned int get_part_count() const; 609 | unsigned int get_retest_count() const; 610 | unsigned int get_abort_count() const; 611 | unsigned int get_pass_count() const; 612 | unsigned int get_func_count() const; 613 | const char* get_wafer_id() const; 614 | const char* get_fabwafer_id() const; 615 | const char* get_frame_id() const; 616 | const char* get_mask_id() const; 617 | const char* get_user_discription() const; 618 | const char* get_exec_discription() const; 619 | 620 | void set_head_number(unsigned char number); 621 | void set_group_number(unsigned char number); 622 | void set_finish_time(time_t t); 623 | void set_part_count(unsigned int count); 624 | void set_retest_count(unsigned int count); 625 | void set_abort_count(unsigned int count); 626 | void set_pass_count(unsigned int count); 627 | void set_func_count(unsigned int count); 628 | void set_wafer_id(const char* id); 629 | void set_fabwafer_id(const char* id); 630 | void set_frame_id(const char* id); 631 | void set_mask_id(const char* id); 632 | void set_user_discription(const char* text); 633 | void set_exec_discription(const char* text); 634 | 635 | unsigned int parse(const StdfHeader& record); 636 | unsigned int unparse(StdfHeader& record); 637 | void print(std::ostream& os) const; 638 | 639 | private: 640 | typedef class WaferResults Impl; 641 | Impl *impl; 642 | }; 643 | 644 | enum WaferUnits : unsigned char 645 | { 646 | Units_Unknown = 0, 647 | Units_Inches = 1, 648 | Units_Centimeters = 2, 649 | Units_Millimeters = 3, 650 | Units_Mils = 4, 651 | }; 652 | 653 | enum WaferFlat : char 654 | { 655 | Flat_Up = 'U', 656 | Flat_Down = 'D', 657 | Flat_Left = 'L', 658 | Flat_Right = 'R', 659 | Flat_Unknown = ' ', 660 | }; 661 | 662 | enum PosDirection : char 663 | { 664 | Pos_Up = 'U', 665 | Pos_Down = 'D', 666 | Pos_Unknown = ' ', 667 | }; 668 | 669 | class StdfWCR : public StdfRecord 670 | { 671 | public: 672 | StdfWCR(); 673 | ~StdfWCR(); 674 | 675 | float get_wafer_size() const; 676 | float get_die_height() const; 677 | float get_die_width() const; 678 | unsigned char get_wafer_unit() const; 679 | char get_wafer_flat() const; 680 | short get_center_x() const; 681 | short get_center_y() const; 682 | char get_positive_x() const; 683 | char get_positive_y() const; 684 | 685 | void set_wafer_size(float size); 686 | void set_die_height(float height); 687 | void set_die_width(float width); 688 | void set_wafer_unit(WaferUnits unit); 689 | void set_wafer_flat(WaferFlat flat_orientation); 690 | void set_center_x(short x); 691 | void set_center_y(short y); 692 | void set_positive_x(PosDirection positive_direction); 693 | void set_positive_y(PosDirection positive_direction); 694 | 695 | unsigned int parse(const StdfHeader& record); 696 | unsigned int unparse(StdfHeader& record); 697 | void print(std::ostream& os) const; 698 | 699 | private: 700 | typedef class WaferConfiguration Impl; 701 | Impl *impl; 702 | }; 703 | 704 | 705 | class StdfPIR : public StdfRecord 706 | { 707 | public: 708 | StdfPIR(); 709 | ~StdfPIR(); 710 | 711 | unsigned char get_head_number() const; 712 | unsigned char get_site_number() const; 713 | 714 | void set_head_number(unsigned char number); 715 | void set_site_number(unsigned char number); 716 | 717 | unsigned int parse(const StdfHeader& record); 718 | unsigned int unparse(StdfHeader& record); 719 | void print(std::ostream& os) const; 720 | 721 | private: 722 | typedef class PartInformation Impl; 723 | Impl *impl; 724 | }; 725 | 726 | 727 | class StdfPRR : public StdfRecord 728 | { 729 | public: 730 | StdfPRR(); 731 | ~StdfPRR(); 732 | 733 | unsigned char get_head_number() const; 734 | unsigned char get_site_number() const; 735 | unsigned char get_part_information_flag() const; 736 | unsigned short get_number_test() const; 737 | unsigned short get_hardbin_number() const; 738 | unsigned short get_softbin_number() const; 739 | short get_x_coordinate() const; 740 | short get_y_coordinate() const; 741 | unsigned int get_elapsed_ms() const; 742 | const char* get_part_id() const; 743 | const char* get_part_discription() const; 744 | bool part_supersede_flag() const; 745 | bool part_abnormal_flag() const; 746 | bool part_failed_flag() const; 747 | bool pass_fail_flag_invalid() const; 748 | 749 | void set_head_number(unsigned char number); 750 | void set_site_number(unsigned char number); 751 | void set_number_test(unsigned short count); 752 | void set_hardbin_number(unsigned short number); 753 | void set_softbin_number(unsigned short number); 754 | void set_x_coordinate(short x); 755 | void set_y_coordinate(short y); 756 | void set_elapsed_ms(unsigned int time_ms); 757 | void set_part_discription(const char* text); 758 | void set_part_id(const char* id); 759 | void part_supersede_flag(bool flag); 760 | void part_abnormal_flag(bool flag); 761 | void part_failed_flag(bool flag); 762 | void pass_fail_flag_invalid(bool flag); 763 | 764 | unsigned int parse(const StdfHeader& record); 765 | unsigned int unparse(StdfHeader& record); 766 | void print(std::ostream& os) const; 767 | 768 | private: 769 | typedef class PartResults Impl; 770 | Impl *impl; 771 | }; 772 | 773 | 774 | enum TestType : char 775 | { 776 | Parametric_Test = 'P', 777 | Functional_Test = 'F', 778 | Multiple_Result_Test = 'M', 779 | UnknownTestType = ' ', 780 | }; 781 | 782 | class StdfTSR : public StdfRecord 783 | { 784 | public: 785 | StdfTSR(); 786 | ~StdfTSR(); 787 | 788 | unsigned char get_head_number() const; 789 | unsigned char get_site_number() const; 790 | char get_test_type() const; 791 | unsigned int get_test_number() const; 792 | unsigned int get_exec_count() const; 793 | unsigned int get_fail_count() const; 794 | unsigned int get_alarm_count() const; 795 | const char* get_test_name() const; 796 | const char* get_sequencer_name() const; 797 | const char* get_test_label() const; 798 | unsigned char get_optional_data_flag() const; 799 | float get_average_time_s() const; 800 | float get_result_min() const; 801 | float get_result_max() const; 802 | float get_result_sum() const; 803 | float get_result_squares_sum() const; 804 | 805 | bool result_min_invalid() const; 806 | bool result_max_invalid() const; 807 | bool test_time_invalid() const; 808 | bool result_sum_invalid() const; 809 | bool result_squares_sum_invalid() const; 810 | 811 | void set_head_number(unsigned char number); 812 | void set_site_number(unsigned char number); 813 | void set_test_type(TestType type); 814 | void set_test_number(unsigned int number); 815 | void set_exec_count(unsigned int count); 816 | void set_fail_count(unsigned int count); 817 | void set_alarm_count(unsigned int count); 818 | void set_test_name(const char* name); 819 | void set_sequencer_name(const char* name); 820 | void set_test_label(const char* label); 821 | void set_average_time_s(float seconds); 822 | void set_result_min(float value); 823 | void set_result_max(float value); 824 | void set_result_sum(float value); 825 | void set_result_squares_sum(float value); 826 | 827 | void result_min_invalid(bool flag); 828 | void result_max_invalid(bool flag); 829 | void test_time_invalid(bool flag); 830 | void result_sum_invalid(bool flag); 831 | void result_squares_sum_invalid(bool flag); 832 | 833 | unsigned int parse(const StdfHeader& record); 834 | unsigned int unparse(StdfHeader& record); 835 | void print(std::ostream& os) const; 836 | 837 | private: 838 | typedef class TestSynopsis Impl; 839 | Impl *impl; 840 | }; 841 | 842 | 843 | class StdfPTR : public StdfRecord 844 | { 845 | public: 846 | StdfPTR(); 847 | ~StdfPTR(); 848 | 849 | unsigned int get_test_number() const; 850 | unsigned char get_head_number() const; 851 | unsigned char get_site_number() const; 852 | unsigned char get_test_flag() const; 853 | unsigned char get_parametric_test_flag() const; 854 | float get_result() const; 855 | const char* get_test_text() const; 856 | const char* get_alarm_id() const; 857 | unsigned char get_optional_data_flag() const; 858 | signed char get_result_exponent() const; 859 | signed char get_lowlimit_exponent() const; 860 | signed char get_highlimit_exponent() const; 861 | float get_low_limit() const; 862 | float get_high_limit() const; 863 | const char* get_unit() const; 864 | const char* get_result_format() const; 865 | const char* get_lowlimit_format() const; 866 | const char* get_highlimit_format() const; 867 | float get_low_spec() const; 868 | float get_high_spec() const; 869 | 870 | // TEST_FLG 871 | bool alarm_detected() const; 872 | bool result_invalid() const; 873 | bool result_unreliable() const; 874 | bool timeout_occured() const; 875 | bool test_unexecuted() const; 876 | bool test_aborted() const; 877 | bool test_pfflag_invalid() const; 878 | bool test_failed() const; 879 | //PARM_FLG 880 | bool param_scale_error() const; 881 | bool param_drift_error() const; 882 | bool param_oscillation() const; 883 | bool result_higher_limit() const; 884 | bool result_lower_limit() const; 885 | bool passed_alternate_limit() const; 886 | bool equal_lowlimit_pass() const; 887 | bool equal_highlimit_pass() const; 888 | //OPT_FLAG 889 | bool result_exponent_invalid() const; 890 | bool no_low_spec() const; 891 | bool no_high_spec() const; 892 | bool low_limit_invalid() const; 893 | bool high_limit_invalid() const; 894 | bool no_low_limit() const; 895 | bool no_high_limit() const; 896 | 897 | void set_test_number(unsigned int number); 898 | void set_head_number(unsigned char number); 899 | void set_site_number(unsigned char number); 900 | void set_result(float value); 901 | void set_test_text(const char* text); 902 | void set_alarm_id(const char* id); 903 | void set_result_exponent(signed char exponent); 904 | void set_lowlimit_exponent(signed char exponent); 905 | void set_highlimit_exponent(signed char exponent); 906 | void set_low_limit(float limit); 907 | void set_high_limit(float limit); 908 | void set_unit(const char* unit); 909 | void set_result_format(const char* format); 910 | void set_lowlimit_format(const char* format); 911 | void set_highlimit_format(const char* format); 912 | void set_low_spec(float spec); 913 | void set_high_spec(float spec); 914 | 915 | // TEST_FLG 916 | void alarm_detected(bool flag); 917 | void result_invalid(bool flag); 918 | void result_unreliable(bool flag); 919 | void timeout_occured(bool flag); 920 | void test_unexecuted(bool flag); 921 | void test_aborted(bool flag); 922 | void test_pfflag_invalid(bool flag); 923 | void test_failed(bool flag); 924 | //PARM_FLG 925 | void param_scale_error(bool flag); 926 | void param_drift_error(bool flag); 927 | void param_oscillation(bool flag); 928 | void result_higher_limit(bool flag); 929 | void result_lower_limit(bool flag); 930 | void passed_alternate_limit(bool flag); 931 | void equal_lowlimit_pass(bool flag); 932 | void equal_highlimit_pass(bool flag); 933 | //OPT_FLAG 934 | void result_exponent_invalid(bool flag); 935 | void no_low_spec(bool flag); 936 | void no_high_spec(bool flag); 937 | void low_limit_invalid(bool flag); 938 | void high_limit_invalid(bool flag); 939 | void no_low_limit(bool flag); 940 | void no_high_limit(bool flag); 941 | 942 | unsigned int parse(const StdfHeader& record); 943 | unsigned int unparse(StdfHeader& record); 944 | void print(std::ostream& os) const; 945 | 946 | private: 947 | typedef class ParametricTest Impl; 948 | Impl *impl; 949 | }; 950 | 951 | 952 | class StdfMPR : public StdfRecord 953 | { 954 | public: 955 | StdfMPR(); 956 | ~StdfMPR(); 957 | 958 | unsigned int get_test_number() const; 959 | unsigned char get_head_number() const; 960 | unsigned char get_site_number() const; 961 | unsigned char get_test_flag() const; 962 | unsigned char get_parametric_test_flag() const; 963 | unsigned short get_pin_count() const; 964 | unsigned short get_result_count() const; 965 | unsigned char get_return_state(unsigned short index) const; 966 | float get_return_result(unsigned short index) const; 967 | const char* get_test_text() const; 968 | const char* get_alarm_id() const; 969 | unsigned char get_optional_data_flag() const; 970 | signed char get_result_exponent() const; 971 | signed char get_lowlimit_exponent() const; 972 | signed char get_highlimit_exponent() const; 973 | float get_low_limit() const; 974 | float get_high_limit() const; 975 | float get_starting_input() const; 976 | float get_increment_input() const; 977 | unsigned short get_pin_index(unsigned short index) const; 978 | const char* get_unit() const; 979 | const char* get_unit_input() const; 980 | const char* get_result_format() const; 981 | const char* get_lowlimit_format() const; 982 | const char* get_highlimit_format() const; 983 | float get_low_spec() const; 984 | float get_high_spec() const; 985 | 986 | // TEST_FLG 987 | bool alarm_detected() const; 988 | bool result_invalid() const; 989 | bool result_unreliable() const; 990 | bool timeout_occured() const; 991 | bool test_unexecuted() const; 992 | bool test_aborted() const; 993 | bool test_pfflag_invalid() const; 994 | bool test_failed() const; 995 | //PARM_FLG 996 | bool param_scale_error() const; 997 | bool param_drift_error() const; 998 | bool param_oscillation() const; 999 | bool result_higher_limit() const; 1000 | bool result_lower_limit() const; 1001 | bool passed_alternate_limit() const; 1002 | bool equal_lowlimit_pass() const; 1003 | bool equal_highlimit_pass() const; 1004 | //OPT_FLAG 1005 | bool result_exponent_invalid() const; 1006 | bool start_input_invalid() const; 1007 | bool no_low_spec() const; 1008 | bool no_high_spec() const; 1009 | bool low_limit_invalid() const; 1010 | bool high_limit_invalid() const; 1011 | bool no_low_limit() const; 1012 | bool no_high_limit() const; 1013 | 1014 | void set_test_number(unsigned int number); 1015 | void set_head_number(unsigned char number); 1016 | void set_site_number(unsigned char number); 1017 | void set_pin_count(unsigned short count); 1018 | void set_result_count(unsigned short count); 1019 | void set_return_state(unsigned short index, unsigned char nibble_state); 1020 | void set_return_result(unsigned short index, float result); 1021 | void set_test_text(const char* text); 1022 | void set_alarm_id(const char* id); 1023 | void set_result_exponent(signed char exponent); 1024 | void set_lowlimit_exponent(signed char exponent); 1025 | void set_highlimit_exponent(signed char exponent); 1026 | void set_low_limit(float limit); 1027 | void set_high_limit(float limit); 1028 | void set_starting_input(float starting); 1029 | void set_increment_input(float increment); 1030 | void set_pin_index(unsigned short index, unsigned short pin_number); 1031 | void set_unit(const char* unit); 1032 | void set_unit_input(const char* input_unit); 1033 | void set_result_format(const char* format); 1034 | void set_lowlimit_format(const char* format); 1035 | void set_highlimit_format(const char* format); 1036 | void set_low_spec(float spec); 1037 | void set_high_spec(float spec); 1038 | 1039 | // TEST_FLG 1040 | void alarm_detected(bool flag); 1041 | void result_invalid(bool flag); 1042 | void result_unreliable(bool flag); 1043 | void timeout_occured(bool flag); 1044 | void test_unexecuted(bool flag); 1045 | void test_aborted(bool flag); 1046 | void test_pfflag_invalid(bool flag); 1047 | void test_failed(bool flag); 1048 | //PARM_FLG 1049 | void param_scale_error(bool flag); 1050 | void param_drift_error(bool flag); 1051 | void param_oscillation(bool flag); 1052 | void result_higher_limit(bool flag); 1053 | void result_lower_limit(bool flag); 1054 | void passed_alternate_limit(bool flag); 1055 | void equal_lowlimit_pass(bool flag); 1056 | void equal_highlimit_pass(bool flag); 1057 | //OPT_FLAG 1058 | void result_exponent_invalid(bool flag); 1059 | void start_input_invalid(bool flag); 1060 | void no_low_spec(bool flag); 1061 | void no_high_spec(bool flag); 1062 | void low_limit_invalid(bool flag); 1063 | void high_limit_invalid(bool flag); 1064 | void no_low_limit(bool flag); 1065 | void no_high_limit(bool flag); 1066 | 1067 | unsigned int parse(const StdfHeader& record); 1068 | unsigned int unparse(StdfHeader& record); 1069 | void print(std::ostream& os) const; 1070 | 1071 | private: 1072 | typedef class MultipleResultParametric Impl; 1073 | Impl *impl; 1074 | }; 1075 | 1076 | enum ReturnState : unsigned char 1077 | { 1078 | Return_Low = 0x0, 1079 | Return_High = 0x1, 1080 | Return_Midband = 0x2, 1081 | Return_Glitch = 0x3, 1082 | Return_Undetermined = 0x4, 1083 | Return_Failed_Low = 0x5, 1084 | Return_Failed_High = 0x6, 1085 | Return_Failed_Midband = 0x7, 1086 | Return_Failed_Glitch = 0x8, 1087 | Return_Ppen = 0x9, 1088 | Return_Short = 0xA, 1089 | }; 1090 | 1091 | enum NormalModeStates : unsigned char 1092 | { 1093 | Normal_Drive_Low = 0, // 0 1094 | Normal_Drive_High = 1, // 1 1095 | Normal_Expect_Low = 2, // L 1096 | Normal_Expect_High = 3, // H 1097 | Normal_Expect_Midband = 4, // M 1098 | Normal_Expect_Valid = 5, // V 1099 | Normal_Compare = 6, // X 1100 | Normal_Keep_Window_Open = 7, // W 1101 | }; 1102 | 1103 | enum DualDriveStates: unsigned char 1104 | { 1105 | Dual_Low_D2_Low_D1 = 0, // 00 1106 | Dual_Low_D2_High_D1 = 1, // 10 1107 | Dual_High_D2_Low_D1 = 2, // 01 1108 | Dual_High_D2_High_D1 = 3, // 11 1109 | Dual_Compare_Low = 4, // L 1110 | Dual_Compare_High = 5, // H 1111 | Dual_Compare_Midband = 6, // M 1112 | Dual_Donnot_Compare = 7, // X 1113 | }; 1114 | 1115 | enum SCIOModeStates : unsigned char 1116 | { 1117 | SCIO_Drive_Low_Compare_Low = 0, // 0L 1118 | SCIO_Drive_Low_Compare_High = 1, // 0H 1119 | SCIO_Drive_Low_Compare_Midband = 2, // 0M 1120 | SCIO_Drive_Low_Donnot_Compare = 3, // 0X 1121 | SCIO_Drive_High_Compare_Low = 4, // 1L 1122 | SCIO_Drive_High_Compare_High = 5, // 1H 1123 | SCIO_Drive_High_Compare_Midband = 6, // 1M 1124 | SCIO_Drive_High_Donnot_Compare = 7, // 1X 1125 | }; 1126 | 1127 | class StdfFTR : public StdfRecord 1128 | { 1129 | public: 1130 | StdfFTR(); 1131 | ~StdfFTR(); 1132 | 1133 | unsigned int get_test_number() const; 1134 | unsigned char get_head_number() const; 1135 | unsigned char get_site_number() const; 1136 | unsigned char get_test_flag() const; 1137 | unsigned char get_optional_data_flag() const; 1138 | unsigned int get_cycle_count() const; 1139 | unsigned int get_relative_address() const; 1140 | unsigned int get_repeat_count() const; 1141 | unsigned int get_failpin_count() const; 1142 | int get_xfail_address() const; 1143 | int get_yfail_address() const; 1144 | short get_vector_offset() const; 1145 | unsigned short get_pin_count() const; 1146 | unsigned short get_program_state_count() const; 1147 | unsigned short get_pin_number(unsigned short index) const; 1148 | unsigned char get_pin_state(unsigned short index) const; 1149 | unsigned short get_program_index(unsigned short index) const; 1150 | unsigned char get_program_state(unsigned short index) const; 1151 | unsigned short get_failpin_data_count() const; 1152 | unsigned char get_failpin_data(unsigned short index) const; 1153 | const char* get_vector_pattern_name() const; 1154 | const char* get_timeset_name() const; 1155 | const char* get_vector_op_code() const; 1156 | const char* get_test_text() const; 1157 | const char* get_alarm_id() const; 1158 | const char* get_result_text() const; 1159 | const char* get_program_text() const; 1160 | unsigned char get_pattern_genertor_number() const; 1161 | unsigned short get_bitmap_data_count() const; 1162 | unsigned char get_bitmap_data(unsigned short index) const; 1163 | 1164 | void set_test_number(unsigned int number); 1165 | void set_head_number(unsigned char number); 1166 | void set_site_number(unsigned char number); 1167 | void set_cycle_count(unsigned int count); 1168 | void set_relative_address(unsigned int address); 1169 | void set_repeat_count(unsigned int count); 1170 | void set_failpin_count(unsigned int count); 1171 | void set_xfail_address(int x); 1172 | void set_yfail_address(int y); 1173 | void set_vector_offset(short offset); 1174 | void set_pin_count(unsigned short count); 1175 | void set_program_state_count(unsigned short count); 1176 | void set_pin_number(unsigned short index, unsigned short pin_number); 1177 | void set_pin_state(unsigned short index, ReturnState nibble_state); 1178 | void set_program_index(unsigned short index, unsigned short state_index); 1179 | void set_program_state(unsigned short index, unsigned char nibble_state); 1180 | void set_failpin_data(unsigned short index, unsigned char bit_data); 1181 | void set_vector_pattern_name(const char* name); 1182 | void set_timeset_name(const char* name); 1183 | void set_vector_op_code(const char* op_code); 1184 | void set_test_text(const char* text); 1185 | void set_alarm_id(const char* id); 1186 | void set_result_text(const char* text); 1187 | void set_program_text(const char* text); 1188 | void set_pattern_genertor_number(unsigned char number); 1189 | void set_bitmap_data(unsigned short index, unsigned char bit_data); 1190 | 1191 | // TEST_FLG 1192 | bool alarm_detected() const; 1193 | bool result_invalid() const; 1194 | bool result_unreliable() const; 1195 | bool timeout_occured() const; 1196 | bool test_unexecuted() const; 1197 | bool test_aborted() const; 1198 | bool test_pfflag_invalid() const; 1199 | bool test_failed() const; 1200 | // TEST_FLG 1201 | void alarm_detected(bool flag); 1202 | void result_invalid(bool flag); 1203 | void result_unreliable(bool flag); 1204 | void timeout_occured(bool flag); 1205 | void test_unexecuted(bool flag); 1206 | void test_aborted(bool flag); 1207 | void test_pfflag_invalid(bool flag); 1208 | void test_failed(bool flag); 1209 | 1210 | // OPT_FLG 1211 | bool cycl_count_invalid() const; 1212 | bool relative_address_invalid() const; 1213 | bool repeat_count_invalid() const; 1214 | bool failpin_count_invalid() const; 1215 | bool xyfail_address_invalid() const; 1216 | bool vector_offset_invalid() const; 1217 | // OPT_FLG 1218 | void cycl_count_invalid(bool flag); 1219 | void relative_address_invalid(bool flag); 1220 | void repeat_count_invalid(bool flag); 1221 | void failpin_count_invalid(bool flag); 1222 | void xyfail_address_invalid(bool flag); 1223 | void vector_offset_invalid(bool flag); 1224 | 1225 | unsigned int parse(const StdfHeader& record); 1226 | unsigned int unparse(StdfHeader& record); 1227 | void print(std::ostream& os) const; 1228 | 1229 | private: 1230 | typedef class FunctionalTest Impl; 1231 | Impl *impl; 1232 | }; 1233 | 1234 | 1235 | class StdfBPS : public StdfRecord 1236 | { 1237 | public: 1238 | StdfBPS(); 1239 | ~StdfBPS(); 1240 | 1241 | const char* get_section_name() const; 1242 | void set_section_name(const char* name); 1243 | 1244 | unsigned int parse(const StdfHeader& record); 1245 | unsigned int unparse(StdfHeader& record); 1246 | void print(std::ostream& os) const; 1247 | 1248 | private: 1249 | typedef class BeginProgramSection Impl; 1250 | Impl *impl; 1251 | }; 1252 | 1253 | 1254 | class StdfEPS : public StdfRecord 1255 | { 1256 | public: 1257 | StdfEPS(); 1258 | ~StdfEPS(); 1259 | 1260 | unsigned int parse(const StdfHeader& record); 1261 | unsigned int unparse(StdfHeader& record); 1262 | void print(std::ostream& os) const; 1263 | 1264 | private: 1265 | typedef class EndProgramSection Impl; 1266 | Impl *impl; 1267 | }; 1268 | 1269 | enum VnType : unsigned char 1270 | { 1271 | Vn_B0 = 0 , // B*0 Special pad field, of length 0 (See note below) 1272 | Vn_U1 = 1 , // U*1 One byte unsigned integer 1273 | Vn_U2 = 2 , // U*2 Two byte unsigned integer 1274 | Vn_U4 = 3 , // U*4 Four byte unsigned integer 1275 | Vn_I1 = 4 , // I*1 One byte signed integer 1276 | Vn_I2 = 5 , // I*2 Two byte signed integer 1277 | Vn_I4 = 6 , // I*4 Four byte signed integer 1278 | Vn_R4 = 7 , // R*4 Four byte floating point number 1279 | Vn_R8 = 8 , // R*8 Eight byte floating point number 1280 | Vn_Cn = 10, // C*n Variable length ASCII character string(first byte is string length in bytes) 1281 | Vn_Bn = 11, // B*n Variable length binary data string(first byte is string length in bytes) 1282 | Vn_Dn = 12, // D*n Bit encoded data(first two bytes of string are length in bits) 1283 | Vn_N1 = 13, // N*1 Unsigned nibble 1284 | }; 1285 | 1286 | class StdfGDR : public StdfRecord 1287 | { 1288 | public: 1289 | StdfGDR(); 1290 | ~StdfGDR(); 1291 | 1292 | unsigned short get_data_count() const; 1293 | void set_data_count(unsigned short count); 1294 | 1295 | unsigned char get_data_type(unsigned int index) const; 1296 | const unsigned char* get_data_value(unsigned int index, int* byte_length, int* bit_count = nullptr) const; 1297 | void set_data_type(VnType type, unsigned int index); 1298 | bool set_data_value(const unsigned char* data, unsigned int index, int byte_length); 1299 | 1300 | unsigned int parse(const StdfHeader& record); 1301 | unsigned int unparse(StdfHeader& record); 1302 | void print(std::ostream& os) const; 1303 | 1304 | private: 1305 | typedef class GenericData Impl; 1306 | Impl *impl; 1307 | mutable unsigned char rawdata[255][256];//MAX V1 length is 255,MAX FLD_CNT is 255 1308 | }; 1309 | 1310 | 1311 | class StdfDTR : public StdfRecord 1312 | { 1313 | public: 1314 | StdfDTR(); 1315 | ~StdfDTR(); 1316 | const char* get_text_data() const; 1317 | void set_text_data(const char*data); 1318 | 1319 | unsigned int parse(const StdfHeader& record); 1320 | unsigned int unparse(StdfHeader& record); 1321 | void print(std::ostream& os) const; 1322 | 1323 | private: 1324 | typedef class DatalogText Impl; 1325 | Impl *impl; 1326 | }; 1327 | 1328 | 1329 | 1330 | #endif//_STDFV4_API_H_ 1331 | -------------------------------------------------------------------------------- /Stdf_V4_Reader/ui/stdf_window.cpp: -------------------------------------------------------------------------------- 1 | #include "stdf_window.h" 2 | #include "ui_mainwindow.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | 10 | MainWindow::MainWindow(QWidget *parent) : 11 | QMainWindow(parent), 12 | ui(new Ui::MainWindow) 13 | { 14 | ui->setupUi(this); 15 | 16 | save_action = new QAction(this); 17 | save_action->setText(tr("Save Values in Table to CSV File")); 18 | ui->RecordTableWidget->addAction(save_action); 19 | connect(save_action, SIGNAL(triggered()), this, SLOT(SaveTableToFile())); 20 | ui->RecordTableWidget->setContextMenuPolicy(Qt::ActionsContextMenu); 21 | 22 | stdf_file = nullptr; 23 | UpdateUi(); 24 | } 25 | 26 | MainWindow::~MainWindow() 27 | { 28 | if(stdf_file) 29 | { 30 | delete stdf_file; 31 | stdf_file = nullptr; 32 | } 33 | delete ui; 34 | } 35 | 36 | void MainWindow::table_set_value(int row, int col, unsigned int value) 37 | { 38 | QString str_number; 39 | str_number.sprintf("%u", value); 40 | ui->RecordTableWidget->setItem(row, col, new QTableWidgetItem(str_number)); 41 | } 42 | 43 | void MainWindow::table_set_value(int row, int col, int value) 44 | { 45 | QString str_number; 46 | str_number.sprintf("%d", value); 47 | ui->RecordTableWidget->setItem(row, col, new QTableWidgetItem(str_number)); 48 | } 49 | 50 | void MainWindow::table_set_value(int row, int col, const char* value) 51 | { 52 | QString tmp_str = QString::fromLocal8Bit(value); 53 | ui->RecordTableWidget->setItem(row, col, new QTableWidgetItem(tmp_str)); 54 | } 55 | 56 | void MainWindow::table_set_value(int row, int col, time_t value) 57 | { 58 | QString tmp_str = QString::fromLocal8Bit(ctime(&value)); 59 | ui->RecordTableWidget->setItem(row, col, new QTableWidgetItem(tmp_str)); 60 | } 61 | 62 | void MainWindow::table_set_value(int row, int col, char value) 63 | { 64 | QString str_number; 65 | str_number.sprintf("%c", value); 66 | ui->RecordTableWidget->setItem(row, col, new QTableWidgetItem(str_number)); 67 | } 68 | 69 | void MainWindow::table_set_value(int row, int col, unsigned char value) 70 | { 71 | QString str_number; 72 | str_number.sprintf("%u", value); 73 | ui->RecordTableWidget->setItem(row, col, new QTableWidgetItem(str_number)); 74 | } 75 | 76 | void MainWindow::table_set_value(int row, int col, unsigned short value) 77 | { 78 | QString str_number; 79 | str_number.sprintf("%u", value); 80 | ui->RecordTableWidget->setItem(row, col, new QTableWidgetItem(str_number)); 81 | } 82 | 83 | void MainWindow::table_set_value(int row, int col, float value) 84 | { 85 | QString str_number; 86 | str_number.sprintf("%f", value); 87 | ui->RecordTableWidget->setItem(row, col, new QTableWidgetItem(str_number)); 88 | } 89 | 90 | void MainWindow::table_set_value(int row, int col, short value) 91 | { 92 | QString str_number; 93 | str_number.sprintf("%d", value); 94 | ui->RecordTableWidget->setItem(row, col, new QTableWidgetItem(str_number)); 95 | } 96 | 97 | void MainWindow::table_set_value(int row, int col, signed char value) 98 | { 99 | QString str_number; 100 | str_number.sprintf("%d", value); 101 | ui->RecordTableWidget->setItem(row, col, new QTableWidgetItem(str_number)); 102 | } 103 | 104 | void MainWindow::table_set_value(int row, int col, QString value) 105 | { 106 | ui->RecordTableWidget->setItem(row, col, new QTableWidgetItem(value)); 107 | } 108 | 109 | void MainWindow::table_set_flag(int row, int col, unsigned char flag) 110 | { 111 | QString str_flag; 112 | str_flag.sprintf("0x%X", flag); 113 | ui->RecordTableWidget->setItem(row, col, new QTableWidgetItem(str_flag)); 114 | } 115 | 116 | void MainWindow::on_OpenButton_clicked() 117 | { 118 | QString strTitle = tr("Open STDF File"); 119 | QString strDir = tr(""); 120 | QString strFilter = tr("STDF Files (*.stdf *.std)"); 121 | 122 | QFileDialog *fileDialog = new QFileDialog(this, strTitle, strDir, strFilter); 123 | fileDialog->setFileMode(QFileDialog::ExistingFile); 124 | if(fileDialog->exec() == QDialog::Accepted) 125 | { 126 | QStringList file_names_list = fileDialog->selectedFiles(); 127 | filename = file_names_list[0]; 128 | stdf_file = new STDF_FILE(); 129 | int ret = stdf_file->read(filename.toLocal8Bit().data()); 130 | if(ret != 0) 131 | { 132 | delete stdf_file; 133 | stdf_file = nullptr; 134 | return; 135 | } 136 | 137 | stdf_types.clear(); 138 | ui->RecordListWidget->clear(); 139 | for(int i = 0; i < STDF_V4_RECORD_COUNT; i++) 140 | { 141 | if(stdf_file->get_count((STDF_TYPE)i) > 0) 142 | { 143 | QString rec_name; 144 | rec_name = QString::fromLocal8Bit(stdf_file->get_name((STDF_TYPE)i)); 145 | ui->RecordListWidget->addItem(rec_name); 146 | stdf_types.push_back(i); 147 | } 148 | } 149 | } 150 | if(stdf_types.size() > 0) 151 | { 152 | ui->RecordListWidget->setCurrentRow(0); 153 | ShowRecordTable(STDF_TYPE(stdf_types[0])); 154 | } 155 | UpdateUi(); 156 | } 157 | 158 | void MainWindow::on_ClearButton_clicked() 159 | { 160 | ui->RecordListWidget->clear(); 161 | ui->RecordTableWidget->clear(); 162 | delete stdf_file; 163 | stdf_file = nullptr; 164 | UpdateUi(); 165 | } 166 | 167 | void MainWindow::on_CloseButton_clicked() 168 | { 169 | if(stdf_file) 170 | { 171 | delete stdf_file; 172 | stdf_file = nullptr; 173 | } 174 | 175 | close(); 176 | } 177 | 178 | void MainWindow::on_SaveButton_clicked() 179 | { 180 | QFileDialog *dialog = new QFileDialog(this); 181 | dialog->setWindowTitle("Save TXT File"); 182 | dialog->setNameFilter("TXT Files(*.txt)"); 183 | dialog->setDefaultSuffix("txt"); 184 | dialog->setAcceptMode(QFileDialog::AcceptSave); 185 | 186 | if(dialog->exec() == QDialog::Accepted) 187 | { 188 | QString savefile = dialog->selectedFiles()[0]; 189 | int ret = stdf_file->write(savefile.toLocal8Bit().data()); 190 | if(ret == 0) 191 | { 192 | QMessageBox::information(this,tr("Save File Success"), tr("Save STDF File to TXT File Success."),QMessageBox::Ok); 193 | } 194 | else 195 | { 196 | QMessageBox::critical(this,tr("Save File Failure"), tr("Save STDF File to TXT File Failure."),QMessageBox::Ok); 197 | } 198 | } 199 | } 200 | 201 | void MainWindow::UpdateUi() 202 | { 203 | if(stdf_file) 204 | { 205 | ui->OpenButton->hide(); 206 | ui->ClearButton->show(); 207 | ui->SaveButton->show(); 208 | ui->SaveChangeButton->show(); 209 | } 210 | else 211 | { 212 | ui->OpenButton->show(); 213 | ui->ClearButton->hide(); 214 | ui->SaveButton->hide(); 215 | ui->SaveChangeButton->hide(); 216 | } 217 | } 218 | 219 | 220 | void MainWindow::on_RecordListWidget_clicked(const QModelIndex &index) 221 | { 222 | int row = index.row(); 223 | STDF_TYPE type = (STDF_TYPE)(stdf_types[row]); 224 | ui->MainStatusBar->showMessage(stdf_file->get_name(type)); 225 | ShowRecordTable(type); 226 | 227 | } 228 | 229 | void MainWindow::ShowRecordTable(STDF_TYPE type) 230 | { 231 | ui->RecordTableWidget->clear(); 232 | switch (type) 233 | { 234 | case FAR_TYPE: ShowStdfFAR(); break; 235 | case ATR_TYPE: ShowStdfATR(); break; 236 | case MIR_TYPE: ShowStdfMIR(); break; 237 | case MRR_TYPE: ShowStdfMRR(); break; 238 | case PCR_TYPE: ShowStdfPCR(); break; 239 | case HBR_TYPE: ShowStdfHBR(); break; 240 | case SBR_TYPE: ShowStdfSBR(); break; 241 | case PMR_TYPE: ShowStdfPMR(); break; 242 | case PGR_TYPE: ShowStdfPGR(); break; 243 | case PLR_TYPE: ShowStdfPLR(); break; 244 | case RDR_TYPE: ShowStdfRDR(); break; 245 | case SDR_TYPE: ShowStdfSDR(); break; 246 | case WIR_TYPE: ShowStdfWIR(); break; 247 | case WRR_TYPE: ShowStdfWRR(); break; 248 | case WCR_TYPE: ShowStdfWCR(); break; 249 | case PIR_TYPE: ShowStdfPIR(); break; 250 | case PRR_TYPE: ShowStdfPRR(); break; 251 | case TSR_TYPE: ShowStdfTSR(); break; 252 | case PTR_TYPE: ShowStdfPTR(); break; 253 | case MPR_TYPE: ShowStdfMPR(); break; 254 | case FTR_TYPE: ShowStdfFTR(); break; 255 | case BPS_TYPE: ShowStdfBPS(); break; 256 | case EPS_TYPE: ShowStdfEPS(); break; 257 | case GDR_TYPE: ShowStdfGDR(); break; 258 | case DTR_TYPE: ShowStdfDTR(); break; 259 | default: break; 260 | } 261 | } 262 | 263 | void MainWindow::ShowStdfFAR() 264 | { 265 | QStringList col_labels; 266 | 267 | unsigned int row_count = stdf_file->get_count(FAR_TYPE); 268 | unsigned int col_count = 2; 269 | 270 | ui->RecordTableWidget->setRowCount(row_count); 271 | ui->RecordTableWidget->setColumnCount(col_count); 272 | 273 | col_labels<<"CPU_TYPE"; 274 | col_labels<<"STDF_VER"; 275 | 276 | StdfFAR* record = (StdfFAR*)(stdf_file->get_record(FAR_TYPE, 0)); 277 | 278 | table_set_value(0, 0, record->get_cpu_type()); // CPU_TYPE 279 | table_set_value(0, 1, record->get_stdf_version()); // STDF_VER 280 | 281 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 282 | ui->RecordTableWidget->resizeColumnsToContents(); 283 | } 284 | 285 | void MainWindow::ShowStdfATR() 286 | { 287 | QStringList col_labels; 288 | 289 | unsigned int col_count = 2; 290 | unsigned int rec_count = stdf_file->get_count(ATR_TYPE); 291 | 292 | QProgressBar progress_bar(ui->RecordTableWidget); 293 | progress_bar.setRange(0, rec_count); 294 | progress_bar.setAlignment(Qt::AlignCenter); 295 | progress_bar.show(); 296 | 297 | ui->RecordTableWidget->setRowCount(0); 298 | ui->RecordTableWidget->setColumnCount(col_count); 299 | 300 | col_labels<<"SETUP_T"; 301 | col_labels<<"CMD_LINE"; 302 | 303 | for(unsigned int i = 0; i < rec_count; i++) 304 | { 305 | ui->RecordTableWidget->insertRow(i); 306 | StdfATR* record = (StdfATR*)(stdf_file->get_record(ATR_TYPE, i)); 307 | 308 | table_set_value(i, 0, record->get_modify_time()); // SETUP_T 309 | table_set_value(i, 1, record->get_command_line()); // CMD_LINE 310 | 311 | progress_bar.setValue(i); 312 | } 313 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 314 | ui->RecordTableWidget->resizeColumnsToContents(); 315 | } 316 | 317 | void MainWindow::ShowStdfMIR() 318 | { 319 | QStringList col_labels; 320 | 321 | unsigned int rec_count = stdf_file->get_count(MIR_TYPE); 322 | unsigned int col_count = 38; 323 | 324 | ui->RecordTableWidget->setRowCount(rec_count); 325 | ui->RecordTableWidget->setColumnCount(col_count); 326 | 327 | col_labels<<"SETUP_T"; 328 | col_labels<<"START_T"; 329 | col_labels<<"STAT_NUM"; 330 | col_labels<<"MODE_COD"; 331 | col_labels<<"RTST_COD"; 332 | col_labels<<"PROT_COD"; 333 | col_labels<<"BURN_TIM"; 334 | col_labels<<"CMOD_COD"; 335 | col_labels<<"LOT_ID "; 336 | col_labels<<"PART_TYP"; 337 | col_labels<<"NODE_NAM"; 338 | col_labels<<"TSTR_TYP"; 339 | col_labels<<"JOB_NAM "; 340 | col_labels<<"JOB_REV "; 341 | col_labels<<"SBLOT_ID"; 342 | col_labels<<"OPER_NAM"; 343 | col_labels<<"EXEC_TYP"; 344 | col_labels<<"EXEC_VER"; 345 | col_labels<<"TEST_COD"; 346 | col_labels<<"TST_TEMP"; 347 | col_labels<<"USER_TXT"; 348 | col_labels<<"AUX_FILE"; 349 | col_labels<<"PKG_TYP "; 350 | col_labels<<"FAMLY_ID"; 351 | col_labels<<"DATE_COD"; 352 | col_labels<<"FACIL_ID"; 353 | col_labels<<"FLOOR_ID"; 354 | col_labels<<"PROC_ID "; 355 | col_labels<<"OPER_FRQ"; 356 | col_labels<<"SPEC_NAM"; 357 | col_labels<<"SPEC_VER"; 358 | col_labels<<"FLOW_ID "; 359 | col_labels<<"SETUP_ID"; 360 | col_labels<<"DSGN_REV"; 361 | col_labels<<"ENG_ID "; 362 | col_labels<<"ROM_COD "; 363 | col_labels<<"SERL_NUM"; 364 | col_labels<<"SUPR_NAM"; 365 | 366 | 367 | for(unsigned int i = 0; i < rec_count; i++) 368 | { 369 | StdfMIR* record = (StdfMIR*)(stdf_file->get_record(MIR_TYPE, i)); 370 | 371 | int col = 0; 372 | table_set_value(i, col++, record->get_setup_time()); // SETUP_T 373 | table_set_value(i, col++, record->get_start_time()); // START_T 374 | table_set_value(i, col++, record->get_station_number()); // STAT_NUM 375 | table_set_value(i, col++, record->get_mode_code()); // MODE_COD 376 | table_set_value(i, col++, record->get_retest_code()); // RTST_COD 377 | table_set_value(i, col++, record->get_protection_code()); // PROT_COD 378 | table_set_value(i, col++, record->get_burn_time()); // BURN_TIM 379 | table_set_value(i, col++, record->get_command_code()); // CMOD_COD 380 | table_set_value(i, col++, record->get_lot_id()); // LOT_ID 381 | table_set_value(i, col++, record->get_part_type()); // PART_TYP 382 | table_set_value(i, col++, record->get_node_name()); // NODE_NAM 383 | table_set_value(i, col++, record->get_tester_type()); // TSTR_TYP 384 | table_set_value(i, col++, record->get_program_name()); // JOB_NAM 385 | table_set_value(i, col++, record->get_program_revision()); // JOB_REV 386 | table_set_value(i, col++, record->get_sublot_id()); // SBLOT_ID 387 | table_set_value(i, col++, record->get_operator_id()); // OPER_NAM 388 | table_set_value(i, col++, record->get_exec_file_type()); // EXEC_TYP 389 | table_set_value(i, col++, record->get_exec_file_version()); // EXEC_VER 390 | table_set_value(i, col++, record->get_test_code()); // TEST_COD 391 | table_set_value(i, col++, record->get_test_temperature()); // TST_TEMP 392 | table_set_value(i, col++, record->get_user_text()); // USER_TXT 393 | table_set_value(i, col++, record->get_auxiliary_filename());// AUX_FILE 394 | table_set_value(i, col++, record->get_package_type()); // PKG_TYP 395 | table_set_value(i, col++, record->get_family_id()); // FAMLY_ID 396 | table_set_value(i, col++, record->get_date_code()); // DATE_COD 397 | table_set_value(i, col++, record->get_facility_id()); // FACIL_ID 398 | table_set_value(i, col++, record->get_floor_id()); // FLOOR_ID 399 | table_set_value(i, col++, record->get_process_id()); // PROC_ID 400 | table_set_value(i, col++, record->get_operation_freq()); // OPER_FRQ 401 | table_set_value(i, col++, record->get_spec_name()); // SPEC_NAM 402 | table_set_value(i, col++, record->get_spec_version()); // SPEC_VER 403 | table_set_value(i, col++, record->get_testflow_id()); // FLOW_ID 404 | table_set_value(i, col++, record->get_setup_id()); // SETUP_ID 405 | table_set_value(i, col++, record->get_design_version()); // DSGN_REV 406 | table_set_value(i, col++, record->get_engineering_id()); // ENG_ID 407 | table_set_value(i, col++, record->get_rom_id()); // ROM_COD 408 | table_set_value(i, col++, record->get_tester_number()); // SERL_NUM 409 | table_set_value(i, col++, record->get_supervisor_name()); // SUPR_NAM 410 | } 411 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 412 | ui->RecordTableWidget->resizeColumnsToContents(); 413 | } 414 | 415 | void MainWindow::ShowStdfMRR() 416 | { 417 | QStringList col_labels; 418 | 419 | unsigned int col_count = 4; 420 | unsigned int rec_count = stdf_file->get_count(MRR_TYPE); 421 | 422 | ui->RecordTableWidget->setRowCount(rec_count); 423 | ui->RecordTableWidget->setColumnCount(col_count); 424 | 425 | col_labels<<"FINISH_T"; 426 | col_labels<<"DISP_COD"; 427 | col_labels<<"USR_DESC"; 428 | col_labels<<"EXC_DESC"; 429 | 430 | for(unsigned int i = 0; i < rec_count; i++) 431 | { 432 | StdfMRR* record = (StdfMRR*)(stdf_file->get_record(MRR_TYPE, i)); 433 | 434 | int col = 0; 435 | table_set_value(i, col++, record->get_finish_time()); // FINISH_T 436 | table_set_value(i, col++, record->get_disposition_code()); // DISP_COD 437 | table_set_value(i, col++, record->get_user_discription()); // USR_DESC 438 | table_set_value(i, col++, record->get_exec_discription()); // EXC_DESC 439 | } 440 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 441 | ui->RecordTableWidget->resizeColumnsToContents(); 442 | } 443 | 444 | void MainWindow::ShowStdfPCR() 445 | { 446 | QStringList col_labels; 447 | 448 | unsigned int col_count = 7; 449 | unsigned int rec_count = stdf_file->get_count(PCR_TYPE); 450 | 451 | ui->RecordTableWidget->setRowCount(rec_count); 452 | ui->RecordTableWidget->setColumnCount(col_count); 453 | 454 | col_labels<<"HEAD_NUM"; 455 | col_labels<<"SITE_NUM"; 456 | col_labels<<"PART_CNT"; 457 | col_labels<<"RTST_CNT"; 458 | col_labels<<"ABRT_CNT"; 459 | col_labels<<"GOOD_CNT"; 460 | col_labels<<"FUNC_CNT"; 461 | 462 | for(unsigned int i = 0; i < rec_count; i++) 463 | { 464 | StdfPCR* record = (StdfPCR*)(stdf_file->get_record(PCR_TYPE, i)); 465 | 466 | int col = 0; 467 | table_set_value(i, col++, record->get_head_number()); // HEAD_NUM 468 | table_set_value(i, col++, record->get_site_number()); // SITE_NUM 469 | table_set_value(i, col++, record->get_part_count()); // PART_CNT 470 | table_set_value(i, col++, record->get_retest_count()); // RTST_CNT 471 | table_set_value(i, col++, record->get_abort_count()); // ABRT_CNT 472 | table_set_value(i, col++, record->get_passed_count()); // GOOD_CNT 473 | table_set_value(i, col++, record->get_func_test_count());// FUNC_CNT 474 | } 475 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 476 | ui->RecordTableWidget->resizeColumnsToContents(); 477 | } 478 | 479 | void MainWindow::ShowStdfHBR() 480 | { 481 | QStringList col_labels; 482 | 483 | unsigned int col_count = 6; 484 | unsigned int rec_count = stdf_file->get_count(HBR_TYPE); 485 | 486 | QProgressBar progress_bar(ui->RecordTableWidget); 487 | progress_bar.setRange(0, rec_count); 488 | progress_bar.setAlignment(Qt::AlignCenter); 489 | progress_bar.show(); 490 | 491 | ui->RecordTableWidget->setRowCount(0); 492 | ui->RecordTableWidget->setColumnCount(col_count); 493 | 494 | col_labels<<"HEAD_NUM"; 495 | col_labels<<"SITE_NUM"; 496 | col_labels<<"HBIN_NUM"; 497 | col_labels<<"HBIN_CNT"; 498 | col_labels<<"HBIN_PF "; 499 | col_labels<<"HBIN_NAM"; 500 | 501 | for(unsigned int i = 0; i < rec_count; i++) 502 | { 503 | ui->RecordTableWidget->insertRow(i); 504 | StdfHBR* record = (StdfHBR*)(stdf_file->get_record(HBR_TYPE, i)); 505 | 506 | int col = 0; 507 | table_set_value(i, col++, record->get_head_number()); //HEAD_NUM 508 | table_set_value(i, col++, record->get_site_number()); //SITE_NUM 509 | table_set_value(i, col++, record->get_hardbin_number()); //HBIN_NUM 510 | table_set_value(i, col++, record->get_hardbin_count()); //HBIN_CNT 511 | table_set_value(i, col++, record->get_hardbin_indication()); //HBIN_PF 512 | table_set_value(i, col++, record->get_hardbin_name()); //HBIN_NAM 513 | 514 | progress_bar.setValue(i); 515 | } 516 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 517 | ui->RecordTableWidget->resizeColumnsToContents(); 518 | } 519 | 520 | void MainWindow::ShowStdfSBR() 521 | { 522 | QStringList col_labels; 523 | 524 | unsigned int col_count = 6; 525 | unsigned int rec_count = stdf_file->get_count(SBR_TYPE); 526 | 527 | QProgressBar progress_bar(ui->RecordTableWidget); 528 | progress_bar.setRange(0, rec_count); 529 | progress_bar.setAlignment(Qt::AlignCenter); 530 | progress_bar.show(); 531 | 532 | ui->RecordTableWidget->setRowCount(0); 533 | ui->RecordTableWidget->setColumnCount(col_count); 534 | 535 | col_labels<<"HEAD_NUM"; 536 | col_labels<<"SITE_NUM"; 537 | col_labels<<"SBIN_NUM"; 538 | col_labels<<"SBIN_CNT"; 539 | col_labels<<"SBIN_PF"; 540 | col_labels<<"SBIN_NAM"; 541 | 542 | for(unsigned int i = 0; i < rec_count; i++) 543 | { 544 | ui->RecordTableWidget->insertRow(i); 545 | StdfSBR* record = (StdfSBR*)(stdf_file->get_record(SBR_TYPE, i)); 546 | 547 | int col = 0; 548 | table_set_value(i, col++, record->get_head_number()); // HEAD_NUM 549 | table_set_value(i, col++, record->get_site_number()); // SITE_NUM 550 | table_set_value(i, col++, record->get_softbin_number()); // SBIN_NUM 551 | table_set_value(i, col++, record->get_softbin_count()); // SBIN_CNT 552 | table_set_value(i, col++, record->get_softbin_indication()); // SBIN_PF 553 | table_set_value(i, col++, record->get_softbin_name()); // SBIN_NAM 554 | 555 | progress_bar.setValue(i); 556 | } 557 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 558 | ui->RecordTableWidget->resizeColumnsToContents(); 559 | } 560 | 561 | void MainWindow::ShowStdfPMR() 562 | { 563 | QStringList col_labels; 564 | 565 | unsigned int col_count = 7; 566 | unsigned int rec_count = stdf_file->get_count(PMR_TYPE); 567 | 568 | ui->RecordTableWidget->setRowCount(rec_count); 569 | ui->RecordTableWidget->setColumnCount(col_count); 570 | 571 | col_labels<<"PMR_INDX"; 572 | col_labels<<"CHAN_TYP"; 573 | col_labels<<"CHAN_NAM"; 574 | col_labels<<"PHY_NAM"; 575 | col_labels<<"LOG_NAM"; 576 | col_labels<<"HEAD_NUM"; 577 | col_labels<<"SITE_NUM"; 578 | 579 | for(unsigned int i = 0; i < rec_count; i++) 580 | { 581 | StdfPMR* record = (StdfPMR*)(stdf_file->get_record(PMR_TYPE, i)); 582 | 583 | int col = 0; 584 | table_set_value(i, col++, record->get_pin_index()); // PMR_INDX 585 | table_set_value(i, col++, record->get_channel_type()); // CHAN_TYP 586 | table_set_value(i, col++, record->get_channel_name()); // CHAN_NAM 587 | table_set_value(i, col++, record->get_physical_name()); // PHY_NAM 588 | table_set_value(i, col++, record->get_logical_name()); // LOG_NAM 589 | table_set_value(i, col++, record->get_head_number()); // HEAD_NUM 590 | table_set_value(i, col++, record->get_site_number()); // SITE_NUM 591 | } 592 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 593 | ui->RecordTableWidget->resizeColumnsToContents(); 594 | } 595 | 596 | void MainWindow::ShowStdfPGR() 597 | { 598 | QStringList col_labels; 599 | 600 | unsigned int col_count = 4; 601 | unsigned int rec_count = stdf_file->get_count(PGR_TYPE); 602 | 603 | ui->RecordTableWidget->setRowCount(rec_count); 604 | ui->RecordTableWidget->setColumnCount(col_count); 605 | 606 | col_labels<<"GRP_INDX"; 607 | col_labels<<"GRP_NAM "; 608 | col_labels<<"INDX_CNT"; 609 | col_labels<<"PMR_INDX"; 610 | 611 | for(unsigned int i = 0; i < rec_count; i++) 612 | { 613 | StdfPGR* record = (StdfPGR*)(stdf_file->get_record(PGR_TYPE, i)); 614 | 615 | int col = 0; 616 | unsigned short pin_count = record->get_pin_count(); 617 | QString pin_number_list; 618 | for(unsigned short n = 0; n < pin_count; n++) 619 | { 620 | QString temp; 621 | temp.sprintf("%u", record->get_pin_number(n)); 622 | if(n != pin_count-1) temp += " ,"; 623 | pin_number_list += temp; 624 | } 625 | 626 | table_set_value(i, col++, record->get_group_index());// GRP_INDX 627 | table_set_value(i, col++, record->get_group_name()); // GRP_NAM 628 | table_set_value(i, col++, pin_count); // INDX_CNT 629 | table_set_value(i, col++, pin_number_list); // PMR_INDX 630 | } 631 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 632 | ui->RecordTableWidget->resizeColumnsToContents(); 633 | } 634 | 635 | void MainWindow::ShowStdfPLR() 636 | { 637 | QStringList col_labels; 638 | 639 | unsigned int col_count = 8; 640 | unsigned int rec_count = stdf_file->get_count(PLR_TYPE); 641 | 642 | ui->RecordTableWidget->setRowCount(rec_count); 643 | ui->RecordTableWidget->setColumnCount(col_count); 644 | 645 | col_labels<<"GRP_CNT"; 646 | col_labels<<"GRP_INDX"; 647 | col_labels<<"GRP_MODE"; 648 | col_labels<<"GRP_RADX"; 649 | col_labels<<"PGM_CHAR"; 650 | col_labels<<"RTN_CHAR"; 651 | col_labels<<"PGM_CHAL"; 652 | col_labels<<"RTN_CHAL"; 653 | 654 | for(unsigned int i = 0; i < rec_count; i++) 655 | { 656 | StdfPLR* record = (StdfPLR*)(stdf_file->get_record(PLR_TYPE, i)); 657 | 658 | int col = 0; 659 | unsigned short group_count = record->get_group_count(); 660 | QString group_number_list; 661 | for(unsigned short n = 0; n < group_count; n++) 662 | { 663 | QString temp; 664 | temp.sprintf("%u", record->get_group_number(n)); 665 | if(n != group_count-1) temp += " ,"; 666 | group_number_list += temp; 667 | } 668 | QString group_mode_list; 669 | for(unsigned short n = 0; n < group_count; n++) 670 | { 671 | QString temp; 672 | temp.sprintf("%u", record->get_group_mode(n)); 673 | if(n != group_count-1) temp += " ,"; 674 | group_mode_list += temp; 675 | } 676 | 677 | QString group_radix_list; 678 | for(unsigned short n = 0; n < group_count; n++) 679 | { 680 | QString temp; 681 | temp.sprintf("%u", record->get_group_radix(n)); 682 | if(n != group_count-1) temp += " ,"; 683 | group_radix_list += temp; 684 | } 685 | QString program_state_right_list; 686 | for(unsigned short n = 0; n < group_count; n++) 687 | { 688 | QString temp; 689 | temp = QString::fromLocal8Bit(record->get_program_state_right(n)); 690 | if(n != group_count-1) temp += " ,"; 691 | program_state_right_list += temp; 692 | } 693 | 694 | QString return_state_right_list; 695 | for(unsigned short n = 0; n < group_count; n++) 696 | { 697 | QString temp; 698 | temp = QString::fromLocal8Bit(record->get_return_state_right(n)); 699 | if(n != group_count-1) temp += " ,"; 700 | return_state_right_list += temp; 701 | } 702 | 703 | QString program_state_left_list; 704 | for(unsigned short n = 0; n < group_count; n++) 705 | { 706 | QString temp; 707 | temp = QString::fromLocal8Bit(record->get_program_state_left(n)); 708 | if(n != group_count-1) temp += " ,"; 709 | program_state_left_list += temp; 710 | } 711 | 712 | QString return_state_left_list; 713 | for(unsigned short n = 0; n < group_count; n++) 714 | { 715 | QString temp; 716 | temp = QString::fromLocal8Bit(record->get_return_state_left(n)); 717 | if(n != group_count-1) temp += " ,"; 718 | return_state_left_list += temp; 719 | } 720 | 721 | table_set_value(i, col++, group_count); // GRP_CNT 722 | table_set_value(i, col++, group_number_list); // GRP_INDX 723 | table_set_value(i, col++, group_mode_list); // GRP_MODE 724 | table_set_value(i, col++, group_radix_list); // GRP_RADX 725 | table_set_value(i, col++, program_state_right_list); // PGM_CHAR 726 | table_set_value(i, col++, return_state_right_list); // RTN_CHAR 727 | table_set_value(i, col++, program_state_left_list); // PGM_CHAL 728 | table_set_value(i, col++, return_state_left_list); // RTN_CHAL 729 | } 730 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 731 | ui->RecordTableWidget->resizeColumnsToContents(); 732 | } 733 | 734 | void MainWindow::ShowStdfRDR() 735 | { 736 | QStringList col_labels; 737 | 738 | unsigned int col_count = 2; 739 | unsigned int rec_count = stdf_file->get_count(RDR_TYPE); 740 | 741 | ui->RecordTableWidget->setRowCount(rec_count); 742 | ui->RecordTableWidget->setColumnCount(col_count); 743 | 744 | col_labels<<"NUM_BINS"; 745 | col_labels<<"RTST_BIN"; 746 | 747 | for(unsigned int i = 0; i < rec_count; i++) 748 | { 749 | StdfRDR* record = (StdfRDR*)(stdf_file->get_record(RDR_TYPE, i)); 750 | 751 | int col = 0; 752 | unsigned short bin_count = record->get_bin_count(); 753 | QString bin_number_list; 754 | for(unsigned short n = 0; n < bin_count; n++) 755 | { 756 | QString temp; 757 | temp.sprintf("%u", record->get_bin_number(n)); 758 | if(n != bin_count-1) temp += " ,"; 759 | bin_number_list += temp; 760 | } 761 | 762 | table_set_value(i, col++, bin_count); // NUM_BINS 763 | table_set_value(i, col++, bin_number_list); // RTST_BIN 764 | } 765 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 766 | ui->RecordTableWidget->resizeColumnsToContents(); 767 | } 768 | 769 | void MainWindow::ShowStdfSDR() 770 | { 771 | QStringList col_labels; 772 | 773 | unsigned int col_count = 20; 774 | unsigned int rec_count = stdf_file->get_count(SDR_TYPE); 775 | 776 | ui->RecordTableWidget->setRowCount(rec_count); 777 | ui->RecordTableWidget->setColumnCount(col_count); 778 | 779 | col_labels<<"HEAD_NUM"; 780 | col_labels<<"SITE_GRP"; 781 | col_labels<<"SITE_CNT"; 782 | col_labels<<"SITE_NUM"; 783 | col_labels<<"HAND_TYP"; 784 | col_labels<<"HAND_ID "; 785 | col_labels<<"CARD_TYP"; 786 | col_labels<<"CARD_ID "; 787 | col_labels<<"LOAD_TYP"; 788 | col_labels<<"LOAD_ID "; 789 | col_labels<<"DIB_TYP "; 790 | col_labels<<"DIB_ID "; 791 | col_labels<<"CABL_TYP"; 792 | col_labels<<"CABL_ID "; 793 | col_labels<<"CONT_TYP"; 794 | col_labels<<"CONT_ID "; 795 | col_labels<<"LASR_TYP"; 796 | col_labels<<"LASR_ID "; 797 | col_labels<<"EXTR_TYP"; 798 | col_labels<<"EXTR_ID "; 799 | 800 | for(unsigned int i = 0; i < rec_count; i++) 801 | { 802 | StdfSDR* record = (StdfSDR*)(stdf_file->get_record(SDR_TYPE, i)); 803 | 804 | int col = 0; 805 | unsigned int site_count = record->get_site_count(); 806 | QString site_number_list; 807 | for(unsigned int k = 0; k < site_count; k++) 808 | { 809 | QString temp; 810 | temp.sprintf("%u", record->get_site_number(k)); 811 | if(k != site_count-1) temp+= ", "; 812 | site_number_list += temp; 813 | } 814 | 815 | table_set_value(i, col++, record->get_head_number()); // HEAD_NUM 816 | table_set_value(i, col++, record->get_site_group_number()); // SITE_GRP 817 | table_set_value(i, col++, site_count); // SITE_CNT 818 | table_set_value(i, col++, site_number_list); // SITE_NUM 819 | table_set_value(i, col++, record->get_handler_type()); // HAND_TYP 820 | table_set_value(i, col++, record->get_handler_id()); // HAND_ID 821 | table_set_value(i, col++, record->get_probecard_type()); // CARD_TYP 822 | table_set_value(i, col++, record->get_probecard_id()); // CARD_ID 823 | table_set_value(i, col++, record->get_loadboard_type()); // LOAD_TYP 824 | table_set_value(i, col++, record->get_loadboard_id()); // LOAD_ID 825 | table_set_value(i, col++, record->get_dibboard_type()); // DIB_TYP 826 | table_set_value(i, col++, record->get_dibboard_id()); // DIB_ID 827 | table_set_value(i, col++, record->get_cable_type()); // CABL_TYP 828 | table_set_value(i, col++, record->get_cable_id()); // CABL_ID 829 | table_set_value(i, col++, record->get_contactor_type()); // CONT_TYP 830 | table_set_value(i, col++, record->get_contactor_id()); // CONT_ID 831 | table_set_value(i, col++, record->get_laser_type()); // LASR_TYP 832 | table_set_value(i, col++, record->get_laser_id()); // LASR_ID 833 | table_set_value(i, col++, record->get_equipment_type()); // EXTR_TYP 834 | table_set_value(i, col++, record->get_equipment_id()); // EXTR_ID 835 | } 836 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 837 | ui->RecordTableWidget->resizeColumnsToContents(); 838 | } 839 | 840 | void MainWindow::ShowStdfWIR() 841 | { 842 | QStringList col_labels; 843 | 844 | unsigned int col_count = 4; 845 | unsigned int rec_count = stdf_file->get_count(WIR_TYPE); 846 | 847 | QProgressBar progress_bar(ui->RecordTableWidget); 848 | progress_bar.setRange(0, rec_count); 849 | progress_bar.setAlignment(Qt::AlignCenter); 850 | progress_bar.show(); 851 | 852 | ui->RecordTableWidget->setRowCount(0); 853 | ui->RecordTableWidget->setColumnCount(col_count); 854 | 855 | col_labels<<"HEAD_NUM"; 856 | col_labels<<"SITE_GRP"; 857 | col_labels<<"START_T"; 858 | col_labels<<"WAFER_ID"; 859 | 860 | for(unsigned int i = 0; i < rec_count; i++) 861 | { 862 | ui->RecordTableWidget->insertRow(i); 863 | StdfWIR* record = (StdfWIR*)(stdf_file->get_record(WIR_TYPE, i)); 864 | 865 | int col = 0; 866 | table_set_value(i, col++, record->get_head_number()); // HEAD_NUM 867 | table_set_value(i, col++, record->get_group_number());// SITE_GRP 868 | table_set_value(i, col++, record->get_start_time()); // START_T 869 | table_set_value(i, col++, record->get_wafer_id()); // WAFER_ID 870 | progress_bar.setValue(i); 871 | } 872 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 873 | ui->RecordTableWidget->resizeColumnsToContents(); 874 | } 875 | 876 | void MainWindow::ShowStdfWRR() 877 | { 878 | QStringList col_labels; 879 | 880 | unsigned int col_count = 14; 881 | unsigned int rec_count = stdf_file->get_count(WRR_TYPE); 882 | 883 | QProgressBar progress_bar(ui->RecordTableWidget); 884 | progress_bar.setRange(0, rec_count); 885 | progress_bar.setAlignment(Qt::AlignCenter); 886 | progress_bar.show(); 887 | 888 | ui->RecordTableWidget->setRowCount(0); 889 | ui->RecordTableWidget->setColumnCount(col_count); 890 | 891 | col_labels<<"HEAD_NUM"; 892 | col_labels<<"SITE_GRP"; 893 | col_labels<<"FINISH_T"; 894 | col_labels<<"PART_CNT"; 895 | col_labels<<"RTST_CNT"; 896 | col_labels<<"ABRT_CNT"; 897 | col_labels<<"GOOD_CNT"; 898 | col_labels<<"FUNC_CNT"; 899 | col_labels<<"WAFER_ID"; 900 | col_labels<<"FABWF_ID"; 901 | col_labels<<"FRAME_ID"; 902 | col_labels<<"MASK_ID"; 903 | col_labels<<"USR_DESC"; 904 | col_labels<<"EXC_DESC"; 905 | 906 | for(unsigned int i = 0; i < rec_count; i++) 907 | { 908 | ui->RecordTableWidget->insertRow(i); 909 | StdfWRR* record = (StdfWRR*)(stdf_file->get_record(WRR_TYPE, i)); 910 | 911 | int col = 0; 912 | table_set_value(i, col++, record->get_head_number()); // HEAD_NUM 913 | table_set_value(i, col++, record->get_group_number()); // SITE_GRP 914 | table_set_value(i, col++, record->get_finish_time()); // FINISH_T 915 | table_set_value(i, col++, record->get_part_count()); // PART_CNT 916 | table_set_value(i, col++, record->get_retest_count()); // RTST_CNT 917 | table_set_value(i, col++, record->get_abort_count()); // ABRT_CNT 918 | table_set_value(i, col++, record->get_pass_count()); // GOOD_CNT 919 | table_set_value(i, col++, record->get_func_count()); // FUNC_CNT 920 | table_set_value(i, col++, record->get_wafer_id()); // WAFER_ID 921 | table_set_value(i, col++, record->get_fabwafer_id()); // FABWF_ID 922 | table_set_value(i, col++, record->get_frame_id()); // FRAME_ID 923 | table_set_value(i, col++, record->get_mask_id()); // MASK_ID 924 | table_set_value(i, col++, record->get_user_discription());// USR_DESC 925 | table_set_value(i, col++, record->get_exec_discription());// EXC_DESC 926 | progress_bar.setValue(i); 927 | } 928 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 929 | ui->RecordTableWidget->resizeColumnsToContents(); 930 | } 931 | 932 | void MainWindow::ShowStdfWCR() 933 | { 934 | QStringList col_labels; 935 | 936 | unsigned int col_count = 9; 937 | unsigned int rec_count = stdf_file->get_count(WCR_TYPE); 938 | 939 | ui->RecordTableWidget->setRowCount(rec_count); 940 | ui->RecordTableWidget->setColumnCount(col_count); 941 | 942 | col_labels<<"WAFR_SIZ"; 943 | col_labels<<"DIE_HT"; 944 | col_labels<<"DIE_WID"; 945 | col_labels<<"WF_UNITS"; 946 | col_labels<<"WF_FLAT"; 947 | col_labels<<"CENTER_X"; 948 | col_labels<<"CENTER_Y"; 949 | col_labels<<"POS_X"; 950 | col_labels<<"POS_Y"; 951 | 952 | for(unsigned int i = 0; i < rec_count; i++) 953 | { 954 | StdfWCR* record = (StdfWCR*)(stdf_file->get_record(WCR_TYPE, i)); 955 | 956 | int col = 0; 957 | QString wafer_unit; 958 | unsigned char unit_code = record->get_wafer_unit(); 959 | switch(unit_code) 960 | { 961 | case 1: wafer_unit = "Inches"; break; 962 | case 2: wafer_unit = "Centimeters"; break; 963 | case 3: wafer_unit = "Millimeters"; break; 964 | case 4: wafer_unit = "Mils"; break; 965 | default: wafer_unit = "Unknown"; break; 966 | } 967 | 968 | table_set_value(i, col++, record->get_wafer_size()); // WAFR_SIZ 969 | table_set_value(i, col++, record->get_die_height()); // DIE_HT 970 | table_set_value(i, col++, record->get_die_width()); // DIE_WID 971 | table_set_value(i, col++, wafer_unit); // WF_UNITS 972 | table_set_value(i, col++, record->get_wafer_flat()); // WF_FLAT 973 | table_set_value(i, col++, record->get_center_x()); // CENTER_X 974 | table_set_value(i, col++, record->get_center_y()); // CENTER_Y 975 | table_set_value(i, col++, record->get_positive_x()); // POS_X 976 | table_set_value(i, col++, record->get_positive_y()); // POS_Y 977 | } 978 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 979 | ui->RecordTableWidget->resizeColumnsToContents(); 980 | } 981 | 982 | void MainWindow::ShowStdfPIR() 983 | { 984 | QStringList col_labels; 985 | 986 | unsigned int col_count = 2; 987 | unsigned int rec_count = stdf_file->get_count(PIR_TYPE); 988 | 989 | QProgressBar progress_bar(ui->RecordTableWidget); 990 | progress_bar.setRange(0, rec_count); 991 | progress_bar.setAlignment(Qt::AlignCenter); 992 | progress_bar.show(); 993 | 994 | ui->RecordTableWidget->setRowCount(0); 995 | ui->RecordTableWidget->setColumnCount(col_count); 996 | 997 | col_labels<<"HEAD_NUM"; 998 | col_labels<<"SITE_NUM"; 999 | 1000 | for(unsigned int i = 0; i < rec_count; i++) 1001 | { 1002 | ui->RecordTableWidget->insertRow(i); 1003 | StdfPIR* record = (StdfPIR*)(stdf_file->get_record(PIR_TYPE, i)); 1004 | 1005 | int col = 0; 1006 | table_set_value(i, col++, record->get_head_number()); // HEAD_NUM 1007 | table_set_value(i, col++, record->get_site_number()); // SITE_NUM 1008 | progress_bar.setValue(i); 1009 | } 1010 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 1011 | ui->RecordTableWidget->resizeColumnsToContents(); 1012 | } 1013 | 1014 | void MainWindow::ShowStdfPRR() 1015 | { 1016 | QStringList col_labels; 1017 | 1018 | unsigned int col_count = 11; 1019 | unsigned int rec_count = stdf_file->get_count(PRR_TYPE); 1020 | 1021 | QProgressBar progress_bar(ui->RecordTableWidget); 1022 | progress_bar.setRange(0, rec_count); 1023 | progress_bar.setAlignment(Qt::AlignCenter); 1024 | progress_bar.show(); 1025 | 1026 | ui->RecordTableWidget->setRowCount(0); 1027 | ui->RecordTableWidget->setColumnCount(col_count); 1028 | 1029 | col_labels<<"HEAD_NUM"; 1030 | col_labels<<"SITE_NUM"; 1031 | col_labels<<"PART_FLG"; 1032 | col_labels<<"NUM_TEST"; 1033 | col_labels<<"HARD_BIN"; 1034 | col_labels<<"SOFT_BIN"; 1035 | col_labels<<"X_COORD"; 1036 | col_labels<<"Y_COORD"; 1037 | col_labels<<"TEST_T(MS)"; 1038 | col_labels<<"PART_ID"; 1039 | col_labels<<"PART_TXT"; 1040 | 1041 | for(unsigned int i = 0; i < rec_count; i++) 1042 | { 1043 | ui->RecordTableWidget->insertRow(i); 1044 | StdfPRR* record = (StdfPRR*)(stdf_file->get_record(PRR_TYPE, i)); 1045 | 1046 | int col = 0; 1047 | table_set_value(i, col++, record->get_head_number()); // HEAD_NUM 1048 | table_set_value(i, col++, record->get_site_number()); // SITE_NUM 1049 | table_set_flag(i, col++, record->get_part_information_flag()); // PART_FLG 1050 | table_set_value(i, col++, record->get_number_test()); // NUM_TEST 1051 | table_set_value(i, col++, record->get_hardbin_number()); // HARD_BIN 1052 | table_set_value(i, col++, record->get_softbin_number()); // SOFT_BIN 1053 | table_set_value(i, col++, record->get_x_coordinate()); // X_COORD 1054 | table_set_value(i, col++, record->get_y_coordinate()); // Y_COORD 1055 | table_set_value(i, col++, record->get_elapsed_ms()); // TEST_T(MS) 1056 | table_set_value(i, col++, record->get_part_id()); // PART_ID 1057 | table_set_value(i, col++, record->get_part_discription()); // PART_TXT 1058 | progress_bar.setValue(i); 1059 | } 1060 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 1061 | ui->RecordTableWidget->resizeColumnsToContents(); 1062 | } 1063 | 1064 | void MainWindow::ShowStdfTSR() 1065 | { 1066 | QStringList col_labels; 1067 | 1068 | unsigned int col_count = 16; 1069 | unsigned int rec_count = stdf_file->get_count(TSR_TYPE); 1070 | 1071 | QProgressBar progress_bar(ui->RecordTableWidget); 1072 | progress_bar.setRange(0, rec_count); 1073 | progress_bar.setAlignment(Qt::AlignCenter); 1074 | progress_bar.show(); 1075 | 1076 | ui->RecordTableWidget->setRowCount(0); 1077 | ui->RecordTableWidget->setColumnCount(col_count); 1078 | 1079 | col_labels<<"HEAD_NUM"; 1080 | col_labels<<"SITE_NUM"; 1081 | col_labels<<"TEST_TYP"; 1082 | col_labels<<"TEST_NUM"; 1083 | col_labels<<"EXEC_CNT"; 1084 | col_labels<<"FAIL_CNT"; 1085 | col_labels<<"ALRM_CNT"; 1086 | col_labels<<"TEST_NAM"; 1087 | col_labels<<"SEQ_NAME"; 1088 | col_labels<<"TEST_LBL"; 1089 | col_labels<<"OPT_FLAG"; 1090 | col_labels<<"TEST_TIM(S)"; 1091 | col_labels<<"TEST_MIN"; 1092 | col_labels<<"TEST_MAX"; 1093 | col_labels<<"TST_SUMS"; 1094 | col_labels<<"TST_SQRS"; 1095 | 1096 | for(unsigned int i = 0; i < rec_count; i++) 1097 | { 1098 | ui->RecordTableWidget->insertRow(i); 1099 | 1100 | StdfTSR* record = (StdfTSR*)(stdf_file->get_record(TSR_TYPE, i)); 1101 | 1102 | int col = 0; 1103 | table_set_value(i, col++, record->get_head_number()); // HEAD_NUM 1104 | table_set_value(i, col++, record->get_site_number()); // SITE_NUM 1105 | table_set_value(i, col++, record->get_test_type()); // TEST_TYP 1106 | table_set_value(i, col++, record->get_test_number()); // TEST_NUM 1107 | table_set_value(i, col++, record->get_exec_count()); // EXEC_CNT 1108 | table_set_value(i, col++, record->get_fail_count()); // FAIL_CNT 1109 | table_set_value(i, col++, record->get_alarm_count()); // ALRM_CNT 1110 | table_set_value(i, col++, record->get_test_name()); // TEST_NAM 1111 | table_set_value(i, col++, record->get_sequencer_name()); // SEQ_NAME 1112 | table_set_value(i, col++, record->get_test_label()); // TEST_LBL 1113 | table_set_flag(i, col++, record->get_optional_data_flag()); // OPT_FLAG 1114 | table_set_value(i, col++, record->get_average_time_s()); // TEST_TIM(S) 1115 | table_set_value(i, col++, record->get_result_min()); // TEST_MIN 1116 | table_set_value(i, col++, record->get_result_max()); // TEST_MAX 1117 | table_set_value(i, col++, record->get_result_sum()); // TST_SUMS 1118 | table_set_value(i, col++, record->get_result_squares_sum()); // TST_SQRS 1119 | 1120 | progress_bar.setValue(i); 1121 | } 1122 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 1123 | ui->RecordTableWidget->resizeColumnsToContents(); 1124 | } 1125 | void MainWindow::ShowStdfPTR() 1126 | { 1127 | QStringList col_labels; 1128 | 1129 | unsigned int col_count = 21; 1130 | unsigned int rec_count = stdf_file->get_count(PTR_TYPE); 1131 | 1132 | QProgressBar progress_bar(ui->RecordTableWidget); 1133 | progress_bar.setRange(0, rec_count); 1134 | progress_bar.setAlignment(Qt::AlignCenter); 1135 | progress_bar.show(); 1136 | 1137 | 1138 | ui->RecordTableWidget->setColumnCount(col_count); 1139 | ui->RecordTableWidget->setRowCount(0); 1140 | 1141 | col_labels<<"Part ID"; 1142 | col_labels<<"TEST_NUM"; 1143 | col_labels<<"HEAD_NUM"; 1144 | col_labels<<"SITE_NUM"; 1145 | col_labels<<"TEST_FLG"; 1146 | col_labels<<"PARM_FLG"; 1147 | col_labels<<"RESULT"; 1148 | col_labels<<"TEST_TXT"; 1149 | col_labels<<"ALARM_ID"; 1150 | col_labels<<"OPT_FLAG"; 1151 | col_labels<<"RES_SCAL"; 1152 | col_labels<<"LLM_SCAL"; 1153 | col_labels<<"HLM_SCAL"; 1154 | col_labels<<"LO_LIMIT"; 1155 | col_labels<<"HI_LIMIT"; 1156 | col_labels<<"UNITS"; 1157 | col_labels<<"C_RESFMT"; 1158 | col_labels<<"C_LLMFMT"; 1159 | col_labels<<"C_HLMFMT"; 1160 | col_labels<<"LO_SPEC"; 1161 | col_labels<<"HI_SPEC"; 1162 | 1163 | unsigned int record_count = stdf_file->get_total_count(); 1164 | unsigned int index_count = 0; 1165 | std::vector temp_ptrs; 1166 | for(unsigned int n = 0; n < record_count; n++) 1167 | { 1168 | StdfRecord* record = stdf_file->get_record(n); 1169 | if(record->type() == PIR_TYPE) 1170 | { 1171 | temp_ptrs.clear(); 1172 | continue; 1173 | } 1174 | if(record->type() == PRR_TYPE) 1175 | { 1176 | unsigned int ptr_count = temp_ptrs.size(); 1177 | StdfPRR* temp_prr = static_cast(record); 1178 | const char* part_id = temp_prr->get_part_id(); 1179 | for(unsigned int i = 0; i < ptr_count; i++) 1180 | { 1181 | ui->RecordTableWidget->insertRow(index_count); 1182 | StdfPTR* record = temp_ptrs[i]; 1183 | 1184 | int col = 0; 1185 | table_set_value(index_count, col++, part_id); 1186 | table_set_value(index_count, col++, record->get_test_number()); // TEST_NUM 1187 | table_set_value(index_count, col++, record->get_head_number()); // HEAD_NUM 1188 | table_set_value(index_count, col++, record->get_site_number()); // SITE_NUM 1189 | table_set_flag (index_count, col++, record->get_test_flag()); // TEST_FLG 1190 | table_set_flag (index_count, col++, record->get_parametric_test_flag()); // PARM_FLG 1191 | table_set_value(index_count, col++, record->get_result()); // RESULT 1192 | table_set_value(index_count, col++, record->get_test_text()); // TEST_TXT 1193 | table_set_value(index_count, col++, record->get_alarm_id()); // ALARM_ID 1194 | table_set_flag(index_count, col++, record->get_optional_data_flag()); // OPT_FLAG 1195 | table_set_value(index_count, col++, record->get_result_exponent()); // RES_SCAL 1196 | table_set_value(index_count, col++, record->get_lowlimit_exponent()); // LLM_SCAL 1197 | table_set_value(index_count, col++, record->get_highlimit_exponent()); // HLM_SCAL 1198 | table_set_value(index_count, col++, record->get_low_limit()); // LO_LIMIT 1199 | table_set_value(index_count, col++, record->get_high_limit()); // HI_LIMIT 1200 | table_set_value(index_count, col++, record->get_unit()); // UNITS 1201 | table_set_value(index_count, col++, record->get_result_format()); // C_RESFMT 1202 | table_set_value(index_count, col++, record->get_lowlimit_format()); // C_LLMFMT 1203 | table_set_value(index_count, col++, record->get_highlimit_format()); // C_HLMFMT 1204 | table_set_value(index_count, col++, record->get_low_spec()); // LO_SPEC 1205 | table_set_value(index_count, col++, record->get_high_spec()); // HI_SPEC 1206 | 1207 | progress_bar.setValue(index_count); 1208 | index_count++; 1209 | } 1210 | continue; 1211 | } 1212 | if(record->type() == PTR_TYPE) 1213 | { 1214 | temp_ptrs.push_back(static_cast(record)); 1215 | continue; 1216 | } 1217 | } 1218 | 1219 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 1220 | ui->RecordTableWidget->resizeColumnsToContents(); 1221 | } 1222 | 1223 | void MainWindow::ShowStdfMPR() 1224 | { 1225 | QStringList col_labels; 1226 | 1227 | unsigned int col_count = 27; 1228 | unsigned int rec_count = stdf_file->get_count(MPR_TYPE); 1229 | 1230 | QProgressBar progress_bar(ui->RecordTableWidget); 1231 | progress_bar.setRange(0, rec_count); 1232 | progress_bar.setAlignment(Qt::AlignCenter); 1233 | progress_bar.show(); 1234 | 1235 | ui->RecordTableWidget->setRowCount(0); 1236 | ui->RecordTableWidget->setColumnCount(col_count); 1237 | 1238 | col_labels<<"TEST_NUM"; 1239 | col_labels<<"HEAD_NUM"; 1240 | col_labels<<"SITE_NUM"; 1241 | col_labels<<"TEST_FLG"; 1242 | col_labels<<"PARM_FLG"; 1243 | col_labels<<"RTN_ICNT"; 1244 | col_labels<<"RSLT_CNT"; 1245 | col_labels<<"RTN_STAT"; 1246 | col_labels<<"RTN_RSLT"; 1247 | col_labels<<"TEST_TXT"; 1248 | col_labels<<"ALARM_ID"; 1249 | col_labels<<"OPT_FLAG"; 1250 | col_labels<<"RES_SCAL"; 1251 | col_labels<<"LLM_SCAL"; 1252 | col_labels<<"HLM_SCAL"; 1253 | col_labels<<"LO_LIMIT"; 1254 | col_labels<<"HI_LIMIT"; 1255 | col_labels<<"START_IN"; 1256 | col_labels<<"INCR_IN"; 1257 | col_labels<<"RTN_INDX"; 1258 | col_labels<<"UNITS"; 1259 | col_labels<<"UNITS_IN"; 1260 | col_labels<<"C_RESFMT"; 1261 | col_labels<<"C_LLMFMT"; 1262 | col_labels<<"C_HLMFMT"; 1263 | col_labels<<"LO_SPEC"; 1264 | col_labels<<"HI_SPEC"; 1265 | 1266 | for(unsigned int i = 0; i < rec_count; i++) 1267 | { 1268 | ui->RecordTableWidget->insertRow(i); 1269 | StdfMPR* record = (StdfMPR*)(stdf_file->get_record(MPR_TYPE, i)); 1270 | 1271 | int col = 0; 1272 | unsigned short pin_count = record->get_pin_count(); 1273 | QString return_state_list; 1274 | for(unsigned short n = 0; n < pin_count; n++) 1275 | { 1276 | QString temp; 1277 | temp.sprintf("%u", record->get_return_state(n)); 1278 | if(n != pin_count-1) temp += ", "; 1279 | return_state_list += temp; 1280 | } 1281 | QString pin_index_list; 1282 | for(unsigned short n = 0; n < pin_count; n++) 1283 | { 1284 | QString temp; 1285 | temp.sprintf("%u", record->get_pin_index(n)); 1286 | if(n != pin_count-1) temp += ", "; 1287 | pin_index_list += temp; 1288 | } 1289 | 1290 | unsigned short result_count = record->get_result_count(); 1291 | QString return_result_list; 1292 | for(unsigned short n = 0; n < result_count; n++) 1293 | { 1294 | QString temp; 1295 | temp.sprintf("%f", record->get_return_result(n)); 1296 | if(n != result_count-1) temp += ", "; 1297 | return_result_list += temp; 1298 | } 1299 | 1300 | table_set_value(i, col++, record->get_test_number()); // TEST_NUM 1301 | table_set_value(i, col++, record->get_head_number()); // HEAD_NUM 1302 | table_set_value(i, col++, record->get_site_number()); // SITE_NUM 1303 | table_set_flag(i, col++, record->get_test_flag()); // TEST_FLG 1304 | table_set_flag(i, col++, record->get_parametric_test_flag());// PARM_FLG 1305 | table_set_value(i, col++, pin_count); // RTN_ICNT 1306 | table_set_value(i, col++, result_count); // RSLT_CNT 1307 | table_set_value(i, col++, return_state_list); // RTN_STAT 1308 | table_set_value(i, col++, return_result_list); // RTN_RSLT 1309 | table_set_value(i, col++, record->get_test_text()); // TEST_TXT 1310 | table_set_value(i, col++, record->get_alarm_id()); // ALARM_ID 1311 | table_set_flag(i, col++, record->get_optional_data_flag()); // OPT_FLAG 1312 | table_set_value(i, col++, record->get_result_exponent()); // RES_SCAL 1313 | table_set_value(i, col++, record->get_lowlimit_exponent()); // LLM_SCAL 1314 | table_set_value(i, col++, record->get_highlimit_exponent()); // HLM_SCAL 1315 | table_set_value(i, col++, record->get_low_limit()); // LO_LIMIT 1316 | table_set_value(i, col++, record->get_high_limit()); // HI_LIMIT 1317 | table_set_value(i, col++, record->get_starting_input()); // START_IN 1318 | table_set_value(i, col++, record->get_increment_input()); // INCR_IN 1319 | table_set_value(i, col++, pin_index_list); // RTN_INDX 1320 | table_set_value(i, col++, record->get_unit()); // UNITS 1321 | table_set_value(i, col++, record->get_unit_input()); // UNITS_IN 1322 | table_set_value(i, col++, record->get_result_format()); // C_RESFMT 1323 | table_set_value(i, col++, record->get_lowlimit_format()); // C_LLMFMT 1324 | table_set_value(i, col++, record->get_highlimit_format()); // C_HLMFMT 1325 | table_set_value(i, col++, record->get_low_spec()); // LO_SPEC 1326 | table_set_value(i, col++, record->get_high_spec()); // HI_SPEC 1327 | progress_bar.setValue(i); 1328 | } 1329 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 1330 | ui->RecordTableWidget->resizeColumnsToContents(); 1331 | } 1332 | 1333 | void MainWindow::ShowStdfFTR() 1334 | { 1335 | QStringList col_labels; 1336 | 1337 | unsigned int col_count = 28; 1338 | unsigned int rec_count = stdf_file->get_count(FTR_TYPE); 1339 | 1340 | QProgressBar progress_bar(ui->RecordTableWidget); 1341 | progress_bar.setRange(0, rec_count); 1342 | progress_bar.setAlignment(Qt::AlignCenter); 1343 | progress_bar.show(); 1344 | 1345 | ui->RecordTableWidget->setRowCount(0); 1346 | ui->RecordTableWidget->setColumnCount(col_count); 1347 | 1348 | col_labels<<"TEST_NUM"; 1349 | col_labels<<"HEAD_NUM"; 1350 | col_labels<<"SITE_NUM"; 1351 | col_labels<<"TEST_FLG"; 1352 | col_labels<<"OPT_FLAG"; 1353 | col_labels<<"CYCL_CNT"; 1354 | col_labels<<"REL_VADR"; 1355 | col_labels<<"REPT_CNT"; 1356 | col_labels<<"NUM_FAIL"; 1357 | col_labels<<"XFAIL_AD"; 1358 | col_labels<<"YFAIL_AD"; 1359 | col_labels<<"VECT_OFF"; 1360 | col_labels<<"RTN_ICNT"; 1361 | col_labels<<"PGM_ICNT"; 1362 | col_labels<<"RTN_INDX"; 1363 | col_labels<<"RTN_STAT"; 1364 | col_labels<<"PGM_INDX"; 1365 | col_labels<<"PGM_STAT"; 1366 | col_labels<<"FAIL_PIN"; 1367 | col_labels<<"VECT_NAM"; 1368 | col_labels<<"TIME_SET"; 1369 | col_labels<<"OP_CODE"; 1370 | col_labels<<"TEST_TXT"; 1371 | col_labels<<"ALARM_ID"; 1372 | col_labels<<"PROG_TXT"; 1373 | col_labels<<"RSLT_TXT"; 1374 | col_labels<<"PATG_NUM"; 1375 | col_labels<<"SPIN_MAP"; 1376 | 1377 | for(unsigned int i = 0; i < rec_count; i++) 1378 | { 1379 | ui->RecordTableWidget->insertRow(i); 1380 | StdfFTR* record = (StdfFTR*)(stdf_file->get_record(FTR_TYPE, i)); 1381 | 1382 | int col = 0; 1383 | unsigned short pin_count = record->get_pin_count(); 1384 | QString pin_number_list; 1385 | for(unsigned short n = 0; n < pin_count; n++) 1386 | { 1387 | QString temp; 1388 | temp.sprintf("%u", record->get_pin_number(n)); 1389 | if(n != pin_count-1) temp += ", "; 1390 | pin_number_list += temp; 1391 | } 1392 | 1393 | QString pin_state_list; 1394 | for(unsigned short n = 0; n < pin_count; n++) 1395 | { 1396 | QString temp; 1397 | temp.sprintf("%u", record->get_pin_state(n)); 1398 | if(n != pin_count-1) temp += ", "; 1399 | pin_state_list += temp; 1400 | } 1401 | 1402 | unsigned short program_state_count = record->get_program_state_count(); 1403 | QString program_index_list; 1404 | for(unsigned short n = 0; n < program_state_count; n++) 1405 | { 1406 | QString temp; 1407 | temp.sprintf("%u", record->get_program_index(n)); 1408 | if(n != program_state_count-1) temp += ", "; 1409 | program_index_list += temp; 1410 | } 1411 | 1412 | QString program_state_list; 1413 | for(unsigned short n = 0; n < program_state_count; n++) 1414 | { 1415 | QString temp; 1416 | temp.sprintf("%u", record->get_program_state(n)); 1417 | if(n != program_state_count-1) temp += ", "; 1418 | program_state_list += temp; 1419 | } 1420 | 1421 | QString failpin_data_list; 1422 | for(unsigned short n = 0; n < record->get_failpin_data_count(); n++) 1423 | { 1424 | QString temp; 1425 | temp.sprintf("%u", record->get_failpin_data(n)); 1426 | failpin_data_list += temp; 1427 | } 1428 | 1429 | QString bitmap_data_bits; 1430 | for(unsigned short n = 0; n < record->get_bitmap_data_count(); n++) 1431 | { 1432 | QString temp; 1433 | temp.sprintf("%u", record->get_bitmap_data(n)); 1434 | bitmap_data_bits += temp; 1435 | } 1436 | 1437 | table_set_value(i, col++, record->get_test_number()); // TEST_NUM 1438 | table_set_value(i, col++, record->get_head_number()); // HEAD_NUM 1439 | table_set_value(i, col++, record->get_site_number()); // SITE_NUM 1440 | table_set_flag(i, col++, record->get_test_flag()); // TEST_FLG 1441 | table_set_flag(i, col++, record->get_optional_data_flag()); // OPT_FLAG 1442 | table_set_value(i, col++, record->get_cycle_count()); // CYCL_CNT 1443 | table_set_value(i, col++, record->get_relative_address()); // REL_VADR 1444 | table_set_value(i, col++, record->get_repeat_count()); // REPT_CNT 1445 | table_set_value(i, col++, record->get_failpin_count()); // NUM_FAIL 1446 | table_set_value(i, col++, record->get_xfail_address()); // XFAIL_AD 1447 | table_set_value(i, col++, record->get_yfail_address()); // YFAIL_AD 1448 | table_set_value(i, col++, record->get_vector_offset()); // VECT_OFF 1449 | table_set_value(i, col++, pin_count); // RTN_ICNT 1450 | table_set_value(i, col++, program_state_count); // PGM_ICNT 1451 | table_set_value(i, col++, pin_number_list); // RTN_INDX 1452 | table_set_value(i, col++, pin_state_list); // RTN_STAT 1453 | table_set_value(i, col++, program_index_list); // PGM_INDX 1454 | table_set_value(i, col++, program_state_list); // PGM_STAT 1455 | table_set_value(i, col++, failpin_data_list); // FAIL_PIN 1456 | table_set_value(i, col++, record->get_vector_pattern_name()); // VECT_NAM 1457 | table_set_value(i, col++, record->get_timeset_name()); // TIME_SET 1458 | table_set_value(i, col++, record->get_vector_op_code()); // OP_CODE 1459 | table_set_value(i, col++, record->get_test_text()); // TEST_TXT 1460 | table_set_value(i, col++, record->get_alarm_id()); // ALARM_ID 1461 | table_set_value(i, col++, record->get_program_text()); // PROG_TXT 1462 | table_set_value(i, col++, record->get_result_text()); // RSLT_TXT 1463 | table_set_value(i, col++, record->get_pattern_genertor_number()); // PATG_NUM 1464 | table_set_value(i, col++, bitmap_data_bits); // SPIN_MAP 1465 | 1466 | progress_bar.setValue(i); 1467 | } 1468 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 1469 | ui->RecordTableWidget->resizeColumnsToContents(); 1470 | } 1471 | 1472 | void MainWindow::ShowStdfBPS() 1473 | { 1474 | QStringList col_labels; 1475 | 1476 | unsigned int col_count = 1; 1477 | unsigned int rec_count = stdf_file->get_count(BPS_TYPE); 1478 | 1479 | ui->RecordTableWidget->setRowCount(rec_count); 1480 | ui->RecordTableWidget->setColumnCount(col_count); 1481 | 1482 | col_labels<<"SEQ_NAME"; 1483 | 1484 | for(unsigned int i = 0; i < rec_count; i++) 1485 | { 1486 | StdfBPS* record = (StdfBPS*)(stdf_file->get_record(BPS_TYPE, i)); 1487 | 1488 | int col = 0; 1489 | table_set_value(i, col++, record->get_section_name()); // SEQ_NAME 1490 | 1491 | } 1492 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 1493 | ui->RecordTableWidget->resizeColumnsToContents(); 1494 | } 1495 | 1496 | void MainWindow::ShowStdfEPS() 1497 | { 1498 | QStringList col_labels; 1499 | 1500 | unsigned int col_count = 1; 1501 | unsigned int rec_count = stdf_file->get_count(EPS_TYPE); 1502 | 1503 | ui->RecordTableWidget->setRowCount(rec_count); 1504 | ui->RecordTableWidget->setColumnCount(col_count); 1505 | 1506 | col_labels<<"EPS"; 1507 | 1508 | for(unsigned int i = 0; i < rec_count; i++) 1509 | { 1510 | //StdfEPS* record = (StdfEPS*)(stdf_file->get_record(EPS_TYPE, i)); 1511 | int col = 0; 1512 | table_set_value(i, col++, QString("EPS")); 1513 | } 1514 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 1515 | ui->RecordTableWidget->resizeColumnsToContents(); 1516 | } 1517 | 1518 | void MainWindow::ShowStdfGDR() 1519 | { 1520 | QStringList col_labels; 1521 | 1522 | unsigned int col_count = 2; 1523 | unsigned int rec_count = stdf_file->get_count(GDR_TYPE); 1524 | 1525 | ui->RecordTableWidget->setRowCount(rec_count); 1526 | ui->RecordTableWidget->setColumnCount(col_count); 1527 | 1528 | col_labels<<"FLD_CNT"; 1529 | col_labels<<"GEN_DATA"; 1530 | 1531 | for(unsigned int i = 0; i < rec_count; i++) 1532 | { 1533 | StdfGDR* record = (StdfGDR*)(stdf_file->get_record(GDR_TYPE, i)); 1534 | 1535 | int col = 0; 1536 | table_set_value(i, col++, record->get_data_count()); // FLD_CNT 1537 | table_set_value(i, col++, QString("Not Parse.")); // GEN_DATA 1538 | } 1539 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 1540 | ui->RecordTableWidget->resizeColumnsToContents(); 1541 | } 1542 | 1543 | void MainWindow::ShowStdfDTR() 1544 | { 1545 | QStringList col_labels; 1546 | 1547 | unsigned int col_count = 1; 1548 | unsigned int rec_count = stdf_file->get_count(DTR_TYPE); 1549 | 1550 | ui->RecordTableWidget->setRowCount(rec_count); 1551 | ui->RecordTableWidget->setColumnCount(col_count); 1552 | 1553 | col_labels<<"TEXT_DAT"; 1554 | 1555 | for(unsigned int i = 0; i < rec_count; i++) 1556 | { 1557 | StdfDTR* record = (StdfDTR*)(stdf_file->get_record(DTR_TYPE, i)); 1558 | 1559 | int col = 0; 1560 | table_set_value(i, col++, record->get_text_data()); // TEXT_DAT 1561 | 1562 | } 1563 | ui->RecordTableWidget->setHorizontalHeaderLabels(col_labels); 1564 | ui->RecordTableWidget->resizeColumnsToContents(); 1565 | } 1566 | 1567 | 1568 | 1569 | void MainWindow::on_actionAbout_triggered() 1570 | { 1571 | QString title = QObject::tr("Update Information"); 1572 | QString message = QObject::tr("This Program Just for the STDF V4 Format Check, and Only Support the CPU_TYP = 2.\n"); 1573 | message += QObject::tr("--2016.04.08 Create New Program for STDF File Check.\n"); 1574 | message += QObject::tr("--2016.04.14 Refactoring Codes of STDF Part.\n"); 1575 | message += QObject::tr("--2016.06.07 Add Save As Function and Fixed STDF File Write Bug.\n"); 1576 | message += QObject::tr("--2017.01.12 Fiexd MIR missing PROC_ID bug.\n"); 1577 | message += QObject::tr("--2017.06.20 Add Save Tabel to CSV File.\n"); 1578 | message += QObject::tr("--2017.07.25 Refactoring the Debug Message Codes.\n"); 1579 | message += QObject::tr("--2017.07.26 Refactoring the Record Show Codes.\n"); 1580 | QMessageBox msgDlg(QMessageBox::Information, title, message, QMessageBox::Ok,NULL); 1581 | msgDlg.exec(); 1582 | } 1583 | 1584 | void MainWindow::on_actionHelp_triggered() 1585 | { 1586 | QString title = QObject::tr("Help Information"); 1587 | QString message; 1588 | message += QObject::tr("1. Open An STDF File\n"); 1589 | message += QObject::tr("2. The Records Show in the ListBox at Left\n"); 1590 | message += QObject::tr("3. Select the Record Type in ListBox\n"); 1591 | message += QObject::tr("4. The Detials Show in the Table at Right\n"); 1592 | QMessageBox msgDlg(QMessageBox::Information, title, message, QMessageBox::Ok,NULL); 1593 | msgDlg.exec(); 1594 | } 1595 | 1596 | void MainWindow::on_SaveChangeButton_clicked() 1597 | { 1598 | QFileDialog *dialog = new QFileDialog(this); 1599 | dialog->setWindowTitle("Save STDF File"); 1600 | dialog->setNameFilter("STDF Files(*.stdf)"); 1601 | dialog->setDefaultSuffix("stdf"); 1602 | dialog->setAcceptMode(QFileDialog::AcceptSave); 1603 | 1604 | if(dialog->exec() == QDialog::Accepted) 1605 | { 1606 | QString savefile = dialog->selectedFiles()[0]; 1607 | int ret = stdf_file->save(savefile.toLocal8Bit().data()); 1608 | if(ret == 0) 1609 | { 1610 | QMessageBox::information(this,tr("Save File Success"), tr("Save STDF File Success."),QMessageBox::Ok); 1611 | } 1612 | else 1613 | { 1614 | QMessageBox::critical(this,tr("Save File Failure"), tr("Save STDF File Failure."),QMessageBox::Ok); 1615 | } 1616 | } 1617 | delete dialog; 1618 | } 1619 | 1620 | 1621 | void MainWindow::SaveTableToFile() 1622 | { 1623 | QFileDialog file_dialog(this); 1624 | file_dialog.setWindowTitle(tr("Save Table to CSV File")); 1625 | file_dialog.setNameFilter(tr("CSV Files(*.csv)")); 1626 | file_dialog.setDefaultSuffix("csv"); 1627 | file_dialog.setAcceptMode(QFileDialog::AcceptSave); 1628 | 1629 | if(file_dialog.exec() == QDialog::Accepted) 1630 | { 1631 | QString filename = file_dialog.selectedFiles()[0]; 1632 | QFile file(filename); 1633 | bool ret = file.open( QIODevice::Truncate | QIODevice::WriteOnly); 1634 | if(!ret) 1635 | { 1636 | QMessageBox::critical(this, tr("Save File Error"), tr("Save Table To File Failure."),QMessageBox::Ok); 1637 | return; 1638 | } 1639 | 1640 | QTextStream stream(&file); 1641 | QString conTents; 1642 | QHeaderView * header = ui->RecordTableWidget->horizontalHeader();//ui.m_pTable->horizontalHeader() ; 1643 | if (header) 1644 | { 1645 | for ( int i = 0; i < header->count(); i++ ) 1646 | { 1647 | QTableWidgetItem *item = ui->RecordTableWidget->horizontalHeaderItem(i); 1648 | if (!item) 1649 | { 1650 | conTents += ","; 1651 | continue; 1652 | } 1653 | conTents += item->text() + ","; 1654 | } 1655 | conTents += "\n"; 1656 | } 1657 | 1658 | for ( int i = 0 ; i < ui->RecordTableWidget->rowCount(); i++ ) 1659 | { 1660 | for ( int j = 0; j < ui->RecordTableWidget->columnCount(); j++ ) 1661 | { 1662 | 1663 | QTableWidgetItem* item = ui->RecordTableWidget->item(i, j); 1664 | if ( !item ) 1665 | { 1666 | conTents += ","; 1667 | continue; 1668 | } 1669 | QString str = item->text(); 1670 | str.replace(","," "); 1671 | conTents += str + ","; 1672 | } 1673 | conTents += "\n"; 1674 | } 1675 | stream << conTents; 1676 | file.close(); 1677 | QMessageBox::information(this,tr("Save File Success"), tr("Save Table to CSV File Success."),QMessageBox::Ok); 1678 | } 1679 | } 1680 | --------------------------------------------------------------------------------