Ejemplo n.º 1
0
        internal PhysicalDimensions QueryLocationColumns(int xCol, int yCol, int zCol, DataRecords.ColumnManager columnManager)
        {
            ColumnStats        x   = columnManager.GetXYZColumnData(xCol);
            ColumnStats        y   = columnManager.GetXYZColumnData(yCol);
            ColumnStats        z   = columnManager.GetXYZColumnData(zCol);
            PhysicalDimensions dim = new PhysicalDimensions();

            dim.originX = x.min;
            dim.originY = y.min;
            dim.originZ = z.min;

            dim.maximumX = x.max;
            dim.maximumY = y.max;
            dim.maximumZ = z.max;

            return(dim);
        }
Ejemplo n.º 2
0
 private ColumnStats GetColumnStatsXYZ(DataColumn<float> col)
 {
     ColumnStats stats = new ColumnStats();
     //float total = 0;
     float min = float.MaxValue;
     float max = float.MinValue;
     int ct = 0;
     foreach (float cv in col.GetDataList())
     {
         ct++;
         min = Math.Min(cv, min);
         max = Math.Max(cv, max);
       //  total += cv;
     }
     float diff = max - min;
     stats.min = min;
     stats.max = max;
     stats.diff = diff;
     stats.count = ct;
     stats.message = "Min " + min + ", max " + max + ", length: " + diff + " ,samples counted " + ct;
     
     return stats;
 }
Ejemplo n.º 3
0
        private ColumnStats GetColumnStatsXYZ(DataColumn<string> col)
        {
            ColumnStats stats = new ColumnStats();
            List<float> vals = new List<float>();
            // try convert to float columns then run stats
            foreach (string v in col.GetDataList()) {
                float val = float.MinValue;
                bool parsed = float.TryParse(v, out val);
                if (parsed) {
                    vals.Add(val);
                }
            }
            if (vals.Count > 0) {
                DataColumn<float> dcf = new DataColumn<float>("tmp");
                dcf.SetDataList(vals);
                stats = GetColumnStatsXYZ(dcf);
            }
            

            return stats;
        }