Exemplo n.º 1
0
        public override void LoadSymbol(string symbolname, IECUFile trionic_file)
        {
            // autonomous
            m_trionic_file = trionic_file;
            m_trionic_file.LibraryPath = Application.StartupPath + "\\Binaries";
            this.IsUpsideDown = true; // always?
            foreach (SymbolHelper sh in m_trionic_file.GetFileInfo().SymbolCollection)
            {
                if (sh.Varname == symbolname)
                {
                    // get data from it
                    IECUFile file = new Trionic5File();
                    file.LibraryPath = Application.StartupPath + "\\Binaries";
                    file.SetAutoUpdateChecksum(m_autoUpdateChecksum);
                    file.SelectFile(m_trionic_file.GetFileInfo().Filename);
                    byte[] symboldata = file.ReadData((uint)sh.Flash_start_address, (uint)sh.Length);
                    //byte[] symboldata = file.readdatafromfile(m_trionic_file.GetFileInfo().Filename, sh.Flash_start_address, sh.Length);
                    this.Map_content = symboldata;
                    this.Map_length = symboldata.Length;
                    this.Filename = m_trionic_file.GetFileInfo().Filename;
                    if (m_trionic_file.IsTableSixteenBits(symbolname))
                    {
                        //this.Map_length /= 2;
                    }
                    this.Map_name = symbolname;
                    this.Correction_factor = m_trionic_file.GetCorrectionFactorForMap(symbolname);
                    this.correction_offset = m_trionic_file.GetOffsetForMap(symbolname);
                    this.SetViewSize(ViewSize.NormalView);
                    //this.Viewtype = Trionic5Tools.ViewType.Easy;
                    // set axis information
                    SymbolAxesTranslator sat = new SymbolAxesTranslator();
                    sat.GetXaxisSymbol(symbolname);
                    sat.GetYaxisSymbol(symbolname);
                    this.X_axisvalues = m_trionic_file.GetMapXaxisValues(symbolname);
                    this.Y_axisvalues = m_trionic_file.GetMapYaxisValues(symbolname);
                    string x = string.Empty;
                    string y = string.Empty;
                    string z = string.Empty;

                    m_trionic_file.GetMapAxisDescriptions(symbolname, out x, out y, out z);

                    this.X_axis_name = x;
                    this.Y_axis_name = y;
                    this.Z_axis_name = z;
                    int columns = 1;
                    int rows = 1;
                    m_trionic_file.GetMapMatrixWitdhByName(symbolname, out columns, out rows);
                    this.ShowTable(columns, m_trionic_file.IsTableSixteenBits(symbolname));

                    break;
                }
            }
            
        }