コード例 #1
0
        private void GeneratePdfHeader()
        {
            Log.Write(LogLevel.Info, string.Format("Wpisywanie podstawowych informacji o sieci"));
            mTimesNormal = new PdfFont(mDocument, "Times New Roman", FontStyle.Regular);
            mTimesBold = new PdfFont(mDocument, "Times New Roman", FontStyle.Bold);

            var page = new PdfPage(mDocument);
            var contents = new PdfContents(page);

            contents.DrawText(mTimesNormal, 22.0, 10, 26, TextJustify.Center, "Raport");
            contents.DrawText(mTimesNormal, 18.0, 10, 25, TextJustify.Center, "z zaprojektowanej bezprzewodowej sieci sensorowej");
            DrawGeneralNetworkInfo(contents);

            contents.CommitToPdfFile(false);
        }
コード例 #2
0
        public void ReportNodeTechnology()
        {
            var page = new PdfPage(mDocument);
            var contents = new PdfContents(page);

            var constraints = mNodeNetwork.Constraints;

            contents.DrawText(mTimesNormal, 14.0, 10, 26, TextJustify.Center, "Informacje o ograniczeniach narzucanych przez wybrany typ węzła");
            contents.DrawText(mTimesNormal, 12.0, 1.5, 24, TextJustify.Left, string.Format("Ograniczenia częstotliwości: {0}-{1} {2}", constraints.FrequencyConstraint.Min, constraints.FrequencyConstraint.Max, constraints.FrequencyConstraint.Metric));
            contents.DrawText(mTimesNormal, 12.0, 1.5, 23.5, TextJustify.Left, string.Format("Ograniczenia mocy sygnału nadawanego: {0}-{1} dBm", constraints.SignalStrengthConstraint.Min, constraints.SignalStrengthConstraint.Max));
            contents.DrawText(mTimesNormal, 12.0, 1.5, 23, TextJustify.Left, string.Format("Ograniczenia czułości: ({0})-({1}) dBm", constraints.SensitivityConstraint.Min, constraints.SensitivityConstraint.Max));
            contents.DrawText(mTimesNormal, 12.0, 1.5, 22.5, TextJustify.Left, string.Format("Ograniczenia zysku: {0}-{1} dBi", constraints.GainConstraint.Min, constraints.GainConstraint.Max));
            contents.DrawText(mTimesNormal, 12.0, 1.5, 22, TextJustify.Left, string.Format("Ograniczenia prądu pobieranego podczas uśpienia: {0}-{1} uA", constraints.SleepCurrentConstraint.Min, constraints.SleepCurrentConstraint.Max));
            contents.DrawText(mTimesNormal, 12.0, 1.5, 21.5, TextJustify.Left, string.Format("Ograniczenia prądu pobieranego podczas nadawania: {0}-{1} mA", constraints.TxCurrentConstraint.Min, constraints.TxCurrentConstraint.Max));
            contents.DrawText(mTimesNormal, 12.0, 1.5, 21, TextJustify.Left, string.Format("Ograniczenia prądu pobieranego podczas odbioru: {0}-{1} mA", constraints.RxCurrentConstraint.Min, constraints.RxCurrentConstraint.Max));

            contents.CommitToPdfFile(false);
        }
コード例 #3
0
        public void ReportNodesInformation()
        {
            var nodes = mNodeRepository.GetAll();

            for(var i = 0; i < nodes.Count; i++)
            {
                var page = new PdfPage(mDocument);
                var contents = new PdfContents(page);

                if (i == 0)
                {
                    contents.DrawText(mTimesNormal, 14.0, 10, 26, TextJustify.Center, "Informacje o węzłach dodanych do projektowanej sieci");
                }

                contents.DrawText(mTimesNormal, 12.0, 1.5, 24, TextJustify.Left, string.Format("Nazwa: {0}", nodes[i].Name));
                contents.DrawText(mTimesNormal, 12.0, 1.5, 23.5, TextJustify.Left, string.Format("Guid: {0}", nodes[i].Guid));
                contents.DrawText(mTimesNormal, 12.0, 1.5, 23, TextJustify.Left, string.Format("Typ: {0}", nodes[i].TechnologyName));
                contents.DrawText(mTimesNormal, 12.0, 1.5, 22.5, TextJustify.Left, string.Format("Częstotliwość: {0} MHz", nodes[i].Parameters.CentralFrequency / Tools.GetFrequencyMetricsWithValues()["[MHz]"]));
                contents.DrawText(mTimesNormal, 12.0, 1.5, 22, TextJustify.Left, string.Format("Moc nadawania: {0} dBm", nodes[i].Parameters.SignalStrength));
                contents.DrawText(mTimesNormal, 12.0, 1.5, 21.5, TextJustify.Left, string.Format("Czułość: {0} dBm", nodes[i].Parameters.Sensitivity));
                contents.DrawText(mTimesNormal, 12.0, 1.5, 21, TextJustify.Left, string.Format("Zysk: {0} dBi", nodes[i].Parameters.Gain));
                contents.DrawText(mTimesNormal, 12.0, 1.5, 20.5, TextJustify.Left, string.Format("Czas uśpienia: {0} ms/sek", nodes[i].Parameters.SleepTime));
                contents.DrawText(mTimesNormal, 12.0, 1.5, 20, TextJustify.Left, string.Format("Czas nadawania: {0} ms/sek", nodes[i].Parameters.TxTime));
                contents.DrawText(mTimesNormal, 12.0, 1.5, 19.5, TextJustify.Left, string.Format("Czas odbierania: {0} ms/sek", nodes[i].Parameters.RxTime));
                contents.DrawText(mTimesNormal, 12.0, 1.5, 19, TextJustify.Left, string.Format("Prąd pobierany podczas uśpienia: {0} uA", nodes[i].Parameters.SleepCurrent));
                contents.DrawText(mTimesNormal, 12.0, 1.5, 18.5, TextJustify.Left, string.Format("Prąd pobierany podczas nadawania: {0} mA", nodes[i].Parameters.TxCurrent));
                contents.DrawText(mTimesNormal, 12.0, 1.5, 18, TextJustify.Left, string.Format("Prąd pobierany podczas odbioru: {0} mA", nodes[i].Parameters.RxCurrent));
                contents.DrawText(mTimesNormal, 12.0, 1.5, 17.5, TextJustify.Left, string.Format("Czas życia: {0} dni", nodes[i].Parameters.BatteryLife.ToString("F")));
                contents.DrawText(mTimesNormal, 12.0, 1.5, 17, TextJustify.Left, string.Format("Pojemność baterii: {0} mAh", nodes[i].Parameters.BatteryCapacitance));
                contents.DrawText(mTimesNormal, 12.0, 1.5, 16.5, TextJustify.Left, string.Format("Nazwa baterii: {0}", nodes[i].Parameters.BatteryName));
                contents.DrawText(mTimesNormal, 12.0, 1.5, 16, TextJustify.Left, string.Format("Cena węzła z czujnikami: {0} zł", nodes[i].Parameters.Price));

                for (var j = 0; j < nodes[i].Parameters.SensingPhenomenas.Count; j++)
                {
                    var name = new PhenomenaConverter().Convert(nodes[i].Parameters.SensingPhenomenas[j], typeof(SensingPhenomena), null, null);
                    var price = double.Parse(XmlParser.GetValue("Phenomena", nodes[i].Parameters.SensingPhenomenas[j].ToString()));

                    contents.DrawText(mTimesNormal, 12.0, 1.5, 15.5 - j*0.5, TextJustify.Left, string.Format("Czujnik: {0}, Cena: {1} zł", name, price));
                }

                contents.CommitToPdfFile(false);
            }
        }
コード例 #4
0
        public void ReportNodesPositioning()
        {
            var nodes = mNodeRepository.GetItems(n => n.IsInNetwork).ToList();

            if (nodes.Any())
            {
                for (var i = 0; i < nodes.Count(); i++)
                {
                    var page = new PdfPage(mDocument);
                    var contents = new PdfContents(page);

                    if(i == 0) contents.DrawText(mTimesNormal, 14.0, 10, 26, TextJustify.Center, "Informacje o położeniu węzłów oraz stacji bazowej na planie budynku");

                    contents.DrawText(mTimesNormal, 12.0, 1.5, 24, TextJustify.Left, string.Format("Nazwa: {0}, Pozycja: [{1}, {2}]",
                                      nodes[i].Name, nodes[i].Position.X, nodes[i].Position.Y));

                    var neighbours = nodes[i].Neighbours;

                    contents.DrawText(mTimesNormal, 12.0, 1.5, 23, TextJustify.Left, "Węzły widoczne:");
                    for (int j = 0; j < neighbours.Count; j++)
                    {
                        contents.DrawText(mTimesNormal, 12.0, 1.5, 23 - (j+1)*0.5, TextJustify.Left, string.Format("- Nazwa: {0}, Guid: {1}, Pozycja: [{2}, {3}]", neighbours[j].Name, neighbours[j].Guid, neighbours[j].Position.X, neighbours[j].Position.Y));
                    }

                    int nextline = 23 - neighbours.Count / 2 - 1;

                    var connections = nodes[i].Connections.Where(n => n.SecondNode != nodes[i].Guid).ToList();

                    contents.DrawText(mTimesNormal, 12.0, 1.5, nextline, TextJustify.Left, "Połączenia z węzłami lub stacją bazową:");
                    for (int j = 0; j < connections.Count; j++)
                    {
                        contents.DrawText(mTimesNormal, 12.0, 1.5, nextline - 0.5*(j+1), TextJustify.Left, string.Format("Element: {0}, Dystans: {1} m",
                                         (connections[j].SecondNode == Guid.Empty ? "Stacja bazowa" : connections[j].SecondNode.ToString()), connections[j].Distance.ToString("F")));
                    }

                    contents.CommitToPdfFile(false);
                }

                var newpage = new PdfPage(mDocument);
                var newcontents = new PdfContents(newpage);

                newcontents.DrawText(mTimesNormal, 12.0, 1.5, 24, TextJustify.Left, string.Format("Stacja bazowa, Pozycja [{0}, {1}]", mNodeNetwork.Sink.Position.X, mNodeNetwork.Sink.Position.Y));
                newcontents.DrawText(mTimesNormal, 12.0, 1.5, 23, TextJustify.Left, string.Format("Połączenia z węzłami:"));

                for (int i = 0; i < mNodeNetwork.Sink.NodeLinks.Count; i++)
                {
                    newcontents.DrawText(mTimesNormal, 12.0, 1.5, 22.5 - (i+1)*0.5 , TextJustify.Left, string.Format("- Element: {0}, Dystans: {1} m",
                                         mNodeNetwork.Sink.NodeLinks[i].FirstNode, mNodeNetwork.Sink.NodeLinks[i].Distance.ToString("F")));
                }

                newcontents.CommitToPdfFile(false);
            }
        }
コード例 #5
-1
        public void ReportBlueprintImage()
        {
            var path = XmlParser.GetValue("ImagePath");

            var page = new PdfPage(mDocument);
            var contents = new PdfContents(page);

            contents.DrawText(mTimesNormal, 12.0, 1.5, 26, TextJustify.Left, "Plan budynku, na którym zaprojektowano sieć sensorową.");

            PdfImage blueprintImage = new PdfImage(mDocument, path);
            blueprintImage.ImageSize(500,700);
            contents.DrawImage(blueprintImage, 1.5, 26, 500, 700);
            contents.CommitToPdfFile(false);
        }