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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
//*******************************************************************
// Zasor2 - viewer
// 2021.03.06 - 2025.02.16
// v. 038
//*******************************************************************
import processing.pdf.*;
//String filePath = "data/"; // путь для сохранения копии файла базы
//String filePath1; // путь для сохранения файла базы (Ядиск)
String filePathLog = "LogFile.txt";
String put = "data/"; // путь для сохранения копии файла настроек
String filePath;
String otwes = put + "OTWESY/"; // путь для сохранения отвесов
int count = 0;
int select = 0;
int selectData = 0;
int selectDataEdit = 0;
int h = 17;
int w = 80;
int otH = 13;
int otW = 10;
int shift = 10;
boolean flagHighlight = false;
boolean flagWork = false;
boolean flagBoss = false;
boolean flagNext = false;
int[] tablo = {10, 30, 1350, 900};
int[] tabloW = {0, 40, 135, 270, 335, 370, 435, 500, 565, 630, 690,
745, 955, 1035, 1110, 1185, 1270, tablo[2]};
String[][] data = new String[60][20];
String inputData = "";
int numberReport;
int millisOld = 0;
String time, timeArh, timeMonth, timeDate, timeExc, timeReport;
int index = 0;
int sumN1 = 0;
int sumN = 0;
int sumChist = 0;
int sumArenda = 0;
int sumDopSor = 0;
int sumSum = 0;
int rowCount = 0;
int s = tablo[1] + tablo[3] - 11;
Table table;
PFont myFont;
//*****************************************************
void settings() {
size(tablo[2] + 20, tablo[3] + 60);
}
void setup() {
//myFont = createFont("Arial", 12, true);
//textFont(myFont);
loadSetup();
//JSONArray values;
//values = loadJSONArray(put + "source.json");
//JSONObject animal = values.getJSONObject(0);
//filePath = animal.getString("filePath");
//println(filePath);
table = loadTable(filePath + "base.csv");
if (table == null) {
fill(0);
textSize(50);
text("File 'base.csv' not found !", 50, 150);
}
}
//*****************************************************
void draw() {
if (millis() >= millisOld + 1000) {
table = loadTable(filePath + "base.csv", "header");
if (table.getRowCount() == rowCount) {
return;
} else {
rowCount = table.getRowCount();
fill(255);
rect(tablo[0], tablo[1], tablo[2], tablo[3]);
reset();
}
}
}
//*****************************************************
// выбор папки с файлами:
void folderSelected(File selection) {
if (selection == null) {
println("Window was closed or the user hit cancel.");
stop();
System.exit(1);
} else {
filePath = selection.getAbsolutePath() + "/";
filePath = filePath.replace("\\", "/");
println(filePath);
flagWork = true;
}
}
//****************************************************
void reset() {
count = 0;
sumN1 = 0;
sumN = 0;
sumChist = 0;
sumArenda = 0;
sumDopSor = 0;
sumSum = 0;
visible();
}
//****************************************************
String printData(String d) {
String d1 = "";
if (d.length() == 0 || d.length() == 1) {
d1 = "";
} else if (d.length() < 2) {
d1 = d.substring(d.length() - 1, d.length());
} else if (d.length() < 3) {
d1 = d.substring(d.length() - 2, d.length());
} else if (d.length() < 4) {
d1 = d.substring(d.length() - 3, d.length());
} else if (d.length() < 5) {
d1 = d.substring(d.length() - 4, d.length() - 3) + "'" + d.substring(d.length() - 3, d.length());
} else if (d.length() < 6) {
d1 = d.substring(d.length() - 5, d.length() - 3) + "'" + d.substring(d.length() - 3, d.length());
} else if (d.length() < 7) {
d1 = d.substring(d.length() - 6, d.length() - 3) + "'" + d.substring(d.length() - 3, d.length());
} else if (d.length() < 8) {
d1 = d.substring(d.length() - 7, d.length() - 6) + "'" + d.substring(d.length() - 6, d.length() - 3) + "'" + d.substring(d.length() - 3, d.length());
}
return d1;
}
//*****************************************************
// вывод времени
void TimeString() {
String D = "";
String H = "";
String M = "";
String S = "";
String Y = "";
String N = "";
Y += year();
N += (month() < 10) ? "0" + month() : month();
D += (day() < 10) ? "0" + day() : day();
H += (hour() < 10) ? "0" + hour() : hour();
M += (minute() < 10) ? "0" + minute() : minute();
S += (second() < 10) ? "0" + second() : second();
time = H + ":" + M + ":" + S;
timeArh = H + M + S;
timeMonth = N;
timeDate = D;
timeExc = D + "_" + H + ":" + M + ":" + S;
timeReport = Y + N + "_" + D;
}
//*****************************************************
// Запись в файл лога:
void printFileLog(String dataLog) {
TimeString();
String[] lines = {};
if (loadStrings(filePathLog) == null) {
saveStrings(put + filePathLog, lines);
lines = loadStrings(filePathLog);
}
loadStrings(filePathLog);
lines = append(lines, timeReport + "_" + timeArh + " vi " + dataLog);
saveStrings(put + filePathLog, lines);
}
//*****************************************************
|