-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsettings.h
63 lines (49 loc) · 1.73 KB
/
settings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// settings.h
#ifndef SETTINGS_H
#define SETTINGS_H
#include <stdio.h>
#include <string>
#include <vector>
#include "config.h"
#include "file.h"
#include "chipdatabase.h"
class CSettings
{
CFileBuffer f;
static bool IsNumber(char ch) { return '0' <= ch && ch <= '9'; }
static bool IsAlpha(char ch) { return ('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z') || (ch == '_') || (ch == '.'); }
static bool IsAlphaNum(char ch) { return IsAlpha(ch) || IsNumber(ch); }
static bool IsWhitespace(char ch) { return (ch == ' ') || (ch == '\t') || (ch == '\n') || (ch == '\r'); }
void SkipWhitespace();
void SkipComment();
void SkipToTag();
void ReadTag(std::string &tag);
bool ReadBool();
int ReadInt(int min, int max);
void ReadString(std::string &s);
void ReadWaferMask();
void ReadWaferExclude();
void Init();
public:
CSettings() { Init(); }
bool Read(const char filename[]);
// --- data --------------------------------------------------------------
int dtbId; // force to open special board (-1 = any connected board)
std::string scriptPath; // script path
int proberPort; // prober serial port nr (-1 = no prober)
int rocType; // 0 = analog ROC, 1 = digital ROC, 2 = PROC600
bool sensor; // sensor mounted
// cable length: 5 48 prober 450 cm bump bonder
int deser160_clkDelay; // 4 0 19 5 16
int deser160_tinDelay; // 4 4 5 6 5
int adc_tinDelay;
int adc_toutDelay;
int adc_clkDelay;
int cableLength; // adapter cable length in mm
int errorRep; // # test rep if defect chip
std::string waferList;
bool IsWaferList() { return waferList.length() != 0; }
std::string waferMask;
std::vector<CChipPos> waferExclude;
};
#endif