AGIS软件二次开发技术_

合集下载

KEIL仿真的AGSI接口

KEIL仿真的AGSI接口

C Compilers • Real-Time OS • Simulators • Education • Evaluation BoardsImplementing µVision DLL’s for Application Note 154 Advanced Generic Simulator Interface Rev. 4Extended by Infineon TechnologiesContents Contents (1)Introduction (3)How to use a Sample Peripheral DLL (4)Implementing own peripheral DLLs: Required Steps (7)How simulation basically works (8)Address representation (9)AGSI Function Description (10)AgsiEntry (11)AgsiDefineSFR (13)AgsiDefineVTR (14)AgsiDeclareInterrupt (15)AgsiSetWatchOnSFR (17)AgsiSetWatchOnVTR (18)AgsiSetWatchOnMemory (19)AgsiCreateTimer (20)AgsiSetTimer (21)AgsiDefineMenuItem (22)AgsiRegisterExecCallBack (24)AgsiWriteSFR (25)AgsiReadSFR (26)AgsiSetSFRReadValue (27)AgsiWriteVTR (28)AgsiReadVTR (29)AgsiWriteMemory (30)AgsiReadMemory (31)AgsiGetStates (32)AgsiGetProgramCounter (33)AgsiIsInInterrupt (34)AgsiIsSleeping (35)AgsiIsSimulatorAccess (36)AgsiIsSyncInstruction (37)AgsiGetSyncCount (38)AgsiSetSyncCount (39)AgsiSetSyncDelay (40)AgsiStopSimulator (41)AgsiWakeUp (42)AgsiTriggerReset (43)AgsiContinue (44)AgsiRequestInterrupt (45)AgsiSetSyncCount (46)AgsiUpdateWindows (47)AgsiHandleFocus (48)AgsiGetExternalClockRate (49)AgsiSetExternalClockRate (50)AgsiGetInternalClockRate (51)AgsiGetClockFactor (52)AgsiMessage (53)AgsiSetTargetKey (54)AgsiGetTargetKey (55)AgsiExecuteCommand (56)AgsiGetLastMemoryAddress (57)AgsiGetSymbolByName (58)AgsiGetSymbolByValue (59)Extensions by Infineon Technologies (61)Index (62)IntroductionThe µVision Debugger supports a simulator interface for implementing user-defined peripherals. This interface is called A dvanced G eneric S imulator I nterface (AGSI). The AGSI introduces a flexible and easy way for adding new user defined peripherals directly to µVision. It provides functions that are necessary to simulate the peripheral’s behavior as well as functions to display peripheral dialogs.To ease the development of a user-defined peripheral, the AGSI and a configuration framework is provided in two example projects. Only µVision version 2.21 or later supports all functions that are described in this document.AGSI Revision 3 is for µVision3 (version 3.00 or higher) and adds the following features: •AgsiEntry has new function codes (nCODE= AGSI_PRE_RESET, AGSI_CMDOUT)•The CALLBACK function for AgsiSetWatchOnSFR, AgsiSetWatchOnVTR, and AgsiSetWatchOnMemory gets now the address and access reason when it is called.AGSI DLL’s that have been developed for µVision2 can still be used with µVision3.SPeriDLLSPeriDLL, is a synonym for ‘Sample Peripheral DLL’. It is a ready to run peripheral DLL which implements a ‘A/D Converter from Analog Devices ADuC812’ as a sample peripheral. It uses most of the AGSI functions to implement this peripheral. The project consists of a MS Visual-C++ (6.0) project file and the following source files:AGSI.h: prototypes for the AGSI functions (do not modify!)SPeriDLL.h: main header file with various prototypes and definitionsSPeriDLL.cpp: main file (created by AppWizard) contains setup code and simulationPeriDialog.h: header file (created by Class Wizard) for a modeless peripheral dialogPeriDialog.cpp: implementation file for a modeless peripheral dialogAlso a simple µVision test project ‘Single A/D conversion with ADuC812’ is included in the fileS812ADC.zip which shows how to include and test the implemented peripheral.STimerDLLSTimerDLL, is a synonym for ‘Sample Timer DLL’. It is a ready to run peripheral DLL which implements a ‘Timer 3’ as a sample peripheral. As regards functionality, ‘Timer 3’ is identical to a standard 8051 Timer 1 but has different SFR addresses so that it can be loaded in addition to a ‘Timer 1’. It uses most of the AGSI functions to implement this peripheral. The project consists of a MS Visual-C++ (6.0) project file and the following source files:AGSI.h: prototypes for the AGSI functions (do not modify!)Common.h: header file with various prototypes and definitionsCommon.cpp: common support functions for AGSI and dialog functionsSTimerDLL.h: header file for STimerDLL classSTimerDLL.cpp: main file provides peripheral setup code and simulationPeriDialog.h: header file (created by Class Wizard) for a modeless peripheral dialogPeriDialog.cpp: implementation file for a modeless peripheral dialogAlso a simple µVision test project is included in the file Timer3.zip which shows how to include and test the implemented peripheral.In order to develop a peripheral, knowledge about C/C++ programming and the MS Visual-C++ 6.00 Programming Environment is required.How to use a Sample Peripheral DLLIn order to use one of the Sample Peripheral DLL’s, you must perform the steps below. The following steps are described for the SPeriDLL but the same applies for the STimerDLL:•Install µVision and the C51 Compiler on your PC.•Create a folder such as D:\Src32\SPeriDLL\•Unzip the file SPeriDLL.zip into the folder. Make sure that the ‘use folder names’ checkbox is checked since SPeriDLL uses some subfolders.•Create a folder such as C:\Keil\C51\Examples\S812ADC\•Unzip the file S812ADC.zip into the folder.•Start Visual-C, select the ‘SPeriDLL.dsw’ project file.•Select ‘Project – Settings’. Click at the ‘Debug’ tab. Browse for the ‘Executable for Debug session’. You need to select the file Uv2.Exe. It is normally in C:\Keil\Uv2 but this depends onwhere you have installed µVision.•Then click at the ‘Custom Build’ tab and write in the ‘Commands’ window the command ‘copy $(InputPath) C:\KEIL\C51\BIN\$(InputName).dll’ and write in the ‘Outputs’ window the outputfile ‘C:\KEIL\C51\BIN\$(InputName).dll’. This step is required to automatically copy the created DLL after building it in the BIN subfolder of µVision which is normally C:\KEIL\C51\BIN butdepends on where you have installed µVision. If everything is right, then the dialog should look like this:•After that, close the dialog.•Select ‘Build – Set active configuration’, choose the SPeriDLL Win32 Debug configuration. •Select ‘Build – Rebuild All’ to create the DLL.•Run µVision by pressing the F5 key. Select ‘Project – Open Project’, the Select Project dialog comes up. Select the ‘S812ADC.uv2’ project. It can be found in the folder that you havecreated and copied the project files into (normally C:\Keil\C51\Examples\S812ADC). •Select ‘Rebuild all target files’ to build the project.•Select ‘Options for Target – Debug’. Enable loading of the SPeriDLL peripheral DLL by simply adding the parameter ‘-dSPeriDLL’ to the parameter list of the ‘Dialog DLL’. The parameter format for peripheral DLL’s is ‘-dDLLName’ (DLL name without extension). Make sure that the ‘Use Simulator’ radio button is checked. If everything is right, then the dialog should look like this:•Close the dialog.•Select ‘Debug – Start/Stop Debug Session’. This will start the µVision Debugger. It initializes and loads also our SPeriDLL.dll. In the ‘Peripherals’ menu a new item should be present withthe label ‘A/D Converter’. Click on this item to open the peripheral dialog which looks like this:•Now you can single step through the code of the ‘Single A/D conversion with ADuC812’ sample and observe the behavior of the ‘A/D Converter’ peripheral and also other peripherals like ‘Port 0’ , ‘Port 2’, ‘Port 3’ and ‘Interrupt’.Note that this sample program demonstrates functionality of only a small part of the A/D Converter.Implementing own peripheral DLLs: Required StepsIn order to develop a peripheral DLL you should perform the following steps:•Start MS Visual-C++ and create a new project ‘MFC AppWizard (dll)’.•Add prototypes and definitions for the AGSI and SFR’s (S pecial F unctions R egisters) and VTR’s (V ir t ual R egisters) definitions to the main header file (*.h).•Write code for the peripheral initialization into the main file (*.cpp). This includes AGSI setup (GetFunctionPointers), declaration of peripheral menu entries and associated dialogs(DefineAllMenuEntries), declaration of SFR’s (DefineAllSFR), VTR’s (DefineAllVTREG),Watches (DefineAllWatches) and Interrupts (DefineAllInterrupts). Write also code for peripheral reset - SFR’s reset values (ResetPripheral). All this functions are called from the functionAgsiEntry() which must be exported by this peripheral DLL.•Write functions for simulation of the peripheral into the main file (these functions are triggered by the defined watches). Include also prototypes of these functions.•Create a peripheral dialog with the Resource Editor (if the dialog is required) and the associated header file (*.h) and implementation file (*.cpp) using the ‘MFC ClassWizard’. Don’tforget to set the ‘Visible’ property of the dialog and include the default buttons ‘OK’ and ‘Cancel’ and make them invisible (required for the behavior of the ESC and Enter keys). Change thedefault constructor for the dialog and add functions PeriDisp() – displays dialog, PeriUpdate() – updates display contents which calls function Update() and PeriKill() – closes the dialog. Addalso a menu definition (AGSIMENU) and a dialog definition (AGSIDLGD).•Write the code for updating the display contents into the Update() function in the dialog implementation file. This function is called automatically when an update is requested and isused to reflect the current state of the peripheral.•Add functions for dialog control item’s messages by using ‘MFC ClassWizard’. Most frequently used messages are: ON_BN_CLICKED for Buttons, ON_EN_KILLFOCUS for Edit Boxes,ON_CBN_SELCHANGE for Combo Boxes …Include also functions for the two invisible buttons ‘OK’ and ‘Cancel’.•Select ‘Project – Settings’. Click at the ‘Debug’ tab. Browse for the ‘Executable for Debug session’ and select the file Uv2.Exe. It is normally in C:\Keil\Uv2 but this depends on where you have installed µVision.•Rebuild your peripheral DLL. Then copy the DLL file to the BIN subfolder of µVision which is normally C:\KEIL\C51\BIN but depends on where you have installed µVision or use the‘Custom Build’ within MS Visual-C++ and write the command that automatically copies the DLL after rebuild (see previous description in the ‘Sample Peripheral DLL’).•Test your peripheral DLL by running µVision (press the F5 key). Select a test project and enable loading of the implemented peripheral DLL by simply adding the parameter‘−dDLLName’ (DLL name without extension) to the parameter list of the peripheral DLL (seeprevious description in the ‘Sample Peripheral DLL’).•If the implemented peripheral is running, switch into Release Mode and rebuild it. Then test the peripheral DLL again (don’t forget to copy the ‘Release DLL’ file to the BIN subfolder ofµVision).How simulation basically worksIf every simulated peripheral would be updated with every simulated CPU instruction, the performance of the simulator would be extremely low. That’s why µVision simulator uses a event driven simulation instead. Events (also called watches) are read or write accesses to special function registers (SFR), virtual register (VTR) or memory areas and when a software timer expires. The following two examples explain this in detail:Analog Digital Converter (see SPeriDLL):Let’s assume that an A/D converter has configuration register (SFR’s ADCCONx), data register (SFR’s ADCDATAx), 8 analog inputs (VTR’s AIN0-7) and one external pin (VTR CONVST) to start a conversion. The A/D converter does nothing until it is started so no functions are called to simulate it and no simulation time is consumed at this time. In order to ‘see’ when the A/D converter is configured and started, so called access watches (AgsiSetWatchOnSFR and AgsiSetWatchOnVTR) need to be set on the configuration register and on the external start pin. This is done in the function ‘DefineAllWatches’. Whenever a new value is written into the ADCCONx register or into the external start pin, the function‘AdcConv’ is called. This function has to check the configuration, reference voltages and the analog inputs in order to calculate the digital value. The digital result cannot be written into the data register at this time. A real A/D converter needs some time to sample and convert an analog voltage. In order to simulate this behavior, a software timer is set (AgsiSetTimer) which calls the function ‘AdcCompleted’ after the specified number of states. This function writes the digital value into the data register, clears the busy flag, and sets the interrupt request bit.16 Bit Timer (see STimerDLL):Even a timer does not need to update (recalculate) its values with every simulated instruction. Typically, the timer values need to be updated when the configuration changes (start/stop, prescaler value) and when the actual timer value is read. Therefore, a write access watch must be set on the configuration register and read access watches must be set on the timer register. The timer calculation function stores the time (states) in a static variable whenever it is called. With the time difference (actual states – last states) the actual timer value can be calculated. With this method, the timer values can be calculated at any time with a minimum of calculation overhead. Only the interrupt on a timer overflow cannot be handled that way. With an additional software timer (AgsiSetTimer) set to this event, the timer is recalculated with every overflow. When a overflow is detected, the interrupt request flag is set and the timer is reloaded with 0 or a specific reload value.Address representationDepending on the microcontroller family, µVision maps the different memory areas (XDATA / DATA / CODE) into one linear address range. These different memory areas are represented with the following values in the most significant byte of a 32 bit address:80166 Microcontroller: This microcontroller has a 16 Mbyte linear address space. The valid address range therefore is from 0 to 0x00FFFFFF. No different memory types are needed.8051 Microcontroller:Define Memory type Address RangeamXDATA XDATA 0x0000 – 0xFFFFamPDATA PDATA 0x0000 – 0x00FF (one page of XDATA)amDATA DATA 0x0000 – 0x00FFamIDATA IDATA 0x0000 – 0x00FF (0x00 – 0x7F = DATA)amCODE CODE 0x0000 – 0xFFFFamBANK0 Bank 0 0x0000 – 0xFFFFamBANK0 + n Bank n 0x0000 – 0xFFFFamBANK31 Bank 31 0x0000 – 0xFFFF80251 Microcontroller: Following types can be used in addition to the memory types of the 8051 Family Define Memory type Address RangeamEDATA EDATA 0x0000 – 0xFFFFamECODE ECODE 0x0000 – 0xFFFFFFamHDATA HDATA 0x0000 – 0xFFFFFFamHCONS HCONST 0x0000 – 0xFFFFFFamCONST CONST 0x0000 – 0xFFFFSLE66 Microcontroller: Following types can be used in addition to the memory types of the 8051 FamilyDefine Memory type Address RangeamPHYS physical 0x0000 – 0xFFFFFFExample:BYTE buffer[10];AgsiReadMemory(0x1000|(amCODE<<24),10,buffer);// read 10 bytes to (CODE) address 0x1000 AgsiReadMemory(0x1000|(amCODE<<16),10,buffer);// the same function but for SLE66 processorAGSI Function DescriptionAgsiEntry is the only function of a peripheral DLL that is called directly from the µVision simulator. All other functions described below are in the µVision simulator and can be called from the peripheral DLL. Functions to define SFR’s, VTR’s, interrupts, timer, menus, dialogs and access watches. These functions can only be called during the initialization.AgsiDefineSFR AgsiDefineVTRAgsiDeclareInterrupt AgsiSetWatchOnSFRAgsiSetWatchOnVTR AgsiSetWatchOnMemoryAgsiCreateTimer AgsiDefineMenuItemAgsiRegisterExecCallBackFunctions to read and write memory, SFR’s and VTR’s:AgsiWriteSFR AgsiReadSFRAgsiWriteVTR AgsiReadVTRAgsiWriteMemory AgsiReadMemoryFunctions to retrieve simulator status information:AgsiGetStates AgsiGetProgramCounterAgsiIsInInterrupt AgsiIsSleepingAgsiIsSimulatorAccess AgsiIsSyncInstructionAgsiGetSyncCount AgsiGetExternalClockRateAgsiGetInternalClockRate AgsiGetClockFactorAgsiGetLastMemoryAddressFunctions to control the simulator:AgsiSetTimer AgsiSetSFRReadValueAgsiStopSimulator AgsiWakeUpAgsiTriggerReset AgsiContinueAgsiRequestInterrupt AgsiSetSyncCountAgsiSetSyncDelay AgsiSetExternalClockRateAgsiUpdateWindows AgsiHandleFocusAgsiMessage AgsiExecuteCommandFunctions to store and retrieve configuration information:AgsiSetTargetKey AgsiGetTargetKeyFunctions to retrieve symbol values or symbol names:AgsiGetSymbolByName AgsiGetSymbolByValueAgsiEntrySummary:extern "C" DWORD AGSIEXPORT AgsiEntry (DWORD nCode, void *vp)Parameter:nCode Function selector. All possible values are listed below.vp Pointer to various objects depending on nCode. In order to use this pointer, itmust be casted to the required data type.Return Value:The function should return TRUE(1) if completed successfully or FALSE(0) if an error occurred.Description:AgsiEntry is the only function of a peripheral DLL that has to be exported. It is called from µVision when a debug session is started to initialize the peripheral simulation as well as during the debugging session to notify events. The meaning of vp depends on the value of nCode. AgsiEntry can be called with the following nCode values:Value of nCode Value of vp FunctionAGSI_CHECK 8051 or 80166 Check CPU TypeAGSI_INIT Pointer to AGSICONFIG Initialize DLLAGSI_TERMINATE Not used TerminateAGSI_RESET Not used ResetAGSI_PREPLL Not used CPU clock is about to be changedAGSI_POSTPLL Not used CPU clock was changedAGSI_PRERESET Not used Called before Reset, but CPU cyclesstill validAGSI_CMDOUT Pointer to Text Command output of 'exec' commands AGSI_ONINTERRUPT Pointer to Interrupt number Interrupt from a deviceAGSI_ONRETI Pointer to Interrupt number Interrupt acknowledgedAGSI_ENTERSLEEP Not used Power down mode enteredAGSI_EXITSLEEP Not used Power down mode exitedAGSI_CHECKThe first call to AgsiEntry is done with nCode=AGSI_CHECK. The pointer vp points to a DWORD which contains either the value 8051 or 80166, or 7 (for ARM) depending on the microcontroller family that is selected in the current project. This call checks if the DLL can be used for the specifiedmicrocontroller family. The function should return TRUE(1) if the DLL supports this microcontroller family or FALSE(0) if not.AGSI_INITThe second call to AgsiEntry is done with nCode=AGSI_INIT. The pointer vp points to the structure AGSICONFIG which contains information about the project and the parameters for this DLL. This information can be used to configure the peripheral DLL. Additional parameters (format: –option) for the DLL can be entered in the µVision dialog ‘Options for Target -> Debug - > Dialog DLL Parameter’. The DLL can analyze the ‘m_pszConfiguration’ string to extract the information. The‘m_pszProjectPath’ can be used to store log files or additional configuration files for the current project.typedef struct {HINSTANCE m_hInstance; // Instance handle to retrieve the function addressesconst char* m_pszProjectPath; // Path to application e.g. C:\KEIL\C51\EXAMPLES\HELLO const char* m_pszDevice; // Simulated Device e.g. 52. This string is extracted// out of the -p option.const char* m_pszConfiguration; // Complete dialog DLL options e.g. -p52 -dmydll ...const char* m_pszAppFile; // Name of loaded OMF file including path e.g.C:\KEIL\C51\EXAMPLES\HELLO\HELLO //HWND m_hwnd; // Mainframe parent window} AGSICONFIG;When AgsiEntry is called with AGSI_INIT, all special function register (SFR), virtual register (VTR), interrupts, watch points and dialogs that need to be simulated must be defined. The function should return FALSE(0) if an error occurs or TRUE(1) if the function has been executed successfully.AGSI_TERMINATEAgsiEntry is called with nCode=AGSI_TERMINATE when the µVision debugger is closed. The pointer vp is not used in this case. When files have been opened during initialization they must be closed and if memory has been allocated, it must be freed.AGSI_RESETAgsiEntry is called with nCode=AGSI_RESET when the simulated CPU is reset. All peripherals (SFR’s) must be set to their reset state. There are several situations where a CPU reset is executed: - When the simulator is started (after AGSI_INIT).- After an application is loaded.- When RESET is entered in the command line or when the reset button is pressed in the toolbar.- When a watchdog timer overflow occurs.The pointer vp is not used in this case.AGSI_PREPLL, AGSI_POSTPLLAgsiEntry is called with nCode=AGSI_PREPLL or AGSI_POSTPLL before and after the CPU clock frequency changes. Some CPU’s have a clock prescaler that can be reprogrammed to save power. In case a peripheral is not connected to the same clock as the CPU, the values for AgsiSetTimer probably need to be recalculated when the CPU clock is modified. This function call notifies a peripheral before and after the CPU clock frequency has changed so that the timer values can be corrected for the new clock. The pointer vp is not used in this case.Summary:BOOL AgsiDefineSFR(const char* pszSfrName, AGSIADDR dwAddress,AGSITYPE eType, BYTE bBitPos);Parameter:pszSfrName Pointer to name of the SFRdwAddress Address of the SFR. Following address ranges are possible:8051/251: 0x80 – 0xFF8051Mx: 0x80 – 0xFF and 0x180 – 0x1FF80166: 0xF000 – 0xF1FE and 0xFE00 – 0xFFFE (even address) eType Type of the SFR.orAGSIBIT8051: AGSIBYTE80166: AGSIWORD or AGSIBITWith AGSIBIT, dwAddress must point to a bit addressable area:8051: 0x80, 0x88, … , 0xF0, 0xF8 every 8th byte80251: 0x80 - 0xFF every byte8051Mx: 0x80 - 0xF8 and 0x180 – 0x1F8 every 8th byte80166: 0xF100 – 0xF1FE and 0xFF00 – 0xFFFE (even address) bBitPos Bit position within SFR (only for eType=AGSIBIT).8051/251/Mx: 0 – 780166: 0 – 15Return Value:TRUE if successful, FALSE in case of wrong address or too many definitions (at least 300 for all loaded DLL’s).Description:This function is used to define a SFR (S pecial F unction R egister) or a SFR bit. These definitions can be listed in the symbol window and can be used in the watch window and command line.Note:This function may only be called during the initialization process.Example:AgsiDefineSFR("IE", 0xA8, AGSIBYTE, 0); // 8051: IEAgsiDefineSFR("EA", 0xA8, AGSIBIT, 7); // 8051: EA bit in IEAgsiDefineSFR("PSW", 0xFF10, AGSIWORD, 0); // 80166: PSWAgsiDefineSFR("IEN", 0xFF10, AGSIBIT, 11); // 80166: IEN bit in PSWSummary:AGSIVTR AgsiDefineVTR(const char* pszVtrName, AGSITYPE eType,DWORD dwValue);Parameter:pszVtrName Name of the VTReType Type of the VTR (AGSIVTRCHAR, AGSIVTRWORD, AGSIVTRLONG orAGSIVTRFLOAT)dwValue Initial Value of the VTR. Initializing float values is a little difficult sincedwValue is defined as DWORD. In this case, the float value can be convertedto a DWORD using a union.Return Value:VTR handle if successful otherwise NULL.Description:This function is used to declare a VTR (V ir t ual R egister). VTR’s are used to display or to set values that are usually set by hardware. With this function, new VTR’s can be defined or the handle of already defined VTR’s can be retrieved.Note:This function may only be called during the initialization process.Example:hXTAL = AgsiDefineVTR("XTAL", AGSIVTRLONG, 0x00B71B00); // 12MHzhVREF = AgsiDefineVTR("VREF", AGSIVTRFLOAT, 0x40200000); // 2.5VhVREF = AgsiDefineVTR("MYPORT", AGSIVTRCHAR, 0x000000FF); // all pins highAgsiDeclareInterruptSummary:BOOL AgsiDeclareInterrupt(AGSIINTERRUPT *pInterrupt);Parameter:PInterrupt Pointer to an AGSIINTERRUPT structure (see below).Return Value:TRUE if successful otherwise FALSE.Description:This function is used to define an interrupt source of an on-chip peripheral. All the information about this interrupt source is passed to the function with a structure. It defines the interrupt vector address as well as all request, enable and priority flags. This information automatically adds another line in the Interrupt Dialog. The structure is different for every microcontroller family and is described in the following AGSIINTERRUPT structure:// 8051/251/8051Mxtypedef struct {AGSIADDR vec; // interrupt vector addresschar *mess; // interrupt name (will be shown in interrupt dialog)// The mode bit is only shown in the interrupt dialog.// It has no influence on interrupt processing.AGSIADDR msfr; // interrupt mode sfr.WORD mmask; // interrupt mode bit mask (only one bit may be set)const char *mname; // name of interrupt mode bitAGSIADDR rsfr; // interrupt request sfrWORD rmask; // interrupt request bit mask (only one bit may be set) const char *rname; // name of interrupt request bitAGSIADDR esfr; // interrupt enable sfrWORD emask; // interrupt enable bit mask (only one bit may be set)const char *ename; // name of interrupt enable bitAGSIADDR p0sfr; // interrupt priority 0 sfrWORD p0mask; // interrupt priority 0 bit mask (only one bit may be set) const char *pname; // name of interrupt priority bitAGSIADDR p1sfr; // interrupt priority 1 sfr. =0 if CPU only supports 2 levels WORD p1mask; // interrupt priority 1 bit mask (only one bit may be set) WORD pwl; // priority within level (1 – lowest priority)WORD auto_reset; // reset interrupt request flag on interrupt entry} AGSIINTERRUPT;// 80166typedef struct {AGSIADDR vec; // interrupt vector address (must be a even address)char *mess; // interrupt name (will be shown in interrupt dialog)AGSIADDR sfr; // interrupt control sfr which contains ILVL, GLVL, IR and IE } AGSIINTERRUPT;// SLE66typedef struct {AGSIADDR vec;char *mess; // Interrupt nameconst char *rname; // name of interrupt request bitconst char *ename; // name of interrupt enable bitconst char *pname; // name of interrupt priority bitDWORD num; // Interrupt NumberDWORD pwl; // priority within level} AGSIINTERRUPT;Note:This function may only be called during the initialization process.Example:// 8051/251/8051Mx#define TCON 0x88#define IE 0xA8#define IP 0xB8#define IPH 0xB7AGSIINTERRUPT ExtInt0 = { // External Interrupt 00x0003, "P3.2/Int0", TCON, 0x01, "IT0", TCON, 0x02, "IE0", IE, 0x01, "EX0", IP, 0x01, "Pri", IPH, 0x01, 8, 1};AGSIINTERRUPT Timer0Int = { // Timer 0 Interrupt0x000B, "Timer 0", 0, 0, "", TCON, 0x20, "TF0", IE, 0x02, "ET0", IP,0x02, "Pri", IPH, 0x02, 6, 1};AgsiDeclareInterrupt(&Timer0Int);AgsiDeclareInterrupt(&ExtInt0);// 80166#define S0TIC 0xFF6CAGSIINTERRUPT SerTransmitInt = { // Serial Transmit Interrupt0x00A8, "S0TINT", S0TIC}AgsiDeclareInterrupt(&SerTransmitInt);Summary:BOOL AgsiSetWatchOnSFR(AGSIADDR SFRAddress, AGSICALLBACKApfnReadWrite,AGSIACCESS eAccess);Parameter:SFRAddress Address of the SFRpfnReadWrite Pointer to a function that is called on SFR access. The function gets asargument the address and the access reason to the memory and does nothave a return value (void function(DWORD adr, AGSICB_REASON r)).eAccess Access type (AGSIREAD, AGSIWRITE, AGSIREADWRITE)Return Value:TRUE if successful otherwise FALSE.Description:This function is used to set a watch on SFR access. Whenever the specified SFR is accessed, the specified function is called.Example:#define TCON 0x88#define TL1 0x8B#define TH1 0x8Dstatic void timer1(DWORD adr, AGSICB_REASON r) {// watch function implementation}AgsiSetWatchOnSFR(TH1, timer1, AGSIREADWRITE); //Call ‘timer1’ when TH1 is written or read AgsiSetWatchOnSFR(TL1, timer1, AGSIREADWRITE); //Call ‘timer1’ when TL1 is written or read AgsiSetWatchOnSFR(TCON, timer1, AGSIWRITE); //Call ‘timer1’ when TCON is written。

二次开发手册

二次开发手册

二次开发手册随着科技的不断发展,软件已经成为人们日常生活和工作中不可或缺的一部分。

为了满足用户对软件功能的需求,开发者经常需要进行二次开发。

本手册旨在为二次开发者提供一套完整、实用的指南,帮助其更好地进行软件二次开发工作。

1.二次开发的基本概念二次开发是指在已有软件的基础上,根据用户需求进行功能扩展、改进或定制的过程。

通过二次开发,可以充分利用已有软件的优点,提高软件的功能性和易用性。

2.二次开发的流程二次开发的流程包括需求分析、设计、编码、测试和部署等阶段。

其中,需求分析阶段是关键,需要充分了解用户需求,确定二次开发的具体内容和目标。

设计阶段需要对系统架构、数据库结构、界面设计等进行详细规划。

编码阶段需要按照设计要求进行编码实现。

测试阶段需要对二次开发的功能进行全面测试,确保其符合预期要求。

部署阶段需要对二次开发的软件进行部署和上线。

3.二次开发的技术实现在进行二次开发时,需要了解和掌握相关的技术实现。

例如,对于Web应用程序的二次开发,需要了解HTML、CSS、JavaScript等前端技术,以及后端语言如Python、Java等。

对于移动应用程序的二次开发,需要了解iOS或Android平台的开发技术。

此外,还需要了解数据库技术、版本控制技术等。

4.二次开发的常见问题及解决方案在进行二次开发时,可能会遇到一些常见问题,如兼容性问题、性能问题、安全性问题等。

针对这些问题,需要采取相应的解决方案。

例如,对于兼容性问题,需要进行充分的测试和调优;对于性能问题,需要进行性能分析和优化;对于安全性问题,需要加强安全措施和防范措施。

5.案例分析为了更好地说明二次开发的实践过程,本手册提供了几个案例分析。

这些案例涵盖了不同领域和不同规模的二次开发项目,通过分析这些案例的成功经验和问题所在,可以为读者提供宝贵的启示和帮助。

通过这些案例的分析和学习,读者可以更好地理解二次开发的实践操作和关键要点,为自己的二次开发工作提供指导和实践经验借鉴。

基于GIS的集成二次开发

基于GIS的集成二次开发

第18卷第2期2000年6月北京轻工业学院学报JOU RNAL O F BE I J I N G I N ST ITU T E O F L IGH T I NDU STR Y V o l 118N o 12Jun 12000 文章编号:100127429(2000)022*******基于G IS 的集成二次开发文远保, 杜亚辉(华中理工大学计算机学院,武汉 430074)摘 要 介绍了G IS 的集成二次开发技术,并指出这种方式正成为应用型G IS 开发的主流方向,最后对Pow er B u ilder 采用OL E A u tom ati on 技术进行M ap info 集成开发进行了具体讨论Λ关键词 地理信息系统;集成二次开发;对象链接与嵌入自动化技术;桌面地图信息系统中图分类号 T P 31115;P 208 文献标识码 A收稿日期:20000302地理信息系统G IS (Geograp h ic Info r m ati on System )起源于20世纪60年代末期,它是由地理学、制图学、遥感与摄影测量学、计算机CAD 技术、数据库技术等学科和技术综合发展而来的,其研究对象是各种具有空间地理特征的空间数据[1]ΛG IS 广泛应用于与自然界有关的领域和行业,随着G IS 应用需求的增加,应用G IS 的开发工作日显重要Λ利用开发工具充分发挥G IS 的功能也成为今后信息系统评价的一个方面[2],因此如何针对不同的应用目标高效地开发出既合乎需要、又具有方便美观界面的应用型G IS 成为开发人员普遍关心的问题Λ1 集成二次开发技术111 技术简介集成二次开发是指以通用编程软件尤其是面向对象的可视化开发工具(如PB 、V isual C ++、V isual B asic 、D elph i 等)为开发平台,利用G IS 工具软件(如A rc V iew ,M ap info 等)实现G IS 基本功能Λ集成二次开发既可以充分利用可视化软件开发工具的高效方便的编程功能,又可以充分利用G IS 工具软件完备的空间数据可视化分析处理功能,集二者之所长,不仅能大大提高应用系统的开发效率,而且使用面向对象的可视化软件开发出来的应用程序具有良好的外观、完善的功能、可靠性好、便于维护等优点,现已成为应用型G IS 开发的主流Λ集成二次开发分两种方式:1)利用G IS 工具软件生产厂家提供的建立在OCX 技术基础上的G IS 功能组件(如ESR I 公司的M apob jects ,M ap info 公司的M apX 等),在PB 等编程04北京轻工业学院学报2000年6月 工具编制的应用程序中直接将OCX控件嵌入,通过编程将其中的G IS功能发挥出来ΛOCX 技术的方便快捷性,使之成为今后集成的方向;2)利用DD E技术或采用OL E A u tom ati on (OL E自动化)技术,用PB等编程工具开发出前台可执行应用程序,以DD E方式或OL E自动化方式启动G IS工具软件在后台运行,实现应用程序中的G IS功能[1]Λ1.2 术语解释DD E(D ynam ic D ata Exchange—动态数据交换),主要是一个发送消息和接收消息的机制,使得应用程序之间能够实现共享数据、在远端执行命令以及检查错误状态等功能ΛOL E(O b ject L ink ing and Em beding),意为对象链接与嵌入Λ是在DD E的基础上建立的,提供了一种使W indow s应用程序之间共享数据和程序的机制Λ现在OL E是一个标准的组件集成和服务体系结构,OL E技术是目前非常流行的一种技术ΛOCX(OL E Cu stom Con tro l),名为OL E定制控件Λ它一般是生产厂家根据普遍需求,特意制作的能实现一定功能的组件,它能够提供某些处理的服务器程序,符合OL E标准Λ实际上,OCX功能组件也是一种OL E技术,在进行集成开发时,也采用OL E自动化技术ΛM ap info 公司提供的M apX就是一个功能强大的OCX组件,为用户提供了完整的地图信息系统解决方案ΛOL E A u tom ati on—OL E自动化,即对象链接与嵌入自动化技术,是指通过编程来使一个OL E服务器应用程序自动修改它的OL E对象Λ1.3 技术说明1)使用W indow s平台Λ只有W indow s平台才支持DD E和OL E技术,在W indow s平台上,PB和M ap info完全支持DD E和OL E这两个机制ΛOL E自动化技术与DD E技术相比,响应速度更快,并且能够更好提供错误信息报告,随着其技术的更加完善,已越来越得到普及应用,提倡应用OL E自动化技术进行开发Λ主要介绍采用OL E自动化技术进行M ap info p rofessi onal(桌面地图信息系统平台,以下简称M ap info)的集成二次开发Λ2)理解OL E自动化技术Λ通常OL E技术,在应用程序窗口中(如W ORD)放入可插入控件(In sertab le con tro l,如BM P图象控件),双击它激活控件服务器,在服务器窗口进行对象编辑Λ它需要用户除了应用程序(如W ORD)之外,还要对其它的服务器(如BM P绘图程序)的功能操作有一定了解,增加用户负担Λ如果通过OL E自动化技术,对OL E对象变量(如OL Eob ject,PB为OL E进行自动化设计的对象类型)编程,引用存储在OL Eob ject变量中的对象进行自动化控制,OL E服务器对前台应用程序的要求在后台响应自动完成,用户就可以不用直接介入服务器的操作ΛG IS开发工具平台本身的复杂性对用户有一定要求,易使非专业用户望而却步,将其通过OL E自动化技术转换成可被用户接收的、易操作的应用系统也是集成开发的初衷Λ3)区别OL E服务器提供的OL E对象ΛM ap info提供的OL E对象有可插入的可视控件(M ap info M ap,地图控件)和不可视可编程对象(OL P,OL E p rogramm ab le ob ject)——M ap info A pp licati onΛM ap info M ap控件对应的服务器只是M ap info中的地图服务器,不是开发工具平台Λ地图控件只能使用的部分特性来创建、显示和编辑地图,不是所有的M ap info 功能都可以在地图嵌入范围内使用Λ进行M ap info 集成二次开发,是指利用M ap info A pp licati on 对象进行集成开发来实现G IS 功能Λ2 集成二次开发的实施进行开发,应该在熟悉软件工程设计思想的基础上,采用科学的开发步骤和技术[1]Λ2.1 选好开发工具面向对象开发工具Pow er B u ilder (PB )是目前最有代表性的数据库前端开发工具之一,受到从事管理信息系统(M IS )和数据库应用系统开发人员的欢迎ΛPB 可以使开发人员的工作速度更快,成本更低,质量更高,功能更强ΛM ap info 公司的M ap info P rofessi onal 产品则是目前世界上最为完备、功能强大、全面而直观的桌面地图信息系统Λ它复杂而深层次的可视化地理分析功能,可以帮助用户在不同的数据之间建立关联,从地理学的角度来获取商业信息Λ二者的结合,既可以大大提高开发效率,又能从外观、速度和G IS 功能等方面使信息系统更加完善Λ2.2 掌握开发技术集成二次开发主要技术关键有两个:一是M ap info 的OL E 对象实例的创建;二是M ap info 功能在PB 环境下本地化,利用M ap info OL E 服务器提供的方法实现G IS 功能Λ为此,应掌握以下技术:1)熟悉开发工具Λ应熟悉PB 中OL E 对象实例的处理及编程实现方法,了解M ap info 平台应用,注意运用M ap info 为方便用户而附带的一些功能,如数据库管理、报表统计分析等Λ在编程时,这些功能可直接在应用系统上通过简单的语句调用,简化开发过程Λ2)将M ap info 集成进其它应用程序中,应了解M ap basic 语句和函数ΛM apbasic 语言提供了M ap info 与其它应用程序的接口功能,详细可参考M ap basic 手册Λ其中最关键的是:由Set A pp licati on W indow (设置M ap info 父窗口)和Set N ex t Docum en t (设置M ap 窗的父窗口,如将地图窗口作为客户程序的子窗口)实现与M ap info 的对话、运行环境Λ3)了解M ap info 为支持OL E 自动化而设计的指令集ΛM ap info 提供的指令主要有:Do (string )(将字符串转换为M ap basic 语句并执行),Eval (string )(将字符串转换为M apbasic 表达式,并且返回表达式的值),R un M enuComm and (m enu id )(执行M ap info 菜单或按钮命令)等Λ开发者可以在PB 的B row ser 工具中查看到完整的M ap info 服务器的属性和方法Λ4)熟悉OL E 自动化实现方法ΛPB 实现OL E 自动化的步骤可以在一个事件脚本中完成,也可以由窗口中的几个控件的活动组成Λ如果需要在所开发的应用程序中让用户参与自动化,可以:1)在窗口声明中声明一个OL E 对象实例变量;2)在窗口的Open 事件中初始化所声明的变量并与服务器连接;3)把用户的要求以命令的形式发给服务器;4)在窗口的C lo se 事件中关闭与服务器的连接并清除这个OL E 对象[3]Λ14 第18卷第2期文远保等:基于G IS 的集成二次开发24北京轻工业学院学报2000年6月 3 开发实例按照OL E自动化的步骤,将地图集成在窗口中,能显示运行中的错误信息Λ声明全局变量:M ap info出错信息变量String M IE rro r M essage创建OL Eob ject对象OL Eob ject M I OL Eob ject在窗口w2m ain的Op en事件脚本中:声明局部变量:应用程序与M ap info服务器连接时返回的信息变量In teger E rrCodeString M sgtom i为OL Eob ject变量分配空间M I OL Eob ject=C reate OL Eob ject与M ap info服务器应用程序连接,并检查连接是否成功E rrCode=M I OL Eob ject.Connecttonew ob ject("M ap info.A pp licati on")If E rrCode<>0T hen M essageBox("Fatal E rro r","E rro r connecting to the m ap server.Ex iting...") H altE lse将当前窗口作为M ap info的对话框父窗口M sgtom i="Set A pp licati on W indow"+String(H andle(th is))M I OL Eob ject.Do(M sgtom i)打开要显示的地图的表文件M sgtom i=′Op en T ab le"′+"C: M ap Infom ati on data w o rld "+′w o rld.tab"′+" In teractive"M I OL Eob ject.Do(M sgtom i)用P ictu re控件(P2m ap)作为显示地图的容器M sgtom i="Set N ex t Docum en t Paren t"+String(H andle(P2m ap))+"Style1"M I OL Eob ject.Do(M sgtom i)显示地图M sgtom i="M ap from w o rld"M I OL Eob ject.Do(M sgtom i)可以按照用户的习惯,移走M ap info默认的地图上单击鼠标右键的快捷菜单M I OL EO b ject.A pp licati on.Do(′C reate M enu"M app erSho rtcu t"I D17as"(2"′)在应用程序的System E rro r 事件脚本中:提交从M ap info 中获得的错误信息,并显示错误信息.M IE rro r M essage =M I OL Eob ject .L astE rro r M essageIf M IE rro r M essage <>""T henM essageBox ("M ap Info E rro r ",M IE rro r M essage )End If在应用程序的C lo se 事件脚本中:关闭与服务器应用程序的连接并清除OL Eob ject 变量ΛM I OL Eob ject .D isconnectO b ject ()D estroy M I OL Eob ject在应用程序的Open 事件脚本中:打开窗口w 2m ainOp en (w 2m ain )以上程序在PB 615,M ap info P rofessi onal 410,W in 98平台上测试通过ΛM ap info 的功能,可以通过PB 在应用程序中建立菜单或工具按钮,运用服务器提供的方法逐一实现,并可以利用PB 本身方便易用的开发方法对其功能进行扩充Λ如实现缩小地图时先确认再进行,可在建立的地图缩小工具按钮的click 事件脚本中用M essagebox ()函数加上M I OL Eob ject 1R un M enuComm and (1706)语句来实现,这个工具的功能就不是单纯的M ap info 中的缩小地图功能了Λ4 讨论运用目前较流行的可视化编程工具(V C 、VB 、D EL PH I、PB )进行M ap info 的集成开发,实现方法接近Λ在用PB 进行开发时,可能会出现一些在V C 、VB 开发中意想不到的问题,因此在具体问题的处理上应区别对待ΛM ap info 提供的有些服务器指令,比如R un M enuComm and (m enu id )),它的参数为菜单代码,较简单,一般在处理这类指令时不会出问题Λ经常会遇到需要将应用程序中的变量通过M apbasic 函数进行服务器对象控制,服务器指令在执行时要先解释成M apbasic 语句或函数Λ由于PB 在编译程序时,不能识别服务器应用程序的命令和函数,即M apbasic 函数及参数无法辩别,也不能识别服务器返回信息的数据类型Λ很多情况往往是因数据类型声明或格式书写不当而出错,影响了开发Λ例如,用变量T ab lenam e 表示M ap info 打开的第一个数据表的名称,类型声明为string Λ实现时要用到Eval (string exp ressi on )指令,其中exp ressi on 表达式应为M apbasic 的T ab leinfo ()函数,其类型为string ΛT ab leinfo ()函数语法T ab leinfo (w hat tab le ,w hat info r m ati on shou ld be retu rened ),不可能象在M apbasic 开发语言中书写那么简单,应注意以下问题:1)T ab leinfo ()中有两个参数:变量L CV 表示已打开表的索引,其值为1表示打开的第一个表;变量m 2tab le 2nam e 其值为1表示需要返回表的名称Λ它们的数据类型不能是In teger ,应为String 类型Λ如String L CV ="1",Con stan t String m 2tab le 2nam e ="1"Λ若声明为In teger ,PB 会以为Eval ()指令中的类型中含有数字类型,而认为数据类型34 第18卷第2期文远保等:基于G IS 的集成二次开发44北京轻工业学院学报2000年6月 不匹配,出现编译错误Λ2)T ab leinfo()中参数应加参数转换标志符Λ"&"在VB中作为参数转换标志符,在PB 中“&”表示行连续符,用"+"作为参数转换标志符Λ应注意“+”与变量之间应有空格,忽略空格,M ap info运行会出错Λ应写为T ab leinfo("+L CV+","+m2tab le2nam e+")Λ3)Eval()中的string类型T ab leinfo()函数外的字符串标识,要用“”来标识Λ不要因为T ab leinfo()函数中参数L CV和m2tab le2nam e外都带有“”,认为双引号“”外的引号用单引号‘’表示,而写成‘T ab leinfo("+L CV+","+m2tab le2nam e+")’,引起系统误解出错Λ正确书写应该是:T ab lenam e=M I OL Eob ject.Eval("T ab leinfo("+L CV+","+m2tab le2nam e+")")为了PB顺利进行M ap info集成,建议:1)访问服务器属性及调用服务器函数的表达式的数据类型都设置成A ny,把这些表达式的值赋给类型为A ny的变量,以避免数据类型转换错误Λ在程序运行中,当把数据赋给A ny 变量时,它只是临时地接受该数据的数据类型,可以先使用C lass N am e函数判断一个A ny变量的数据类型,然后再做适当的赋值操作Λ如果已知服务器自动化函数的返回值,就不需使用A ny数据类型,可直接把返回值赋给一个具有正确数据类型的变量[3]Λ如,上例知道要返回的是表名称T ab lenam e,其数据类型可直接声明为StringΛ2)应尽量使用产品默认的代码值(常用代码值可在m apbasic.def、icon.def、m enu.def 中查看),引用M ap info或M apbasic中的约定变量名称的方法不可靠Λ如上例,变量m2tab le2 nam e源自M ap basic.def中的做法不好,如果直接使用tab lenam e=M I OL Eob ject.Eval(" tab leinfo(1,1)"),就不易出错,这样既可加速运行,又可避免PB或M ap info工具本身解码过程中的误解Λ为加强程序的可读性,可以用注释说明Λ5 结论G IS开发工具与可视化开发工具的结合使得可视化的数据在可视化界面上得到很好发挥,用户易接受,开发也易实现Λ但随着信息系统网络功能的需求,G IS面临着在因特网中如何实现的挑战,目前基于W eb的G IS开发还较复杂,也并非完全意义上的W ebG IS,因此现有G IS产品还急待改善Λ参考文献:[1] 陈述彭,鲁学军,周成虎.地理信息系统导论[M].北京:科学出版社,1999.[2] 张剑平等.地理信息系统与M A P I N FO应用[M].北京:科学出版社,1999.[3] 刘红岩等.PB应用开发技术详解[M].北京:电子工业出版社,1999.INTEGRATED SECONDARY D EVELOP M ENT OF GISW EN Yuan2bao, DU Ya2hu i(Colleg e of Co m p u ter S cience and T echnology,H uaz hong U n iversity of S cience andT echnology,W uhan430074,Ch ina)Abstract In troduced the in tegrated secondary developm en t m ethod of G IS,stated that the m ode w ill be the m ain stream,and discu ssed som e questi on abou t u sing pb too ls to develop m ap info by the techno logy of OL E A u tom ati on.Key words Geograp h ic Info r m ati on System;in tegrated secondary developm en t;OL E A u tom ati on;M ap info(编辑:邓清燕)54 第18卷第2期文远保等:基于G IS的集成二次开发。

二次开发方案

二次开发方案

二次开发方案引言:随着技术的进步和需求的不断增长,许多企业和组织在使用现有软件或系统时,常常会遇到一些功能不足或无法满足实际需求的情况。

这时,进行二次开发成为了一种常见的解决方案。

本文将探讨二次开发的定义、目的、方法以及实施过程,并提出一套完整的二次开发方案。

一、二次开发的定义二次开发指的是在已有软件或系统的基础上,根据用户的实际需求进行功能扩展、定制开发或性能优化等工作。

通过二次开发,用户可以在不改变现有软件或系统的基本框架和核心功能的前提下,实现更加个性化和高效的使用体验。

二、二次开发的目的二次开发的目的主要包括以下几个方面:1. 实现个性化需求:根据用户的具体需求,通过二次开发来实现一些特定的功能或业务流程,以满足用户个性化的需求。

2. 提升系统性能:通过优化代码结构、算法调优等手段,提高系统的性能和响应速度,确保系统能够高效稳定地运行。

3. 增强系统功能:在现有软件或系统的基础上,增加一些新的功能模块或扩展功能,以丰富系统的功能和可用性。

4. 适应业务发展:随着企业或组织的业务规模的扩大或业务流程的改变,二次开发可以根据业务需求进行系统定制或功能拓展,以适应新的业务发展。

三、二次开发的方法二次开发的方法多种多样,常见的方法有以下几种:1. 插件开发:在现有软件或系统的基础上,通过编写插件或模块,实现一些特定的功能或业务流程。

插件开发可以使系统具有一定的可扩展性,同时也能够保证原有系统的稳定性。

2. 数据库扩展:通过对现有数据库进行扩展或优化,实现更加高效的数据存储和管理,提升系统的运行效率。

3. API集成:利用现有软件或系统提供的API接口,将其他系统或软件与之集成,实现数据交互和功能扩展。

API集成可以使不同系统之间实现数据共享和协同工作,提高工作效率。

4. 定制开发:根据用户的具体需求,从头开始自定义开发一个全新的软件或系统。

定制开发可以满足用户的个性化需求,但同时也需要更多的开发时间和成本投入。

二次开发方案

二次开发方案

二次开发方案引言随着互联网的普及和发展,许多企业开始重视软件系统的二次开发,以满足其独特的业务需求。

在本文档中,我们将探讨二次开发方案的重要性,并提供一些相关的实施建议。

二次开发的定义二次开发是指在现有的软件系统基础上进行功能增强、定制化开发的过程。

通过二次开发,企业可以根据自身业务需求,对现有系统进行改造和优化,以满足其独特的业务要求。

二次开发的重要性1.适应业务需求在市场竞争日益激烈的今天,企业需求不断变化。

现有的软件系统可能无法完全满足企业的需求,因此二次开发成为了不可或缺的一环。

通过二次开发,企业可以根据自身业务需求,定制系统功能,以更好地支持业务流程。

2.提升工作效率通过二次开发,可以针对现有软件系统的不足之处进行优化和改进。

这些改进可能包括界面操作优化、功能整合、自动化流程等,可以有效提升员工的工作效率,减少重复劳动,提高生产效率。

3.降低成本相比于自行开发一个全新的软件系统,进行二次开发往往更加经济高效。

二次开发不需要从零开始,而是基于现有系统进行改进和定制。

这样可以节省开发成本和时间,降低项目风险,同时提高项目的成功率。

二次开发的实施建议1.需求分析和规划在进行二次开发之前,首先需要进行详细的需求分析和规划。

与业务部门沟通,了解他们的具体需求和期望,然后根据这些需求制定开发计划和时间表。

2.选择合适的开发工具和技术在进行二次开发时,选择合适的开发工具和技术是非常重要的。

根据企业的具体需求和系统特点,选择适合的开发语言、框架和数据库等工具。

同时,考虑到二次开发的稳定性和可维护性,选择流行且有良好支持的开发工具和技术更为推荐。

3.合理的功能定制和改进在进行二次开发时,需要根据需求来进行功能定制和改进。

尽量避免过度定制,以免影响系统的稳定性和维护成本。

定制和改进的功能应该能够满足业务部门的需求,同时保持与原有系统的兼容性。

4.测试和部署在二次开发完成之后,需要对新功能进行全面测试,确保其稳定性和可靠性。

采用二次开发方法的成果管理GIS系统设计与实现

采用二次开发方法的成果管理GIS系统设计与实现

采用二次开发方法的成果管理GIS系统设计与实现文章主要针对采用二次开发方法的成果管理GIS系统设计与实现进行分析,结合现代技术发展现状,从测绘数据集成管理系统设计与测绘数据集成管理系统实现方面进行深入研究与探索,主要目的在于更好的促进测绘数据集成管理系统运行效率的提升。

标签:二次开发;GIS系统;设计在社会经济与科学技术快速发展作用下,数据逐渐受到人们的关注与重视。

同时随着数据信息变化程度的加快,数据量与数据种类的提升,使得传统数据文件管理模式不能满足当前信息数据应用需求。

而在GIS快速兴起作用下,数据处理、分析以及运用方面得到了全面拓展,并逐渐在人们日常生活中有了广泛运用。

1.测绘数据集成管理系统设计通常情况下,测绘数据集成管理系统主要以传统的三层结构设计方式为基础,也就是将服务层、应用层以及数据层等作为出发点。

在实际设计期间,服务层以COM 组件技术为核心,通过Arc GIS Engine平台科学创建数据集成管理系统模块,利用ArcGIS空间数据引擎确保针对大量空间数据进行搜索具有较强便捷性与高效性,并运用数据库载体技术实现数据库维护与管理效率的提升[1]。

这也就是三方面内容的设计:首先,设计程序框架;其次,设计功能程序框架,主要针对业务运用、图像输出、图像管理以及数据信息更新等功能进行设计;最后,设计数据框架。

结合国土资源测量工作进行分析可以发现,系统数据主要由城镇地籍数据与当前土地资源现状数据组合而成,并将各种要素种类、位置层等作为條件实施分层存储与管理,为集成化管理与维护工作的实现奠定坚实基础。

同时系统使用C/S系统结构,以数据库为条件,确保其成为测绘数据集成管理系统的底层数据库,各种管理逻辑关系则属于中间层,而上层主要是根据实际需求为用户提供良好的服务。

空间数据与自身相对应的属性数据共同组成了底层数据库。

其中底层数据库也主要包含了地籍数据库、测绘数据库、影像资料数据库、勘探数据库、矿产数据库以及征地数据库等所有国土资源管理期间需要使用的数据信息和其对应的属性数据资源,特殊情况下也可根据实际需求在数据库中添加数据种类。

GIS二次开发实验报告

GIS二次开发实验报告

下载可编辑GIS 二次开发实验报告学号:姓名:班级:专业:指导老师:二零一五年 11 月 15 日目录1实验一:软件安装与 AOI 书签开发 (2)1.1实验目的 (2)1.2实验内容 (2)1.3实验结果 (2)2实验二:地图数据组织与访问 (5)2.1实验目的 (5)2.2实验内容 (5)2.3实验结果 (5)3实验三:地图渲染与制图输出 (9)3.1实验目的 (9)3.2实验内容 (9)3.3实验结果 (9)4实验四:空间数据处理 (14)4.1实验目的 (14)4.2实验内容 (14)4.3实验结果 (14)5实验五:GIS 分析 (20)5.1实验目的 (20)5.2实验内容 (20)5.3实验结果 (20)6 实验六:栅格数据处理 (25)4.1实验目的 (25)4.2实验内容 (25)4.3实验结果 (25)7实验总结 (31)1实验一:软件安装与 AOI 书签开发1.1实验目的掌握 AOI 书签程序开发1.2实验内容实现 AOI 书签的创建实现 AOI 书签的调用1.3实验步骤与结果安装程序后,新建地图显示项目。

在程序的主窗体上端添加添加菜单项,文本属性为创建书签,控件名为miCreateBookmark,在旁边添加组合框,控件名为cbBookmarkList。

1.右击引用选择AddArcGIS Reference在弹出的对话框中添加引用在主窗体(即MainForm.cs )中添加代码;(1 )首先添加引用代码:using ESRI.ArcGIS.Display;using ESRI.ArcGIS.esriSystem;using ESRI.ArcGIS.Carto;using ESRI.ArcGIS.Controls;using ESRI.ArcGIS.ADF;using ESRI.ArcGIS.SystemUI;using ESRI.ArcGIS.Geometry;using ESRI.ArcGIS.Geodatabase;using ESRI.ArcGIS.DataSourcesFile;using ESRI.ArcGIS.DataSourcesRaster;(此引用代码都需添加引用后才可以使用,上述引用代码为本类中所需要的所有引用,在之后的编程中,可以不用重复引用)(2)添加“创建书签”函数在 MainForm 类中添加成员函数 CreateBookMark ,代码如下:public void CreateBookmark(string sBookmarkName)//参数为书签名{// 通过 IAOIBookmark接口创建一个变量,其类型为AOIBookmark,用于保存当前地图的范围IAOIBookmark aoiBookmark = new AOIBookmarkClass();if (aoiBookmark != null){aoiBookmark.Location = axMapControl1.ActiveView.Extent; = sBookmarkName;}//通过 IMaoBookmarks 接口访问当前地图,并向地图中加入新建书签IMapBookmarks bookmarks=axMapControl1.Map as IMapBookmarks;if (bookmarks != null){bookmarks.AddBookmark(aoiBookmark);}//将新建书签名加入组合框中,用于之后调用对应书签cbBookmarkList.Items.Add();}2.添加“书签名成设置”窗体(1)点击项目添加 Windows 窗体,该窗体命名为“AdmitBookmarkName.cs ”,点击添加后,转入设计窗口。

GIS二次开发综合实验报告

GIS二次开发综合实验报告

二次开发综合实验报告目录实验一:设计界面,添加鹰眼控件 ____________________________________________ 1 1.1实验目的__________________________________________________________________ 1 1.2实验内容__________________________________________________________________ 1 1.3实验步骤与结果____________________________________________________________ 1实验二:利用菜单,打开MXD文档,Shapefile文件_____________________________ 4 2.1实验目的__________________________________________________________________ 4 2.2实验内容__________________________________________________________________ 4 2.3实验步骤与结果____________________________________________________________ 4实验三:实现鹰眼功能______________________________________________________ 7 3.1实验目的__________________________________________________________________ 7 3.2实验内容__________________________________________________________________ 7 3.3实验步骤结果______________________________________________________________ 7实验四:实现右键查询图层信息以及删除图层操作 _____________________________ 11 4.1实验目的_________________________________________________________________ 11 4.2实验内容_________________________________________________________________ 11 4.3实验步骤与结果___________________________________________________________ 11实验五:使用多边形选择区域内部要素,并高亮显示____________________________ 21 5.1实验目的_________________________________________________________________ 21 5.2实验内容_________________________________________________________________ 21 5.3实验步骤与结果___________________________________________________________ 21实验六:实现柱状图渲染__________________________________________________ 23 6.1实验目的_________________________________________________________________ 23 6.2实验内容_________________________________________________________________ 23 6.3实验步骤与结果___________________________________________________________ 23实验七:实现最短路径分析(网络分析) ____________________________________ 27 7.1实验目的_________________________________________________________________ 27 7.2实验内容_________________________________________________________________ 27 7.3实验步骤与结果___________________________________________________________ 27实验总结__________________________________________________ 错误!未定义书签。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
相关文档
最新文档