コード例 #1
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="ledShowInfo"></param>
        /// <returns></returns>
        public bool UpdateScreenSetting(ScreenSetting screenSetting)
        {
            string sSql = $@"Update ScreenSetting  set ScreenID ='{screenSetting.ScreenID}' ,AddressNum ='{screenSetting.AddressNum}' ,
CarName = '{screenSetting.CarName}',ScreenWidth= '{screenSetting.ScreenWidth}' ,ScreenHeight = '{screenSetting.ScreenHeight}'
,IpAddress = '{screenSetting.IpAddress}',ColorStyle= '{screenSetting.ColorStyle}',FontSize = '{screenSetting.FontSize}' where ID = '{screenSetting.ID}'";

            return(server.ExecuteNonQuery(sSql) > 0);
        }
コード例 #2
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="ledShowInfo"></param>
        /// <returns></returns>
        public bool InsertScreenSetting(ScreenSetting screeenSetting)
        {
            string sSql = $@"Insert into ScreenSetting(ScreenID,AddressNum,CarName,ScreenWidth,ScreenHeight,IpAddress,ColorStyle,FontSize) 
values('{screeenSetting.ScreenID}','{screeenSetting.AddressNum}','{screeenSetting.CarName}','{screeenSetting.ScreenWidth}','{screeenSetting.ScreenHeight}',
'{screeenSetting.IpAddress}','{screeenSetting.ColorStyle}','{screeenSetting.FontSize}')";

            return(server.ExecuteNonQuery(sSql) > 0);
        }
コード例 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            DisplayOrientation ori = ScreenSetting.GetScreenOrientation();

            if (ori == DisplayOrientation.DmdoDEFAULT)
            {
                ori = DisplayOrientation.Dmdo90;
            }
            else
            {
                ori = DisplayOrientation.DmdoDEFAULT;
            }
            ScreenSetting.Orientation(ori);
        }
コード例 #4
0
        public void SetScreen(ScreenSetting setting)
        {
            _setting = setting;

            _headerBox.Text     = _setting.Header.Value;
            _backgroundBox.Text = _setting.Background.Value;

            _bannerLabel.Visible  = IsWelcomeScreen();
            _bannerBox.Visible    = IsWelcomeScreen();
            _bannerButton.Visible = IsWelcomeScreen();

            if (IsWelcomeScreen())
            {
                _bannerBox.Text = Config.MainBanner.Value;
            }
        }
コード例 #5
0
ファイル: FrmLEDSetting.cs プロジェクト: yangyunping/GUIDE
 public FrmLEDSetting(ScreenSetting screeenSetting)
 {
     InitializeComponent();
     id                  = screeenSetting.ID;
     txtLEDid.Text       = screeenSetting.ScreenID;
     txtWidth.Text       = screeenSetting.ScreenWidth.ToString();
     txtHeight.Text      = screeenSetting.ScreenHeight.ToString();
     cmbControlType.Text = screeenSetting.CarName;
     cmbCarAdress.Text   = screeenSetting.AddressNum.ToString();
     cmbColor.Text       = screeenSetting.ColorStyle;
     IpAddress0.Text     = screeenSetting.IpAddress.Split('.')[0].ToString();
     IpAddress1.Text     = screeenSetting.IpAddress.Split('.')[1].ToString();
     IpAddress2.Text     = screeenSetting.IpAddress.Split('.')[2].ToString();
     IpAddress3.Text     = screeenSetting.IpAddress.Split('.')[3].ToString();
     txtFontSize.Text    = screeenSetting.FontSize.ToString();
 }
コード例 #6
0
    /// <summary>
    /// 如果是移动平台,根据屏幕设置分辨率
    /// </summary>
    private void OnAwakeScreen()
    {
        bool fullscreen = false;

        if (Application.isMobilePlatform)
        {
            fullscreen = true;
        }
        else
        {
            fullscreen = Screen.fullScreen;
        }
        ScreenSetting.Init();
#if UNITY_IPHONE || UNITY_IOS || UNITY_ANDROID
        ScreenSetting.ScreenInch(this.gameObject, fullscreen);
#endif
    }
コード例 #7
0
ファイル: Program.cs プロジェクト: taisandog/OtherSource
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            DisplayOrientation ori = ScreenSetting.GetScreenOrientation();

            if (ori == DisplayOrientation.DmdoDEFAULT)
            {
                ori = DisplayOrientation.Dmdo90;
            }
            else
            {
                ori = DisplayOrientation.DmdoDEFAULT;
            }
            ScreenSetting.Orientation(ori);

            //Application.Run(new Form1());
        }
コード例 #8
0
 /// <summary>
 /// 修改参数信息
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnModify_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvScreenSetting.CurrentRow != null)
         {
             ScreenSetting screeenSetting = new ScreenSetting();
             screeenSetting.ID           = Convert.ToInt32(dgvScreenSetting.CurrentRow.Cells["ID"].Value);
             screeenSetting.ScreenID     = dgvScreenSetting.CurrentRow.Cells["ScreenId"].Value.ToString();
             screeenSetting.ScreenWidth  = Convert.ToInt32(dgvScreenSetting.CurrentRow.Cells["ScreenWidth"].Value);
             screeenSetting.ScreenHeight = Convert.ToInt32(dgvScreenSetting.CurrentRow.Cells["ScreenHeight"].Value);
             screeenSetting.AddressNum   = Convert.ToInt32(dgvScreenSetting.CurrentRow.Cells["AddressNum"].Value);
             screeenSetting.CarName      = dgvScreenSetting.CurrentRow.Cells["CarName"].Value.ToString();
             screeenSetting.ColorStyle   = dgvScreenSetting.CurrentRow.Cells["ColorStyle"].Value.ToString();
             screeenSetting.IpAddress    = dgvScreenSetting.CurrentRow.Cells["IpAddress"].Value.ToString();
             screeenSetting.FontSize     = Convert.ToInt32(dgvScreenSetting.CurrentRow.Cells["FontSize"].Value);
             FrmLEDSetting frmLEDSetting = new FrmLEDSetting(screeenSetting);
             frmLEDSetting.ShowDialog();
             btnSearch_Click(null, null);
         }
     }
     catch { }
 }
コード例 #9
0
        private void LoadSettings()
        {
            _counter = 0;

            _screenSetting = _processGame.LoadSettings();

            lblCounter.Text = _counter + " to " + _screenSetting.Counter + " wins";

            lblPlayerOne.Text      = _screenSetting.PlayerOne.Name;
            lblPlayerOneScore.Text = _screenSetting.PlayerOne.Score.ToString();

            lblPlayerTwo.Text      = _screenSetting.PlayerTwo.Name;
            lblPlayerTwoScore.Text = _screenSetting.PlayerTwo.Score.ToString();

            this.HideResultArea();

            // Computer vs Computer
            if (!_screenSetting.IsShapesEnabled)
            {
                btnStartGame.Visible = true;
                btnStartGame.Enabled = true;
                HideShapeButtons();
            }
        }
コード例 #10
0
 public bool UpdateScreenSetting(ScreenSetting screenSetting)
 {
     return(dalSreenSetting.UpdateScreenSetting(screenSetting));
 }
コード例 #11
0
 /// <summary>
 /// 新增
 /// </summary>
 /// <param name="ledShowInfo"></param>
 /// <returns></returns>
 public bool InsertScreenSetting(ScreenSetting screenSetting)
 {
     return(dalSreenSetting.InsertScreenSetting(screenSetting));
 }
コード例 #12
0
ファイル: FrmLEDSetting.cs プロジェクト: yangyunping/GUIDE
        /// <summary>
        /// 添加控制卡参数到配置文件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                int carTpe = 0;
                if (cmbControlType.Text.Equals("21-EQ2013"))
                {
                    carTpe = 21;
                }
                else if (cmbControlType.Text.Equals("22-EQ2023"))
                {
                    carTpe = 22;
                }
                else if (cmbControlType.Text.Equals("23-EQ2033"))
                {
                    carTpe = 23;
                }
                else
                {
                    MessageBox.Show("信息不全!");
                    return;
                }
                int colorStyle = 0;
                if (cmbColor.Text.Equals("单色"))
                {
                    colorStyle = 0;
                }
                else if (cmbColor.Text.Equals("双色"))
                {
                    colorStyle = 1;
                }

                ScreenSetting screenSetting = new ScreenSetting();
                screenSetting.ScreenID     = txtLEDid.Text.Trim();
                screenSetting.ScreenWidth  = Convert.ToInt32(txtWidth.Text);
                screenSetting.ScreenHeight = Convert.ToInt32(txtHeight.Text);
                screenSetting.AddressNum   = Convert.ToInt32(cmbCarAdress.Text);
                screenSetting.CarName      = cmbControlType.Text;
                screenSetting.ColorStyle   = cmbColor.Text;
                screenSetting.IpAddress    = IpAddress0.Text + "." + IpAddress1.Text + "." + IpAddress2.Text + "." + IpAddress3.Text;
                screenSetting.FontSize     = Convert.ToInt32(txtFontSize.Text);
                if (id == -1)//判断是  其他为修改   新增-1
                {
                    bllScreeenSetting.InsertScreenSetting(screenSetting);
                }
                else
                {
                    screenSetting.ID = id;
                    bllScreeenSetting.UpdateScreenSetting(screenSetting);
                }


                //保存到EQ诣阔LED动态库指定的文件里
                PublicClass.WritePrivateProfileString(@"地址:" + (Convert.ToInt32(cmbCarAdress.Text) - 1), "CardType", carTpe.ToString(), _EQSetPath);                                      //控制类型
                PublicClass.WritePrivateProfileString(@"地址:" + (Convert.ToInt32(cmbCarAdress.Text) - 1), "CardAddress", (Convert.ToInt32(cmbCarAdress.Text) - 1).ToString(), _EQSetPath); //控制地址
                PublicClass.WritePrivateProfileString(@"地址:" + (Convert.ToInt32(cmbCarAdress.Text) - 1), "CommunicationMode", "1", _EQSetPath);                                           //通讯方式
                PublicClass.WritePrivateProfileString(@"地址:" + (Convert.ToInt32(cmbCarAdress.Text) - 1), "ScreemWidth", txtWidth.Text, _EQSetPath);                                       //显示屏宽度
                PublicClass.WritePrivateProfileString(@"地址:" + (Convert.ToInt32(cmbCarAdress.Text) - 1), "ScreemHeight", txtHeight.Text, _EQSetPath);                                     //显示屏高度
                PublicClass.WritePrivateProfileString(@"地址:" + (Convert.ToInt32(cmbCarAdress.Text) - 1), "SerialBaud", "57600", _EQSetPath);                                              //串口通信波特率
                PublicClass.WritePrivateProfileString(@"地址:" + (Convert.ToInt32(cmbCarAdress.Text) - 1), "SerialNum", "1", _EQSetPath);                                                   //串口通信串口号
                PublicClass.WritePrivateProfileString(@"地址:" + (Convert.ToInt32(cmbCarAdress.Text) - 1), "NetPort", "5005", _EQSetPath);                                                  //网络通信端口号
                PublicClass.WritePrivateProfileString(@"地址:" + (Convert.ToInt32(cmbCarAdress.Text) - 1), "IpAddress0", IpAddress0.Text, _EQSetPath);                                      //IP地址
                PublicClass.WritePrivateProfileString(@"地址:" + (Convert.ToInt32(cmbCarAdress.Text) - 1), "IpAddress1", IpAddress1.Text, _EQSetPath);
                PublicClass.WritePrivateProfileString(@"地址:" + (Convert.ToInt32(cmbCarAdress.Text) - 1), "IpAddress2", IpAddress2.Text, _EQSetPath);
                PublicClass.WritePrivateProfileString(@"地址:" + (Convert.ToInt32(cmbCarAdress.Text) - 1), "IpAddress3", IpAddress3.Text, _EQSetPath);
                PublicClass.WritePrivateProfileString(@"地址:" + (Convert.ToInt32(cmbCarAdress.Text) - 1), "ColorStyle", colorStyle.ToString(), _EQSetPath); //显示屏颜色类型

                MessageBox.Show("保存成功!");
                if (id != -1)
                {
                    this.Close();//修改完关闭窗体
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }