Example #1
0
        /** już nie używane  nowy generator */
        private string dajSlownikStare(Package d, ref int wiersz)
        {
            okno.Log(Statystyki.LogMsgType.Info, "Eksport słownika");
            String wynik = "";

            wynik += "<div class=\"img\">";
            wynik += dajTytulRozdz("2", ref wiersz, "Rozdzial1b");
            Wordy.Table tab;
            if (jezykPolski)
            {
                tab = word.wstawTabele("", new string[] { "Lp", "Skrót/pojęcie", "Opis" });
            }
            else
            {
                tab = word.wstawTabele("", new string[] { "No", "Term", "Description" });
            }
            tab.Columns[1].SetWidth(50f, Wordy.WdRulerStyle.wdAdjustNone);
            tab.Columns[2].SetWidth(150f, Wordy.WdRulerStyle.wdAdjustNone);
            tab.Columns[3].SetWidth(300f, Wordy.WdRulerStyle.wdAdjustNone);
            wynik += "<table><tr><th>Lp</th><th>Skrót/pojęcie</th><th>Opis</th></tr>";
            int i = 1;

            foreach (Element e in d.Elements)
            {
                wynik += "<tr";
                if (i % 2 == 0)
                {
                    wynik += " class=\"parz\"";
                }
                wynik += "><td>" + i + "</td><td>" + e.Name + "</td><td>";
                string opis = "";
                ///// zmiana

                /* foreach (TaggedValue t in e.TaggedValues)
                 * {
                 *   if (t.Name == "Opis")
                 *       opis= t.Value;
                 * }*/
                opis = e.Notes; ////<---- zmiana względem mojego modelu zamiast tagi notatka
                ////koniec zmiany
                wynik += opis + "</td></tr>";
                word.wstawWierszDoTabeli("", tab, i + 1, new string[] { i.ToString(), e.Name, opis });
                i++;
            }
            //   word.wstawKoniecTabeli("Rozdzial1b");
            wynik += "</table></div>";
            okno.Log(Statystyki.LogMsgType.WynikOK, " elementów: " + d.Elements.Count + " [ok]\n");
            return(wynik);
        }
Example #2
0
        private String dajOpisRoliSystemu(Package systemsPckg, ref int nrRozdz)
        {
            okno.Log(Statystyki.LogMsgType.Info, "Eksport listy systemów");
            String wynik = "";

            if (modelProjektu.WkladyPckg[Obszar].Packages.Count > 0)
            {
                wynik += "<div class=\"img\">";
                wynik += dajTytulRozdz("3", ref nrRozdz);
                Wordy.Table tab;
                if (jezykPolski)
                {
                    tab = word.wstawTabele("", new string[] { "Lp", "Nazwa systemu", "Opis roli systemu w projekcie", "Dostawca" });
                }
                else
                {
                    tab = word.wstawTabele("", new string[] { "No", "System name", "System changes - abstract", "Vendor" });
                }
                tab.Columns[1].SetWidth(25f, Wordy.WdRulerStyle.wdAdjustNone);
                tab.Columns[2].SetWidth(80f, Wordy.WdRulerStyle.wdAdjustNone);
                tab.Columns[3].SetWidth(330f, Wordy.WdRulerStyle.wdAdjustNone);
                tab.Columns[4].SetWidth(65f, Wordy.WdRulerStyle.wdAdjustNone);
                wynik += "<table><tr><th>Lp</th><th>Nazwa systemu</th><th>Opis roli systemu w projekcie</th></tr>";
                int j = 1;
                foreach (Package p in systemsPckg.Packages)
                {
                    EA.Element systEl   = EAUtils.dajComponentSystemZpakietu(modelProjektu.Repozytorium, p);
                    String     dostawca = EAUtils.dajDostawceSystemu(modelProjektu.Repozytorium, systEl);

                    word.wstawWierszDoTabeli("", tab, j + 1, new string[] { j.ToString(), p.Name, p.Notes, dostawca });
                    wynik += "<tr><td>" + j + "</td><td>" + p.Name + "</td><td>" + p.Notes + " </td></tr>";
                    j++;
                }
                wynik += "</table>";
                wynik += "</div>";
            }
            else
            {
                nrRozdz++;     //by przeskoczyc do nast rodzialu
            }
            okno.Log(Statystyki.LogMsgType.WynikOK, " systemów: " + systemsPckg.Packages.Count + " [ok]\n");
            return(wynik);
        }
Example #3
0
        private String dajInterfejsyRealizacjaOpis(Package pakiet, ref int nrRozdz, int lp, Package pakietSystemu)
        {
            String w = "";

            w += "<div class=\"img\">";

            Package pakietInterfejs = EAUtils.utworzPakietGdyBrak(ref pakiet, "Realizowane interfejsy", "");
            int     licznik         = 0;

            foreach (Element e1 in pakietInterfejs.Elements)
            {
                foreach (Method m1 in e1.Methods)
                {
                    licznik++;
                }
            }
            if (licznik == 0)
            {
                w += "\nSystem nie dostarcza interfejsów.\n<BR>";
                if (jezykPolski)
                {
                    word.wstawParagraf("System nie dostarcza interfejsów.", word.stylNorm);
                }
                else
                {
                    word.wstawParagraf("The system does not realize any interfaces.", word.stylNorm);
                }
                return(w + "</div>");
            }



            int i = 1;

            Wordy.WdColor kolor1 = Wordy.WdColor.wdColorBlack;


            foreach (Element e in pakietInterfejs.Elements)
            {
                word.wstawParagraf(nrRozdz + "." + lp + "." + i + " " + e.Name, 3);
                Wordy.Table tab = word.wstawTabele("", new string[] { e.Name, "" });
                tab.Columns[1].SetWidth(200f, Wordy.WdRulerStyle.wdAdjustNone);
                tab.Columns[2].SetWidth(300f, Wordy.WdRulerStyle.wdAdjustNone);
                /// nagłówek
                //tab.Rows[1].Cells[1].Merge(tab.Rows[1].Cells[2]);
                tab.Rows[1].Cells[1].Shading.BackgroundPatternColor = kolor1;
                tab.Rows[1].Cells[2].Shading.BackgroundPatternColor = kolor1;
                tab.Rows[1].Cells[1].Range.Font.Bold = 1;
                tab.Rows[1].Cells[1].Range.Font.Name = "Calibri";

                int index = 2;
                if (jezykPolski)
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { "Opis", e.Notes });
                }
                else
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { "Description", e.Notes });
                }
                tab.Rows[index].Cells[1].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorGray25;
                tab.Rows[index].Cells[1].Range.Font.Bold = 1;
                tab.Rows[index].Cells[2].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorWhite;
                tab.Rows[index].Cells[2].Range.Font.Bold = 0;
                index++;
                if (jezykPolski)
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { "Technologia", e.Stereotype });
                }
                else
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { "Technology", e.Stereotype });
                }
                tab.Rows[index].Cells[1].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorGray25;
                tab.Rows[index].Cells[1].Range.Font.Bold = 1;
                tab.Rows[index].Cells[2].Range.Font.Bold = 0;
                tab.Rows[index].Cells[2].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorWhite;
                index++;
                string dostawca = "";
                foreach (Connector c in e.Connectors)
                {
                    if (c.Type == "Realisation")
                    {
//                        Element realizator = Repo.GetElementByID(c.ClientID);
                        Element realizator = modelProjektu.Repozytorium.GetElementByID(c.ClientID);
                        dostawca += realizator.Name + ", ";
                    }
                }
                if (jezykPolski)
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { "Dostawca", dostawca });
                }
                else
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { "Provider", dostawca });
                }
                tab.Rows[index].Cells[1].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorGray25;
                tab.Rows[index].Cells[1].Range.Font.Bold = 1;
                tab.Rows[index].Cells[2].Range.Font.Bold = 0;
                tab.Rows[index].Cells[2].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorWhite;
                index++;
                string konsument = "";
                foreach (Connector c in e.Connectors)
                {
                    if (c.Type == "Usage")
                    {
                        // Element kons = Repo.GetElementByID(c.ClientID);
                        Element kons = modelProjektu.Repozytorium.GetElementByID(c.ClientID);
                        konsument += kons.Name + ", ";
                    }
                }
                if (jezykPolski)
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { "Konsument", konsument });
                }
                else
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { "Consumer", konsument });
                }
                tab.Rows[index].Cells[1].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorGray25;
                tab.Rows[index].Cells[1].Range.Font.Bold = 1;
                tab.Rows[index].Cells[2].Range.Font.Bold = 0;
                tab.Rows[index].Cells[2].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorWhite;
                index++;
                if (jezykPolski)
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { "Operacje", "" }, false);
                }
                else
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { "Operations", "" }, false);
                }
                //  tab.Rows[index].Cells[1].Merge(tab.Rows[1].Cells[2]);
                tab.Rows[index].Cells[1].Shading.BackgroundPatternColor = kolor1;
                tab.Rows[index].Cells[1].Range.Font.Bold = 1;
                tab.Rows[index].Cells[2].Range.Font.Bold = 0;
                tab.Rows[index].Cells[2].Shading.BackgroundPatternColor = kolor1;
                index++;
                if (jezykPolski)
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { "Nazwa operacji", "Opis" });
                }
                else
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { "Operation name", "Description" });
                }
                //  tab.Rows[index].Cells[1].Merge(tab.Rows[1].Cells[2]);
                tab.Rows[index].Cells[1].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorGray25;
                tab.Rows[index].Cells[1].Range.Font.Bold = 0;
                tab.Rows[index].Cells[2].Range.Font.Bold = 0;
                tab.Rows[index].Cells[2].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorGray25;
                index++;

                foreach (Method m in e.Methods)
                {
                    //  i++;
                    word.wstawWierszDoTabeli("", tab, index, new string[] { "&lt;&lt;" + m.Stereotype + "&gt;&gt;\n" + m.Name, m.Notes });
                    //  tab.Rows[index].Cells[1].Merge(tab.Rows[1].Cells[2]);
                    tab.Rows[index].Cells[1].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorWhite;
                    tab.Rows[index].Cells[1].Range.Font.Bold = 0;
                    tab.Rows[index].Cells[2].Range.Font.Bold = 0;
                    tab.Rows[index].Cells[2].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorWhite;
                    index++;
                }
                if (e.Methods.Count <= 0)
                {
                    if (jezykPolski)
                    {
                        word.wstawWierszDoTabeli("", tab, index, new string[] { "Brak operacji", "" }, false);
                    }
                    else
                    {
                        word.wstawWierszDoTabeli("", tab, index, new string[] { "None", "" }, false);
                    }
                    //  tab.Rows[index].Cells[1].Merge(tab.Rows[1].Cells[2]);
                    tab.Rows[index].Cells[1].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorWhite;
                    tab.Rows[index].Cells[1].Range.Font.Bold = 0;
                    tab.Rows[index].Cells[2].Range.Font.Bold = 0;
                    tab.Rows[index].Cells[2].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorWhite;
                    index++;
                }
                if (jezykPolski)
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { "Atrybuty", "" }, false);
                }
                else
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { "Atributes", "" }, false);
                }
                //  tab.Rows[index].Cells[1].Merge(tab.Rows[1].Cells[2]);
                tab.Rows[index].Cells[1].Shading.BackgroundPatternColor = kolor1;
                tab.Rows[index].Cells[1].Range.Font.Bold = 1;
                tab.Rows[index].Cells[2].Range.Font.Bold = 0;
                tab.Rows[index].Cells[2].Shading.BackgroundPatternColor = kolor1;
                index++;
                if (jezykPolski)
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { "Nazwa atrybutu", "Opis" });
                }
                else
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { "Atribute name", "Description" });
                }
                //  tab.Rows[index].Cells[1].Merge(tab.Rows[1].Cells[2]);
                tab.Rows[index].Cells[1].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorGray25;
                tab.Rows[index].Cells[1].Range.Font.Bold = 0;
                tab.Rows[index].Cells[2].Range.Font.Bold = 0;
                tab.Rows[index].Cells[2].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorGray25;
                index++;
                foreach (EA.Attribute a in e.Attributes)
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { a.Name, a.Notes });
                    //  tab.Rows[index].Cells[1].Merge(tab.Rows[1].Cells[2]);
                    tab.Rows[index].Cells[1].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorWhite;
                    tab.Rows[index].Cells[1].Range.Font.Bold = 0;
                    tab.Rows[index].Cells[2].Range.Font.Bold = 0;
                    tab.Rows[index].Cells[2].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorWhite;
                    index++;
                }
                if (e.Attributes.Count <= 0)
                {
                    if (jezykPolski)
                    {
                        word.wstawWierszDoTabeli("", tab, index, new string[] { "Brak atrybutów", "" }, false);
                    }
                    else
                    {
                        word.wstawWierszDoTabeli("", tab, index, new string[] { "None", "" }, false);
                    }
                    //  tab.Rows[index].Cells[1].Merge(tab.Rows[1].Cells[2]);
                    tab.Rows[index].Cells[1].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorWhite;
                    tab.Rows[index].Cells[1].Range.Font.Bold = 0;
                    tab.Rows[index].Cells[2].Range.Font.Bold = 0;
                    tab.Rows[index].Cells[2].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorWhite;
                    index++;
                }

                if (jezykPolski)
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { "Parametry dla operacji:", "" }, false);
                }
                else
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { "Operation parameters:", "" }, false);
                }
                tab.Rows[index].Cells[1].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorWhite;
                tab.Rows[index].Cells[2].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorWhite;
                tab.Rows[index].Cells[1].Range.Font.Bold = 1;
                tab.Rows[index].Cells[1].Range.Font.Name = "Calibri";
                index++;

                foreach (Method m in e.Methods)
                {
                    word.wstawWierszDoTabeli("", tab, index, new string[] { m.Name, "" }, false);
                    tab.Rows[index].Cells[1].Shading.BackgroundPatternColor = kolor1;
                    tab.Rows[index].Cells[1].Range.Font.Bold = 0;
                    tab.Rows[index].Cells[2].Range.Font.Bold = 0;
                    tab.Rows[index].Cells[2].Shading.BackgroundPatternColor = kolor1;
                    index++;
                    if (jezykPolski)
                    {
                        word.wstawWierszDoTabeli("", tab, index, new string[] { "Nazwa parametru : Typ danych", "Opis" });
                    }
                    else
                    {
                        word.wstawWierszDoTabeli("", tab, index, new string[] { "Parameter name : Type", "Description" });
                    }
                    tab.Rows[index].Cells[1].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorGray25;
                    tab.Rows[index].Cells[1].Range.Font.Bold = 0;
                    tab.Rows[index].Cells[2].Range.Font.Bold = 0;
                    tab.Rows[index].Cells[2].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorGray25;
                    index++;

                    if (m.Parameters.Count <= 0)
                    {
                        if (jezykPolski)
                        {
                            word.wstawWierszDoTabeli("", tab, index, new string[] { "Brak parametrów dla operacji", "" }, false);
                        }
                        else
                        {
                            word.wstawWierszDoTabeli("", tab, index, new string[] { "None", "" }, false);
                        }
                        tab.Rows[index].Cells[1].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorWhite;
                        tab.Rows[index].Cells[1].Range.Font.Bold = 0;
                        tab.Rows[index].Cells[2].Range.Font.Bold = 0;
                        tab.Rows[index].Cells[2].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorWhite;
                        index++;
                    }
                    else
                    {
                        foreach (EA.Parameter par in m.Parameters)
                        {
                            word.wstawWierszDoTabeli("", tab, index, new string[] { par.Name + " " + par.Type, par.Notes });
                            tab.Rows[index].Cells[1].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorWhite;
                            tab.Rows[index].Cells[1].Range.Font.Bold = 0;
                            tab.Rows[index].Cells[2].Range.Font.Bold = 0;
                            tab.Rows[index].Cells[2].Shading.BackgroundPatternColor = Wordy.WdColor.wdColorWhite;
                            index++;
                        }
                    }
                }
                /// dodanie opisu
                /// jesli jest załączony
                string d = e.GetLinkedDocument();
                if (d.Length > 0)
                {
                    if (jezykPolski)
                    {
                        word.wstawWierszDoTabeli("", tab, index, new string[] { "Dodatowy opis interfejsu", "" }, false);
                    }
                    else
                    {
                        word.wstawWierszDoTabeli("", tab, index, new string[] { "Additional description", "" }, false);
                    }

                    tab.Rows[index].Cells[1].Shading.BackgroundPatternColor = kolor1;
                    tab.Rows[index].Cells[1].Range.Font.Bold = 1;
                    tab.Rows[index].Cells[2].Range.Font.Bold = 0;
                    tab.Rows[index].Cells[2].Shading.BackgroundPatternColor = kolor1;
                    index++;

                    //tu fragment prawdopodobnie zjebany bo mergowanie coś średnio bangla i potem tabela
                    //może się rozjechać, dlatego bez tabeli
                    word.wstawZalacznikRTF(e);
                    // koniec zjebu
                }
                i++;
            }

            return(w + "</div>\n");
        }
Example #4
0
        private string dajOgraniczeniaRozwiazania(ref int nrRozdz)
        {
            okno.Log(Statystyki.LogMsgType.Info, "Eksport ograniczeń rozwiązania");
            String w = "";

            w += "<div class=\"img\">";
            w += dajTytulRozdz("2", ref nrRozdz);

            if (modelProjektu.OgraniczeniaPckg.Elements.Count > 0 || modelProjektu.ListaIssue.Count > 0)
            {
                Wordy.Table tab;
                if (jezykPolski)
                {
                    tab = word.wstawTabele("", new string[] { "Lp", "Ograniczenie rozwiązania", "Opis" });
                }
                else
                {
                    tab = word.wstawTabele("", new string[] { "No", "Constraint", "Descritpion" });
                }
                tab.Columns[1].SetWidth(50f, Wordy.WdRulerStyle.wdAdjustNone);
                tab.Columns[2].SetWidth(150f, Wordy.WdRulerStyle.wdAdjustNone);
                tab.Columns[3].SetWidth(300f, Wordy.WdRulerStyle.wdAdjustNone);
                w += "<table><tr><th>Lp</th><th>Ograniczenie rozwiązania</th><th>Opis</th></tr>";
                int i = 1;
                foreach (Element e in modelProjektu.OgraniczeniaPckg.Elements)
                {
                    if (e.Type == "Issue")
                    {
                        continue;                       //omin issue bo potem osobno wszystkie issue ida do tabelki
                    }
                    w += "<tr";

                    w += "><td>" + i + "</td><td>" + e.Name + "</td><td>";
                    string opis = "";

                    opis = e.Notes;     ////<---- zmiana względem mojego modelu zamiast tagi notatka
                    ////koniec zmiany
                    w += opis + "</td></tr>";
                    word.wstawWierszDoTabeli("", tab, i + 1, new string[] { i.ToString(), e.Name, opis });
                    i++;
                }
                foreach (Element e in modelProjektu.ListaIssue)
                {
                    string opis = e.Notes;
                    word.wstawWierszDoTabeli("", tab, i + 1, new string[] { i.ToString(), e.Name, opis });
                    i++;
                }
            }
            else
            {
                word.wstawParagraf("Brak", 0);
            }
            w += "</div>";
            okno.Log(Statystyki.LogMsgType.WynikOK, " elementów: " + modelProjektu.OgraniczeniaPckg.Elements.Count + " [ok]\n");
            return(w);
        }
Example #5
0
        private String dajInterfejsyRealizacja(Package pakiet, ref int nrRozdz, int lp, String typ, String nr)
        {
            String w = "";

            w += "<div class=\"img\">";
            w += dajTytulRozdz("3", ref nrRozdz, "", "r" + numer + "-" + lp + "-" + nr, "." + lp);
            Package pakietInterfejs = EAUtils.utworzPakietGdyBrak(ref pakiet, "Realizowane interfejsy", "");
            int     licznik         = 0;

            foreach (Element e1 in pakietInterfejs.Elements)
            {
                licznik += e1.Methods.Count;

                /*foreach (Method m1 in e1.Methods)
                 * {
                 *  licznik++;
                 * }*/
            }
            if (licznik == 0)
            {
                w += "\nBrak\n<BR>";
                if (jezykPolski)
                {
                    word.wstawParagraf("Brak", word.stylNorm);
                }
                else
                {
                    word.wstawParagraf("None", word.stylNorm);
                }

                return(w + "</div>");
            }
            w += "<table><tr><th>Nazwa interfejsu</th><th>Nazwa operacji</th><th>Opis</th></tr>\n";

            Wordy.Table tab;
            if (jezykPolski)
            {
                tab = word.wstawTabele("", new string[] { "Nazwa interfejsu", "Nazwa operacji", "Opis" });
            }
            else
            {
                tab = word.wstawTabele("", new string[] { "Interface Name", "Operation name", "Description" });
            }
            tab.Columns[1].SetWidth(100f, Wordy.WdRulerStyle.wdAdjustNone);
            tab.Columns[2].SetWidth(150f, Wordy.WdRulerStyle.wdAdjustNone);
            tab.Columns[3].SetWidth(250f, Wordy.WdRulerStyle.wdAdjustNone);

            int i = 1;

            foreach (Element e in pakietInterfejs.Elements)
            {
                foreach (Method m in e.Methods)
                {
                    w += "<tr><td>" + e.Name + "</td><td>";
                    w += m.Name + "</td><td>" + m.Notes + "</td></tr>";
                    word.wstawWierszDoTabeli("", tab, i + 1, new string[] { e.Name, m.Name, m.Notes });
                    i++;
                }
            }

            return(w + "</table></div>\n");
        }