⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nvrameditor.h

📁 MTK_NVRAM_Editor的源码,可能对你们有用哦
💻 H
字号:
//---------------------------------------------------------------------------

#ifndef NVRAMEditorH
#define NVRAMEditorH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
#include <ToolWin.hpp>
#include <Grids.hpp>
#include <ImgList.hpp>
#include <Dialogs.hpp>
#include <ExtCtrls.hpp>
#include <OleCtrls.hpp>
// added by Andy Ueng
//#include "meta2.h"
#include "meta_const.h"
#include "CONTROLSLib_OCX.h"
#include "META_error_handler.h"
//#include "META_NVRAM_cb.h"
#include "NVRAM_LID_Parsing.h"
#include "meta_msg.h"
// end of added

// added by Andy Ueng
#define TOTAL_RID_COUNT 1000
#define MAX_LID_NUM_IN_NVRAM 100
#define MAX_RID_NUM_IN_LID 300
//#define META_MAX_LID_LEN 200
#define MAX_NVRAM_REC_LEN 1024*4
// end of added
typedef struct
{
  // modified by Andy Ueng
  // char GroupName[MAX_GROUP_NAME_LEN];
  // char ElementName[MAX_ELEMENT_NAME_LEN];
  char LIDNAME[MAX_LID_NUM_IN_NVRAM ];
  // end of modified
   char StructName[MAX_STRUCT_NAME_LEN];
   char Buf[MAX_FDM_REC_LEN];
   int  iDataLen;
   TVariant vTreeItemHandle;  //  Active X Tree Control Item
   void *pNode;           // Tree View Node
   bool bRead;
//   bool bModified;
//   bool bSaved;
} TreeStructType;
// end of added
//---------------------------------------------------------------------------
class TfrmNVRAMEditor : public TForm
{
__published:	// IDE-managed Components
        TToolBar *tb_FDM;
        TToolButton *tbReadFromNVRAM;
        TToolButton *ToolButton1;
        TToolButton *tb_save_to_NVRAM;
        TToolButton *tb_NVRAM_Tree_Property;
        TToolButton *tb_NVRAM_Clear;
        TTreeView *tv_NVRAM;
        TStringGrid *sg_NVRAM_editor;
        TImageList *ImageList1;
        TOpenDialog *dlgOpenNVRAMDB;
        TOpenDialog *dlgOpenTreeDB;
        TTimer *TimerMETACheck;
        TStatusBar *sb_NVRAM_editor;
        TTree *NVRAM_RawDataTree;
        // end of added
        void __fastcall tbReadFromNVRAMClick(TObject *Sender);
        void __fastcall tbSaveToNVRAMClick(TObject *Sender);
        void __fastcall tb_NVRAM_Tree_PropertyClick(TObject *Sender);
        void __fastcall tb_NVRAM_ClearClick(TObject *Sender);
        void __fastcall OnClick(TObject *Sender);
private:	// User declarations

public:
       // TToolButton *tbReadFromNVRAM;
      //  TToolButton *tb_save_to_NVRAM;
       // TToolButton *tb_NVRAM_Tree_Property;
       // TToolButton *tb_NVRAM_Clear;
public:		// User declarations
        __fastcall TfrmNVRAMEditor(TComponent* Owner);
        __fastcall ~TfrmNVRAMEditor(void); // added by Andy Ueng
        void __fastcall tb_Init_NVRAMClick(TObject *Sender);
        // added by Andy Ueng
        // modified by Andy Ueng
        // TTreeNode *ptn_element;
        // TTreeNode *ptn_group;
        TTreeNode *ptn_selected;
        TTreeNode *ptn_rec;
        // end of modified
        // modified by Andy Ueng
       // TreeStructType NVRAM_TreeItem[MAX_ELEMENT_IN_NVRAM];
        TreeStructType NVRAM_TreeItem[TOTAL_RID_COUNT];
        // end of modified
        short NVRAM_node_read_rec_token;  // for META_UI AX tree
        short NVRAM_node_write_rec_token;
        FT_NVRAM_READ_CNF NVRAM_node_read_rec;  // for META_UI AX tree
        FT_NVRAM_WRITE_CNF NVRAM_node_write_rec_cnf;
        FT_NVRAM_WRITE_REQ    *NVRAM_WriteReq;
        FT_NVRAM_READ_REQ     *NVRAM_ReadReq;
        bool NVRAM_ReadReq_allocated;
        bool NVRAM_WriteReq_allocated;
        META_RESULT mr1;
        // modified by Andy Ueng
       // bool get_index_from_LID( char *LID_para, int &index );
         bool get_index_from_LID( char *LID_para, int *index );
        // end of modified 

        void read_Raw_Data_from_StringGrid( TStringGrid *sg,
                                            int iStartCol, int iStartRow,
                                            int iDisplayColCount, int iDataLen,
                                            char *buf );
        void  fill_StringGrid( TStringGrid *sg,
                                             int iStartCol, int iStartRow,
                                             int iDisplayColCount, int iDataLen,
                                             AnsiString as );
        bool get_index_from_handle( TreeStructType *tst,
                                                 int i,
                                                 int &index );
        void show_Raw_Data_on_StringGrid( TStringGrid *sg,
                                                      char *buf,
                                                      int buf_len);
       void __stdcall NVRAM_node_write_rec_cnf_cb(const FT_NVRAM_WRITE_CNF *cnf, const short token, void *usrData);
       void __stdcall NVRAM_node_read_rec_cnf_cb( const FT_NVRAM_READ_CNF *cnf, const short token, void *usrData);                                              
        // end of added
};
//---------------------------------------------------------------------------
extern PACKAGE TfrmNVRAMEditor *frmNVRAMEditor;
//---------------------------------------------------------------------------
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -