Ejemplo n.º 1
0
        /// <summary> 缺陷管理 </summary>
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Window window = new Window();

            window.Width  = 1000;
            window.Height = 600;
            //window.WindowStyle = WindowStyle.None;

            IDefectSign defectViewModel = DefectViewModel.CreateInstance();

            //  Message:刷新常用数据
            List <DefectCommonUsed> defectCommonUseds = new List <DefectCommonUsed>();

            for (int i = 0; i < 7; i++)
            {
                DefectCommonUsed defectCommonUsed = new DefectCommonUsed();

                defectCommonUsed.Describletion = "统一跨距接头数量(n) -n>=2" + i.ToString();
                defectCommonUsed.CountUse      = i;
                defectCommonUsed.Code          = "Code" + i;
                defectCommonUsed.ID            = Guid.NewGuid().ToString();

                defectCommonUseds.Add(defectCommonUsed);
            }

            defectViewModel.LoadDefectCommonUsed(defectCommonUseds);

            //  Message:刷新预估缺陷
            List <DefectCommonUsed> defectCommonUseds1 = new List <DefectCommonUsed>();

            for (int i = 0; i < 3; i++)
            {
                DefectCommonUsed defectCommonUsed = new DefectCommonUsed();
                defectCommonUsed.Code          = "Code" + i;
                defectCommonUsed.Describletion = "统一跨距接头数量统一跨距接头数量(统一跨距接头数量((n) -n>=2" + i;
                defectCommonUsed.ID            = Guid.NewGuid().ToString();
                defectCommonUsed.CountUse      = i;

                defectCommonUseds1.Add(defectCommonUsed);
            }


            defectViewModel.LoadEstimateDefectCommonUseds(defectCommonUseds1);

            //  Message:刷新缺陷输入信息
            defectViewModel.LoadPHM("B 01 15 000045 000261 000033");

            //  Do:取消
            defectViewModel.CancelClick += () =>
            {
                window.Hide();
            };

            //  Do:q确定
            defectViewModel.SumitClick += () =>
            {
                window.Hide();

                Debug.WriteLine(defectViewModel.ToString());
            };

            DefectControl defect = DefectViewModel.CreateInstance().GetControlInstance();

            window.Content = defect;

            window.ShowDialog();
        }
Ejemplo n.º 2
0
        /// <summary> 获取测试数据 </summary>
        DefectMenuEntity GetEntity()
        {
            DefectMenuEntity entity = new DefectMenuEntity();

            entity.PHMCodes = "A";

            //  Message:数据采集方式
            List <TyeBaseDatacollecttypeEntity> tyeEncodeCategoryconfigEntities = new List <TyeBaseDatacollecttypeEntity>();

            for (int i = 0; i < 20; i++)
            {
                TyeBaseDatacollecttypeEntity tyeEncodeCategoryconfigEntity = new TyeBaseDatacollecttypeEntity();

                //tyeEncodeCategoryconfigEntity.ID = i.ToString();
                tyeEncodeCategoryconfigEntity.Code = "Data" + i.ToString();
                tyeEncodeCategoryconfigEntity.Name = "N00" + i.ToString();

                tyeEncodeCategoryconfigEntities.Add(tyeEncodeCategoryconfigEntity);
            }

            entity.DataAcquisitionMode = tyeEncodeCategoryconfigEntities;

            List <TyeBaseRailwaystationEntity> RailwaySsequences = new List <TyeBaseRailwaystationEntity>();

            for (int i = 0; i < 20; i++)
            {
                TyeBaseRailwaystationEntity tyeEncodeCategoryconfigEntity = new TyeBaseRailwaystationEntity();

                //tyeEncodeCategoryconfigEntity.ID = i.ToString();
                tyeEncodeCategoryconfigEntity.Code = "Data" + i.ToString();
                tyeEncodeCategoryconfigEntity.Name = "N00" + i.ToString();

                RailwaySsequences.Add(tyeEncodeCategoryconfigEntity);
            }

            entity.RailwaySsequence = RailwaySsequences;

            List <TyeBaseLineEntity> tyeBaseLineEntities = new List <TyeBaseLineEntity>();

            for (int i = 0; i < 10; i++)
            {
                TyeBaseLineEntity tyeBaseLineEntity = new TyeBaseLineEntity();
                tyeBaseLineEntity.ID       = i.ToString();
                tyeBaseLineEntity.LineCode = "Line" + i.ToString();
                tyeBaseLineEntity.LineName = "LN00" + i.ToString();
                tyeBaseLineEntities.Add(tyeBaseLineEntity);
            }

            entity.DedicatedLine = tyeBaseLineEntities;

            List <TyeBaseSiteEntity> tyeBaseSiteEntities = new List <TyeBaseSiteEntity>();

            for (int i = 0; i < 10; i++)
            {
                TyeBaseSiteEntity tyeBaseSiteEntity = new TyeBaseSiteEntity();
                tyeBaseSiteEntity.ID       = i.ToString();
                tyeBaseSiteEntity.SiteCode = "Site" + i.ToString();
                tyeBaseSiteEntity.SiteName = "SN00" + i.ToString();
                tyeBaseSiteEntities.Add(tyeBaseSiteEntity);
            }

            entity.DedicatedStation = tyeBaseSiteEntities;

            List <TyeBaseDepartmentEntity> responsibilityworkarea = new List <TyeBaseDepartmentEntity>();

            for (int i = 0; i < 10; i++)
            {
                TyeBaseDepartmentEntity tyeBaseSiteEntity = new TyeBaseDepartmentEntity();
                tyeBaseSiteEntity.ID   = i.ToString();
                tyeBaseSiteEntity.Code = "Site" + i.ToString();
                tyeBaseSiteEntity.Name = "SN00" + i.ToString();
                responsibilityworkarea.Add(tyeBaseSiteEntity);
            }


            List <TyeBasePillarEntity> basicunit = new List <TyeBasePillarEntity>();

            for (int i = 0; i < 10; i++)
            {
                TyeBasePillarEntity tyeBaseSiteEntity = new TyeBasePillarEntity();
                tyeBaseSiteEntity.ID           = i.ToString();
                tyeBaseSiteEntity.PoleMarkCode = "Site" + i.ToString();
                //tyeBaseSiteEntity. = "SN00" + i.ToString();
                basicunit.Add(tyeBaseSiteEntity);
            }


            entity.BasicUnit = basicunit;

            entity.ResponsibilityWorkArea = responsibilityworkarea;

            entity.ResponsibilityWorkshop = responsibilityworkarea;

            ObservableCollection <TyeEncodeDeviceEntity> tyeEncodeDeviceEntities = new ObservableCollection <TyeEncodeDeviceEntity>();

            for (int i = 0; i < 3000; i++)
            {
                TyeEncodeDeviceEntity tyeEncodeDeviceEntity = new TyeEncodeDeviceEntity();
                tyeEncodeDeviceEntity.ID     = i.ToString();
                tyeEncodeDeviceEntity.Code   = "Defect" + i.ToString();
                tyeEncodeDeviceEntity.Name   = "DN00" + i.ToString();
                tyeEncodeDeviceEntity.NamePY = "PY" + i.ToString();
                //tyeEncodeDeviceEntity.Name = "名称" + (i + 50).ToString();
                //tyeEncodeDeviceEntity.Code = "编码:" + (i + 100).ToString();
                //tyeEncodeDeviceEntity.NamePY = "拼音:" + (i + 150).ToString();

                tyeEncodeDeviceEntities.Add(tyeEncodeDeviceEntity);
            }

            entity.DefectOrMarkCodes = tyeEncodeDeviceEntities;

            List <DefectCommonUsed> defectCommonUseds = new List <DefectCommonUsed>();

            for (int i = 0; i < 50; i++)
            {
                DefectCommonUsed defectCommonUsed = new DefectCommonUsed();

                defectCommonUsed.ID            = i.ToString();
                defectCommonUsed.Name          = "名称" + (i + 50).ToString();
                defectCommonUsed.Code          = "编码:" + (i + 100).ToString();
                defectCommonUsed.NamePY        = "拼音:" + (i + 150).ToString();
                defectCommonUsed.Describletion = i.ToString().PadLeft(3, '0') + " " + defectCommonUsed.Name + " " + defectCommonUsed.Code + defectCommonUsed.NamePY + (50 - i).ToString() + "次";
                defectCommonUsed.CountUse      = i;
                defectCommonUsed.OrderNo       = i;
                defectCommonUseds.Add(defectCommonUsed);
            }

            ObservableCollection <TyeEncodeDeviceEntity> defectOrMarkCodes = new ObservableCollection <TyeEncodeDeviceEntity>();

            for (int i = 0; i < 3000; i++)
            {
                TyeEncodeDeviceEntity defectOrMarkCode = new TyeEncodeDeviceEntity();

                defectOrMarkCode.ID      = i.ToString();
                defectOrMarkCode.Name    = "DN00" + i.ToString();
                defectOrMarkCode.Code    = "CommonHistoricalDefectsOrMark" + i.ToString();
                defectOrMarkCode.NamePY  = "NamePY" + i.ToString();
                defectOrMarkCode.OrderNo = i;
                defectOrMarkCodes.Add(defectOrMarkCode);
            }

            entity.CommonHistoricalDefectsOrMark = defectCommonUseds;

            TyeAdminUserEntity tyeAdminUserEntity = new TyeAdminUserEntity();

            tyeAdminUserEntity.ID     = "1";
            tyeAdminUserEntity.Name   = "王杰结";
            entity.tyeAdminUserEntity = tyeAdminUserEntity;

            entity.KmLog             = "K102+123";
            entity.DetectionVehicles = "川A213213";
            entity.DetectDate        = DateTime.Now;

            return(entity);
        }