개정판 32e95118
최신 소스 취합 및 Convert내용 업데이트
ConvertService/ConverterService/ConverterStation/Classes/ServiceItem.cs | ||
---|---|---|
8 | 8 |
public class ServiceItem |
9 | 9 |
{ |
10 | 10 |
public IConverterPDF.RemConverterPDFObject RemotingSerivce {get;set;} |
11 |
public Guid ServiceID { get; set; }
|
|
11 |
public string ServiceID { get; set; }
|
|
12 | 12 |
} |
13 | 13 |
} |
ConvertService/ConverterService/ConverterStation/Remoting/ConverterService.cs | ||
---|---|---|
33 | 33 |
public TcpChannel channel { get; set; } |
34 | 34 |
public ServiceEventLog _log { get; set; } |
35 | 35 |
private ConverterServiceType SeriviceType { get; set; } |
36 |
private Guid ServiceID { get; set; }
|
|
36 |
private string ServiceID { get; set; }
|
|
37 | 37 |
private string _serviceID { get; set; } |
38 |
private Guid _ServiceID { get; set; }
|
|
38 |
private string _ServiceID { get; set; }
|
|
39 | 39 |
private Thread _ConverterPdfThread { get; set; } |
40 | 40 |
private Queue<CONVERTER_DOC> _WorkItems { get; set; } |
41 | 41 |
private List<CONVERTER_DOC> _thread { get; set; } |
... | ... | |
85 | 85 |
} |
86 | 86 |
} |
87 | 87 |
|
88 |
public ConverterPDFResult Notify(string ProjectNo, Guid ConverterID)
|
|
88 |
public ConverterPDFResult Notify(string ProjectNo, string ConverterID)
|
|
89 | 89 |
{ |
90 | 90 |
try |
91 | 91 |
{ |
... | ... | |
108 | 108 |
return new ConverterPDFResult { ConverterID = ConverterID, ProjectNo = ProjectNo }; |
109 | 109 |
} |
110 | 110 |
|
111 |
public Guid[] RunningProcessID()
|
|
111 |
public string[] RunningProcessID()
|
|
112 | 112 |
{ |
113 | 113 |
string[] _temp = _thread.Select(t => t.ID).ToArray(); |
114 |
Guid[] _return = new Guid[_temp.Length];
|
|
114 |
string[] _return = new string[_temp.Length];
|
|
115 | 115 |
|
116 | 116 |
for (int i = 0; i < _temp.Length; i++ ) |
117 | 117 |
{ |
118 |
_return[i] = Guid.Parse(_temp[i]);
|
|
118 |
_return[i] = _temp[i];
|
|
119 | 119 |
} |
120 | 120 |
|
121 | 121 |
return _return; |
... | ... | |
216 | 216 |
return _info.ToArray(); |
217 | 217 |
} |
218 | 218 |
|
219 |
public bool ServiceOn(Guid ServiceID)
|
|
219 |
public bool ServiceOn(string ServiceID)
|
|
220 | 220 |
{ |
221 | 221 |
try |
222 | 222 |
{ |
... | ... | |
263 | 263 |
|
264 | 264 |
if (_T.Count() > 0) |
265 | 265 |
{ |
266 |
Guid _id = Guid.Parse(_T.First().ID);
|
|
266 |
string _id = _T.First().ID;
|
|
267 | 267 |
SetConveterState(_id, IConverterPDF.ConverterStatus.Success); |
268 | 268 |
_thread.Remove((sender as DZConverterLib.DZConverter).ConverterItem); |
269 | 269 |
(sender as DZConverterLib.DZConverter).ConverterMakeError -= new EventHandler<MakeConverterErrorArgs>(dz_ConverterMakeError); |
... | ... | |
272 | 272 |
} |
273 | 273 |
else |
274 | 274 |
{ |
275 |
SetError(Guid.Parse((sender as DZConverterLib.DZConverter).ConverterItem.ID), "Thread Count 0", "Thread가 없습니다", 0);
|
|
275 |
SetError((sender as DZConverterLib.DZConverter).ConverterItem.ID, "Thread Count 0", "Thread가 없습니다", 0);
|
|
276 | 276 |
} |
277 | 277 |
|
278 | 278 |
if (_WorkItems.Count() == 0 && this.SeriviceType == ConverterServiceType.Main) |
... | ... | |
344 | 344 |
{ |
345 | 345 |
var serviceProperty = serviceProperties.First(); |
346 | 346 |
remotingPort = int.Parse(serviceProperty.SERVICE_PORT.ToString()); |
347 |
ServiceID = Guid.Parse(serviceProperty.ID);
|
|
347 |
ServiceID = serviceProperty.ID;
|
|
348 | 348 |
MultiProcessCount = serviceProperty.PROCESS_COUNT; |
349 | 349 |
SeriviceType = (ConverterServiceType)serviceProperty.SERVICET_TYPE; |
350 | 350 |
} |
... | ... | |
537 | 537 |
//강인구 |
538 | 538 |
_service.ForEach(s => |
539 | 539 |
{ |
540 |
_ServiceID = Guid.Parse(s.ID);
|
|
540 |
_ServiceID = s.ID;
|
|
541 | 541 |
if (s.ID != _serviceID && LstService.Where(ser => ser.ServiceID == _ServiceID).Count() == 0) |
542 | 542 |
{ |
543 | 543 |
System.Runtime.Remoting.Channels.IChannel _ch = ChannelServices.GetChannel("tcp"); |
... | ... | |
578 | 578 |
_ServiceStartRpt.AppendLine(f.ToString()); |
579 | 579 |
}); |
580 | 580 |
//여기 |
581 |
LstService.Add(new ServiceItem { RemotingSerivce = rem, ServiceID = Guid.Parse(s.ID) });
|
|
581 |
LstService.Add(new ServiceItem { RemotingSerivce = rem, ServiceID = s.ID });
|
|
582 | 582 |
} |
583 | 583 |
catch (Exception ex) |
584 | 584 |
{ |
... | ... | |
692 | 692 |
_stathread.Start(_item); //Parameter 전달 |
693 | 693 |
_thread.Add(_item); |
694 | 694 |
|
695 |
SetConveterState(Guid.Parse(_item.ID), IConverterPDF.ConverterStatus.Wait);
|
|
695 |
SetConveterState(_item.ID, IConverterPDF.ConverterStatus.Wait);
|
|
696 | 696 |
System.Diagnostics.Debug.WriteLine("Status Change : " + _item.ID); |
697 | 697 |
} |
698 | 698 |
} |
... | ... | |
708 | 708 |
for (int i = 0; i < LstService.Count; i++) |
709 | 709 |
{ |
710 | 710 |
int maxCount = LstService[i].RemotingSerivce.MultiProcessCount; |
711 |
Guid[] _id = LstService[i].RemotingSerivce.RunningProcessID();
|
|
711 |
string[] _id = LstService[i].RemotingSerivce.RunningProcessID();
|
|
712 | 712 |
|
713 | 713 |
if (maxCount > _id.Count()) |
714 | 714 |
{ |
715 |
var _conveter = LstService[i].RemotingSerivce.SetConverterPDF(_item.PROJECT_NO, Guid.Parse(_item.ID));
|
|
715 |
var _conveter = LstService[i].RemotingSerivce.SetConverterPDF(_item.PROJECT_NO, _item.ID);
|
|
716 | 716 |
|
717 | 717 |
if (_conveter.Exception == null) |
718 | 718 |
{ |
... | ... | |
737 | 737 |
_ConverterPdfThread = null; |
738 | 738 |
} |
739 | 739 |
|
740 |
private void SetConveterState(Guid ConverterID, IConverterPDF.ConverterStatus Status)
|
|
740 |
private void SetConveterState(string ConverterID, IConverterPDF.ConverterStatus Status)
|
|
741 | 741 |
{ |
742 | 742 |
using (DeepView_Entity _deepview = new DeepView_Entity(ConnectStringBuilder.DeepViewConnectionString().ToString())) |
743 | 743 |
{ |
... | ... | |
764 | 764 |
} |
765 | 765 |
} |
766 | 766 |
|
767 |
private void SetError(Guid ConverterID, string Msg, string Ex, int level)
|
|
767 |
private void SetError(string ConverterID, string Msg, string Ex, int level)
|
|
768 | 768 |
{ |
769 | 769 |
try |
770 | 770 |
{ |
ConvertService/ConverterService/ConvertionWebService/Conversion.asmx.cs | ||
---|---|---|
98 | 98 |
} |
99 | 99 |
else |
100 | 100 |
{ |
101 |
Guid _id = GetGuid(0, GuidGenerator.GetUniqueGuid());
|
|
101 |
string _id = GetGuid(0, GuidGenerator.GetUniqueGuid()).ToString();
|
|
102 | 102 |
|
103 | 103 |
using (DeepView_Entity _entity = new DeepView_Entity(ConnectStringBuilder.DeepViewConnectionString().ToString())) |
104 | 104 |
{ |
ConvertService/ConverterService/IConverterPDF/Cache.cs | ||
---|---|---|
27 | 27 |
return myInstance; |
28 | 28 |
} |
29 | 29 |
|
30 |
public ConverterPDFResult SetConverterPDF(string ProjectNo, Guid ConverterID)
|
|
30 |
public ConverterPDFResult SetConverterPDF(string ProjectNo, string ConverterID)
|
|
31 | 31 |
{ |
32 | 32 |
return Observer.Notify(ProjectNo, ConverterID); |
33 | 33 |
} |
... | ... | |
50 | 50 |
} |
51 | 51 |
} |
52 | 52 |
|
53 |
public Guid[] RunningProcessID()
|
|
53 |
public string[] RunningProcessID()
|
|
54 | 54 |
{ |
55 | 55 |
return Observer.RunningProcessID(); |
56 | 56 |
} |
... | ... | |
60 | 60 |
return Observer.TileSorceStorageInfomation(); |
61 | 61 |
} |
62 | 62 |
|
63 |
public bool ServiceOn(Guid ServiceID)
|
|
63 |
public bool ServiceOn(string ServiceID)
|
|
64 | 64 |
{ |
65 | 65 |
return Observer.ServiceOn(ServiceID); |
66 | 66 |
} |
ConvertService/ConverterService/IConverterPDF/InterfaceConverterPDF.cs | ||
---|---|---|
7 | 7 |
{ |
8 | 8 |
public interface InterfaceConverterPDF |
9 | 9 |
{ |
10 |
ConverterPDFResult Notify(string ProjectNo, Guid ConverterID);
|
|
10 |
ConverterPDFResult Notify(string ProjectNo, string ConverterID);
|
|
11 | 11 |
int MultiProcessCount { get; set; } |
12 |
Guid[] RunningProcessID();
|
|
12 |
string[] RunningProcessID();
|
|
13 | 13 |
ServiceInfo ServiceInfomation(); |
14 | 14 |
TileSorceStorageInfo[] TileSorceStorageInfomation(); |
15 |
bool ServiceOn(Guid ServiceID);
|
|
15 |
bool ServiceOn(string ServiceID);
|
|
16 | 16 |
|
17 | 17 |
} |
18 | 18 |
|
... | ... | |
20 | 20 |
public struct ConverterPDFResult |
21 | 21 |
{ |
22 | 22 |
public string ProjectNo; |
23 |
public Guid ConverterID;
|
|
23 |
public string ConverterID;
|
|
24 | 24 |
public int CurrentPage; |
25 | 25 |
public ConverterStatus Status; |
26 | 26 |
public string Exception; |
... | ... | |
29 | 29 |
[Serializable] |
30 | 30 |
public struct ServiceInfo |
31 | 31 |
{ |
32 |
public Guid ServiceID;
|
|
32 |
public string ServiceID;
|
|
33 | 33 |
public Uri ServiceUri; |
34 | 34 |
public TileSorceStorageInfo[] StorageInfo; |
35 | 35 |
public string Exception; |
ConvertService/ConverterService/IConverterPDF/RemConverterPDFObject.cs | ||
---|---|---|
21 | 21 |
} |
22 | 22 |
} |
23 | 23 |
|
24 |
public Guid[] RunningProcessID()
|
|
24 |
public string[] RunningProcessID()
|
|
25 | 25 |
{ |
26 | 26 |
return Cache.GetInstance().RunningProcessID(); |
27 | 27 |
} |
28 | 28 |
|
29 |
public ConverterPDFResult SetConverterPDF(string ProjectNo, Guid ConverterID)
|
|
29 |
public ConverterPDFResult SetConverterPDF(string ProjectNo, string ConverterID)
|
|
30 | 30 |
{ |
31 | 31 |
return Cache.GetInstance().SetConverterPDF(ProjectNo, ConverterID); |
32 | 32 |
} |
... | ... | |
41 | 41 |
return Cache.GetInstance().TileSorceStorageInfomation(); |
42 | 42 |
} |
43 | 43 |
|
44 |
public bool ServiceOn(Guid ServiceID)
|
|
44 |
public bool ServiceOn(string ServiceID)
|
|
45 | 45 |
{ |
46 | 46 |
return Cache.GetInstance().ServiceOn(ServiceID); |
47 | 47 |
} |
ConvertService/ConverterService/Main/PDFConverter/ConverterStation_Client/Program.cs | ||
---|---|---|
22 | 22 |
Console.ReadLine(); |
23 | 23 |
|
24 | 24 |
ConverterPDFResult _result = new ConverterPDFResult(); |
25 |
Guid _convertID = GuidGenerator.GetUniqueGuid();
|
|
25 |
string _convertID = GuidGenerator.GetUniqueGuid().ToString();
|
|
26 | 26 |
RemConverterPDFObject remObj =null; |
27 | 27 |
TcpChannel chan=null; |
28 | 28 |
Guid ID = Guid.Parse("837c4435-595b-b651-742f-63b811b1813e"); |
ConvertService/ConverterService/Main/PDFConverter/ConverterStation_Console/Classses/ServiceItem.cs | ||
---|---|---|
9 | 9 |
public class ServiceItem |
10 | 10 |
{ |
11 | 11 |
public IConverterPDF.RemConverterPDFObject RemotingSerivce { get; set; } |
12 |
public Guid ServiceID { get; set; }
|
|
12 |
public string ServiceID { get; set; }
|
|
13 | 13 |
} |
14 | 14 |
} |
ConvertService/ConverterService/Main/PDFConverter/ConverterStation_Console/Service/ConverterService.cs | ||
---|---|---|
32 | 32 |
public TcpChannel channel { get; set; } |
33 | 33 |
public ServiceEventLog _log { get; set; } |
34 | 34 |
private ConverterServiceType SeriviceType { get; set; } |
35 |
private Guid ServiceID { get; set; }
|
|
35 |
private string ServiceID { get; set; }
|
|
36 | 36 |
private string _serviceID { get; set; } |
37 |
private Guid _ServiceID { get; set; }
|
|
37 |
private string _ServiceID { get; set; }
|
|
38 | 38 |
private Thread _ConverterPdfThread { get; set; } |
39 | 39 |
private Queue<CONVERTER_DOC> _WorkItems { get; set; } |
40 | 40 |
private List<CONVERTER_DOC> _thread { get; set; } |
... | ... | |
84 | 84 |
} |
85 | 85 |
} |
86 | 86 |
|
87 |
public ConverterPDFResult Notify(string ProjectNo, Guid ConverterID)
|
|
87 |
public ConverterPDFResult Notify(string ProjectNo, string ConverterID)
|
|
88 | 88 |
{ |
89 | 89 |
try |
90 | 90 |
{ |
... | ... | |
107 | 107 |
return new ConverterPDFResult { ConverterID = ConverterID, ProjectNo = ProjectNo }; |
108 | 108 |
} |
109 | 109 |
|
110 |
public Guid[] RunningProcessID()
|
|
110 |
public string[] RunningProcessID()
|
|
111 | 111 |
|
112 | 112 |
{ |
113 | 113 |
|
114 | 114 |
string[] _temp = _thread.Select(t => t.ID).ToArray(); |
115 |
Guid[] _return = new Guid[_temp.Length];
|
|
115 |
string[] _return = new string[_temp.Length];
|
|
116 | 116 |
|
117 | 117 |
for (int i = 0; i < _temp.Length; i++) |
118 | 118 |
{ |
119 |
_return[i] = Guid.Parse(_temp[i]);
|
|
119 |
_return[i] = _temp[i];
|
|
120 | 120 |
} |
121 | 121 |
|
122 | 122 |
return _return; |
... | ... | |
217 | 217 |
return _info.ToArray(); |
218 | 218 |
} |
219 | 219 |
|
220 |
public bool ServiceOn(Guid ServiceID)
|
|
220 |
public bool ServiceOn(string ServiceID)
|
|
221 | 221 |
{ |
222 | 222 |
try |
223 | 223 |
{ |
... | ... | |
263 | 263 |
|
264 | 264 |
if (_T.Count() > 0) |
265 | 265 |
{ |
266 |
Guid _id = Guid.Parse(_T.First().ID);
|
|
266 |
string _id = _T.First().ID;
|
|
267 | 267 |
SetConveterState(_id.ToString(), IConverterPDF.ConverterStatus.Success); |
268 | 268 |
_thread.Remove((sender as DZConverterLib.DZConverter).ConverterItem); |
269 | 269 |
(sender as DZConverterLib.DZConverter).ConverterMakeError -= new EventHandler<MakeConverterErrorArgs>(dz_ConverterMakeError); |
... | ... | |
272 | 272 |
} |
273 | 273 |
else |
274 | 274 |
{ |
275 |
SetError(Guid.Parse((sender as DZConverterLib.DZConverter).ConverterItem.ID), "Thread Count 0", "Thread가 없습니다", 0);
|
|
275 |
SetError((sender as DZConverterLib.DZConverter).ConverterItem.ID, "Thread Count 0", "Thread가 없습니다", 0);
|
|
276 | 276 |
} |
277 | 277 |
|
278 | 278 |
if (_WorkItems.Count() == 0 && this.SeriviceType == ConverterServiceType.Main) |
... | ... | |
316 | 316 |
{ |
317 | 317 |
var serviceProperty = serviceProperties.First(); |
318 | 318 |
remotingPort = int.Parse(serviceProperty.SERVICE_PORT.ToString()); |
319 |
ServiceID = Guid.Parse(serviceProperty.ID);
|
|
319 |
ServiceID = serviceProperty.ID;
|
|
320 | 320 |
MultiProcessCount = serviceProperty.PROCESS_COUNT; |
321 | 321 |
SeriviceType = (ConverterServiceType)serviceProperty.SERVICET_TYPE; |
322 | 322 |
SettingCompleted = true; |
... | ... | |
521 | 521 |
|
522 | 522 |
_service.ForEach(s => |
523 | 523 |
{ |
524 |
_ServiceID = Guid.Parse(s.ID);
|
|
524 |
_ServiceID = s.ID;
|
|
525 | 525 |
if (s.ID != _serviceID && LstService.Where(ser => ser.ServiceID == _ServiceID).Count() == 0) |
526 | 526 |
{ |
527 | 527 |
System.Runtime.Remoting.Channels.IChannel _ch = ChannelServices.GetChannel("tcp"); |
... | ... | |
562 | 562 |
_ServiceStartRpt.AppendLine(f.ToString()); |
563 | 563 |
}); |
564 | 564 |
//여기 |
565 |
LstService.Add(new ServiceItem { RemotingSerivce = rem, ServiceID = Guid.Parse(s.ID) });
|
|
565 |
LstService.Add(new ServiceItem { RemotingSerivce = rem, ServiceID = s.ID });
|
|
566 | 566 |
} |
567 | 567 |
catch (Exception ex) |
568 | 568 |
{ |
... | ... | |
688 | 688 |
for (int i = 0; i < LstService.Count; i++) |
689 | 689 |
{ |
690 | 690 |
int maxCount = LstService[i].RemotingSerivce.MultiProcessCount; |
691 |
Guid[] _id = LstService[i].RemotingSerivce.RunningProcessID();
|
|
691 |
string[] _id = LstService[i].RemotingSerivce.RunningProcessID();
|
|
692 | 692 |
|
693 | 693 |
if (maxCount > _id.Count()) |
694 | 694 |
{ |
695 |
var _conveter = LstService[i].RemotingSerivce.SetConverterPDF(_item.PROJECT_NO, Guid.Parse(_item.ID));
|
|
695 |
var _conveter = LstService[i].RemotingSerivce.SetConverterPDF(_item.PROJECT_NO, _item.ID);
|
|
696 | 696 |
|
697 | 697 |
if (_conveter.Exception == null) |
698 | 698 |
{ |
... | ... | |
743 | 743 |
} |
744 | 744 |
} |
745 | 745 |
|
746 |
private void SetError(Guid ConverterID, string Msg, string Ex, int level)
|
|
746 |
private void SetError(string ConverterID, string Msg, string Ex, int level)
|
|
747 | 747 |
{ |
748 | 748 |
try |
749 | 749 |
{ |
KCOM/Controls/AdornerFinal.xaml.cs | ||
---|---|---|
102 | 102 |
SetAdornerMember(objectData as CommentUserInfo); |
103 | 103 |
this.Focus(); |
104 | 104 |
} |
105 |
public AdornerFinal(List<CommentUserInfo> objectData) : this() |
|
105 |
public AdornerFinal(List<CommentUserInfo> objectData) : this()
|
|
106 | 106 |
{ |
107 | 107 |
InitializeComponent(); |
108 | 108 |
foreach (var item in objectData) |
... | ... | |
203 | 203 |
break; |
204 | 204 |
case "TriControl": |
205 | 205 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.Triangle, ThumbList = new List<Thumb>() }); |
206 |
break; |
|
206 |
break;
|
|
207 | 207 |
case "CircleControl": |
208 | 208 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.Circle, ThumbList = new List<Thumb>() }); |
209 | 209 |
break; |
... | ... | |
253 | 253 |
DragThumb.RenderTransform = new RotateTransform() |
254 | 254 |
{ |
255 | 255 |
Angle = (member as TextControl).Angle, |
256 |
//CenterX = middle.X, |
|
257 |
//CenterY = middle.Y, |
|
258 | 256 |
}; |
259 | 257 |
|
260 | 258 |
AdornerBorder.RenderTransformOrigin = new Point(0.0, 0.0); |
261 | 259 |
AdornerBorder.RenderTransform = new RotateTransform() |
262 | 260 |
{ |
263 | 261 |
Angle = (member as TextControl).Angle, |
264 |
//CenterX = middle.X, |
|
265 |
//CenterY = middle.Y, |
|
266 | 262 |
}; |
267 | 263 |
Observable.FromEventPattern(((TextControl)member), "PropertyChanged").Subscribe(a => |
268 | 264 |
{ |
... | ... | |
279 | 275 |
this.ContainerContent.Children.Remove(member); |
280 | 276 |
this.Visibility = Visibility.Collapsed; |
281 | 277 |
} |
282 |
|
|
283 |
//((TextControl)member).UnEditingMode(); |
|
284 |
//((TextControl)member).Base_TextBlock.Visibility = Visibility.Collapsed; |
|
285 |
//((TextControl)member).Base_Border.Visibility = Visibility.Collapsed; |
|
286 |
//((TextControl)member).Base_TextPath.Visibility = Visibility.Collapsed; |
|
287 | 278 |
}); |
288 | 279 |
break; |
289 | 280 |
default: |
... | ... | |
366 | 357 |
case "RectCloudControl": |
367 | 358 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.RectCloud, ThumbList = new List<Thumb>() }); |
368 | 359 |
break; |
369 |
//강인구 추가 |
|
360 |
//강인구 추가
|
|
370 | 361 |
case "SignControl": |
371 | 362 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.Sign, ThumbList = new List<Thumb>() }); |
372 | 363 |
break; |
... | ... | |
439 | 430 |
{ |
440 | 431 |
if ((MemberSet.First().DrawingData as TextControl).Angle != 0) |
441 | 432 |
{ |
433 |
///TODO: 원점 설정 |
|
442 | 434 |
trRotate.Angle = (MemberSet.First().DrawingData as TextControl).Angle; |
443 | 435 |
trRotateThumb.Angle = (MemberSet.First().DrawingData as TextControl).Angle; |
444 | 436 |
} |
... | ... | |
466 | 458 |
textControlWidth = ((currentControl as TextControl).Base_TextBox.ActualWidth); |
467 | 459 |
textControlHeight = ((currentControl as TextControl).Base_TextBox.ActualHeight); |
468 | 460 |
} |
469 |
|
|
470 | 461 |
//Border 사이즈 불필요 |
471 | 462 |
|
472 | 463 |
//if ((currentControl as TextControl).LineSize.Left == 0) |
... | ... | |
497 | 488 |
// textControlHeight += 8; |
498 | 489 |
// } |
499 | 490 |
//} |
500 |
|
|
501 | 491 |
if ((currentControl as TextControl).EndPoint.X < minX) |
502 | 492 |
{ |
503 | 493 |
minX = (currentControl as TextControl).EndPoint.X; |
... | ... | |
696 | 686 |
{ |
697 | 687 |
var temp = (MemberSet.First() as AdornerMember).DrawingData as ArrowTextControl; |
698 | 688 |
|
699 |
|
|
689 |
|
|
700 | 690 |
switch (Math.Abs(temp.Angle).ToString()) |
701 | 691 |
{ |
702 | 692 |
case "90": |
... | ... | |
1048 | 1038 |
|
1049 | 1039 |
DynamicThumbUpdate(control); |
1050 | 1040 |
BorderUpdate(); |
1051 |
|
|
1041 |
|
|
1052 | 1042 |
//if (control.DrawingData.GetType().Name == "ArrowTextControl") |
1053 | 1043 |
//{ |
1054 | 1044 |
// Thumb tm = control.ThumbList.Last(); |
... | ... | |
1093 | 1083 |
} |
1094 | 1084 |
break; |
1095 | 1085 |
#endregion |
1096 |
//강인구 추가
|
|
1086 |
//강인구 추가
|
|
1097 | 1087 |
#region Sign |
1098 | 1088 |
case ControlType.Sign: |
1099 | 1089 |
if (nearPoint.Equals(AllControl.PointSet[i])) |
... | ... | |
1320 | 1310 |
else |
1321 | 1311 |
IsTextAngle = false; |
1322 | 1312 |
|
1323 |
//System.Diagnostics.Debug.WriteLine("X축 : " + e.GetPosition(this).X + "LastRotateVerticalValue : " + LastRotateVerticalValue);
|
|
1313 |
System.Diagnostics.Debug.WriteLine("X축 : " + e.GetPosition(this).X + "LastRotateVerticalValue : " + LastRotateVerticalValue); |
|
1324 | 1314 |
LastRotateVerticalValue = e.GetPosition(this).X; |
1325 | 1315 |
} |
1326 | 1316 |
else |
1327 | 1317 |
{ |
1328 |
//System.Diagnostics.Debug.WriteLine("e.GetPosition(this).X : " + e.GetPosition(this).X);
|
|
1329 |
//System.Diagnostics.Debug.WriteLine("LastRotateHorizontalValue: " + LastRotateHorizontalValue);
|
|
1318 |
System.Diagnostics.Debug.WriteLine("e.GetPosition(this).X : " + e.GetPosition(this).X); |
|
1319 |
System.Diagnostics.Debug.WriteLine("LastRotateHorizontalValue: " + LastRotateHorizontalValue); |
|
1330 | 1320 |
|
1331 | 1321 |
if (e.GetPosition(this).X > LastRotateHorizontalValue) |
1332 | 1322 |
{ |
... | ... | |
1395 | 1385 |
(item.DrawingData as TextControl).StartPoint = |
1396 | 1386 |
new Point(Canvas.GetLeft((item.DrawingData as TextControl)) + e.HorizontalChange / 5, Canvas.GetTop((item.DrawingData as TextControl)) + e.VerticalChange / 5); |
1397 | 1387 |
(item.DrawingData as TextControl).EndPoint = (item.DrawingData as TextControl).StartPoint; |
1398 |
|
|
1399 |
(item.DrawingData as TextControl).CanvasX = (item.DrawingData as TextControl).StartPoint.X; |
|
1400 |
(item.DrawingData as TextControl).CanvasY = (item.DrawingData as TextControl).StartPoint.Y; |
|
1401 | 1388 |
} |
1402 | 1389 |
#endregion |
1403 | 1390 |
#region 날짜 |
... | ... | |
1422 | 1409 |
temp.DrawingCloud(); |
1423 | 1410 |
} |
1424 | 1411 |
#endregion |
1425 |
#region 심볼 |
|
1412 |
//#region 심볼
|
|
1426 | 1413 |
//if (item.Drawingtype == MarkupType.Viewbox) |
1427 | 1414 |
//{ |
1428 | 1415 |
// DynamicThumbUpdate(e, item); |
1429 | 1416 |
// BorderUpdate(); |
1430 | 1417 |
//} |
1431 |
#endregion |
|
1432 |
#region 폴리곤확장 |
|
1418 |
//#endregion
|
|
1419 |
//#region 폴리곤확장
|
|
1433 | 1420 |
//if (item.Drawingtype == MarkupType.PolygonEx) |
1434 | 1421 |
//{ |
1435 | 1422 |
// Point px = new Point(e.HorizontalChange, e.VerticalChange); |
... | ... | |
1462 | 1449 |
// //} |
1463 | 1450 |
// //(item.DrawingData as IPath).updateControl(); |
1464 | 1451 |
//} |
1465 |
#endregion |
|
1452 |
//#endregion
|
|
1466 | 1453 |
#region 폴리곤 |
1467 | 1454 |
if (item.Drawingtype == ControlType.PolygonControl) |
1468 | 1455 |
{ |
... | ... | |
2122 | 2109 |
// } |
2123 | 2110 |
//} |
2124 | 2111 |
} |
2112 |
|
|
2125 | 2113 |
/// <summary> |
2126 | 2114 |
/// 회전 |
2127 | 2115 |
/// </summary> |
... | ... | |
2129 | 2117 |
/// <param name="e"></param> |
2130 | 2118 |
public void rotate_DragDelta(object sender, DragDeltaEventArgs e) |
2131 | 2119 |
{ |
2132 |
|
|
2133 | 2120 |
MoveRotate(e); |
2134 | 2121 |
} |
2135 | 2122 |
|
... | ... | |
2202 | 2189 |
{ |
2203 | 2190 |
if (item.DrawingData.GetType().Name == "TextControl") |
2204 | 2191 |
{ |
2205 |
//if (AngleValue == 0) |
|
2206 |
//{ |
|
2207 |
// AngleValue = (item.DrawingData as TextControl).Angle; |
|
2208 |
//} |
|
2209 | 2192 |
//double X = Canvas.GetLeft((item.DrawingData as TextControl)); |
2210 | 2193 |
//double Y = Canvas.GetTop((item.DrawingData as TextControl)); |
2211 |
//AllPointSet.Add(new Point(X,Y)); |
|
2212 |
if (AngleValue == 0) |
|
2213 |
{ |
|
2214 |
AngleValue = (item.DrawingData as TextControl).Angle; |
|
2215 |
} |
|
2216 |
double X = Canvas.GetLeft((item.DrawingData as TextControl)); |
|
2217 |
double Y = Canvas.GetTop((item.DrawingData as TextControl)); |
|
2218 |
AllPointSet.Add(new Point(X, Y)); |
|
2194 |
//AllPointSet.Add(new Point(X, Y)); |
|
2195 |
AllPointSet.Add((item.DrawingData as TextControl).StartPoint); |
|
2219 | 2196 |
} |
2220 | 2197 |
else |
2221 | 2198 |
{ |
... | ... | |
2229 | 2206 |
CenterPoint = MathSet.FindCentroid(AllPointSet); |
2230 | 2207 |
Point pt = Mouse.GetPosition(this); |
2231 | 2208 |
|
2232 |
|
|
2233 |
|
|
2234 |
|
|
2235 |
//if ((MemberSet.First() as AdornerMember).DrawingData.GetType().Name != "TextControl") |
|
2236 |
//{ |
|
2237 | 2209 |
Point vec1 = new Point(this.rotatePoint.X - CenterPoint.X, this.rotatePoint.Y - CenterPoint.Y); |
2238 | 2210 |
Point vec2 = new Point(pt.X - CenterPoint.X, pt.Y - CenterPoint.Y); |
2239 | 2211 |
dDeltaAngle = (MathSet.getAngleBetweenVectors(vec1, vec2)); |
2240 | 2212 |
|
2241 |
System.Diagnostics.Debug.WriteLine("vec1 : " + vec1.X + "/" + vec1.Y); |
|
2242 |
System.Diagnostics.Debug.WriteLine("vec2 : " + vec2.X + "/" + vec2.Y); |
|
2243 |
System.Diagnostics.Debug.WriteLine("dDeltaAngle : " + dDeltaAngle); |
|
2244 |
|
|
2245 |
//} |
|
2246 |
//else |
|
2247 |
//{ |
|
2248 |
//if (IsTextAngle || RotateFlag) |
|
2249 |
//{ |
|
2250 |
// AngleValue = ((MemberSet.First() as AdornerMember).DrawingData as TextControl).Angle + 5; |
|
2251 |
//} |
|
2252 |
//else |
|
2253 |
//{ |
|
2254 |
// AngleValue = ((MemberSet.First() as AdornerMember).DrawingData as TextControl).Angle - 5; |
|
2255 |
//} |
|
2256 |
//} |
|
2257 |
|
|
2258 | 2213 |
AngleValue += dDeltaAngle; |
2259 | 2214 |
if (AngleValue > 360) AngleValue -= 360; |
2260 | 2215 |
if (AngleValue < 0) AngleValue += 360; |
... | ... | |
2273 | 2228 |
Canvas.SetLeft(thumb, value.X); |
2274 | 2229 |
Canvas.SetTop(thumb, value.Y); |
2275 | 2230 |
|
2276 |
/*if (item.DrawingData.GetType().Name == "ArrowTextControl" && thumb == item.ThumbList.Last()) |
|
2231 |
/* |
|
2232 |
if (item.DrawingData.GetType().Name == "ArrowTextControl" && thumb == item.ThumbList.Last()) |
|
2277 | 2233 |
{ |
2278 | 2234 |
Canvas.SetLeft(thumb, Canvas.GetLeft((item.DrawingData as ArrowTextControl).Base_TextBox)); |
2279 | 2235 |
Canvas.SetTop(thumb, Canvas.GetTop((item.DrawingData as ArrowTextControl).Base_TextBox)); |
... | ... | |
2336 | 2292 |
//Canvas.SetLeft((MemberSet.First() as AdornerMember).ThumbList[1], tempP.X); |
2337 | 2293 |
//Canvas.SetTop((MemberSet.First() as AdornerMember).ThumbList[1], tempP.Y); |
2338 | 2294 |
} |
2339 |
}*/ |
|
2295 |
} |
|
2296 |
*/ |
|
2340 | 2297 |
} |
2341 | 2298 |
|
2342 | 2299 |
for (int i = 0; i < (item.DrawingData as IPath).PointSet.Count(); i++) |
... | ... | |
2351 | 2308 |
{ |
2352 | 2309 |
case ControlType.TextControl: |
2353 | 2310 |
((TextControl)item.DrawingData).Angle = AngleValue; |
2354 |
//trRotate.Angle = AngleValue; |
|
2355 | 2311 |
|
2356 | 2312 |
RectangleGeometry Data = new RectangleGeometry |
2357 | 2313 |
{ |
... | ... | |
2377 | 2333 |
// CenterY = middle.Y + ((member as TextControl) as FrameworkElement).ActualHeight /2, |
2378 | 2334 |
//}; |
2379 | 2335 |
|
2380 |
|
|
2381 |
DragThumb.RenderTransformOrigin = new Point(0, 0); |
|
2336 |
DragThumb.RenderTransformOrigin = new Point(0.0, 0.0); |
|
2382 | 2337 |
DragThumb.RenderTransform = new RotateTransform() |
2383 | 2338 |
{ |
2384 | 2339 |
Angle = (item.DrawingData as TextControl).Angle, |
... | ... | |
2386 | 2341 |
//CenterY = middle.Y, |
2387 | 2342 |
}; |
2388 | 2343 |
|
2389 |
AdornerBorder.RenderTransformOrigin = new Point(0, 0);
|
|
2344 |
AdornerBorder.RenderTransformOrigin = new Point(0.0, 0.0);
|
|
2390 | 2345 |
AdornerBorder.RenderTransform = new RotateTransform() |
2391 | 2346 |
{ |
2392 | 2347 |
Angle = (item.DrawingData as TextControl).Angle, |
... | ... | |
2509 | 2464 |
BorderUpdate(); |
2510 | 2465 |
} |
2511 | 2466 |
|
2467 |
/// <summary> |
|
2468 |
/// starting rotate |
|
2469 |
/// </summary> |
|
2470 |
/// <param name="sender"></param> |
|
2471 |
/// <param name="e"></param> |
|
2512 | 2472 |
private void rotate_DragStarted(object sender, DragStartedEventArgs e) |
2513 | 2473 |
{ |
2514 |
////System.Windows.Forms.Cursor.Position = new System.Drawing.Point(System.Windows.Forms.Cursor.Position.X - 150, System.Windows.Forms.Cursor.Position.Y - 150); |
|
2515 |
//this.rotatePoint = Mouse.GetPosition(this); /// 2018.05.09 added by humkyung |
|
2516 |
//rotateTop.Cursor = Cursors.SizeAll; |
|
2517 |
|
|
2518 |
////CustomCursor.SetCursorTemplate(rotateTop, this.Resources["AnimatedCursor"] as DataTemplate); |
|
2519 |
////rotateTop.Cursor = Cursors.None; |
|
2520 |
|
|
2521 |
////if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().PointSet != null) |
|
2522 |
////{ |
|
2523 |
//// return; |
|
2524 |
////} |
|
2525 |
|
|
2526 | 2474 |
this.rotatePoint = Mouse.GetPosition(this); /// 2018.05.09 added by humkyung |
2527 | 2475 |
rotateTop.Cursor = Cursors.SizeAll; |
2528 | 2476 |
|
... | ... | |
2533 | 2481 |
} |
2534 | 2482 |
/// up to here |
2535 | 2483 |
|
2536 |
|
|
2537 |
|
|
2538 | 2484 |
if (ViewerDataModel.Instance.UndoDataList == null) |
2539 | 2485 |
{ |
2540 | 2486 |
return; |
... | ... | |
2613 | 2559 |
multi_Undo_Data.PointSet = new List<Point>(); |
2614 | 2560 |
p_set = new List<Point>(); |
2615 | 2561 |
|
2616 |
if (control.DrawingData as TextControl != null)
|
|
2562 |
if(control.DrawingData as TextControl != null) |
|
2617 | 2563 |
{ |
2618 | 2564 |
multi_Undo_Data.PointSet.Add((control.DrawingData as TextControl).StartPoint); |
2619 | 2565 |
multi_Undo_Data.PointSet.Add((control.DrawingData as TextControl).EndPoint); |
... | ... | |
2820 | 2766 |
Canvas.SetTop((MemberSet.First() as AdornerMember).ThumbList[1], tempP.Y); |
2821 | 2767 |
} |
2822 | 2768 |
|
2823 |
|
|
2769 |
|
|
2824 | 2770 |
BorderUpdate(); |
2825 |
|
|
2771 |
|
|
2826 | 2772 |
}; |
2827 | 2773 |
} |
2828 | 2774 |
else if ((MemberSet.First() as AdornerMember).DrawingData.GetType().Name == "DateControl") |
... | ... | |
2926 | 2872 |
if ((MemberSet.First() as AdornerMember).DrawingData.GetType().Name == "TextControl" || (MemberSet.First() as AdornerMember).DrawingData.GetType().Name == "ArrowTextControl") |
2927 | 2873 |
{ |
2928 | 2874 |
DragThumb.Visibility = Visibility.Collapsed; |
2929 |
} |
|
2875 |
}
|
|
2930 | 2876 |
} |
2931 | 2877 |
|
2932 | 2878 |
//private void testText_Loaded(object sender, RoutedEventArgs e) |
KCOM/Views/MainMenu.xaml.cs | ||
---|---|---|
2601 | 2601 |
} |
2602 | 2602 |
} |
2603 | 2603 |
|
2604 |
if(currentControl == null) |
|
2604 |
mouseButtonDown = e.ChangedButton; |
|
2605 |
/// complete drawing text control when user click mouse right button - 2018.05.14 added by humkyung |
|
2606 |
if ((mouseButtonDown == MouseButton.Right) && (currentControl != null)) |
|
2605 | 2607 |
{ |
2606 | 2608 |
var text_item_ = ViewerDataModel.Instance.MarkupControls_USER.Where(data => (data as TextControl) != null && (data as TextControl).Base_TextBox.Visibility == Visibility.Visible).FirstOrDefault(); |
2607 | 2609 |
if (text_item_ != null) |
... | ... | |
3592 | 3594 |
|
3593 | 3595 |
CreateControl(); |
3594 | 3596 |
|
3595 |
currentControl = null; |
|
3597 |
//currentControl = null;
|
|
3596 | 3598 |
} |
3597 | 3599 |
} |
3598 | 3600 |
} |
... | ... | |
3622 | 3624 |
(currentControl as TextControl).IsHighLight = ViewerDataModel.Instance.checkHighShape; |
3623 | 3625 |
CreateControl(); |
3624 | 3626 |
|
3625 |
currentControl = null; |
|
3627 |
//currentControl = null;
|
|
3626 | 3628 |
} |
3627 | 3629 |
} |
3628 | 3630 |
} |
... | ... | |
3652 | 3654 |
(currentControl as TextControl).IsHighLight = ViewerDataModel.Instance.checkHighShape; |
3653 | 3655 |
|
3654 | 3656 |
CreateControl(); |
3655 |
currentControl = null; |
|
3657 |
//currentControl = null;
|
|
3656 | 3658 |
} |
3657 | 3659 |
} |
3658 | 3660 |
} |
... | ... | |
5440 | 5442 |
/// <param name="StartP"></param> |
5441 | 5443 |
/// <param name="EndP"></param> |
5442 | 5444 |
/// <returns></returns> |
5443 |
private List<Point> GetRegularTrianglePoints(Point StartP, Point EndP, bool bCheckAxis = false) |
|
5445 |
/// <history>humkyung 2018.05.11 apply axis lock</history> |
|
5446 |
private List<Point> GetRegularTrianglePoints(Point StartP, Point EndP, bool bCheckAxis=false) |
|
5444 | 5447 |
{ |
5445 | 5448 |
List<Point> res = new List<Point>(); |
5446 | 5449 |
|
5447 | 5450 |
double dx = EndP.X - StartP.X; |
5448 | 5451 |
double dy = EndP.Y - StartP.Y; |
5449 | 5452 |
double length = Math.Sqrt(dx * dx + dy * dy); |
5450 |
double baseLength = length * Math.Tan(30.0 * Math.PI / 180.0);
|
|
5453 |
double baseLength = length * Math.Tan(30.0* Math.PI / 180.0); |
|
5451 | 5454 |
dx /= length; |
5452 | 5455 |
dy /= length; |
5453 | 5456 |
double tmp = dx; |
내보내기 Unified diff