/// <summary> /// 读取某个通道亮度 /// </summary> /// <param name="Channel"></param> /// <returns></returns> public int ReadIntensity(LightChn lightType) { int Value = 0; opt.ReadIntensity(SwitchChannel(lightType), ref Value); return(Value); }
public ItensityClass FindChn(LightChn chanel) { //Itensity itensity = new Itensity() { Chanel = Chanels.None, On = false, Value = 0 }; int chn = LightingOPT.SwitchChannel(chanel); return(FindChn(chn)); }
private ExecutePrmOPT AddChanel(LightChn chn, int value) { ItensityClass itensity; itensity = FindChn(chn); //存在就修改 if (itensity != null) { itensity.On = true; itensity.Value = value; } //不存在 else { int chnInt = LightingOPT.SwitchChannel(chn); itensity = new ItensityClass() { Chanel = (Chanels)chnInt, On = true, Value = value }; this.ListCls.Add(itensity); } return(this); }
/// <summary> /// 获取各个通道连接状态 /// </summary> /// <param name="lightType">通道类型</param> /// <returns>-1:函数执行失败,0:已连接光源,1:没有连接光源,2:短路保护3:过压保护4:过流保护</returns> public int GetChannelState(LightChn lightType) { int i = 0; unsafe { int *p = &i; int ret = opt.GetChannelState(SwitchChannel(lightType), p); if (ret == 0) { return(i); } return(-1); } }
//选择rgb通道 private LightChn RGBSwitch(ComboBox combobox) { LightChn rgb = 0; switch (combobox.SelectedItem.ToString()) { case "R": rgb = LightChn.Red; break; case "G": rgb = LightChn.Green; break; case "B": rgb = LightChn.Blue; break; default: break; } return(rgb); }
/// <summary> /// 切换通道 /// </summary> /// <param name="lightType"></param> /// <returns></returns> private int SwitchChannel(LightChn lightType) { int channel = 0; switch (lightType) { case LightChn.Red: channel = 1; break; case LightChn.Green: channel = 2; break; case LightChn.Blue: channel = 3; break; default: break; } return(channel); }
public int SetHBTriggerWidth(LightChn lightType, int Value) { throw new NotImplementedException(); }
public int ReadTriggerWidth(LightChn lightType, ref int Value) { throw new NotImplementedException(); }
public int ReadIntensity(LightChn lightType) { throw new NotImplementedException(); }
public int GetChannelState(LightChn lightType) { throw new NotImplementedException(); }
/// <summary> /// 打开单通道 /// </summary> /// <param name="lightType"></param> /// <returns></returns> public int TurnOnChannel(LightChn lightType) { throw new NotImplementedException(); }
public int SoftwareTrigger(LightChn lightType, int time) { throw new NotImplementedException(); }
public int SetMaxCurrent(LightChn lightType, int Value) { throw new NotImplementedException(); }
/// <summary> /// 设置单个通道亮度 /// </summary> /// <param name="lightType"></param> /// <param name="Value"></param> /// <returns></returns> public int SetIntensity(LightChn lightType, int Value) { throw new NotImplementedException(); }
/// <summary> /// 软触发 /// </summary> /// <param name="channelIdx"></param> /// <param name="time"></param> /// <returns></returns> public int SoftwareTrigger(LightChn lightType, int time) { return(opt.SoftwareTrigger(SwitchChannel(lightType), time)); }
/// <summary> /// 设置单个通道最大电流 /// </summary> /// <param name="Channel"></param> /// <param name="Value"></param> /// <returns></returns> public int SetMaxCurrent(LightChn lightType, int Value) { return(opt.SetMaxCurrent(SwitchChannel(lightType), Value)); }
/// <summary> /// 读取单个通道高亮触发脉宽 /// </summary> /// <param name="Channel"></param> /// <param name="Value"></param> /// <returns></returns> public int ReadHBTriggerWidth(LightChn lightType, ref int Value) { return(opt.ReadHBTriggerWidth(SwitchChannel(lightType), ref Value)); }
/// <summary> /// 设置高亮触发脉宽 /// </summary> /// <param name="Channel"></param> /// <param name="Value"></param> /// <returns></returns> public int SetHBTriggerWidth(LightChn lightType, int Value) { return(opt.SetHBTriggerWidth(SwitchChannel(lightType), Value)); }
/// <summary> /// 关闭单个通道 /// </summary> /// <param name="lightType"></param> /// <returns></returns> public int TurnOffChannel(LightChn lightType) { return(opt.TurnOffChannel(SwitchChannel(lightType))); }
/// <summary> /// 设置单个通道亮度 /// </summary> /// <param name="Channel"></param> /// <param name="Value"></param> /// <returns></returns> public int SetIntensity(LightChn lightType, int Value) { return(opt.SetIntensity(SwitchChannel(lightType), Value)); }