Esempio n. 1
0
        public Infragistics.Win.UltraWinDataSource.UltraDataRow  AddRow(object[] cells)
        {
            if (cells == null)
            {
                return(null);
            }

            if (this.Columns.Count != cells.Length)
            {
                return(null);
            }

            Infragistics.Win.UltraWinDataSource.UltraDataRow row = this.Rows.Add();
            for (int i = 0; i < this.Columns.Count; i++)
            {
                row[i] = cells[i];
            }

            return(row);
        }
Esempio n. 2
0
        private void StringParsing(string strLine)
        {
            string readNo = "", readName = "", readMin = "", readMax = "", readData = "";
            int    indexNo = 0, indexStr = 0, indexEnd = 0;

            if (strLine.Length < 12 || strLine.IndexOf('=') > 3 || strLine.IndexOf('=') < 0)
            {
                return;
            }

            indexNo = int.Parse(strLine.Substring(0, 2));
            readNo  = indexNo.ToString("00");
            if (readNo == "00")
            {
                this.m_ColumnNo++;
            }
            indexStr = strLine.IndexOf('=');
            indexEnd = strLine.IndexOf('|');
            readName = strLine.Substring(indexStr + 1, indexEnd - indexStr - 1);
            indexStr = strLine.IndexOf('|', indexEnd + 1);
            readMin  = strLine.Substring(indexEnd + 1, indexStr - indexEnd - 1);
            indexEnd = strLine.IndexOf('|', indexStr + 1);
            readMin  = strLine.Substring(indexStr + 1, indexEnd - indexStr - 1);
            indexStr = strLine.IndexOf('|', indexEnd + 1);
            readMax  = strLine.Substring(indexEnd + 1, indexStr - indexEnd - 1);
            indexEnd = strLine.IndexOf('|', indexStr + 1);
            int temp = strLine.Length - indexStr - 1;

            readData = strLine.Substring(indexStr + 1, strLine.Length - indexStr - 1);

            Infragistics.Win.UltraWinDataSource.UltraDataRow ultraDataRow = null;
            this.uDSConfigStepMotor.Rows.Add();
            ultraDataRow    = this.uDSConfigStepMotor.Rows[this.uDSConfigStepMotor.Rows.Count - 1];
            ultraDataRow[0] = readName;
            ultraDataRow[1] = readMin;
            ultraDataRow[2] = readMax;
            ultraDataRow[3] = readData;
        }
Esempio n. 3
0
        private void StringParsing(string strLine)
        {
            string readNo = "", readName = "", readData = "";
            int    indexNo    = strLine.IndexOf('.');
            int    indexLeng  = strLine.Length;
            string Datastring = strLine.Substring(0, 2);

            if (Datastring == "##" || Datastring == "#=")
            {
                return;
            }

            readNo = strLine.Substring(0, 2);
            if (readNo == "00")
            {
                this.m_ColumnNo++;
            }
            indexNo  = strLine.IndexOf('=');
            readName = strLine.Substring(3, indexNo - 3);
            readData = strLine.Substring(indexNo + 1, strLine.Length - indexNo - 1);

            Infragistics.Win.UltraWinDataSource.UltraDataRow ultraDataRow = null;
            if (this.uDSConfigMotion.Rows.Count < 40)
            {
                this.uDSConfigMotion.Rows.Add();
                ultraDataRow    = this.uDSConfigMotion.Rows[this.uDSConfigMotion.Rows.Count - 1];
                ultraDataRow[0] = readName;
                ultraDataRow[1] = readData;
            }
            else
            {
                int cn = this.uDSConfigMotion.Band.Columns.Count;
                ultraDataRow = this.uDSConfigMotion.Rows[int.Parse(readNo)];
                ultraDataRow[this.m_ColumnNo] = readData;
            }
        }
Esempio n. 4
0
        public void RefreshPanel()
        {
            //Laws Lu,2006/12/27 减少Open/Close次数
            ((SQLDomainDataProvider)DataProvider).PersistBroker.AutoCloseConnection = false;
            ((SQLDomainDataProvider)DataProvider).PersistBroker.OpenConnection();
            if (_shelfFacade == null)
            {
                _shelfFacade = new ShelfFacade(this.DataProvider);
            }
            /* 尚未到期的 */
            this.ultraDataSource1.Rows.Clear();
            Hashtable expiredHt = _shelfFacade.GetNotExpiredShelf();

            if (expiredHt != null)
            {
                System.Data.DataTable dtExpire = new System.Data.DataTable();

                dtExpire.Columns.Add("ShelfNO1", typeof(string));
                dtExpire.Columns.Add("ResidualTime", typeof(int));
                dtExpire.Columns.Add("ShelfPosition", typeof(string));
                foreach (DictionaryEntry dic in expiredHt)
                {
                    BurnOutShelf sf   = (BurnOutShelf)dic.Value;
                    TimeSpan     span = sf.TimeSpan;
                    int          min  = span.Days * 24 * 60 + span.Hours * 60 + span.Minutes;

                    //she
                    dtExpire.Rows.Add(new object[] { sf.ShelfNO, min, sf.memo });
                    dtExpire.AcceptChanges();
                }

                System.Data.DataView dv = new System.Data.DataView(dtExpire);

                dv.Sort = "ResidualTime DESC";

                for (int i = 0; i < dv.Count; i++)
                {
//					try
//					{
                    Infragistics.Win.UltraWinDataSource.UltraDataRow row = ultraDataSource1.Rows.Add();

                    row["ShelfNO1"] = dv[i]["ShelfNO1"].ToString();

                    row["ResidualTime"] = dv[i]["ResidualTime"].ToString() + "min";

                    row["ShelfPosition"] = dv[i]["ShelfPosition"].ToString();

//					}
//					catch{}
                }
                //ultraGrid1.DisplayLayout.Override. = Infragistics.Win.UltraWinGrid.RowFilterMode.
                //ultraDataSource1.Band.Columns.
            }

            /* 已经到期的 */
            this.ultraDataSource2.Rows.Clear();
            Hashtable notExpiredHt = _shelfFacade.GetExpiredShelf();

            if (notExpiredHt != null)
            {
                ArrayList alList = new ArrayList();
                alList.AddRange(notExpiredHt.Keys);
                alList.Sort();
                foreach (object key in alList)
                {
//					try
//					{

                    Infragistics.Win.UltraWinDataSource.UltraDataRow row = ultraDataSource2.Rows.Add();

                    if (notExpiredHt.ContainsKey(key))
                    {
                        BurnOutShelf bs = (BurnOutShelf)notExpiredHt[key];
                        row["ShelfNO2"]       = bs.ShelfNO;
                        row["ShelfPosition2"] = bs.memo;
                    }

//					}
//					catch{}
                }
            }


            /* 车位数量的 */
            object volumn = _shelfFacade.GetBurnInOutVolumn(Guid.Empty.ToString());

            if (volumn != null)
            {
                this.lblTotal.Text = (volumn as BurnInOutVolumn).Total.ToString("##.##");
                this.lblUsed.Text  = (volumn as BurnInOutVolumn).Used.ToString("##.##");
                decimal residual = (volumn as BurnInOutVolumn).Total - (volumn as BurnInOutVolumn).Used;
                this.lblResidual.Text = residual.ToString("##.##");
            }

            //Laws Lu,2006/12/27 减少Open/Close次数
            ((SQLDomainDataProvider)DataProvider).PersistBroker.CloseConnection();
            ((SQLDomainDataProvider)DataProvider).PersistBroker.AutoCloseConnection = true;

            Application.DoEvents();
            this.uclShelfNO.TextFocus(true, true);
//			System.Windows.Forms.SendKeys.Send("+{TAB}");
        }