Exemplo n.º 1
0
 void pSetSize(CommonControl _control, int width, int height)
 {
     if (Platform.IsWinForms)
     {
         _control.Size = new Size(width, height);
     }
     else
     {
         _control.Width = width;
     }
 }
Exemplo n.º 2
0
        private void OpenConnection()
        {
            CommonControl.OpenConnection();

            if (CommonControl.CheckSocketState())
            {
                Dispatcher.Invoke(new Action(delegate
                {
                    CpldStatus.Text      = "在线";
                    ImgCpldStatus.Source = new BitmapImage(new Uri("Icon/cpldOnline.png", UriKind.RelativeOrAbsolute));
                    LoadBoardCount();
                }
                                             ));
            }
        }
Exemplo n.º 3
0
        private void HandleCheckResult(bool isCheckOk, IEnumerable <List <string> > shortCircuitList, IEnumerable <string[]> openCircuitList)
        {
            var shortCircuit = "";
            var openCircuit  = "";

            if (isCheckOk)
            {
                CommonCheck.UpdateBarList(Cable.CableName, this, _barDt);
                CpldControl.Bartend.BartendControl.PrintBar(Cable.CableName);

                CommonCheck.AddCheckResult(this, _barDt, Cable.CableName, "OK", shortCircuit, openCircuit, User.UserName);
                Cable.Settings.OkTime++;
                CommonControl.SendOkRelay(1000);
            }
            else
            {
                foreach (var tmpList in shortCircuitList)
                {
                    var scTmp = "";
                    foreach (var tmp in tmpList)
                    {
                        if (_phyAddrMapToDot.ContainsKey(tmp))
                        {
                            scTmp += ((Dot)_phyAddrMapToDot[tmp]).Info.Name + "-";
                        }
                        else
                        {
                            scTmp += tmp + "(未标定)-";
                        }
                    }
                    shortCircuit += scTmp.Remove(scTmp.Length - 1) + "; ";
                }

                openCircuit = openCircuitList.Aggregate(openCircuit, (current, arrTmp) => current + (arrTmp[0] + "/" + arrTmp[1] + "; "));

                CommonCheck.AddCheckResult(this, _barDt, Cable.CableName, "NG", shortCircuit, openCircuit, User.UserName);            //add check result to db
                Cable.Settings.NgTime++;
            }
            LbOkTime.Content = Cable.Settings.OkTime;
            LbNgTime.Content = Cable.Settings.NgTime;
            InfoBox.PlaySound(isCheckOk);
            new ResultPopUp(isCheckOk, Cable.Settings.OkAutoRelease, Cable.Settings.NgAutoRelease).ShowDialog();
        }
Exemplo n.º 4
0
        private static void LoadConfig(string strAP)
        {
            if (File.Exists(__documentDirectory + "\\Configuration\\QDConfig.tvc"))
            {
                _config.LoadConfig(__documentDirectory + "\\Configuration\\QDConfig.tvc");
                string key = "";
                _strConnect = _config.GetConnection(ref key, "QD");
                QueryBuilder.SQLBuilder.SetConnection(_strConnect);
                CommonControl.SetConnection(_strConnect);
                _strConnectDes     = _config.GetConnection(ref strAP, "AP");
                _sqlBuilder.ConnID = strAP;


                if (_config.DIR.Count > 0)
                {
                    __templatePath = _config.DIR[0]["TMP"].ToString();
                    __reportPath   = _config.DIR[0]["RPT"].ToString();
                }
                if (_config.SYS.Count > 0)
                {
                    ReportGenerator.User2007 = (bool)_config.SYS[0][_config.SYS.USE2007Column];
                }
            }
        }
Exemplo n.º 5
0
 private void useEnterAsTab(object sender, System.Windows.Input.KeyEventArgs e)
 {
     CommonControl.IntepretEnterAsTab(sender, e);
 }
Exemplo n.º 6
0
 private void txt_NumberOnlyCheck(object sender, TextCompositionEventArgs e)
 {
     CommonControl.NumberOnlyEventCheckNoPeriod(sender, e);
 }
Exemplo n.º 7
0
        private void SetResource(string filePath, bool loadWithTypeNone = false)
        {
            var typeInfo = FileType.GetFileViewType(filePath);

            if (loadWithTypeNone)
            {
                typeInfo.Type = FileViewType.None;
            }
            if (lastViewType != typeInfo.Type || MyGrid.Children[0] is HelloControl)
            {
                lastViewType = typeInfo.Type;
                MyGrid.Children.Clear();
            }
            else if (MyGrid.Children.Count == 1)
            {
                (MyGrid.Children[0] as FileControl).OnFileChanged((filePath, typeInfo.Ext));
                return;
            }
            FileControl fc;

            switch (typeInfo.Type)
            {
            case FileViewType.Image:
                fc = new ImageControl();
                GlobalNotify.OnResizeMode(true);
                break;

            case FileViewType.Code:
            case FileViewType.Txt:
                fc = new TextControl();
                GlobalNotify.OnResizeMode(true);
                break;

            case FileViewType.Music:
                fc = new MusicControl();
                GlobalNotify.OnResizeMode(false);
                break;

            case FileViewType.Video:
                fc = new VideoControl();
                GlobalNotify.OnResizeMode(true);
                break;

            case FileViewType.Pdf:
                fc = new PdfControl();
                GlobalNotify.OnResizeMode(true);
                break;

            case FileViewType.Excel:
                fc = new ExcelControl();
                GlobalNotify.OnResizeMode(true);
                break;

            case FileViewType.Word:
                fc = new WordControl();
                GlobalNotify.OnResizeMode(true);
                break;

            case FileViewType.PowerPoint:
                fc = new PowerPointControl();
                GlobalNotify.OnResizeMode(true);
                break;

            default:
                fc = new CommonControl();
                GlobalNotify.OnResizeMode(false);
                break;
            }
            if (fc != null)
            {
                LoadFile(fc, filePath, typeInfo.Ext);
            }
        }
Exemplo n.º 8
0
 public static void Foo(this CommonControl cc)
 {
 }
Exemplo n.º 9
0
 public void Setup(CommonControl common)
 {
     _common = common;
 }
Exemplo n.º 10
0
 void NumericTextBoxInput(object sender, TextCompositionEventArgs e)
 {
     CommonControl.NumericTextBoxInput(sender, e);
 }