public UC_StandarAndSimpleLayout(SettingCommInfo commInfo)
        {
            InitializeComponent();
            try
            {
                _commonInfo = (SettingCommInfo)commInfo.Clone();
            }
            catch
            {
                _commonInfo = new SettingCommInfo();
            }

            _proposedSize = new System.Drawing.Size(int.MaxValue, int.MaxValue);

            //默认字体
            this.DefaultFocusStyle.GridFont = new Font("宋体", 12, FontStyle.Regular);

            #region Bitmap -- Test
            //_tempBitMap = new Bitmap(_fanImage);
            //_lineBytes = ((_tempBitMap.Width * 24 + 31) >> 5) << 2;
            //_bmpInf.bmiHeader.biBitCount = 32;
            //_bmpInf.bmiHeader.biClrImportant = 1;
            //_bmpInf.bmiHeader.biClrUsed = 0;
            //_bmpInf.bmiHeader.biCompression = 0;
            //_bmpInf.bmiHeader.biHeight = -_tempBitMap.Height;
            //_bmpInf.bmiHeader.biPlanes = 1;
            //_bmpInf.bmiHeader.biSize = 40;
            //_bmpInf.bmiHeader.biSizeImage = _lineBytes * _tempBitMap.Height;
            //_bmpInf.bmiHeader.biWidth = _tempBitMap.Width;
            //_bmpInf.bmiHeader.biXPelsPerMeter = 0;
            //_bmpInf.bmiHeader.biYPelsPerMeter = 0;
            #endregion
        }
 public Frm_FanPowerAdvanceSetting(List <ILEDDisplayInfo> oneLedInfos, string sn, string commPort,
                                   SerializableDictionary <string, byte> curAllSettingDic,
                                   SettingCommInfo commInfo)
 {
     InitializeComponent();
     _oneLedInfos  = oneLedInfos;
     _sn           = sn;
     _commPort     = commPort;
     _curConfigDic = new SerializableDictionary <string, byte>();
     if (curAllSettingDic != null)
     {
         foreach (string addr in curAllSettingDic.Keys)
         {
             _curConfigDic.Add(addr, curAllSettingDic[addr]);
         }
     }
     try
     {
         _commonInfo = (SettingCommInfo)commInfo.Clone();
     }
     catch
     {
         _commonInfo = new SettingCommInfo();
     }
 }
Exemplo n.º 3
0
        private void crystalButton_FanCountSetting_Click(object sender, EventArgs e)
        {
            SettingCommInfo commInfo = new SettingCommInfo();
            commInfo.SameCount = (byte)numericUpDown_MCSameFanCount.Value;
            commInfo.TypeStr = CommonUI.GetCustomMessage(HsLangTable,"HwFanName","风扇");
            commInfo.IconImage = Nova.Monitoring.UI.MonitorFromDisplay.Properties.Resources.Fan;
            commInfo.MaxCount = (byte)(MaxFanCount);
            if (_vm.FanInfo.AllFanCountDif == null || _vm.FanInfo.AllFanCountDif.Count == 0)
            {
                SerializableDictionary<string, byte> moinfos = new SerializableDictionary<string, byte>();
                SetCount(MonitorAllConfig.Instance().AllCommPortLedDisplayDic[_vm.SN],
                    _vm.SN.Replace("-",""), commInfo.SameCount, out moinfos);
                _vm.FanInfo.AllFanCountDif = moinfos;
            }

            Frm_FanPowerAdvanceSetting setFanCntFrm = new Frm_FanPowerAdvanceSetting(
                MonitorAllConfig.Instance().AllCommPortLedDisplayDic[_vm.SN],
                string.IsNullOrEmpty(MonitorAllConfig.Instance().CurrentScreenName) ? _sn10 : MonitorAllConfig.Instance().CurrentScreenName,
                _vm.SN.Replace("-", ""), _vm.FanInfo.AllFanCountDif, commInfo);
            setFanCntFrm.StartPosition = FormStartPosition.CenterParent;
            //setFanCntFrm.UpdateFont(Frm_MonitorStatusDisplay.CurrentFont);
            setFanCntFrm.UpdateLanguage(CommonUI.LanguageName);
            if (setFanCntFrm.ShowDialog() == DialogResult.OK)
            {
                _vm.FanInfo.AllFanCountDif = setFanCntFrm.CurAllSettingDic;
            }
        }
Exemplo n.º 4
0
        public UC_StandarAndSimpleLayout(SettingCommInfo commInfo)
        {
            InitializeComponent();
            try
            {
                _commonInfo = (SettingCommInfo)commInfo.Clone();
            }
            catch
            {
                _commonInfo = new SettingCommInfo();
            }

            _proposedSize = new System.Drawing.Size(int.MaxValue, int.MaxValue);

            //默认字体
            this.DefaultFocusStyle.GridFont = new Font("宋体", 12, FontStyle.Regular);

            #region Bitmap -- Test
            //_tempBitMap = new Bitmap(_fanImage);
            //_lineBytes = ((_tempBitMap.Width * 24 + 31) >> 5) << 2;
            //_bmpInf.bmiHeader.biBitCount = 32;
            //_bmpInf.bmiHeader.biClrImportant = 1;
            //_bmpInf.bmiHeader.biClrUsed = 0;
            //_bmpInf.bmiHeader.biCompression = 0;
            //_bmpInf.bmiHeader.biHeight = -_tempBitMap.Height;
            //_bmpInf.bmiHeader.biPlanes = 1;
            //_bmpInf.bmiHeader.biSize = 40;
            //_bmpInf.bmiHeader.biSizeImage = _lineBytes * _tempBitMap.Height;
            //_bmpInf.bmiHeader.biWidth = _tempBitMap.Width;
            //_bmpInf.bmiHeader.biXPelsPerMeter = 0;
            //_bmpInf.bmiHeader.biYPelsPerMeter = 0;
            #endregion
        }
 public Frm_FanPowerAdvanceSetting(List<ILEDDisplayInfo> oneLedInfos,string sn,string commPort,
                                   SerializableDictionary<string, byte> curAllSettingDic, 
                                   SettingCommInfo commInfo)
 {
     InitializeComponent();
     _oneLedInfos = oneLedInfos;
     _sn = sn;
     _commPort = commPort;
     _curConfigDic = new SerializableDictionary<string, byte>();
     if (curAllSettingDic != null)
     {
         foreach(string addr in curAllSettingDic.Keys)
         {
             _curConfigDic.Add(addr, curAllSettingDic[addr]);
         }
     }
     try
     {
         _commonInfo = (SettingCommInfo)commInfo.Clone();
     }
     catch
     {
         _commonInfo = new SettingCommInfo();
     }
 }
Exemplo n.º 6
0
        public UC_OneScreenLayout(string commPort, ILEDDisplayInfo ledDisplayInfo,
                                  Dictionary<string, byte> curAllSettingDic,
                                  SettingCommInfo commInfo, 
                                  SettingMonitorCntEventHandler SetOneScanBoardInfoEvent)
        {
            InitializeComponent();
            this.Disposed += new EventHandler(UC_OneScreenLayout_Disposed);

            _commPort = commPort;
            _curLedInf = ledDisplayInfo;
            _curSettingDic = curAllSettingDic;

            _customToolTipFont = this.Font;
            _complexScreenFont = this.Font;
            _simpleOrStandardScreenFont = this.Font;
            try
            {
                _commonInfo = (SettingCommInfo)commInfo.Clone();
            }
            catch
            {
                _commonInfo = new SettingCommInfo();
            }
            _setOneScanBoardInfoEvent = SetOneScanBoardInfoEvent;

            _ledType = _curLedInf.Type;
            if (_ledType == LEDDisplyType.ComplexType)
            {
                _complexLayout = new UC_ComplexLayout(_commonInfo);
                _complexLayout.Parent = doubleBufferPanel_SettingZoon;
                _complexLayout.Dock = DockStyle.Fill;
                _complexLayout.SetComplexScreenInfEvent += new SettingMonitorCntEventHandler(ComplexScreenSetInfo);
                groupBox_ScalingRate.Visible = false;
            }
            else
            {
                _standarAndSimpleLayout = new UC_StandarAndSimpleLayout(_commonInfo);
                _standarAndSimpleLayout.DefaultFocusStyle.BackColor = Color.Wheat;
                _standarAndSimpleLayout.IsCanSelect = true;
                _standarAndSimpleLayout.IsCanSelectMoreGrid = true;
                _standarAndSimpleLayout.Parent = doubleBufferPanel_SettingZoon;
                _standarAndSimpleLayout.Dock = DockStyle.Fill;
                _standarAndSimpleLayout.BorderStyle = BorderStyle.FixedSingle;
                _standarAndSimpleLayout.BackColor = Color.Transparent;
                _standarAndSimpleLayout.ClearAllRectangularGrid();
                _standarAndSimpleLayout.ContextMenuStrip = contextMenuStrip_Set;
                _standarAndSimpleLayout.GridMouseMove += new RectangularGridMouseEventHandler(StandarAndSimpleLayout_GridMouseMove);

                _standarAndSimpleLayout.GridMouseDoubleClick += new RectangularGridMouseEventHandler(StandarAndSimpleLayout_GridMouseDoubleClick);

                groupBox_ScalingRate.Visible = true;
            }
            UpdateDisplay();
            if (_standarAndSimpleLayout != null)
            {
                vScrollBar_PixelLength_Scroll(null, null);
            }
        }
Exemplo n.º 7
0
        public UC_OneScreenLayout(string commPort, ILEDDisplayInfo ledDisplayInfo,
                                  Dictionary <string, byte> curAllSettingDic,
                                  SettingCommInfo commInfo,
                                  SettingMonitorCntEventHandler SetOneScanBoardInfoEvent)
        {
            InitializeComponent();
            this.Disposed += new EventHandler(UC_OneScreenLayout_Disposed);

            _commPort      = commPort;
            _curLedInf     = ledDisplayInfo;
            _curSettingDic = curAllSettingDic;

            _customToolTipFont          = this.Font;
            _complexScreenFont          = this.Font;
            _simpleOrStandardScreenFont = this.Font;
            try
            {
                _commonInfo = (SettingCommInfo)commInfo.Clone();
            }
            catch
            {
                _commonInfo = new SettingCommInfo();
            }
            _setOneScanBoardInfoEvent = SetOneScanBoardInfoEvent;

            _ledType = _curLedInf.Type;
            if (_ledType == LEDDisplyType.ComplexType)
            {
                _complexLayout        = new UC_ComplexLayout(_commonInfo);
                _complexLayout.Parent = doubleBufferPanel_SettingZoon;
                _complexLayout.Dock   = DockStyle.Fill;
                _complexLayout.SetComplexScreenInfEvent += new SettingMonitorCntEventHandler(ComplexScreenSetInfo);
                groupBox_ScalingRate.Visible             = false;
            }
            else
            {
                _standarAndSimpleLayout = new UC_StandarAndSimpleLayout(_commonInfo);
                _standarAndSimpleLayout.DefaultFocusStyle.BackColor = Color.Wheat;
                _standarAndSimpleLayout.IsCanSelect         = true;
                _standarAndSimpleLayout.IsCanSelectMoreGrid = true;
                _standarAndSimpleLayout.Parent      = doubleBufferPanel_SettingZoon;
                _standarAndSimpleLayout.Dock        = DockStyle.Fill;
                _standarAndSimpleLayout.BorderStyle = BorderStyle.FixedSingle;
                _standarAndSimpleLayout.BackColor   = Color.Transparent;
                _standarAndSimpleLayout.ClearAllRectangularGrid();
                _standarAndSimpleLayout.ContextMenuStrip = contextMenuStrip_Set;
                _standarAndSimpleLayout.GridMouseMove   += new RectangularGridMouseEventHandler(StandarAndSimpleLayout_GridMouseMove);

                _standarAndSimpleLayout.GridMouseDoubleClick += new RectangularGridMouseEventHandler(StandarAndSimpleLayout_GridMouseDoubleClick);

                groupBox_ScalingRate.Visible = true;
            }
            UpdateDisplay();
            if (_standarAndSimpleLayout != null)
            {
                vScrollBar_PixelLength_Scroll(null, null);
            }
        }
Exemplo n.º 8
0
 public object Clone()
 {
     SettingCommInfo newObj = new SettingCommInfo();
     bool res = this.CopyTo(newObj);
     if (!res)
     {
         return null;
     }
     else
     {
         return newObj;
     }
 }
Exemplo n.º 9
0
        public object Clone()
        {
            SettingCommInfo newObj = new SettingCommInfo();
            bool            res    = this.CopyTo(newObj);

            if (!res)
            {
                return(null);
            }
            else
            {
                return(newObj);
            }
        }
Exemplo n.º 10
0
        public bool CopyTo(object obj)
        {
            if (!(obj is SettingCommInfo))
            {
                return(false);
            }
            SettingCommInfo temp = (SettingCommInfo)obj;

            temp.IconImage = this.IconImage;
            temp.SameCount = this.SameCount;
            temp.TypeStr   = this.TypeStr;
            temp.MaxCount  = this.MaxCount;
            return(true);
        }
Exemplo n.º 11
0
        /// <summary>
        /// 构造复杂显示屏监控信息设置页面
        /// </summary>
        public UC_ComplexLayout(SettingCommInfo commInfo)
        {
            InitializeComponent();
            _countList = new List <byte>();
            _addrList  = new List <string>();

            try
            {
                _commonInfo = (SettingCommInfo)commInfo.Clone();
            }
            catch
            {
                _commonInfo = new SettingCommInfo();
            }
            CountArray = new string[_commonInfo.MaxCount];  //最大个数加上4,然后再加未选中时的个数0
            for (int i = 0; i < _commonInfo.MaxCount; i++)
            {
                CountArray[i] = (i + 1).ToString();
            }
            InitDataGridView();
        }