Esempio n. 1
0
 /// <summary>
 ///     Indicates that this paragraph is a new revision
 /// </summary>
 /// <param name="par"></param>
 private void NewParagraphRevision(DataDictionary.Specification.Paragraph par)
 {
     if (par.Comment == null)
     {
         par.Comment = "";
     }
     par.Comment = par.Comment + "\nPrevious revision status was " + par.getImplementationStatus_AsString();
     par.setImplementationStatus(acceptor.SPEC_IMPLEMENTED_ENUM.Impl_NewRevisionAvailable);
     par.setReviewed(false);
     par.setBl("3.2.0");
     par.setVersion("3.2.0");
     foreach (ReqRef reqRef in par.Implementations)
     {
         ReqRelated reqRelated = reqRef.Model as ReqRelated;
         if (reqRelated != null)
         {
             reqRelated.setImplemented(false);
             reqRelated.setVerified(false);
         }
     }
 }
        /// <summary>
        /// Performs the delta on the specification provided
        /// </summary>
        /// <param name="delta"></param>
        /// <param name="specifications"></param>
        private void PerformDelta(DataDictionary.Specification.Specification specifications)
        {
            foreach (Paragraph p in NewDocument.ChangedParagraphs)
            {
                DataDictionary.Specification.Paragraph par = specifications.FindParagraph(p.Id);

                if (par != null)
                {
                    par.Text = p.Text;
                    par.AddInfo("Paragraph has been changed");
                    par.setImplementationStatus(DataDictionary.Generated.acceptor.SPEC_IMPLEMENTED_ENUM.Impl_NewRevisionAvailable);
                    par.setReviewed(false);
                    foreach (DataDictionary.ReqRef reqRef in par.Implementations)
                    {
                        DataDictionary.ReqRelated reqRelated = reqRef.Model as DataDictionary.ReqRelated;
                        if (reqRelated != null)
                        {
                            reqRelated.setImplemented(false);
                            reqRelated.setVerified(false);
                        }
                    }
                }
                else
                {
                    AddError(specifications, p, "Cannot find paragraph " + p.Id + " for modification");
                }
            }

            foreach (Paragraph p in NewDocument.NewParagraphs)
            {
                DataDictionary.Specification.Paragraph par = specifications.FindParagraph(p.Id);

                if (par != null)
                {
                    AddError(specifications, p, "Paragraph " + p.Id + " already exists, whereas it has been detected as a new paragraph in the release");
                }
                else
                {
                    par = specifications.FindParagraph(p.Id, true);
                    if (par != null)
                    {
                        par.setText(p.Text);
                        par.AddInfo("New paragraph");
                    }
                    else
                    {
                        AddError(specifications, p, "Paragraph " + p.Id + " cannot be found in the specification");
                    }
                }
            }

            foreach (Paragraph p in NewDocument.RemovedParagraphs)
            {
                DataDictionary.Specification.Paragraph par = specifications.FindParagraph(p.Id);

                if (par != null)
                {
                    par.Text = "<Removed in current release>";
                    par.AddInfo("Paragraph has been removed");
                }
                else
                {
                    AddError(specifications, p, "Cannot find paragraph " + p.Id + " for removal");
                }
            }
        }