private void SetChannelValue(float digitalValue, V_ScreenMonitorValue obj, MonitorControl vobj)
        {
            if (vobj == null)
            {
                return;
            }

            if (vobj is RealTimeT)
            {
                (vobj as RealTimeT).SetLineValue(obj);
                return;
            }

            if (vobj.ScreenElement.DeviceID.Value != -1 && vobj.ScreenElement.ChannelNo.Value != -1)
            {
                float fValue;
                if (float.TryParse(obj.MonitorValue.ToString(), out fValue))
                {
                    if (vobj.ScreenElement.ElementName == "DigitalBiaoPan")
                    {
                        digitalValue = fValue;
                        vobj.SetChannelValue(fValue);
                    }
                    else if (vobj.ScreenElement.ElementName == "DrawLine")
                    {
                        vobj.SetChannelValue(fValue, digitalValue);
                    }
                    else
                    {
                        vobj.SetChannelValue(fValue);
                    }
                }
            }
        }
Beispiel #2
0
 /// <summary>
 /// 用于向 V_ScreenMonitorValue EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddToV_ScreenMonitorValue(V_ScreenMonitorValue v_ScreenMonitorValue)
 {
     base.AddObject("V_ScreenMonitorValue", v_ScreenMonitorValue);
 }
Beispiel #3
0
 /// <summary>
 /// 创建新的 V_ScreenMonitorValue 对象。
 /// </summary>
 /// <param name="id">id 属性的初始值。</param>
 /// <param name="elementID">ElementID 属性的初始值。</param>
 /// <param name="stationID">StationID 属性的初始值。</param>
 public static V_ScreenMonitorValue CreateV_ScreenMonitorValue(global::System.Guid id, global::System.Int32 elementID, global::System.Int32 stationID)
 {
     V_ScreenMonitorValue v_ScreenMonitorValue = new V_ScreenMonitorValue();
     v_ScreenMonitorValue.id = id;
     v_ScreenMonitorValue.ElementID = elementID;
     v_ScreenMonitorValue.StationID = stationID;
     return v_ScreenMonitorValue;
 }
 public void SetLineValue(V_ScreenMonitorValue obj)
 {
     foreach (RealTimeLineOR line in this._listRealTimeLine)
     {
         if (line.LineInfo.DeviceID != null && line.LineInfo.ChannelNo != null)
         {
             if (line.LineInfo.DeviceID.Value == obj.DeviceID && line.LineInfo.ChannelNo == obj.ChannelNo
                 && line.LineInfo.ComputeStr == obj.ComputeStr)
             {
                 line.SetYValue(obj.MonitorValue.Value);
             }
         }
     }
 }