VAGSuite.MapViewerEx.FillDataOriginal C# (CSharp) Méthode

FillDataOriginal() private méthode

private FillDataOriginal ( NMeshSurfaceSeries surface ) : void
surface NMeshSurfaceSeries
Résultat void
        private void FillDataOriginal(NMeshSurfaceSeries surface)
        {
            try
            {
                DataTable dt = (DataTable)gridControl1.DataSource;
                int rowcount = dt.Rows.Count;
                int colcount = dt.Columns.Count;
                for (int row = 0; row < rowcount; row++)
                {
                    for (int col = 0; col < colcount; col++)
                    {
                        try
                        {
                            if (m_issixteenbit)
                            {
                                int indexinmap = ((row * colcount) + col) * 2;
                                Int32 ivalue = Convert.ToInt32(m_map_original_content[indexinmap]) * 256;
                                ivalue += Convert.ToInt32(m_map_original_content[indexinmap + 1]);

                                //Int32 diffivalue = Convert.ToInt32(m_map_content[indexinmap]) * 256;
                                //diffivalue += Convert.ToInt32(m_map_content[indexinmap + 1]);
                                //if (diffivalue != 0)
                                {
                                    if (ivalue > 32000)
                                    {
                                        ivalue = 65536 - ivalue;
                                        ivalue = -ivalue;
                                    }

                                    double value = ivalue;
                                    if (m_viewtype != ViewType.Decimal && m_viewtype != ViewType.Hexadecimal && m_viewtype != ViewType.ASCII)
                                    {
                                        value *= correction_factor;
                                        value += correction_offset; // bij origineel wel doen
                                    }
                                    surface.Data.SetValue((rowcount - 1) - row, col, value, (rowcount - 1) - row, col);
                                }
                                //Console.WriteLine(surface.Name + ": " + row.ToString() + " " + col.ToString() + " value: " + value.ToString());
                            }
                            else
                            {

                                int indexinmap = ((row * colcount) + col);
                                Int32 ivalue = Convert.ToInt32(m_map_original_content[indexinmap]);
                                //Int32 diffivalue = Convert.ToInt32(m_map_content[indexinmap]);
                                //if (diffivalue != 0)
                                {
                                    double value = ivalue;
                                    if (m_viewtype != ViewType.Decimal && m_viewtype != ViewType.Hexadecimal && m_viewtype != ViewType.ASCII)
                                    {
                                        value *= correction_factor;
                                        value += correction_offset;
                                    }
                                    surface.Data.SetValue((rowcount - 1) - row, col, value, (rowcount - 1) - row, col);
                                }
                                //Console.WriteLine(surface.Name + ": " + row.ToString() + " " + col.ToString() + " value: " + value.ToString());

                            }
                        }
                        catch (Exception E)
                        {
                            Console.WriteLine("Failed to fill data for original map: " + E.Message);
                        }
                    }
                }
            }
            catch (Exception E)
            {
                Console.WriteLine("FilleDataOriginal: " + E.Message);
            }
        }
MapViewerEx