개정판 7a8645c9
dev issue #1229 : text, note modeling
Change-Id: I67bf903df65b6940447b62777565d3c0918d2f52
DTI_PID/APIDConverter/AutoModeling.cs | ||
---|---|---|
172 | 172 |
{ |
173 | 173 |
SplashScreenManager.Default.SendCommand(APIDSplashScreen.SplashScreenCommand.SetAllProgress, document.Notes.Count); |
174 | 174 |
SplashScreenManager.Default.SendCommand(APIDSplashScreen.SplashScreenCommand.SetStep, "Note Modeling"); |
175 |
foreach (var item in document.Texts)
|
|
175 |
foreach (var item in document.Notes)
|
|
176 | 176 |
{ |
177 |
TextModeling(item);
|
|
177 |
NoteModeling(item);
|
|
178 | 178 |
SplashScreenManager.Default.SendCommand(APIDSplashScreen.SplashScreenCommand.UpProgress, null); |
179 | 179 |
} |
180 | 180 |
} |
... | ... | |
248 | 248 |
if (text.Aveva.LabelType == LabelType.SingleText) |
249 | 249 |
DrawText(text.Aveva.X, text.Aveva.Y, text.Aveva.Height, text.VALUE); |
250 | 250 |
else if (text.Aveva.LabelType == LabelType.MultiText) |
251 |
DrawMultiLineText(text.Aveva.X, text.Aveva.Y, text.Aveva.Width, text.VALUE); |
|
251 |
{ |
|
252 |
string[] valueArray = text.VALUE.Split(new string[] { "\n" }, StringSplitOptions.None); |
|
253 |
List<string> values = new List<string>(); |
|
254 |
for (int i = 0; i < valueArray.Length; i++) |
|
255 |
values.Insert(0, valueArray[i]); |
|
256 |
|
|
257 |
for (int i = 0; i < values.Count; i++) |
|
258 |
{ |
|
259 |
double x = text.Aveva.X; |
|
260 |
double y = text.Aveva.Y; |
|
261 |
int heightIndex = i; |
|
262 |
|
|
263 |
if (text.TextAngle == TextAngle.Degree0 || text.TextAngle == TextAngle.Degree180) |
|
264 |
y = y + text.Aveva.Height * i; |
|
265 |
else if (text.TextAngle == TextAngle.Degree90 || text.TextAngle == TextAngle.Degree270) |
|
266 |
x = x + text.Aveva.Height * i; |
|
267 |
|
|
268 |
DrawText(x, y, text.Aveva.Height, values[i]); |
|
269 |
} |
|
270 |
} |
|
271 |
|
|
252 | 272 |
|
253 | 273 |
} |
254 | 274 |
private void NoteModeling(Model.Note note) |
... | ... | |
259 | 279 |
if (note.Aveva.LabelType == LabelType.SingleNote) |
260 | 280 |
DrawText(note.Aveva.X, note.Aveva.Y, note.Aveva.Height, note.VALUE); |
261 | 281 |
else if (note.Aveva.LabelType == LabelType.MultiNote) |
262 |
DrawMultiLineText(note.Aveva.X, note.Aveva.Y, note.Aveva.Width, note.VALUE); |
|
282 |
{ |
|
283 |
string[] valueArray = note.VALUE.Split(new string[] { "\n" }, StringSplitOptions.None); |
|
284 |
List<string> values = new List<string>(); |
|
285 |
for (int i = 0; i < valueArray.Length; i++) |
|
286 |
values.Insert(0, valueArray[i]); |
|
287 |
|
|
288 |
for (int i = 0; i < values.Count; i++) |
|
289 |
{ |
|
290 |
double x = note.Aveva.X; |
|
291 |
double y = note.Aveva.Y; |
|
292 |
int heightIndex = i; |
|
293 |
|
|
294 |
if (note.TextAngle == TextAngle.Degree0 || note.TextAngle == TextAngle.Degree180) |
|
295 |
y = y + note.Aveva.Height * i; |
|
296 |
else if (note.TextAngle == TextAngle.Degree90 || note.TextAngle == TextAngle.Degree270) |
|
297 |
x = x + note.Aveva.Height * i; |
|
263 | 298 |
|
299 |
DrawText(x, y, note.Aveva.Height, values[i]); |
|
300 |
} |
|
301 |
} |
|
264 | 302 |
} |
265 | 303 |
#endregion |
266 | 304 |
|
내보내기 Unified diff