public TP_ButtonSetProperty(MonitorControl _baseCtl)
        {
            InitializeComponent();

            BaseCtl = _baseCtl;
            ListScreenShow=_baseCtl.GetChildScreenObj();
            if (ListScreenShow == null)
                ListScreenShow = new ObservableCollection<ScreenAddShowName>();
            BindList();
            //gvList.DataContext = ListScreenShow;
        }
예제 #2
0
        private void ShowElements(List<t_Element> lsitElement, Canvas canvas, MonitorControl parentContol = null)
        {
            foreach (t_Element el in lsitElement)
            {
                var list = _DataContext.t_ElementProperties.Where(a => a.ElementID == el.ElementID);
                var monitorControl = ShowElement(canvas, el, ElementSate.Save, list.ToList());

                _ScreenView.ShowElement( el, ElementSate.Save, list.ToList());

                if (null != monitorControl && null != parentContol)
                {
                    monitorControl.ParentControl = parentContol;
                    monitorControl.AllowToolTip = false;
                    monitorControl.ClearValue(Canvas.ZIndexProperty);
                    if (null != monitorControl.AdornerLayer)
                    {
                        monitorControl.AdornerLayer.AllToolTip = false;
                    }
                }
                //_ScreenView.AddEletemt(monitorControl);
                ScreenAllElement.Add(el);
            }
        }
예제 #3
0
        private void SetEletemt(Canvas canvas, MonitorControl mControl, t_Element obj, ElementSate eleStae,
            List<t_ElementProperty> listObj)
        {
            mControl.Selected += (o, e) =>
            {
                PropertyMain.Instance.ControlPropertyGrid.SelectedObject = null;
                PropertyMain.Instance.ControlPropertyGrid.BrowsableProperties = mControl.BrowsableProperties;
                PropertyMain.Instance.ControlPropertyGrid.SelectedObject = mControl;
            };
            if (eleStae == ElementSate.Save)
            {
                mControl.Name = obj.ElementID.ToString();
            }
            mControl.ScreenElement = obj;
            mControl.ListElementProp = listObj;
            mControl.ElementState = eleStae;

            //if (eleStae == ElementSate.Save)
            //{
            //    mControl.Name = obj.ElementID.ToString();
            //}
            mControl.SetPropertyValue();
            mControl.SetCommonPropertyValue();
            //添加到场景
            canvas.Children.Add(mControl);

            //if (CBIsztControl.IsChecked.Value)
            if (IsZT)
            {
                mControl.DesignMode();
            }
        }
예제 #4
0
        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);
                    }
                }
            }
        }
예제 #5
0
        private void ShowElements(List<t_Element> lsitElement, Canvas canvas, MonitorControl parentContol = null)
        {
            List<t_ElementProperty> _elementProperties = new ElementPropertyDA().selectByScreenID(_screen.ScreenID);
            foreach (t_Element el in lsitElement)
            {
                var list = _elementProperties.Where(a => a.ElementID == el.ElementID);
                var monitorControl = ShowElement(el, ElementSate.Save, list.ToList());

               // _ScreenView.ShowElement(canvas, el, ElementSate.Save, list.ToList());
                if (null != monitorControl && null != parentContol)
                {
                    monitorControl.ParentControl = parentContol;
                    monitorControl.AllowToolTip = false;
                    monitorControl.ClearValue(Canvas.ZIndexProperty);
                    if (null != monitorControl.AdornerLayer)
                    {
                        monitorControl.AdornerLayer.AllToolTip = false;
                    }
                }
            }
        }
예제 #6
0
        private void SetEletemt(Canvas canvas, MonitorControl mControl, t_Element obj, ElementSate eleStae,
           List<t_ElementProperty> listObj)
        {
            mControl.Selected += (o, e) =>
            {
                MonitorControl.UpdatePropertyGrid(mControl.BrowsableProperties, null);
                MonitorControl.UpdatePropertyGrid(mControl.BrowsableProperties, mControl);
            };
            if (eleStae == ElementSate.Save)
            {
                mControl.Name ="slt"+ obj.ElementID.ToString();
            }
            mControl.ScreenElement = obj;
            mControl.ListElementProp = listObj;
            mControl.ElementState = eleStae;

            mControl.SetPropertyValue();
            mControl.SetCommonPropertyValue();
            //添加到场景
            canvas.Children.Add(mControl);
        }
예제 #7
0
 public ToolTipControl(MonitorControl target)
 {
     Target = target;
     _borderPathFigure.IsClosed = true;
     _borderPathGeometry.Figures.Add(_borderPathFigure);
     _borderPath.IsHitTestVisible = false;
     _borderPath.Data = _borderPathGeometry;
     UpdateBackground();
     _borderPath.Stroke = new SolidColorBrush(Stroke);
     _borderPath.StrokeThickness = StrokeThickness;
     _borderCanvas.Children.Add(_borderPath);
     _layoutRoot.Children.Add(_borderCanvas);
     _layoutRoot.Children.Add(ToolTipCanvas);
     Content = _layoutRoot;
     this.ToolTipCanvas.SizeChanged += ToolTipCanvas_SizeChanged;
     this.Selected += ToolTipControl_Selected;
     base.IsToolTip = true;
 }
예제 #8
0
 /// <summary>
 /// 复制对象
 /// </summary>
 /// <param name="obj"></param>
 public void ElementClone(MonitorControl obj, int mWidth, int mHeight)
 {
     this.ParentControl = obj.ParentControl;
      m_Element = new t_Element();
        t_Element m_Older= obj.ScreenElement;
     //ElementID
        m_Element.ElementName = m_Older.ElementName;
        m_Element.ControlID = m_Older.ControlID;
        //m_Element.ScreenX = m_Older.ScreenX;
        m_Element.ScreenX = Convert.ToInt32(obj.GetValue(Canvas.LeftProperty));
        m_Element.ScreenY = Convert.ToInt32(obj.GetValue(Canvas.TopProperty));
       // m_Element.ScreenY = m_Older.ScreenY;
        m_Element.ScreenY += Convert.ToInt16(obj.Height);
        m_Element.TxtInfo = m_Older.TxtInfo;
        m_Element.Width = mWidth;
        m_Element.Height = mHeight;
        m_Element.ImageURL = m_Older.ImageURL;
        m_Element.ForeColor = m_Older.ForeColor;
        m_Element.Font = m_Older.Font;
        m_Element.ChildScreenID = m_Older.ChildScreenID;
        m_Element.DeviceID = m_Older.DeviceID;
        m_Element.ChannelNo = m_Older.ChannelNo;
        m_Element.ScreenID = m_Older.ScreenID;
        m_Element.BackColor = m_Older.BackColor;
        m_Element.Transparent = m_Older.Transparent;
        m_Element.oldX = m_Older.oldX;
        m_Element.oldY = m_Older.oldY;
        m_Element.Method = m_Older.Method;
        m_Element.MinFloat = m_Older.MinFloat;
        m_Element.MaxFloat = m_Older.MaxFloat;
        m_Element.SerialNum = m_Older.SerialNum;
        m_Element.TotalLength = m_Older.TotalLength;
        m_Element.LevelNo = m_Older.LevelNo;
        m_Element.ComputeStr = m_Older.ComputeStr;
        m_ListElementProperty = new List<t_ElementProperty>();
     foreach(t_ElementProperty elePro in obj.ListElementProp)
     {
         t_ElementProperty m_elePro = new t_ElementProperty();
         m_elePro.PropertyNo = elePro.PropertyNo;
         m_elePro.PropertyValue = elePro.PropertyValue;
         m_elePro.Caption = elePro.Caption;
         m_elePro.PropertyName = elePro.PropertyName;
         m_ListElementProperty.Add(m_elePro);
     }
 }
예제 #9
0
        private void SetEletemt(Canvas canvas, MonitorControl mControl, t_Element obj, ElementSate eleStae,
           List<t_ElementProperty> listObj)
        {
            mControl.Selected += (o, e) =>
            {
                //PropertyMain.Instance.ControlPropertyGrid.SelectedObject = null;
                //PropertyMain.Instance.ControlPropertyGrid.BrowsableProperties = mControl.BrowsableProperties;
                //PropertyMain.Instance.ControlPropertyGrid.SelectedObject = mControl;
                MonitorControl.OnUpdatePropertyGrid(new string[0], null);
                MonitorControl.OnUpdatePropertyGrid(mControl.BrowsableProperties, mControl);
            };
            if (eleStae == ElementSate.Save)
            {
                mControl.Name = "wpft" + obj.ElementID.ToString();
            }
            mControl.ScreenElement = obj;
            mControl.ListElementProp = listObj;
            mControl.ElementState = eleStae;

            mControl.SetPropertyValue();
            mControl.SetCommonPropertyValue();
            //添加到场景
            canvas.Children.Add(mControl);
        }