Creating a Design Resource Database gear is a generic part that involves many standard queries and references during its design calculations, such as modulus, bending fatigue strength limits, and contact fatigue strength limits. The general processing method is to create a standard resource database on the server side, in which various standard resources are stored for the COM component to query. At the same time, in order to realize network design and resource sharing, it is also necessary to establish a design calculation result database for storing design calculation results, and for the authorized network users to query or modify. In this example, SQL Server 2000 is used to create a database named GearSystemDB on the server side. The library contains standard resource data tables and designs such as modulus, working condition coefficient, tooth width coefficient, gear material and mechanical characteristics that are indispensable in gear calculation. Calculate the results table.
COM component design Because VB is a development tool that supports ActiveX interface, and it implies most of the COM runtime library, this article uses VB to develop COM components. The detailed process is: create a new project, the project type is ActiveXDLL. In the project Create a new class, named GearMgr. Then create a class module Standard-Calculate for standard gear design calculations, add various methods in the table. And in the various methods of the class module StandardCalculate, respectively add the corresponding code to achieve the corresponding function. For example, the Mainparameter method is written in the following program section: The main method of the table component interface and the description method Description Mainparameter main parameter calculation SelectvKFN selection gear bending, connection, EndSub In this gear calculation process, query gear bending, contact fatigue from the database table Strength limit Strsql=0selectfrom gear material and its mechanical characteristics - release database resource SetDBTable=Nothing Compile this project file GearMgr.dll successfully, then register this component with Regsvr32 in the registry, the user prompt information after registration is /DllRegisterServerin , /GearMgr.dllsucceeded.0. This can be found in the registry with a self-built server component GearMgr.
The COM component interface and the interface to the connection component are a set of methods that define how something is used. To call the server component, you must first generate a server component object instance using the method Cre-ateObject in the Server object. The syntax is Server.Cre-ateObject(0ProgID0), where ProgID is the identifier string of a component. This string is unique. , equivalent to the project name. Class module name. When the component of the designed gear calculation is successfully registered, it has a ProgID corresponding to GearMgr.StandardCalculate. Run the Regedit program to see its ProgID. Once the component is generated, it can be used in the ASP page for its gear calculations using its methods and properties. The program syntax for using the Server component is as follows: - The reference component Setobj=Server.CreateObject(0GearMgr.StandardCalcu-late0) uses the various methods in the component to release the component resource. Setobj=Nothing in the ASP page, to implement the network-based gear design calculation function, In addition to referencing the component, using its methods, and finally releasing the component resources, the program code also needs to pass parameters between the web pages. The data is uploaded from the web page to the COM component to be called, and can be completed through the ASP Request object. The syntax is Request.Form. After the design calculation is completed, the results are output to the calculation result table, which can be viewed by the user through the query webpage. By completing the component call, the network-based gear design calculation is realized, and the purpose of design resource sharing is achieved.
System Development Example Based on the above design ideas and steps, this paper developed a network-based standard spur gear design system. To develop ActiveXDll in-process components on the Visual Basic platform, the following is part of the program implementation code for implementing the Gear Design Computation COM component. The gear calculation result is the parameter input interface of the spur gear. After the user passes the authentication, the user first enters the parameter input interface. The submit button of this interface is submitted to the Calculate.asp page. Calcu-late.asp writes the detailed code of the calling component. When the calculation process is completed, the calculation result is displayed through the Result.asp page. The submit button of the page is to write the calculation result to the Output data table in the database, which is convenient for later. The results can be viewed or called through a database query. Although this calculation process is implemented through the network, the component call is made in the ASP page, and the component itself is encapsulated, so the code of the component program is not leaked, and the sharing of the COM component of the gear calculation can be guaranteed. The security of the resource.

Silicone Straw

Hubei Daxin Electronic Technology Co., LTD , https://www.hkdaxinrubber.com