/// <summary> /// 获取增益 /// </summary> /// <returns></returns> public string GetGainRaw() { { using (IFloatParameter p = objDev.ParameterCollection[new FloatName("GainRaw")]) { Trace.WriteLine(string.Format("ExposureTime value: {0}", p.GetValue())); return(p.GetValue().ToString()); } } }
public override uint GetGain() { lock (m_lock) { uint _gain = 0; if (camera != null) { if (camera.IsOpen) { IFloatParameter parameter = null; if (camera.Parameters.Contains(PLCamera.GainAbs)) { parameter = camera.Parameters[PLCamera.GainAbs]; } else { parameter = camera.Parameters[PLCamera.Gain]; } if (parameter.IsReadable) { _gain = (uint)parameter.GetValue(); } } } return(_gain); } }
public override uint GetExpourseTime() { lock (m_lock) { uint _expourestime = 0; if (camera != null) { if (camera.IsOpen) { IFloatParameter parameter = null; if (camera.Parameters.Contains(PLCamera.ExposureTimeAbs)) { parameter = camera.Parameters[PLCamera.ExposureTimeAbs]; } else { parameter = camera.Parameters[PLCamera.ExposureTime]; } if (parameter.IsReadable) { _expourestime = (uint)parameter.GetValue(); } } } return(_expourestime); } }
// Gets the current values from the node and displays them. private void UpdateValues() { try { if (parameter != null) { if (parameter.IsReadable) // Check if the parameter is readable. { // Get the values. double min = parameter.GetMinimum(); double max = parameter.GetMaximum(); double val = parameter.GetValue(); double percent = parameter.GetValuePercentOfRange(); // Update the slider. MinVal = min; //PercentToSliderValue(0); MaxVal = max; //PercentToSliderValue(100); Val = PercentToSliderValue(percent); SmallChange = PercentToSliderValue(0.05); TickFrequency = PercentToSliderValue(10); // Update the access status. IsWriteable = parameter.IsWritable; IsUseable = true; } } } catch { // If errors occurred, disable the control. Reset(); } }
public override double GetExposureTime() // 获取曝光时间 { try { using (IFloatParameter p = m_dev.ParameterCollection[ParametrizeNameSet.ExposureTime]) { return(p.GetValue()); } } catch (Exception) { return(0); } }
public override double GetTriggerDelayTime() // 获取触发延迟 { try { using (IFloatParameter p = m_dev.ParameterCollection[ParametrizeNameSet.TriggerDelay]) { return(p.GetValue()); } } catch (Exception) { return(0); } }
public override double GetGain() // 获取增益 { try { using (IFloatParameter p = m_dev.ParameterCollection[ParametrizeNameSet.GainRaw]) { return(p.GetValue()); } } catch (Exception) { return(0); } }
// Gets the current values from the node and displays them. private void UpdateValues() { try { if (parameter != null) { if (parameter.IsReadable) // Check if the parameter is readable. { // Get the values. double min = parameter.GetMinimum(); double max = parameter.GetMaximum(); double val = parameter.GetValue(); double percent = parameter.GetValuePercentOfRange(); // Update the slider. slider.Minimum = PercentToSliderValue(0); slider.Maximum = PercentToSliderValue(100); slider.Value = PercentToSliderValue(percent); slider.SmallChange = PercentToSliderValue(0.05); slider.TickFrequency = PercentToSliderValue(10); // Update the displayed values. labelMin.Text = "" + min; labelMax.Text = "" + max; labelCurrentValue.Text = "" + val; // Update the access status. slider.Enabled = parameter.IsWritable; labelMin.Enabled = true; labelMax.Enabled = true; labelName.Enabled = true; labelCurrentValue.Enabled = true; return; } } } catch { // If errors occurred, disable the control. } Reset(); }
// Get the current values from the parameter and display them. private void UpdateValues() { try { if (parameter != null) { if (parameter.IsReadable) // Check if parameter is accessible. { // Get values. _dMin = parameter.GetMinimum(); _dMax = parameter.GetMaximum(); double val = parameter.GetValue(); double percent = parameter.GetValuePercentOfRange(); // Update the slider. slider.Minimum = PercentToSliderValue(0); slider.Maximum = PercentToSliderValue(100); slider.Value = PercentToSliderValue(percent); slider.SmallChange = PercentToSliderValue(0.05); slider.TickFrequency = PercentToSliderValue(10); // Update the displayed values. // labelMin.Text = "" + min; // labelMax.Text = "" + max; tb_Value.Text = "" + val; // Update accessibility. slider.IsEnabled = parameter.IsWritable; // labelMin.Enabled = true; // labelMax.Enabled = true; lb_ValueName.IsEnabled = true; tb_Value.IsEnabled = true; return; } } } catch { // If errors occurred disable the control. Reset(); } }