Ejemplo n.º 1
0
        private void ShowRequirementLog(int nKey)
        {
            FormGenericTable genTable;

            ReqProRequirementPrx.sHistEntry[] asHistory;
            ReqProRequirementPrx rpxReq;
            int nCount;

            string[,] astrGrid;
            string[] astrHead;
            float[]  afHeadSize;

            rpxReq        = reqDBBrowser.GetRequirementPrx(nKey);
            astrHead      = new string[2];
            astrHead[0]   = rpxReq.Name;
            astrHead[1]   = rpxReq.Text;
            afHeadSize    = new float[2];
            afHeadSize[0] = 3F / 2;
            afHeadSize[1] = 11F / 2;

            genTable = new FormGenericTable("Log - Requirement: " + rpxReq.Tag, astrHead, afHeadSize, FormGenericTableLayout.eFormGenericTableToken.eReqLog);
            rpxReq.GetRequirementLog(out asHistory);
            nCount = asHistory.GetLength(0);

            astrGrid       = new string [nCount + 1, 4];
            astrGrid[0, 0] = "Rev";
            astrGrid[0, 1] = "Date";
            astrGrid[0, 2] = "User";
            astrGrid[0, 3] = "Description";

            for (int i = 1; i <= nCount; i++)
            {
                astrGrid[i, 0] = asHistory[i - 1].strRevision;
                astrGrid[i, 1] = asHistory[i - 1].date.ToString("u");
                astrGrid[i, 2] = asHistory[i - 1].strUser;
                astrGrid[i, 3] = asHistory[i - 1].strDesc;
            }

            genTable.SetGridContent(astrGrid, nCount + " Log Entries");
            genTable.Show();
        }
Ejemplo n.º 2
0
        private void ShowRequirements(ArrayList arrKeys, string strTreePathName, bool bWithFilter)
        {
            ReqProRequirementPrx rpxReq;
            FormGenericTable     genTable;
            int    nCount;
            string strCell;
            int    nTraceCountTo;
            int    nTraceCountFrom;

            ReqProRequirementPrx[] arpxReqTracesTo;
            ReqProRequirementPrx[] arpxReqTracesFrom;
            ReqTraceNode           reqTN;

            string[]      arrStringTrace;
            List <string> listTrace = new List <string>();

            string[,] astrGrid;
            List <string[]> aastrCells;
            List <string>   rowHdrCells = new List <string>();

            string[] rowCells;

            string[]      astrCol;
            string[]      astrValue;
            int           nColCount;
            List <string> colTraceTo;
            List <string> colTraceFrom;

            ReqProRequirementPrx.eTraceAbortReason eAbortReason = ReqProRequirementPrx.eTraceAbortReason.eNoAbort;

            if (bWithFilter)
            {
                if (!ToContinueAfterFilter(true, false))
                {
                    return;
                }
            }

            genTable = new FormGenericTable("Requirements - Package: " + strTreePathName, null, null, FormGenericTableLayout.eFormGenericTableToken.eReqDetails);
            nCount   = 0;

            /* at least we have: Tag, Name, Text, Version, Date, User,  */
            rowHdrCells.Add("Tag");
            rowHdrCells.Add("Name");
            rowHdrCells.Add("Text");
            rowHdrCells.Add("Version");
            rowHdrCells.Add("Date");
            rowHdrCells.Add("User");
            rowHdrCells.Add("Path");
            rowHdrCells.Add("Package");

            colTraceTo   = new List <string>();
            colTraceFrom = new List <string>();

            colTraceTo.Add("Trace To");
            colTraceFrom.Add("Trace From");

            aastrCells = new List <string[]> ();


            foreach (int nKey in arrKeys)
            {
                int nColIdx;
                rowCells = new string [rowHdrCells.Count];

                rpxReq = reqDBBrowser.GetRequirementPrx(nKey);

                if (!listnReqTypeRootKeyExcl.Contains(rpxReq.ReqTypeKey))
                {
                    rowCells[0] = rpxReq.Tag;
                    rowCells[1] = rpxReq.Name;
                    rowCells[2] = rpxReq.Text;
                    rowCells[3] = rpxReq.VersionNumber;
                    rowCells[4] = rpxReq.VersionDateTime;
                    rowCells[5] = rpxReq.VersionUser;
                    rowCells[6] = rpxReq.PackagePathName;
                    rowCells[7] = rpxReq.PackageName;

                    nColCount = rpxReq.GetAttributes(out astrCol, out astrValue);

                    for (int i = 0; i < nColCount; i++)
                    {
                        nColIdx = rowHdrCells.IndexOf(astrCol[i]);
                        if (nColIdx == -1)
                        {
                            int      nOldCnt     = rowHdrCells.Count;
                            string[] rowCellsOld = rowCells;
                            rowCells = new string[nOldCnt + 1];
                            rowHdrCells.Add(astrCol[i]);
                            for (int j = 0; j < nOldCnt; j++)
                            {
                                rowCells[j] = rowCellsOld[j];
                            }
                            nColIdx = rowHdrCells.Count - 1;
                        }
                        rowCells[nColIdx] = astrValue[i];
                        if (rowCells[nColIdx] == null)
                        {
                            rowCells[nColIdx] = "";
                        }
                        System.Diagnostics.Trace.Write(rowHdrCells[nColIdx] + "(" + rowCells[nColIdx] + "); ");
                    }

                    aastrCells.Add(rowCells);
                    arpxReqTracesTo   = rpxReq.GetRequirementTracesTo(20, ref eAbortReason, out nTraceCountTo, null);
                    arpxReqTracesFrom = rpxReq.GetRequirementTracesFrom(20, ref eAbortReason, out nTraceCountFrom, null);
                    reqTN             = new ReqTraceNode(rpxReq, 0, true, arpxReqTracesFrom, arpxReqTracesTo,
                                                         nTraceCountFrom, nTraceCountTo, eAbortReason, 0, 0);

                    reqTN.GetTraceFromString(out listTrace);
                    arrStringTrace = listTrace.ToArray();
                    colTraceFrom.Add(string.Join("\n", arrStringTrace));

                    reqTN.GetTraceToString(out listTrace);
                    arrStringTrace = listTrace.ToArray();
                    colTraceTo.Add(string.Join("\n", arrStringTrace));

                    nCount++;
                }
            }

            aastrCells.Insert(0, rowHdrCells.ToArray());

            // we want some additional space for Trace To and From
            astrGrid = new string[aastrCells.Count, rowHdrCells.Count + 2];
            for (int i = 0; i < aastrCells.Count; i++)
            {
                int j;
                for (j = 0; j < rowHdrCells.Count; j++)
                {
                    if (j < aastrCells[i].GetLength(0))
                    {
                        strCell = aastrCells[i][j];
                    }
                    else
                    {
                        strCell = null;
                    }
                    if (strCell == null)
                    {
                        strCell = "n/a";
                    }
                    astrGrid[i, j] = strCell;
                }
                astrGrid[i, j]     = colTraceTo[i];
                astrGrid[i, j + 1] = colTraceFrom[i];
            }

            genTable.SetGridContent(astrGrid, nCount + " Requirements");
            genTable.Show();
        }
Ejemplo n.º 3
0
        private void ShowRequirementsLog(ArrayList arrKeys, string strTreePathName, bool bWithFilter)
        {
            ReqProRequirementPrx rpxReq;
            FormGenericTable     genTable;

            ReqProRequirementPrx.sHistEntry[] asPerReqHistory;
            int nCount;
            int nReqCount = 0;

            string[,] astrGrid;
            List <ReqProRequirementPrx.sHistEntry> listHistory;
            List <string> listTag;
            List <string> listName;

            listHistory = new List <ReqProRequirementPrx.sHistEntry>();
            listTag     = new List <string>();
            listName    = new List <string>();

            if (bWithFilter)
            {
                if (!ToContinueAfterFilter(true, false))
                {
                    return;
                }
            }

            genTable = new FormGenericTable("Log - Package: " + strTreePathName, null, null, FormGenericTableLayout.eFormGenericTableToken.eReqLog);

            foreach (int nKey in arrKeys)
            {
                rpxReq = reqDBBrowser.GetRequirementPrx(nKey);
                if (!listnReqTypeRootKeyExcl.Contains(rpxReq.ReqTypeKey))
                {
                    rpxReq.GetRequirementLog(out asPerReqHistory);
                    listHistory.AddRange(asPerReqHistory);
                    for (int i = 0; i < asPerReqHistory.GetLength(0); i++)
                    {
                        listTag.Add(rpxReq.Tag);
                        listName.Add(rpxReq.Name);
                    }
                    nReqCount++;
                }
            }

            nCount = listHistory.Count;

            astrGrid       = new string[nCount + 1, 6];
            astrGrid[0, 0] = "Tag";
            astrGrid[0, 1] = "Name";
            astrGrid[0, 2] = "Rev";
            astrGrid[0, 3] = "Date";
            astrGrid[0, 4] = "User";
            astrGrid[0, 5] = "Description";

            for (int i = 1; i <= nCount; i++)
            {
                astrGrid[i, 0] = listTag[i - 1];
                astrGrid[i, 1] = listName[i - 1];
                astrGrid[i, 2] = listHistory[i - 1].strRevision;
                astrGrid[i, 3] = listHistory[i - 1].date.ToString("u");
                astrGrid[i, 4] = listHistory[i - 1].strUser;
                astrGrid[i, 5] = listHistory[i - 1].strDesc;
            }

            genTable.SetGridContent(astrGrid, nCount + " Log Entries for " + nReqCount + " Requirements");
            genTable.Show();
        }