Ejemplo n.º 1
0
        public List <Result> TestLatitude(WriteableBitmap chart)
        {
            try
            {
                var rl = new List <Result>();
                TestChart.setChart(chart);
                (TestChart as ITEGrayscaleChart).ConstGradeL = ConstL;
                LatitudeValue = (TestChart as ITEGrayscaleChart).getGrayGrade(TestAreaHeight, TestAreaWidth);
                Result lp = new Result();
                lp.Name      = "Latitude";
                lp.Memo      = "数据表示在一张照片里面可以分辨的灰阶亮度级别";
                lp.Dimension = "Grade";
                lp.Value     = LatitudeValue;
                rl.Add(lp);

                if (LatitudeValue == 11)
                {
                    ChartTestHelper.setGBSign(true, GBControl);
                }
                else
                {
                    ChartTestHelper.setGBSign(false, GBControl);
                }
                ShowLatitude();
                return(rl);
            }
            catch (Exception xe)
            {
                SilverlightLFC.common.Environment.ShowMessage(xe.Message);
                //testHelper.ProcessError(xe, "灰阶计算错误,请检查照片");
                return(null);
            }
        }
Ejemplo n.º 2
0
        void LoadPhoto(WriteableBitmap TargetPhoto)
        {
            if (TargetPhoto == null)
            {
                return;
            }
            lChartPhoto1.setPhoto(TargetPhoto);
            Color c = pt.getAverageColor(TargetPhoto);

            textBlockR.Text = c.R.ToString();
            textBlockG.Text = c.G.ToString();
            textBlockB.Text = c.B.ToString();

            double rg = (Convert.ToDouble(c.R) / Convert.ToDouble(c.G));
            double bg = (Convert.ToDouble(c.R) / Convert.ToDouble(c.G));

            textBlockJBBG.Text = bg.ToString();
            textBlockJBRG.Text = rg.ToString();
            if (rg > 0.8 && rg < 1.2 && bg > 0.8 && bg < 1.2)
            {
                ChartTestHelper.setGBSign(true, gridGB);
            }
            else
            {
                ChartTestHelper.setGBSign(false, gridGB);
            }


            DrawGraphic dg = new DrawGraphic(DrawCanvas);

            dg.ForeColor = Colors.Blue;
            dg.DrawColorPoint(c, 0.9f, 3);
        }
Ejemplo n.º 3
0
        void TestGB(WriteableBitmap b)
        {
            GBValue = (TestChart as GrayChart).ptp.getGBBrightChangedValue(b, GBSelectAreaNum);

            if (IsLongFocus)
            {
                if (GBValue > 0.7)
                {
                    ChartTestHelper.setGBSign(true, GBControl);
                }
                else
                {
                    ChartTestHelper.setGBSign(false, GBControl);
                }
            }
            else
            {
                if (GBValue > 0.5)
                {
                    ChartTestHelper.setGBSign(true, GBControl);
                }
                else
                {
                    ChartTestHelper.setGBSign(false, GBControl);
                }
            }
        }
Ejemplo n.º 4
0
        public ChartScatterSeriesSerializerTests()
        {
            var chart = ChartTestHelper.CreateChart <XYData>();

            chart.DataSource = XYDataBuilder.GetCollection();
            scatterSeries    = new ChartScatterSeries <XYData, float>(chart, s => s.X, s => s.Y);
        }
Ejemplo n.º 5
0
        void control_PointerPressed(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            var control = sender as LynxPhotoViewControl;

            control.PointerPressed -= control_PointerPressed;
            control.PointerMoved   -= control_PointerMoved;
            ActiveButtonBackground  = DeactiveBrush;
            if (control.getDrawObjectCanvas().Children.Contains(tl))
            {
                control.getDrawObjectCanvas().Children.Remove(tl);
            }

            (TestChart as ITEGrayscaleChart).ConstGradeL = ConstL;
            double h = e.GetCurrentPoint(control.getDrawObjectCanvas()).Position.Y / control.getImage().Height *control.getPhoto().PixelHeight;

            ActiveHeight = Convert.ToInt32(h);
            int v = (TestChart as ITEGrayscaleChart).getGrayGrade(ActiveHeight, TestAreaHeight, TestAreaWidth);

            LatitudeValue = v;
            ShowLatitude(ActiveHeight);

            if (LatitudeValue == 11)
            {
                ChartTestHelper.setGBSign(true, GBControl);
            }
            else
            {
                ChartTestHelper.setGBSign(false, GBControl);
            }
        }
Ejemplo n.º 6
0
        //Dictionary<WriteableBitmap, XMarkChart> tl = new Dictionary<WriteableBitmap, XMarkChart>();

        public XMarkTest()
        {
            InitializeComponent();
            testHelper = new ChartTestHelper(this);

            am = new ActionMove(this, Title);
            //photoInforTool1.setTarget(ChartPhoto);
            //lPhotoList1.TargetControl = ChartPhoto;
            //lPhotoList1.photoOperated += new UIControl.PhotoOperation(lPhotoList1_photoModifyed);

            //photoEditToolbar.setChartControl(lPhotoList1);//设置图版和工具栏的关联
            //photoEditToolbar.saveChartTestResult = WriteToHTML;
            //photoEditToolbar.setTestAll(BeginAll);
            //ChartPhoto.InitTest(Begin);

            ci         = new CameraTestIcon(this, null, "XMark", "XMark测试卡");
            ci.release = CloseWindow;
            CameraTestDesktop cd = CameraTestDesktop.getDesktop();

            if (!cd.TaskList.Children.Contains(ci))
            {
                cd.TaskList.Children.Add(ci);
            }
            else
            {
                ci.Active();
            }
        }
        public ChartBarSeriesSerializerTests()
        {
            var chart = ChartTestHelper.CreateChart <SalesData>();

            chart.DataSource = SalesDataBuilder.GetCollection();
            barSeries        = new ChartBarSeries <SalesData, decimal>(chart, s => s.RepSales);
        }
        public ChartPieSeriesSerializerTests()
        {
            var chart = ChartTestHelper.CreateChart <SalesData>();

            chart.DataSource = SalesDataBuilder.GetCollection();
            series           = new ChartPieSeries <SalesData, decimal>(chart, s => s.RepSales, s => s.RepName, s => s.Color, s => s.Explode);
        }
        List<Result> TestGBAberration(WriteableBitmap photo)
        {
            var rl = new List<Result>();
            TestChart.setChart(photo);
            var Chart = TestChart as AberrationChart;

            double _1l = getDistance(L10.Value, R10.Value);
            double _5l = getDistance(L50.Value, R50.Value);
            double _9l = getDistance(L90.Value, R90.Value);

            GBResult5 = Chart.ptp.getGBAberration(_5l, _1l, 5);
            GBResult9 = Chart.ptp.getGBAberration(_9l, _1l, 9);

            double h = 0.05;
            if (!IsLongFocus)
            {
                h = 0.07;
            }
            if (Math.Abs(GBResult5) < h && Math.Abs(GBResult9) < h)
            {
                ChartTestHelper.setGBSign(true, GBControl);
            }
            else
            {
                ChartTestHelper.setGBSign(false, GBControl);
            }

            Result lp = new Result();
            lp.Name = "国标畸变测试0.5处";
            lp.Memo = "计算照片变形程度测算畸变";
            lp.Dimension = "";
            lp.Value = GBResult5;
            rl.Add(lp);

            lp = new Result();
            lp.Name = "国标畸变测试0.9处";
            lp.Memo = "计算照片变形程度测算畸变";
            lp.Dimension = "";
            lp.Value = GBResult9;
            rl.Add(lp);

            return rl;
        }
Ejemplo n.º 10
0
        public void Test(List <WriteableBitmap> b)
        {
            if (b.Count == 0 || b == null)
            {
                return;
            }
            pl = b;
            try
            {
                //pt.CurrentLabMode = getCurrentLabMode();
                RefreshShow();
                textBlockAverageDifferentHSB.Text = pt.getAverageColorTrend(sl, pl).ToString();
                textBlockAverageDifferentRGB.Text = pt.getAverageRGBColorTrend(sl, pl).ToString();
                textBlockAverageDifferentLab.Text = pt.getAverageLabColorTrend(sl, pl).ToString();
                double gbr = pt.getMaxLabColorTrend(sl, pl);
                textBlockMaxDifferentLab.Text = gbr.ToString();
                textBlockMaxDifferentRGB.Text = pt.getMaxRGBColorTrend(sl, pl).ToString();
                textBlockMaxDifferentHSB.Text = pt.getMaxColorTrend(sl, pl).ToString();

                if (gbr > 35)
                {
                    ChartTestHelper.setGBSign(false, gridGB);
                }
                else
                {
                    ChartTestHelper.setGBSign(true, gridGB);
                }
            }
            catch (Exception xe)        //未知的异常
            {
                if (xe is LFCException) //已经是系统约定的错误类型,直接往上抛
                {
                    SilverlightLFC.common.Environment.ShowMessage(xe.Message);
                }
                else
                {
                    SilverlightLFC.common.Environment.ShowMessage("测试错误,请检查照片");
                }
            }
        }
Ejemplo n.º 11
0
        void ShowGBBadInfor()
        {
            textBlockJBBadPixNum.Text = JBBadPixList.Count.ToString();
            int c = 0;

            foreach (PixInfor p in JBBadPixList)
            {
                if (p.XPosition > (lChartPhotoBadPix.Photo).PixelWidth * 0.25 && p.XPosition < (lChartPhotoBadPix.Photo).PixelWidth * 0.75 && p.YPosition > lChartPhotoBadPix.getPhoto().PixelHeight * 0.25 && p.YPosition < lChartPhotoBadPix.getPhoto().PixelHeight * 0.75)
                {
                    c++;
                }
            }
            textBlockJBCenterBadPixNum.Text = c.ToString();
            if (JBBadPixList.Count > 2 || c > 0)
            {
                ChartTestHelper.setGBSign(false, gridGB);
            }
            else
            {
                ChartTestHelper.setGBSign(true, gridGB);
            }
        }
Ejemplo n.º 12
0
        void Calculate(FlipView list)
        {
            var ChartPhoto = GetCurrentPhotoViewControl(list);

            if (ChartPhoto.IsSelect)
            {
                EVDistance = (TestChart as GrayChart).ptp.getDEv(ChartPhoto.getSelectArea(), gama, TestParameter);
                CenterL    = (TestChart as GrayChart).ptp.getAverageColorL(ChartPhoto.getSelectArea());

                if (Math.Abs(EVDistance) >= 1)
                {
                    ChartTestHelper.setGBSign(false, GBControl);
                }
                else
                {
                    ChartTestHelper.setGBSign(true, GBControl);
                }
            }
            else
            {
                TestGBEv(CurrentPhoto);
            }
        }
Ejemplo n.º 13
0
        //XRiteColorChart t = new XRiteColorChart();
        //private DispatcherTimer sw = new DispatcherTimer();
        public XRiteTest()
        {
            InitializeComponent();
            testHelper = new ChartTestHelper(this);
            //photoInforTool1.setTarget(ChartPhoto);
            am = new ActionMove(this, Title);
            //chartCorrect1.Init(t, ChartPhoto);//初始化管理按钮
            //photoEditToolbar.setChartControl(ChartPhoto);//设置图版和工具栏的关联
            //photoEditToolbar.saveChartTestResult = WriteToHTML;
            //ChartPhoto.InitTest(autoTest);
            //ChartPhoto.InitSaveTest(WriteToHTML);
            ci         = new CameraTestIcon(this, null, "XRite", "XRite色标卡");
            ci.release = CloseWindow;
            CameraTestDesktop cd = CameraTestDesktop.getDesktop();

            if (!cd.TaskList.Children.Contains(ci))
            {
                cd.TaskList.Children.Add(ci);
            }
            else
            {
                ci.Active();
            }
        }
Ejemplo n.º 14
0
        List <Result> TestGBEv(WriteableBitmap photo)
        {
            var rl = new List <Result>();

            TestChart.setChart(photo);
            EVDistance = (TestChart as GrayChart).ptp.getGBDEv(photo, gama, TestParameter);
            Result lp = new Result();

            lp.Name      = "曝光量误差";
            lp.Memo      = "计算照片中央明度来确定曝光量";
            lp.Dimension = "";
            lp.Value     = EVDistance;
            rl.Add(lp);

            WriteableBitmap cb = (TestChart as GrayChart).ptp.getImageArea(photo, photo.PixelWidth / 4, photo.PixelHeight / 4, photo.PixelWidth / 2, photo.PixelHeight / 2);

            CenterL = (TestChart as GrayChart).ptp.getAverageColorL(cb);

            lp           = new Result();
            lp.Name      = "中央平均明度";
            lp.Memo      = "照片中央明度";
            lp.Dimension = "";
            lp.Value     = CenterL;
            rl.Add(lp);


            if (Math.Abs(EVDistance) >= 1)
            {
                ChartTestHelper.setGBSign(false, GBControl);
            }
            else
            {
                ChartTestHelper.setGBSign(true, GBControl);
            }
            return(rl);
        }
        public ChartSeriesDefaultsSerializerTests()
        {
            var chart = ChartTestHelper.CreateChart <SalesData>();

            seriesDefaults = new ChartSeriesDefaults <SalesData>(chart);
        }
Ejemplo n.º 16
0
 public void Initialize()
 {
     ChartTestHelper.InitializeTestDataFor7185Feb012018(db);
 }
 public ChartHtmlBuilderTests()
 {
     chart   = ChartTestHelper.CreateChart <SalesData>();
     builder = new ChartHtmlBuilder <SalesData>(chart);
 }