Exemplo n.º 1
0
 public void addBlox(Blox i_Blox)
 {
     m_arBlox.Add(i_Blox);
 }
Exemplo n.º 2
0
        private PageLayoutTable createIndicatorTable(Blox _blox)
        {
            PageLayoutTable table = new PageLayoutTable(null);

            table.addTableData(createBloxIndicatorTableHeader());

            PageLayoutTableData tableRow;
            PageLayoutText name;
            PageLayoutText type;
            PageLayoutText scope;
            PageLayoutText parameter;
            PageLayoutList paramlist;
            PageLayoutListItem param;
            PageLayoutText sourceparams;
            PageLayoutList sourcelist;
            PageLayoutListItem source;
            PageLayoutText plots;

            foreach (Indicator indi in _blox.Indicators) {
                name = new PageLayoutText(null, PageLayoutType.Plain, indi.ScriptName);
                type = new PageLayoutText(null, PageLayoutType.Plain, indi.Type);
                scope = new PageLayoutText(null, PageLayoutType.Plain, indi.Scope.ToString());
                paramlist = new PageLayoutList(new string[] {Class_Params});
                foreach(string str in indi.Params) {
                    parameter = new PageLayoutText(null, PageLayoutType.Plain, str);
                    param = new PageLayoutListItem(null, parameter);
                    paramlist.addListElem(param);
                }
                sourcelist = new PageLayoutList(new string[] {Class_Params});
                foreach (string str in indi.SourceParameters) {
                    if (str != "Enter Value") sourceparams = new PageLayoutText(null, PageLayoutType.Plain, str);
                    else sourceparams = new PageLayoutText(null, PageLayoutType.Plain, "-");
                    source = new PageLayoutListItem(null, sourceparams);
                    sourcelist.addListElem(source);
                }
                plots = new PageLayoutText(null, PageLayoutType.Plain, indi.Plot.ToString());
                tableRow = new PageLayoutTableData(null, new PageLayout[] {name, type, scope, paramlist,
                                                    sourcelist,plots});
                table.addTableData(tableRow);
            }

            return table;
        }
Exemplo n.º 3
0
        private Blox readBlock(BlockType type, string szName)
        {
            Blox blox = new Blox(szName, type);
            UseType useType;

            foreach (XmlNode node in m_xmlDocBlox.ChildNodes[1].ChildNodes) {
                if (node.Name == "indicator") {
                    blox.addIndicator(BloxReader.CreateIndicator(node));
                } else if(node.Name != "script"){
                    switch(node.Name) {
                        case "instrument_global":
                            useType = UseType.InstrumentGlobal;
                            break;
                        case "block_global":
                            useType = UseType.BlockGlobal;
                            break;
                        case "parameter":
                            useType = UseType.Parameter;
                            break;
                        default:
                            if (node.Name != "#comment") {
                                if (log.IsWarnEnabled) log.Warn("Variable Type not recognized. Skipping! (" + node.Name + ")");
                            }
                            continue;
                    }

                    blox.addVar(BloxReader.CreateVar(node, useType));
                }
            }

            return blox;
        }
Exemplo n.º 4
0
        private void createBlox(Blox _blox)
        {
            PageDef page = new PageDef(_blox.Name, _blox.Name, _blox.Name + ".html", new XHTMLGenerator(m_szOutputDir + "\\"));

            createHeader(page);

            page.addPageLayout(new PageLayoutText(null, PageLayoutType.Section, _blox.Name + " Description"));
            page.addPageLayout(new PageLayoutText(null, PageLayoutType.Paragraph,
                                "Here is a brief overview of all variables used in this block"));

            PageLayoutTable table = new PageLayoutTable(null);
            PageLayoutTableData tableRow;
            PageLayoutText name;
            PageLayoutText varType;
            PageLayoutText useType;
            PageLayoutText scope;
            PageLayoutText defaultValue;
            PageLayoutText external;
            PageLayoutText autoIndex;
            PageLayoutText SeriesSize;
            PageLayoutText plotName;

            table.addTableData(createBloxTableHeader());

            //TODO: plot Eigenschaften der Variablen in die Tabelle schreiben
            foreach (BlockVar var in _blox.Vars) {
                name = new PageLayoutText(null, PageLayoutType.Plain, var.Name);
                varType = new PageLayoutText(null, PageLayoutType.Plain, var.VarType);
                useType = new PageLayoutText(null, PageLayoutType.Plain, var.UseType.ToString());
                scope = new PageLayoutText(null, PageLayoutType.Plain, var.Scope.ToString());
                defaultValue = new PageLayoutText(null, PageLayoutType.Plain, var.DefaultValue);
                external = new PageLayoutText(null,PageLayoutType.Plain,var.External.ToString());
                if (var.VarType == "Series") {
                    autoIndex = new PageLayoutText(null, PageLayoutType.Plain, var.AutoIndex.ToString());
                    SeriesSize = new PageLayoutText(null, PageLayoutType.Plain, var.SeriesSize.ToString());
                } else {
                    autoIndex = new PageLayoutText(null, PageLayoutType.Plain, "-");
                    SeriesSize = new PageLayoutText(null, PageLayoutType.Plain, "-");
                }
                if (var.Plots == true) {
                    plotName = new PageLayoutText(null, PageLayoutType.Plain, var.Plotname);
                } else {
                    plotName = new PageLayoutText(null, PageLayoutType.Plain, "-");
                }

                tableRow = new PageLayoutTableData(null, new PageLayout[] { name, varType, useType, scope,
                                                    defaultValue, external, autoIndex, SeriesSize,plotName});
                table.addTableData(tableRow);
            }

            page.addPageLayout(table);

            //Auskommentieren um auch Indikatoren auszugeben
            //Neue Tabelle mit Indikatoren erstellen, falls vorhanden in dem Block
            //if (_blox.Indicators.Count > 0) {
            //    page.addPageLayout(createIndicatorTable(_blox));
            //}

            Pages.getInstance().addPage(page);
        }