public VcpControl(Monitor monitor) { Monitor = monitor; Brightness = new MonitorLevel(GetBrightness, SetBrightness); Contrast = new MonitorLevel(GetContrast, SetContrast); Gain = new MonitorRgbLevel(GetGain, SetGain); Drive = new MonitorRgbLevel(GetDrive, SetDrive); }
public void ProbeLowLuminance() { var probe = new ArgyllProbe(); if (!probe.Installed) { PleaseInstall(); return; } new Thread(() => { MonitorLevel level = Vcp.Brightness; //LineSeries _line = new LineSeries(); //Curve.PlotModel.Series.Add(_line); uint max = Vcp.Gain.Red.Max; uint min = Vcp.Gain.Red.Min; double old = Model.ProbeLut().Luminance; level.Value = 0; for (uint i = max; i >= min; i--) { TuneWhitePoint(i); Tune t = Lut.Current; if (probe.SpotRead()) { t.Y = probe.ProbedColor.xyY.Y; t.x = probe.ProbedColor.xyY.x; t.y = probe.ProbedColor.xyY.y; } Lut.RemoveLowBrightness(i); Lut.Add(t); //_line.Points.Add(new DataPoint(i, t.Y)); //Curve.Refresh(); if (t.MinGain <= min) { break; } } Model.ProbeLut().Luminance = old; } ).Start(); return; }
public static void AddNewMonitor(string subjectType, string subjectId, string errorMessage, string operationUser, string operationName, MonitorLevel level = MonitorLevel.Info, MonitorModule module = MonitorModule.Other) { try { Manager.AddMonitorInfo(subjectType, subjectId, errorMessage, operationUser, operationName, level, module); } catch (Exception ex) { var exception = new MonitorException(BizErrorCode.SystemError, "添加异常监控错误", ex); Logger.Log(Level.Error, "Error occurred in AddNewMonitor.", exception); } }
private void Probe(ArgyllProbe probe, Color c, MonitorLevel level) { //LineSeries line = new LineSeries {Color = c}; //Curve.PlotModel.Series.Add(line); for (uint i = level.Min; i <= level.Max; i++) { level.CheckedValue = i; if (probe.SpotRead()) { //line.Points.Add(new DataPoint(i, probe.ProbedColor.Lab.L)); //Curve.Refresh(); } } }
public void AddMonitorInfo(string subjectType, string subjectId, string errorMessage, string operationUser, string operationName, MonitorLevel level = MonitorLevel.Info, MonitorModule module = MonitorModule.Other) { var parms = new object[] { subjectType, subjectId, errorMessage, operationUser, operationName, level, module }; TuHuThreadPool.QueueUserWorkItem(HandlerAddMonitorInfo, parms); }
public void AddMonitorInfo(string subjectType, string subjectId, string errorMessage, string operationUser, string operationName, MonitorLevel level = MonitorLevel.Info, MonitorModule module = MonitorModule.Other) { try { handler.AddMonitorInfo(subjectType, subjectId, errorMessage, operationUser, operationName, level, module); } catch (Exception innerEx) { var exception = new MonitorException(BizErrorCode.SystemError, "查询异常订单错误", innerEx); Logger.Log(Level.Error, "Error occurred in GetExceptionOrders.", exception); throw exception; } }
public static void AddNewMonitor(string subjectType, Exception ex, string operationName, MonitorLevel level = MonitorLevel.Info, MonitorModule module = MonitorModule.Other) { AddNewMonitor(subjectType, string.Empty, ex.ToString(), ThreadIdentity.Operator.Name, operationName, level, module); }
public void Probe() { var probe = new ArgyllProbe(); if (!probe.Installed) { PleaseInstall(); return; } //Vcp.Brightness.SetToMax(); //Vcp.Contrast.SetToMax(); uint red = Vcp.Gain.Red.Value; uint green = Vcp.Gain.Green.Value; uint blue = Vcp.Gain.Blue.Value; //Vcp.Brightness.SetToMax(); //Vcp.Contrast.SetToMax(); //Vcp.Gain.Red.SetToMax(); //Vcp.Gain.Green.SetToMax(); //Vcp.Gain.Blue.SetToMax(); new Thread(() => { Vcp.Gain.Red.SetToMax(); Vcp.Gain.Green.SetToMin(); Vcp.Gain.Blue.SetToMin(); Probe(probe, Colors.Red, Vcp.Contrast); Vcp.Gain.Red.SetToMin(); Vcp.Gain.Green.SetToMax(); Vcp.Gain.Blue.SetToMin(); Probe(probe, Colors.Green, Vcp.Contrast); Vcp.Gain.Red.SetToMin(); Vcp.Gain.Green.SetToMin(); Vcp.Gain.Blue.SetToMax(); Probe(probe, Colors.Blue, Vcp.Contrast); Vcp.Gain.Red.Value = red; Vcp.Gain.Green.Value = green; Vcp.Gain.Blue.Value = blue; } ).Start(); return; new Thread(() => { for (uint channel = 0; channel < 3; channel++) { MonitorLevel level = Vcp.Gain.Channel(channel); //LineSeries line = new LineSeries(); switch (channel) { case 0: //line.Color = OxyColors.Red; break; case 1: //line.Color = OxyColors.Green; break; case 2: //line.Color = OxyColors.Blue; break; } // Curve.PlotModel.Series.Add(line); uint max = level.Value; for (uint i = 32; i <= max; i++) { level.Value = i; Thread.Sleep(1000); if (probe.SpotRead()) { //line.Points.Add(new DataPoint(i,probe.ProbedColor.DeltaE00())); //Curve.Refresh(); } } double min = double.MaxValue; uint minIdx = level.Value; //foreach (DataPoint dp in line.Points) //{ // if (dp.Y < min) // { // min = dp.Y; // minIdx = (uint)dp.X; // } //} level.Value = minIdx; } } ).Start(); }
private void ProbeLuminance() { var probe = new ArgyllProbe(); if (!probe.Installed) { PleaseInstall(); return; } new Thread(() => { MonitorLevel level = Vcp.Brightness; //LineSeries _line = new LineSeries(); //_line.Color = OxyColors.Red; //Curve.PlotModel.Series.Add(_line); for (uint i = level.Min; i <= level.Max; i++) { level.Value = i; TuneWhitePoint(); Tune t = Lut.Current; if (probe.SpotRead()) { t.Y = probe.ProbedColor.xyY.Y; t.x = probe.ProbedColor.xyY.x; t.y = probe.ProbedColor.xyY.y; } Lut.RemoveBrightness(t.Brightness); Lut.Add(t); //_line.Points.Add(new DataPoint(i, t.Y)); //Curve.Refresh(); } } ).Start(); return; new Thread(() => { for (uint channel = 0; channel < 3; channel++) { MonitorLevel level = Vcp.Gain.Channel(channel); //LineSeries line = new LineSeries(); switch (channel) { case 0: //line.Color = OxyColors.Red; break; case 1: //line.Color = OxyColors.Green; break; case 2: //line.Color = OxyColors.Blue; break; } // Curve.PlotModel.Series.Add(line); uint max = level.Value; for (uint i = 32; i <= max; i++) { level.Value = i; Thread.Sleep(1000); probe.SpotRead(); ProbedColor color = probe.ProbedColor; //line.Points.Add(new DataPoint(i, color.DeltaE00())); //Curve.Refresh(); } double min = double.MaxValue; uint minIdx = level.Value; //foreach (DataPoint dp in line.Points) //{ // if (dp.Y < min) // { // min = dp.Y; // minIdx = (uint)dp.X; // } //} level.Value = minIdx; } } ).Start(); }