public void SetNodeContent(TreeIter iter, Table2D table2D)
        {
            store.SetValue (iter, (int)ColumnNr2D.Obj, table2D);

            store.SetValue (iter, (int)ColumnNr2D.Category, table2D.Category);
            store.SetValue (iter, (int)ColumnNr2D.Toggle, false);
            store.SetValue (iter, (int)ColumnNr2D.Title, table2D.Title);
            store.SetValue (iter, (int)ColumnNr2D.UnitY, table2D.UnitY);

            store.SetValue (iter, (int)ColumnNr2D.NameX, table2D.NameX);
            store.SetValue (iter, (int)ColumnNr2D.UnitX, table2D.UnitX);

            store.SetValue (iter, (int)ColumnNr2D.CountX, table2D.CountX);

            store.SetValue (iter, (int)ColumnNr2D.Xmin, table2D.Xmin);
            store.SetValue (iter, (int)ColumnNr2D.Xmax, table2D.Xmax);

            store.SetValue (iter, (int)ColumnNr2D.Multiplier, table2D.Multiplier);
            store.SetValue (iter, (int)ColumnNr2D.Offset, table2D.Offset);

            store.SetValue (iter, (int)ColumnNr2D.Location, table2D.Location);
            store.SetValue (iter, (int)ColumnNr2D.XPos, table2D.RangeX.Pos);
            store.SetValue (iter, (int)ColumnNr2D.YPos, table2D.RangeY.Pos);
            store.SetValue (iter, (int)ColumnNr2D.Description, table2D.Description);
            Toggle (iter, table2D.Selected);

            SetNodeContentTypeChanged (iter, table2D);
        }
Esempio n. 2
0
        public Table2D Copy()
        {
            Table2D c = new Table2D();

            c.countX        = countX;
            c.tableType     = tableType;
            c.typeUncertain = typeUncertain;

            c.hasMAC     = hasMAC;
            c.multiplier = Multiplier;
            c.offset     = Offset;

            c.location = location;
            c.rangeX   = rangeX;
            c.rangeY   = rangeY;

            c.valuesX         = valuesX;
            c.valuesY         = valuesY;
            c.valuesYasFloats = valuesYasFloats;
            c.valuesYmin      = valuesYmin;
            c.valuesYmax      = valuesYmax;
            c.valuesYavg      = valuesYavg;

            // metadata
            c.title       = title ?? string.Empty;
            c.category    = category ?? string.Empty;
            c.selected    = selected;
            c.description = description ?? string.Empty;
            c.nameX       = nameX ?? string.Empty;
            c.unitX       = unitX ?? string.Empty;
            c.unitY       = unitY ?? string.Empty;

            return(c);
        }
Esempio n. 3
0
    void Show2D(Tables.Denso.Table2D table)
    {
        if (table == null)
        {
            return;
        }

        navbarwidget.CurrentPos = table.Location;
        navbarwidget.SetMarkedPositions(new int[] { table.RangeX.Pos, table.RangeY.Pos });

        // plot
        plot2D.Draw(table);

        // table data as text
        var values  = table.GetValuesYasFloats();
        var tableUI = new GtkWidgets.TableWidget2D(coloring, table.ValuesX, values, table.Xmin, table.Xmax, table.Ymin, table.Ymax);

        tableUI.HeaderAxisMarkup   = Util.Markup.Unit(table.UnitX);
        tableUI.HeaderValuesMarkup = Util.Markup.Unit(table.UnitY);
        tableUI.AxisXMarkup        = Util.Markup.NameUnit(table.NameX, table.UnitX);
        tableUI.ValuesMarkup       = Util.Markup.NameUnit(table.Title, table.UnitY);
        tableUI.FormatValues       = ScoobyRom.Data.AutomaticValueFormat(values, table.Ymin, table.Ymax);

        // Viewport needed for ScrolledWindow to work as generated table widget has no scroll support
        var viewPort = new Gtk.Viewport();

        viewPort.Add(tableUI.Create());

        Gtk.Widget previous = this.scrolledwindowTable2D.Child;
        if (previous != null)
        {
            this.scrolledwindowTable2D.Remove(previous);
        }
        // previous.Dispose () or previous.Destroy () cause NullReferenceException!

        this.scrolledwindowTable2D.Add(viewPort);
        this.scrolledwindowTable2D.ShowAll();
    }
 public void ChangeTableType(Table2D table2D, Tables.TableType newType)
 {
     data.ChangeTableType (table2D, newType);
 }
Esempio n. 5
0
        public Table2D Copy()
        {
            Table2D c = new Table2D ();
            c.countX = countX;
            c.tableType = tableType;
            c.typeUncertain = typeUncertain;

            c.hasMAC = hasMAC;
            c.multiplier = Multiplier;
            c.offset = Offset;

            c.location = location;
            c.rangeX = rangeX;
            c.rangeY = rangeY;

            c.valuesX = valuesX;
            c.valuesY = valuesY;
            c.valuesYasFloats = valuesYasFloats;
            c.valuesYmin = valuesYmin;
            c.valuesYmax = valuesYmax;
            c.valuesYavg = valuesYavg;

            // metadata
            c.title = title ?? string.Empty;
            c.category = category ?? string.Empty;
            c.selected = selected;
            c.description = description ?? string.Empty;
            c.nameX = nameX ?? string.Empty;
            c.unitX = unitX ?? string.Empty;
            c.unitY = unitY ?? string.Empty;

            return c;
        }
Esempio n. 6
0
 void Merge(Table2D original, Table2D newTable)
 {
     MergeCommon (original, newTable);
 }
Esempio n. 7
0
        static Table2D ParseTable2D(XElement el)
        {
            Table2D table2D = new Table2D ();
            ParseCommon (el, table2D);

            int? address;
            string name, unit;
            XElement subEl;
            subEl = el.Element (X_axisX);
            if (subEl != null) {
                ParseAxis (subEl, out address, out name, out unit);
                table2D.NameX = name;
                table2D.UnitX = unit;
                if (address.HasValue)
                    table2D.RangeX = new Util.Range (address.Value, 0);
            }

            subEl = el.Element (X_values);
            if (subEl != null) {
                TableType? tableType;
                ParseValues (subEl, out address, out unit, out tableType);
                table2D.UnitY = unit;
                if (address.HasValue)
                    table2D.RangeY = new Util.Range (address.Value, 0);
                if (tableType.HasValue)
                    table2D.TableType = tableType.Value;
            }

            table2D.Description = (string)el.Element (X_description);

            return table2D;
        }
Esempio n. 8
0
 static XElement GetXElement(Table2D table2D)
 {
     return new XElement (X_table2D,
         new XAttribute (X_category, table2D.Category),
         new XAttribute (X_name, table2D.Title),
         new XAttribute (X_address, HexNum (table2D.Location)),
         Table.CommentValuesStats (table2D.Xmin, table2D.Xmax),
         GetAxisXElement (X_axisX, table2D.RangeX.Pos, table2D.NameX, table2D.UnitX),
         Table.CommentValuesStats (table2D.Ymin, table2D.Ymax, table2D.Yavg),
         GetValuesElement (table2D.RangeY.Pos, table2D.UnitY, table2D.TableType), new XElement (X_description, table2D.Description));
 }
Esempio n. 9
0
 static void WriteGnuPlotBinary(BinaryWriter bw, Table2D table2D)
 {
     float[] valuesX = table2D.ValuesX;
     bw.Write ((float)(valuesX.Length));
     foreach (var x in valuesX) {
         bw.Write (x);
     }
     // same format as 3D but only write a single row
     float[] valuesY = table2D.GetValuesYasFloats ();
     bw.Write (0f);
     for (int ix = 0; ix < valuesX.Length; ix++) {
         bw.Write (valuesY [ix]);
     }
 }
Esempio n. 10
0
        static void ScriptGnuplot2D(StreamWriter sw, Table2D table2D)
        {
            WriteLine (sw, SetLabel ("xlabel", table2D.NameX, false, table2D.UnitX));
            WriteLine (sw, SetLabel ("ylabel", table2D.Title, false, table2D.UnitY));
            WriteLine (sw, SetLabel ("title", table2D.Title, false, table2D.UnitY));

            // Min/Max/Avg label might obscure title etc.
            //sw.WriteLine ("set label 1 \"" + AnnotationStr (table2D) + "\" at screen 0.01,0.96 front left textcolor rgb \"blue\"");

            // Windows: use single instead of double quotes because would interpret backslashes in path
            sw.WriteLine ("call '{0}' '{1}'", FindFileInCurrentOrAppFolder (TemplateFile2D), BinaryFile);
        }