Exemple #1
0
 public SCCWithComponentsConstraintComponent(string name, WithComponentsConstraint.Component.PresenseConstraint presCon, IConstraint valCon)
     : base(name, presCon, valCon)
 {
 }
Exemple #2
0
 public override WithComponentsConstraint.Component CreateWithComponentsConstraintComponent(string name, WithComponentsConstraint.Component.PresenseConstraint presCon, IConstraint valCon)
 {
     return new SCCWithComponentsConstraintComponent(name, presCon, valCon);
 }
        public void PrintHtml(StreamWriterLevel o, int p, int index, WithComponentsConstraint.Component cmp)
        {
            IInternalContentsInHtml intCont = m_type as IInternalContentsInHtml;

            string cssClass = "OddRow";
            if (index % 2 == 0)
                cssClass = "EvenRow";
            o.WriteLine("<tr class=\"" + cssClass + "\">");
            o.WriteLine("<td class=\"no\">{0}</td>", index);
            o.WriteLine("<td class=\"field\">{0}</td>", m_childVarName);
            if (intCont == null)
                o.WriteLine("<td class=\"comment\">{0}</td>", o.BR(m_comments));
            else
                o.WriteLine("<td class=\"comment\">{0}</td>", o.BR(m_comments) + intCont.InternalContentsInHtml(m_type.m_constraints));
            if (m_optional)
                o.WriteLine("<td class=\"optional\">Yes</td>");
            else if (m_default)
                o.WriteLine("<td class=\"optional\">Def</td>");
            else
                o.WriteLine("<td class=\"optional\">No</td>");

            if (m_type is ReferenceType)
                o.WriteLine("<td class=\"type\"> <a href=\"#ICD_{0}\">{1}</a></td>", m_type.Name.Replace("-", "_"), m_type.Name);
            else
                o.WriteLine("<td class=\"type\">{0}</td>", m_type.Name);

            string withComponentPart = string.Empty;
            if (cmp != null)
            {
                withComponentPart = "<span style=\"color: yellow\">";
                if (cmp.m_valueConstraint != null)
                    withComponentPart += " (" + cmp.m_valueConstraint.ToString() + ")";
                if (cmp.m_presenceConstraint != WithComponentsConstraint.Component.PresenseConstraint.None)
                    withComponentPart += " " + cmp.m_presenceConstraint.ToString();
                withComponentPart += "</span>" + ICDBType.WithComponentWhy;
                ICDBackend.m_WithComponentMustBeExplained = true;
            }

            o.WriteLine("<td class=\"constraint\">{0}</td>", o.Constraint(m_type.Constraints + withComponentPart));

            if (m_type.GetFinalType() is IntegerType && m_type.MinBitsInPER == 0 && m_type.MaxBitsInPER == 0)
            {
                o.WriteLine("<td class=\"min\">0{0}</td>", ICDBType.ZeroBitsWhy);
                o.WriteLine("<td class=\"max\">0{0}</td>", ICDBType.ZeroBitsWhy);
                ICDBackend.m_ZeroBitsMustBeExplained = true;
            }
            else
            {
                o.WriteLine("<td class=\"min\">{0}</td>", (m_type.MinBitsInPER == -1 ? "&#8734" : m_type.MinBitsInPER.ToString()));
                o.WriteLine("<td class=\"max\">{0}{1}</td>", (m_type.MaxBitsInPER == -1 ? "&#8734" : m_type.MaxBitsInPER.ToString()), m_type.MaxBitsInPER_Explained);
            }
            o.WriteLine("</tr>");
        }