프로젝트

일반

사용자정보

개정판 8c128693

ID8c1286939e920e90cb67de1bd472ad8f4fd25f38
상위 73cb17e3
하위 1b4709fe, 9cc9da49

semi 이(가) 약 5년 전에 추가함

AliveItems MarkusLink And 원본파일 수정

Change-Id: I9a870479dc15f572e3576394ededee3a45a7c94a

차이점 보기:

ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/DataBaseItemsModel.cs
215 215
        }
216 216

  
217 217

  
218
        private ConvertItem _SelectAliveConvert;
219
        public ConvertItem SelectAliveConvert
220
        {
221
            get => _SelectAliveConvert;
222
            set
223
            {
224
                _SelectAliveConvert = value;
225
                OnPropertyChanged(() => SelectAliveConvert);
226
            }
227
        }
228

  
229

  
218 230
        private StatusTypeList _StatusType;
219 231
        public StatusTypeList StatusType
220 232
        {
......
254 266
            }
255 267
        }
256 268

  
257
        public bool _ConvertShow;
258
        public bool ConvertShow
259
        {
260
            get => _ConvertShow;
261
            set
262
            {
263
                if (_ConvertShow = !value)
264
                {
265
                    _ConvertShow = false;
266
                }
267
                _ConvertShow = value;
268
                OnPropertyChanged(() => ConvertShow);
269
            }
270
        }
271

  
272 269
        public string _ProjectNumberFilter;
273 270
        public string ProjectNumberFilter
274 271
        {
......
486 483
            }
487 484
        }
488 485

  
489
        public int _DocpanelHeigh = 800;
490
        public int DocpanelHeight //나중에 다시 해야함
486
        public int _DataBase_ItemsHeight = 800;
487
        public int DataBase_ItemsHeight 
488
        {
489
            get { return _DataBase_ItemsHeight; }
490
            set
491
            {
492
                _DataBase_ItemsHeight = value;
493
                OnPropertyChanged(() => DataBase_ItemsHeight);
494

  
495
            }
496
        }
497

  
498

  
499
        public int _RealConvert_Height = 80;
500
        public int RealConvert_Height
491 501
        {
492
            get { return _DocpanelHeigh; }
502
            get { return _RealConvert_Height; }
493 503
            set
494 504
            {
495
                _DocpanelHeigh = value;
496
                OnPropertyChanged(() => DocpanelHeight);
505
                _RealConvert_Height = value;
506
                OnPropertyChanged(() => RealConvert_Height);
497 507
            }
498 508
        }
499 509

  
500
        private string _Click = "Click";
501
        public string Click
510
        public int _Alive_Height = 80;
511
        public int Alive_Height
502 512
        {
513
            get { return _Alive_Height; }
514
            set
515
            {
516
                _Alive_Height = value;
517
                OnPropertyChanged(() => Alive_Height);
518
            }
519
        }
503 520

  
504
            get { return _Click; }
521
        public bool _ConvertShow;
522
        public bool ConvertShow
523
        {
524
            get => _ConvertShow;
525
            set
526
            {
527
                if (_ConvertShow = !value)
528
                {
529
                    _ConvertShow = false;
530
                }
531
                _ConvertShow = value;
532
                OnPropertyChanged(() => ConvertShow);
533
            }
505 534
        }
535

  
506 536
        #endregion
507 537

  
508 538
        #region Command
......
527 557
        /// </summary>
528 558

  
529 559
        private DispatcherTimer dispatcherTimer;
530
        //public override void Loaded()
531
        //{
532
        //    base.Loaded();
533

  
534
        //    if (!App.IsDesignMode)
535
        //    {
536
        //        dispatcherTimer = new DispatcherTimer();
537
        //        dispatcherTimer.Tick += new EventHandler(Timer_Tick);
538
        //        dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
539
        //        dispatcherTimer.Start();
540
        //    }
541
        //}
560
        public override void Loaded()
561
        {
562
            base.Loaded();
563

  
564
            if (!App.IsDesignMode)
565
            {
566
                dispatcherTimer = new DispatcherTimer();
567
                dispatcherTimer.Tick += new EventHandler(Timer_Tick);
568
                dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
569
                dispatcherTimer.Start();
570
            }
571
        }
542 572

  
543 573
        private async void Timer_Tick(object sender, EventArgs e)
544 574
        {
......
619 649
                        collection.UpdateWhere(changeitem =>
620 650
                        ConvertItemEx.ChangeValues(changeitem, newitem), x => x.ConvertID == newitem.ConvertID && x.ProjectNumber == newitem.ProjectNumber);
621 651
                    });
652

  
653
                    RealConvert_Height = 80 + ( 10 * collection.Count());
654
                    DataBase_ItemsHeight = 800 - (RealConvert_Height + Alive_Height);
622 655
                }
623 656
            }
624 657
            catch (Exception ex)
......
838 871
            try
839 872
            {
840 873
                List<ConvertItem> newitems = new List<ConvertItem>();
841

  
842
                foreach (var client in App.StationClientList)
874
                using (Markus.Service.DataBase.ConvertDatabase database = new Markus.Service.DataBase.ConvertDatabase(App.MarkusDataBaseConnecitonString))
843 875
                {
844
                    if (await SimplePingAsync(client.Endpoint.Address.ToString()))
876
                    foreach (var client in App.StationClientList)
845 877
                    {
846
                        try
878
                        if (await SimplePingAsync(client.Endpoint.Address.ToString()))
847 879
                        {
848
                            List<ConvertItem> itemsToList = new List<ConvertItem>();
849
                            var items = await client.AliveConvertListAsync();
850
                            foreach (var item in items)
880
                            try
851 881
                            {
852
                                ConvertItem itemsToEach = new ConvertItem();
853
                                itemsToEach.ServiceID = item.ServiceID;
854
                                itemsToEach.ConvertID = item.ConvertID;
855
                                itemsToEach.ProjectNumber = item.ProjectNumber;
882
                                List<ConvertItem> itemsToList = new List<ConvertItem>();
883
                                var items = await client.AliveConvertListAsync();
884
                                string result = "";
856 885

  
857
                                if (item.ConvertState != null)
886
                                foreach (var item in items)
858 887
                                {
859
                                    itemsToEach.ConvertState = (StatusCodeType)Enum.Parse(typeof(StatusCodeType), item.ConvertState);
888
                                    ConvertItem itemsToEach = new ConvertItem();
889
                                    itemsToEach.ServiceID = item.ServiceID;
890
                                    itemsToEach.ConvertID = item.ConvertID;
891
                                    itemsToEach.ProjectNumber = item.ProjectNumber;
892

  
893
                                    var convertpath = database.GetSearchConvertPathAndMarkus(item.ProjectNumber, item.UniqueKey);
894

  
895
                                    if (item.ConvertState != null)
896
                                    {
897
                                        itemsToEach.ConvertState = (StatusCodeType)Enum.Parse(typeof(StatusCodeType), item.ConvertState);
898
                                    }
899

  
900
                                    if (item.OriginfilePath.Contains("/"))
901
                                    {
902
                                        result = item.OriginfilePath.Substring(item.OriginfilePath.LastIndexOf("/") + 1);
903
                                    }
904
                                    else
905
                                    {
906
                                        result = item.OriginfilePath.Substring(item.OriginfilePath.LastIndexOf("%") + 1);
907
                                    }
908
                                    itemsToEach.FileName = result;
909

  
910
                                    itemsToEach.CurrentPageNo = item.CurrentPageNo;
911
                                    itemsToEach.TotalPage = item.TotalPage;
912
                                    itemsToEach.OriginfilePath = item.OriginfilePath;
913
                                    itemsToEach.ConvertPath = item.ConvertPath;
914
                                    itemsToEach.MarkusLink = convertpath[1];
915
                                    itemsToEach.UniqueKey = item.UniqueKey;
916

  
917
                                    //itemsToEach.ConvertPath = item.ConvertPath;
918
                                    itemsToEach.ConvertPath = convertpath[0];
919
                                    itemsToEach.CreateTime = item.CreateTime;
920
                                    itemsToEach.Exception = item.Exception;
921
                                    itemsToEach.ProcessorAffinity = item.ProcessorAffinity;
922
                                    itemsToEach.ReConverter = item.ReConverter;
923
                                    itemsToEach.DocumentID = item.DocumentID;
924
                                    itemsToEach.DocumnetName = item.DocumnetName;
925
                                    itemsToEach.GroupNo = item.GroupNo;
926
                                    itemsToEach.Revision = item.Revision;
927
                                    itemsToEach.StartTime = item.StartTime;
928
                                    itemsToEach.EndTime = item.EndTime;
929

  
930
                                    itemsToList.Add(itemsToEach);
860 931
                                }
932
                                newitems.AddRange(itemsToList);
933
                                System.Diagnostics.Trace.WriteLine($"{client.Endpoint.Address} ping");
861 934

  
862
                                itemsToEach.CurrentPageNo = item.CurrentPageNo;
863
                                itemsToEach.TotalPage = item.TotalPage;
864
                                itemsToEach.OriginfilePath = item.OriginfilePath;
865
                                itemsToEach.ConvertPath = item.ConvertPath;
866
                                itemsToEach.MarkusLink = item.MarkusLink;
867
                                itemsToEach.UniqueKey = item.UniqueKey;
868
                                itemsToEach.FileName = item.FileName;
869
                                itemsToEach.ConvertPath = item.ConvertPath;
870
                                itemsToEach.CreateTime = item.CreateTime;
871
                                itemsToEach.Exception = item.Exception;
872
                                itemsToEach.ProcessorAffinity = item.ProcessorAffinity;
873
                                itemsToEach.ReConverter = item.ReConverter;
874
                                itemsToEach.DocumentID = item.DocumentID;
875
                                itemsToEach.DocumnetName = item.DocumnetName;
876
                                itemsToEach.GroupNo = item.GroupNo;
877
                                itemsToEach.Revision = item.Revision;
878
                                itemsToEach.StartTime = item.StartTime;
879
                                itemsToEach.EndTime = item.EndTime;
880

  
881

  
882
                                itemsToList.Add(itemsToEach);
935
                                if (items.Count() == 0)
936
                                {
937
                                    System.Diagnostics.Trace.WriteLine($"{client.Endpoint.Address} Alive Items is zero.");
938
                                }
883 939
                            }
884
                            newitems.AddRange(itemsToList);
885
                            System.Diagnostics.Trace.WriteLine($"{client.Endpoint.Address} ping");
886

  
887
                            if (items.Count() == 0)
940
                            catch (Exception ex)
888 941
                            {
889
                                System.Diagnostics.Trace.WriteLine($"{client.Endpoint.Address} Alive Items is zero.");
942
                                System.Diagnostics.Trace.Fail($"{client.Endpoint.Address} {ex.Message}");
890 943
                            }
891 944
                        }
892
                        catch (Exception ex)
945
                        else
893 946
                        {
894
                            System.Diagnostics.Trace.Fail($"{client.Endpoint.Address} {ex.Message}");
947
                            System.Diagnostics.Trace.Fail($"{client.Endpoint.Address} ping Error");
895 948
                        }
896 949
                    }
897
                    else
898
                    {
899
                        System.Diagnostics.Trace.Fail($"{client.Endpoint.Address} ping Error");
900
                    }
901 950
                }
902

  
903 951
                ItemsUpdate(newitems);
904 952
                await System.Windows.Application.Current.Dispatcher.InvokeAsync(() => ItemsUpdate(newitems));
905 953
            }
......
966 1014
                    }
967 1015
                }
968 1016
            }
1017

  
1018
            Alive_Height = 80 + (newitems.Count() * 10 );
1019
            DataBase_ItemsHeight = 800 - ( RealConvert_Height + Alive_Height);
969 1020
        }
970 1021

  
971 1022

  
......
1254 1305
        #endregion
1255 1306

  
1256 1307

  
1257
        #region
1308
        #region ConvertAddDialog
1258 1309

  
1259 1310
        /// <summary>
1260 1311
        /// 그리드 상단 Conver 추가 버튼
......
1263 1314

  
1264 1315
        public void ConverAdd(object obj)
1265 1316
        {
1266
            //줄 530줄 load부분 주석 처리하면 잘됨 
1267
            //dispatcherTimer.Stop();
1317
            dispatcherTimer.Tick -= new EventHandler(Timer_Tick);
1268 1318

  
1269 1319
            Views.ConvertAddDialog convertAddDialog = new Views.ConvertAddDialog();
1320

  
1270 1321
            convertAddDialog.ShowDialog();
1271 1322

  
1272
            //dispatcherTimer.Start();
1323
            dispatcherTimer.Tick += new EventHandler(Timer_Tick);
1273 1324
        }
1274 1325

  
1275 1326
        #endregion
1276 1327

  
1328

  
1277 1329
        #endregion
1278 1330
    }
1279 1331
}

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)