社区
非技术区
帖子详情
axis2与WAS6.1
龙四
2010-06-20 11:31:02
如果仅仅使用soap over http倒还可以
用JAX-WS、soap over JMS简直TM恶梦!随处可见的jar冲突,axis2 1.5中基于JAX-WS的JMS貌似还不支持,1.4.1中说是支持,支持的并不好,文档很写的很空,没实例
发下牢骚,顺便小散点分,仅此而已
...全文
103
1
打赏
收藏
axis2与WAS6.1
如果仅仅使用soap over http倒还可以 用JAX-WS、soap over JMS简直TM恶梦!随处可见的jar冲突,axis2 1.5中基于JAX-WS的JMS貌似还不支持,1.4.1中说是支持,支持的并不好,文档很写的很空,没实例 发下牢骚,顺便小散点分,仅此而已
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
1 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
铁匠梁
2010-06-21
打赏
举报
回复
千金散尽还复来
webservice发布及调用
Webservice四种发布方式及客户端调用,可直接使用,方便日常开发
二级减速器课程设计说明书reducer design specification.doc
二级减速器课程设计说明书,全英文书写 《Machine Parts Design》 Design Specification Topic Designation of Reducer College College of Mechanical and Electrical Engineering Major Mechanical Engineering Class 16机械工程3(国际化) No. of team Team 1 ID/Name 陈旭颖 16211452104 方 琢 16211452105 李成雍 16211452106 Instructor Zhang Yi Date submitted 2019.01.11 Contents Abstract 1 Chapter 1 Course Design Task Book 3 1.1 Purpose 3 1.2 Description of design project 3 1.3 Design Data 4 Chapter 2 Integral Design Scheme of Transmission Device 4 2.1 Transmission Scheme 4 2.2 Advantages and Disadvantages of this Scheme 4 Chapter 3 Selection of Motor 5 3.1 Motor Type Selection 5 3.2 Determination of the Efficiency of the Transmission 5 3.3 Selection of the motor capacity 5 3.4 Determination of the total transmission ratio and distribution transmission ratio of the transmission device 7 Chapter 4 Calculation of Dynamic Parameters 8 Chapter 5 Designation and calculation of high speed gear 11 5.1 Selection of gear type, accuracy grade, material and number of teeth 11 5.2 Design according to tooth surface contact fatigue strength 11 5.3 Determination of the sizes of transmission 15 5.4 Check the bending fatigue strength of tooth root 15 5.5 Calculations of other geometric dimensions of gear transmission 19 5.6 Summary of gear parameters and geometric dimensions 20 Chapter 6 Calculation of low-speed gear 21 6.1 Selection of gear type, accuracy grade, material and number of teeth 21 6.2 Designation according to tooth surface contact fatigue strength 22 6.3 Determination of the sizes of transmission 25 6.4 Check the bending fatigue strength of tooth root 26 6.5 Calculations of other geometric dimensions of gear transmission 30 6.6 Summary of gear parameters and geometric dimensions 30 Chapter 7 The designation of the shaft 32 7.1 Calculateion of High-speed shaft design 32 7.2 Calculation of jack shaft design 39 7.3 Calculation of low speed shaft 47 Chapter 8 Rolling bearing life check 53 8.1 Bearing check on high speed shaft 53 8.2 Bearing check on the jack shaft 55 8.3 Bearing check on the low speed shaft 57 Chapter 9 Key connection design calculation 58 9.1 Calculation check of coupling key connection 58 9.2 Calculation check of low speed pinion’s key connection 59 9.3 Calculation check of high speed main gear’s key connection 59 9.4 Calculation check of low speed main gear’s key connection 59 Chapter 10 Coupling selection 60 10.1 Coupling on the high speed shaft 60 10.2 Coupling on the low speed shaft 60 Chapter 11 Seal and lubricate the reducer 61 11.1 Selection of sealing 61 11.2 Gear lubrication 61 11.3 Bearing lubrication 62 Chapter 12 Reducer accessory 63 12.1 Oil level indicator 63 12.2 Ventilator 63 12.3 Drain plug 64 12.4 Peephole cover 65 12.5 Positioning pin 66 12.6 Cover screw 67 12.7 Lifting device 68 Chapter 13 Main structural dimensions of reducer housing 70 Chapter 14 Drawing of structure analysis of reduce 72 14.1 Drawing of assembly 72 14.2 Housing 73 14.3 Drawing of gears 74 14.4 Drawing of shafts 78 Chapter 15 Conclusion 81 15.1 Summary 81 15.2 Job description of team members 82 Reference 83 Attachment 84 Abstract Belt conveyor is a kind of friction driven to transport materials in a continuous way machinery. It Is mainly composed of irame conveyor belt, supporting roller, roller, tensioning device and belt conveyor motor device. It can put the material on a certain conveying line and form a conveying process of material from the initial feeding point to the final unloading point. It can not only carry out the transport of broken bulk materials, but also the transport of finished articles. In addition to the pure material transport, it can also cooperate with the requirements of the technological process in the production process of various industrial enterprises to form a rhythmic assembly line. Belt conveyor is widely used in metallurgy, coal, transportation, water and electricity, chemical and other departments, because it has a large amount of transport, simple structure, convenient maintenance, low cost, strong versatility and other advantages. Belt conveyor is also used in building materials, power, light industry, food, ports, ships and other departments. Main contents of this manual is for the design of belt conveyor drive system, the V belt transmission and twoestage cylindrical gear reducer, used in the design and calculation to the "machine design foundation", "mechanical drawing" "tolerance and interchangeability", “theoretical mechanics" courses, such as knowledge, and use AutoCAD software to carry on the drawing, so the comprehensive practice is a very important link, is also a comprehensive, standardized training in practice. Through this training, so that we have been in many aspects of training and training. It is mainly reflected in the following aspects. (1) we have cultivated the design idea of combining theory with practice, trained our ability to comprehensively apply the basic theory of mechanical design course and other related courses, analyze and solve practical engineering problems in combination with production practice, and consolidated, deepened and expanded the knowledge of relevant mechanical design. (2) through the standard mechanical parts. common mechanical transmission or simple mechanical design, so that we master the general mechanical design procedures and methods. establish a correct engineering desrgn Ideas. cultivate independence. comprehensive. Scientific engineering design ability and innovation ability. (3) in addition, it cultivates our ability to consult and use manuals, atlas and other relevant technical data, as well as the ability in calculation, drawing data processing and computer, aided design. (4) enhanced our understanding and application of the functions of Word and AutoCAD in office software. Keywords: reducer, transmission device, design, calculation, CAD Chapter 1 Course Design Task Book 1.1 Purpose According to the diagam of the belt conveyor system: (1) Plan and analysis of transmission device; (2) Selection of motor and calculation of kinematic and dynamic parameters in conveyor system; (3) Design of transmission parts (e.g. gear, worm or belt, etc.); (4) Design of shaft; (5) Design of bearing and its assemblies; (6) Selection and confirmation of key and coupling; (7) Design of lubrication; (8) Housing, framework and accessories; (9) Drawing of assembly and its components; (10) Design specification 1.2 Description of design project (a) running on two shifts per day in one-direction continuously; (b) stable loading; (c) starting with idling; (d) indoor setting with dust; (e) usage period: 10 years, minor overhaul period: 1 year, and overhaul period: 3 years; (f) power source is alternating three-phase voltage; (g) small-batch production in medium scale machinery plant; (h) allowed tolerance of conveyor speed is ± 5%. Working hours per day: 16 hours, working life: 10 years, working days per year: 300 days, equipped with three-phase AC power supply, voltage 380/220 V. 1.3 Design Data Working force of conveyor, F 2900N Speed of conveyor, v 1.5m/s Diameter, D 410mm Chapter 2 Integral Design Scheme of Transmission Device 2.1 Transmission Scheme Analysis of transmission scheme v-belt transmission is adopted . Considering the requirements of the project , I chose this scheme . Its transmission diagram is shown in figure 1-1. The transmission scheme has been given, and the reducer is a two-stage cylindrical gear reducer. 2.2 Advantages and Disadvantages of this Scheme The extemal outline size of this scheme is large, with good shock absorption capacity, low manufacturing, stability accuracy with low cost, and overload protection. But because the gear relative to the bearing of the two-stage cylindrical gear reducer is arranged asymmetrically, the load distribution along the tooth direction is uneven, and the shaft stiffness is required. Chapter 3 Selection of Motor 3.1 Motor Type Selection According to the use of the Y-series general purpose fully closed self-cooled three-phase asynchronous motor. 3.2 Determination of the Efficiency of the Transmission According to table 2-1, we got: The Efficiency of coupling:η1=0.99 The Efficiency of rolling bearing:η2=0.99 The Efficiency of closed cylindrical gears:η3=0.98 The Efficiency of Working Machine:ηw=0.97 Total efficiency from motor to machine: ηa=η1×η24×η32×ηw=0.877 3.3 Selection of the motor capacity The power required by the working machine Pw: Rated power required by motor Pd: Work speed of transmission belt wheels nw: According to the recommended reasonable transmission ratio range in table 2-2, the transmission ratio range of the expanded two-stage gear reducer ia=8 ~ 40, the transmission ratio range of v-belt transmission is ib=2~4, so the theoretical transmission ratio range is=16~160. The optional speed range of the motor : nd=is*nw=(16 ~ 160) 69.91=559--2796r/min. After comprehensive consideration of price, weight, transmission ratio and other factors, the selected three-phase asynchronous motor model : Y132M2-6 . Rated power Pen=5.5kW,Full load speed nm=960r/min,Synchronous speed nt=1000r/min。 Serial Number Motor Type Synchronous Speed/(r/min) Rated Power/kW Full Speed/(r/min) 1 Y160M2-8 750 5.5 720 2 Y132M2-6 1000 5.5 960 3 Y132S-4 1500 5.5 1440 4 Y132S1-2 3000 5.5 2900 Figure 3-1 main size parameters of the motor Height of Center Dimensionof overall Dimensionof base mounting Diameter of anchor bolt hole Size of Axis stretch Size of key H L×HD A×B K D×E F×G 132 515×315 216×178 12 38×80 10×33 3.4 Determination of the total transmission ratio and distribution transmission ratio of the transmission device (1)Calculation of total transmission ratio According to the selected fullload speed of the motor nm and the drive shaft speed of the motor nw,we can calculate the total transmission ratio of the transmission device ia: (2)Allocate transmission ratio High speed stage transmission ratio i1 Then the transmission ratio of low-speed stage i2 Total transmission ratio of reducer ib Chapter 4 Calculation of Dynamic Parameters (1)The speed of each shaft: High speed shaft : Jack shaft : Low speed shaft : The working machine shaft : (2)Input power of each shaft: High speed shaft : Jack shaft : Low speed shaft : The working machine shaft : Then the output power of each shaft: High speed shaft : Jack shaft : Low speed shaft : The working machine shaft : (3)Input torque of each shaft: Motor shaft : High speed shaft : Jack shaft : Low speed shaft : The working machine shaft : Then the torque of each shaft: High speed shaft : Jack shaft : Low speed shaft : The working machine shaft : The rotational speed, power and torque of each shaft are listed in the following table name of the shaft rotating speed n /(r/min) power P/kW torque T/(N•m) Motor shaft 960 4.96 49.34 High speed shaft 960 4.91 48.84 Jack shaft 222.74 4.76 204.09 Low speed shaft 69.82 4.62 631.92 The working machine shaft 69.82 4.35 594.99 Chapter 5 Designation and calculation of high speed gear 5.1 Selection of gear type, accuracy grade, material and number of teeth 1. According to the transmission scheme, helical cylindrical gear transmission is selected,Pressure angle α=20°,Primary spiral Angle β=12°。 2. Refer to table 10-6 for level 7 accuracy. 3. Material selection : According to table 10-1, Pinion chosen: 40Cr (quenched and tempered), hardness: 280HBS; Main gear: 45 (quenched and tempered), hardness: 240HBS. 4. Number of pinion teeth: z1=24,number of main gear teeth: z2=z1×i=24×4.31=103. 5.2 Design according to tooth surface contact fatigue strength 1. The diameter of the dividing circle of the pinion is calculated by formula (10-24),that is: (1) Determine the values of each parameter in the formula (1) Choose KHt=1.3 (2) Calculate the torque T transmitted by the pinion: (3) According to table 10-7, the tooth width coefficient: φd=1 (4) According to figure 10-20, regional coefficient: ZH=2.47 (5) According to table 10-5, the elastic influence coefficient of the material: ZE=189.8√MPa. (6)The contact fatigue strength Zε is calculated by formula (10-9). (7) The spiral Angle coefficient Zβ can be obtained from the formula. (8) Calculate the allowable contact fatigue stress[σH] According to figure 10-25d, the contact fatigue limit of pinion and large gear is respectively The stress cycle number is calculated from equation (10-15): Contact fatigue coefficients were obtained from FIG. 10-23 If the failure probability is 1% and the safety coefficient S=1,then: Take the smaller one of [σH]1 and [σH]2as the contact fatigue allowable stress of the gear pair, that is: (2) Calculate the diameter of the dividing circle of the pinion 2. Adjust the diameter of the dividing circle of the pinion (1) Data preparation before calculating actual load coefficient. (1) Circumferential velocity ν (2) Tooth width b (2) Calculate the actual load coefficient KH (1) According to table 10-2, KA=1 (2) According to v=1.827m/s and the accuracy of level 7, the dynamic load coefficient can be obtained from figure 10-8, Kv=1.035 (3) The circular force of a gear. In table 10-3, the load distribution coefficient between teeth was KH =1.4 When the accuracy of level 7 and the relative support of pinion are arranged asymmetrically by interpolation method, according to table 10-4, the distribution coefficient of load in tooth direction KHβ=1.417 Thus, the actual load coefficient KH is obtained (3) According to equation (10-12) and the actual load coefficient, the diameter of the dividing circle d1 can be obtained (4) Determine the modulus of 5.3 Determination of the sizes of transmission 1. Computing center distance a 2. The helix Angle is corrected according to the center distance after rounding β=12°19'58" 3. Calculate the dividing circle diameter d1 ,d2of small and big gear 4. Calculate the tooth width b Take B1=55mm, B2=50mm 5.4 Check the bending fatigue strength of tooth root The fatigue strength condition of tooth root bending: (1)T、mn and d1 are like the previous Tooth width: b=b2=50 Tooth shape coefficient YFa and stress correction coefficient YSa, the equivalent number of teeth: The equivalent number of teeth of pinion Zv1: Equivalent number of teeth of main gear Zv2: The tooth shape coefficient is obtained from FIG. 10-17 The stress correction coefficient is obtained from FIG. 10-18 (1) Choose load factor KFt=1.3 (2) From equation (10-18), the coincidence coefficient of bending fatigue strength Yε can be calculated Have a type: (3) From equation (10-19), obtain the spiral Angle coefficient of bending fatigue strength Yβ (2) Circumferential velocity (3) Aspect ratio b/h According to v=2.47m/s, level 7 accuracy, dynamic load coefficient can be found from figure 10-8, Kv=1.047 According to table 10-3 , load distribution coefficients between teeth KFα=1.4 According to table 10-4, KH =1.42 and b/h=50/4.5=11.111. According to figure 10-13, KF =1.079. Then the load coefficient is: According to FIG. 10-24c, the tooth root bending fatigue limit of pinion and big gear is respectively The bending fatigue coefficient KFN1 ,KFN2 was obtained from FIG. 10-22 The bending fatigue safety factor S=1.25, from equation (10-14) Check the bending fatigue strength of tooth root The bending fatigue strength of tooth root meets the requirement, and the ability of pinion to resist bending fatigue damage is greater than that of large gear. (4) The circular velocity of a gear Level 7 accuracy is appropriate. 5.5 Calculations of other geometric dimensions of gear transmission (1)Calculate the height of addendum tooth, dedendum tooth and total tooth (2)Calculate the addendum circle diameters of small and large gears (3)Calculate the diameter of dedendum circle of small and large gears 5.6 Summary of gear parameters and geometric dimensions Code name Calculated formula Pinion Main gear Modulus m 2 2 Spiral Angle β left-handed 12°19'58" right-handed 12°19'58" Coefficient of addendum height ha* 1.0 1.0 Tip clearance coefficient c* 0.25 0.25 Number of teeth z 24 103 Width of teeth B 55 50 Height of addendum teeth ha m×ha* 2 2 Height of dedendum teeth hf m×(ha*+c*) 2.5 2.5 Diameter of the dividing circle d 49.134 210.866 Addendum circle diameter da d+2×ha 53.134 214.866 Dedendum circle diameter df d-2×hf 44.134 205.866 Figure 5-1 structure diagram of high-speed main gear Chapter 6 Calculation of low-speed gear 6.1 Selection of gear type, accuracy grade, material and number of teeth 1. According to the transmission scheme, choose helical cylindrical gears,The pressure off for alpha = 20 °, primary spiral Angle beta = 12 °. 2. Refer to table 10-6 , choose level 7 accuracy. 3. Material selection According to table 10-1, choose pinion 40Cr (quenching and tempering), and the hardness was 280HBS; choose main gear 45 (quenching and tempering), and the hardness was 240HBS 4. Select the number of pinion teeth z1=25, then the number of large gear teethz2=z1×i=25×3.19=81. 6.2 Designation according to tooth surface contact fatigue strength 1. From formula (10-24), the diameter of the dividing circle of the pinion is calculated, i.e (1) Determine the values of each parameter in the formula (1) Choose KHt=1.3 (2) Calculate the torque transmitted by the pinion: (3) From table 10-7, the tooth width coefficient is φd=1 (4) From figure 10-20, Regional coefficient ZH=2.47 (5) From table 10-5, the elastic influence coefficient of the material ZE=189.8√MPa。 (6) From equation (10-9), the coincidence coefficient is used to calculate the contact fatigue strength Zε. (7) From the formula, the spiral Angle coefficient Zβ. (8) Calculate the allowable contact fatigue stress[σH] According to figure 10-25d, the contact fatigue limit of pinion and big gear is respectively From equation (10-15) , the number of stress cycles can be calculated : From figure10-23, check the contact fatigue coefficient If the failure probability is 1% and the safety coefficient S=1, then Take the smaller one of [σH]1 and [σH]2as the contact fatigue allowable stress of the gear pair, that is: (2) Calculate the diameter of the dividing circle of the pinion 2.Adjust the diameter of the dividing circle of the pinion (1) Data preparation before calculating actual load coefficient. (1) Circumferential velocity ν (2) Tooth width b (2) Calculate the actual load coefficient KH (1) According to table 10-2, KA=1 (2) According to v=0.666m/s and the accuracy of level 7, the dynamic load coefficient can be obtained from figure 10-8, Kv=1.013 (3) The circular force of a gear. In table 10-3, the load distribution coefficient between teeth was KH =1.2 When the accuracy of level 7 and the relative support of pinion are arranged asymmetrically by interpolation method, according to table 10-4, the distribution coefficient of load in tooth direction KHβ=1.421 Thus, the actual load coefficient KH is obtained (3) According to equation (10-12) and the actual load coefficient, the diameter of the dividing circle d1 can be obtained (4) Determine the modulus of 6.3 Determination of the sizes of transmission 1. Computing center distance a 2.The helix Angle is corrected according to the center distance after rounding β=12°43'9" 3. Calculate the dividing circle diameter d1 ,d2of small and big gear 4. Calculate the tooth width b Take B1=85mm B2=80mm 6.4 Check the bending fatigue strength of tooth root The fatigue strength condition of tooth root bending: (1)T、mn and d1 are like the previous Tooth width: b=b2=80 Tooth shape coefficient YFa and stress correction coefficient YSa, the equivalent number of teeth: Equivalent number of teeth of pinion Zv1: Equivalent number of teeth of main gear Zv2: The tooth shape coefficient is obtained from FIG. 10-17 The stress correction coefficient is obtained from FIG. 10-18 (1) Choose load factor KFt=1.3 (2) From equation (10-18), the coincidence coefficient of bending fatigue strength Yε can be calculated Have a type: (3) From equation (10-19), obtain the spiral Angle coefficient of bending fatigue strength Yβ (2) Circumferential velocity (3) Aspect ratio b/h According to v=0.9m/s, level 7 accuracy, dynamic load coefficient can be found from figure 10-8, Kv=1.017 According to table 10-3 , load distribution coefficients between teeth KFα=1.4 According to table 10-4, KHβ =1.427 and b/h=80/6.75=11.852. According to figure 10-13, KF =1.08. Then the load coefficient is: According to FIG. 10-24c, the tooth root bending fatigue limit of pinion and big gear is respectively The bending fatigue coefficient KFN1 ,KFN2 was obtained from FIG. 10-22 The bending fatigue safety factor S=1.25, from equation (10-14) Check the bending fatigue strength of tooth root The bending fatigue strength of tooth root meets the requirement, and the ability of pinion to resist bending fatigue damage is greater than that of large gear. (4) The circular velocity of a gear Level 7 accuracy is appropriate. 6.5 Calculations of other geometric dimensions of gear transmission (1)Calculate the height of addendum tooth, dedendum tooth and total tooth (2)Calculate the addendum circle diameters of small and large gears (3)Calculate the diameter of dedendum circle of small and large gears 6.6 Summary of gear parameters and geometric dimensions Code name Calculated formula Pinion Main gear Modulus m 3 3 Spiral Angle β left-handed 12°43'9" right-handed 12°43'9" Coefficient of addendum height ha* 1.0 1.0 Tip clearance coefficient c* 0.25 0.25 Number of teeth z 25 81 Width of teeth B 85 80 Height of addendum teeth ha m×ha* 3 3 Height of dedendum teeth hf m×(ha*+c*) 3.75 3.75 Diameter of the dividing circle d 76.887 249.113 Addendum circle diameter da d+2×ha 82.887 255.113 Dedendum circle diameter df d-2×hf 69.387 241.613 Figure 6-1 Low speed large gear structure drawing Chapter 7 The designation of the shaft 7.1 Calculateion of High-speed shaft design 1. Select the material on the shaft and determine the allowable stress Because the reducer is a general machine, there is no special requirement, so 40Cr (quenched and tempered) is selected, the hardness is 280HBS, check the table15-1,take σb=735MPa, σ-1b=60MPa 2. The minimum diameter of the shaft estimated according to the initial torsion strength Check table 15-3, take A0=112,so Shaft ends have 1 keyway, therefore, the axle diameter should be increased by 5% According to the table, the diameter of the standard axle hole is 22mm, so d=22 Figure 7-1 Schematic diagram of high-speed shaft (1) The minimum diameter of the input shaft is obviously d12, where the coupling is mounted. In order to adapt the selected shaft diameter d12 to the coupling aperture, the type of coupling should be selected. The calculated torque of the coupling Tca = KA×T, according to the table, thinking about the stability, we choose KA = 1.3, then: According to the condition that the torque Tca of the coupling should be less than the nominal torque of the coupling, refer to standard GB t4323-2002 or design manual, choose LX3 type coupling. The aperture of the semi-coupling is 22mm, the hub hole length of the semi-coupling and the shaft is 52mm. Choose ordinary flat keys,A type keys, b×h = 6×6mm(GB T 1096-2003), bond length L=40mm。 (2) Initial selection of rolling bearing. Since the bearing is subject to both radial and axial forces, angular contact bearing is selected. Referring to the work requirements and according to d23 = 27mm, select 7206AC angular contact bearing from bearing product catalog, its size: d×D×B = 30×62×16mm, so d34 = d78 = 30 mm. The positioning shaft shoulder height of 7206AC type bearing is found in the manual, h = 3 mm,then choose d45 = d67 = 36 mm. (3)Because the diameter of the gear is small, in order to ensure the strength of the gear wheel body, the gear and the shaft should be made into one and become the gear shaft. So l56 = 55 mm, d56 = 53.134 mm. (4) Thickness of bearing end covere=10, thickness of the gasketΔt=2. According to the bearing end cover for easy assembly and disassembly, ensure that the outer end face of the bearing end cover has a certain distance from the end face of the coupling, K=24; Screw C1=22mm, C2=20mm, thickness of box seat wall δ=8mm, then: (5) Take small spacing distance of enclosure wall Δ1 = 10 mm, the distance between high speed main gear and low speed pinion Δ3 = 15 mm distance. Considering about the housing casting error, when determining the position of rolling bearing, a distance Δ from inner wall of box should be taken, take Δ = 10 mm, the width of low speed pinion b3=85mm, then: At this point, the diameter and length of each section of the shaft have been preliminarily determined. Shaft section 1 2 3 4 5 6 7 Diameter / mm 22 27 30 36 53.134 36 30 Length/ mm 52 65 28 105.5 55 8 28 3. Stress analysis of the shaft The circumferential force on a high speed pinion Ft1 (d1 is the diameter of the indexing circle of the high-speed pinion) Radial force on a high speed pinion Fr1 Axial force on a high speed pinion Fa1 According to 7206AC angular contact manual, pressure center a=18.7mm Distance between the center point of the first shaft and the bearing pressure center l1: Distance from bearing pressure center to gear fulcrum l2: Distance between gear midpoint and bearing pressure center l3: (1) Calculate the supporting reaction of the shaft Horizontal support reaction: Vertical support reaction: (2) Calculate the bending moment of the shaft, and draw the bending moment diagram The horizontal bending moment at section C: The vertical bending moment at section C: Bending moment diagram of horizontal plane (fig.b) and vertical plane (fig.c). The resultant bending moment at section C: (3) Make composite bending moment diagram (figure d) Make torque diagram (figure e) Figure 7-2 High - speed shaft force and bending moment diagram 4. Check the strength of the shaft Because the bending moment on the left side of C is large and the action has torque, the left side of C is the dangerous section. The bending section coefficient W: The torsion cross section coefficient WT: The maximum bending stress: The shear stress: Check and calculate according to the strength of bending and torsion. For the shaft of one-way drive, torque is processed according to pulsating cycle. Therefore, the reduced coefficient is adopted α=0.6, then the equivalent stress is (10) Check the table, get 40Cr(tempering and tempering) treatment, and the limit of tensile strength σB=735MPa; Then the allowable bending stress of the axis [σ-1b]=60MPa, σca<[σ-1b], so the strength is good. 7.2 Calculation of jack shaft design 1. Select the material on the shaft, and determine the allowable stress Because the reducer is a general machine, there is no special requirements, so choose 45 (quenched and tempered), the hardness: 240HBS. Referring table 15-1, take σb=640MPa, σ-1b=60MPa 2. According to the initial torsion strength, the minimum diameter of the shaft estimated Refer to table 15-3, take A0=112, then: Since the minimum diameter of the shaft section is all rolling bearings, the standard diameter d=35mm is selected. Figure 7-3 Diagram of intermediate shaft (1) Initial selection of rolling bearing. The minimum diameters of the intermediate shaft are d12 and d56 for mounting the rolling bearing. Because the bearing is subject to both radial and axial forces, angular contact bearing is chosen. Referring to the requirement of working and according to dmin = 31.08 mm, from the bearing catalogue, selsct angular contact bearing 7207AC, its size: d×D×B = 35×72×17mm, so d12 = d56 = 35 mm. (2) At the installation of the big gear, take the diameter of the shaft section d45 = 38mm; Positioning by oil baffle ring is taken between the right end of the gear and the right bearing. It is known that the width of the hub of the high-speed large gear wheel b2 = 50mm, in order to press gears reliably, this section should be slightly shorter than the width of the hub, then take l45 = 48 mm. Shaft shoulder positioning is adopted in the left end of the gear, the height of shaft shoulder h = (2~3)R. Refer to the table with trunnion d45 = 38 mm, take h = 5 mm, then the diameter of Collar point d34 = 48 mm. Collar width b≥1.4h, take l34 = 15 mm. (3) Left end rolling bearing adopts oil baffle ring for axial positioning. (4) Considering about material and machining economy, low speed pinion and shaft should be designed and manufactured separately. It is known that the hub width of the low-speed pinion is b3= 85mm, in order to make the end face of oil retaining ring press the gear reliably, this section should be slightly shorter than the width of the hub, so take l23 = 83 mm,d23=38mm。 (5) Take the distance between the low-speed pinion and the inner wall of the boxΔ1 =10 mm, the distance between the high speed big gear and the inner wall of the box Δ2 =12.5 mm, the distance between high speed main gear and low speed pinionΔ3=15mm. Consider housing casting error, when determining the position of rolling bearing, should be from a distance Δ casing wall, take Δ = 10 mm, then: At this point, the diameter and length of each section of the shaft have been preliminarily determined. Shaft section 1 2 3 4 5 Diameter/ mm 35 38 48 38 35 Length/ mm 39 83 15 48 41.5 3. Force analysis of the shaft The circumferential force on a high speed pinion Ft2 (d2 is the diameter of the indexing circle of the high-speed pinion) Radial force on a high speed pinion Fr2 Axial force on a high speed pinion Fa2 Circumferential force on the low-speed pinion Ft3 (d3 is the dividing circle diameter of the low-speed pinion) Radial force on a low speed pinion The axial force on a low speed pinion According to 7207AC angular contact manual, pressure center a=21mm Distance from bearing pressure center to middle point of low-speed pinion: Distance from the midpoint of the low-speed pinion to that of the high-speed large gear: Distance from the middle point of the high-speed large gear to the bearing pressure center: (1) Calculate the reaction force of the shaft Horizontal support reaction Vertical support reaction (2) Calculate the bending moment of the shaft and draw the bending moment diagram The horizontal bending moment at section B The horizontal bending moment at section C The vertical bending moment at section C The vertical bending moment at section B Draw the bending moment diagram of horizontal plane (fig.b) and vertical plane (fig.c) The resultant bending moment at section B The synthetic bending moment of section C: Make composite bending moment diagram (figure d) Make torque diagram (figure e) Figure 7-4 force and bending moment of jack shaft 4. Check the strength of the shaft Because the bending moment on the left side of B is large and the action has torque, the left side of B is the dangerous section. Its bending section coefficient: Its torsion cross section coefficient: The maximum bending stress: Its shear stress: Check and calculate according to the strength of bending and torsion. For the shaft of one-way drive, torque is processed according to pulsating cycle. Therefore, the reduced coefficient is adopted α=0.6, then the equivalent stress is Check the table, get 40Cr(tempering and tempering) treatment, and the limit of tensile strength σB=640MPa; Then the allowable bending stress of the axis [σ-1b]=60MPa, σca<[σ-1b], so the strength is good. 7.3 Calculation of low speed shaft 1. Select the material on the shaft, and determine the allowable stress Because the reducer is a general machine, there is no special requirements, so choose 45 (quenched and tempered), the hardness: 240HBS. Referring table 15-1, take σb=640MPa, σ-1b=60MPa 2. According to the initial torsion strength, the minimum diameter of the shaft estimated Refer to table 15-3, take A0=112, then: Shaft end has 1 keyway, so increase shaft diameter by 7% According to the table, the diameter of the standard axle hole is 50mm, so d=50 Figure 7-5 Schematic diagram of low-speed shaft (1) The minimum diameter of the output shaft is obviously the diameter d1 of the shaft where the coupling is mounted. In order to make the selected shaft diameter d1 match the coupling aperture, it is necessary to select the type of coupling.The calculated torque of the coupling Tca = KA×T, refer to the table, consider about stability, then take KA = 1.3,thus: According to the condition that the torque Tca of the coupling should be less than the nominal torque of the coupling, check the standard GB t4323-2002 or the design manual, choose LX4 type coupling. The aperture of the semi-coupling is 50mm, the hub hole length of fitness of the semi-coupling and the shaft is 112mm. Choose ordinary flat bond, A type bond, b×h = 14×9mm(GB T 1096-2003), length of bond L=100mm. (2) Initial selection of rolling bearing. Because the bearing is subject to both radial and axial forces, angular contact bearing is chosen. According to work requirements and d23 = 55mm, angular contact bearing 7212AC is selected from the bearing product catalog, its size: d×D×B = 60×110×22mm, so d34 = d78 = 60 mm. Positioning of bearing oil retaining ring. According to the manual, the positioning shaft shoulder height of type 7212AC bearing is h = 4.5mm, so d45 = 69mm (3) Take the diameter of the shaft section where the gear is mounted d67 = 63 mm;The width of the low-speed large gear hub is known as b4 = 80 mm,in order to make the end face of the oil retaining ring press the gear reliably, this shaft segment should be slightly shorter than the width of the hub, so l67 = 78mm. The left end of the gear is fixed by the shaft shoulder. The height of shaft shoulder h = (2~3)R,The diameter of the shaft d67 = 63 mm, so take h = 10 mm, then the diameter at the collar d56 = 83 mm, take l56=10mm. (4) Thickness of bearing end cover e=10, the thickness of the gasket Δt=2. According to the ease of mounting and dismounting of the bearing end cover, ensure that the outer end face of the bearing end cover has a certain distance from the end face of the coupling K=24, screw C1=22mm, C2=20mm, box seat wall thickness δ=8mm, then: (5) Assume the distance between low level main gear and inner box wall Δ 2 = 12.5 mm, the distance between high speed main gear and low speed pinion Δ 3 = 15 mm distance. Consider housing casting error, when determining the position of rolling bearing, should be from a distance Δ casing wall, assume Δ = 10 mm, then: At this point, the diameter and length of each section of the shaft have been preliminarily determined. Shaft section 1 2 3 4 5 6 7 Diameter 50 55 60 69 83 63 60 Length 112 59 44.5 57.5 10 78 46.5 3. Force analysis of the shaft Circumferential force on the low-speed big gear (d4 is the dividing circle diameter of the low-speed big gear) The radial force on a large low speed gear The axial force exerted on a large low-speed gear Refer to the manual with 7212AC angular contaction, know pressure center a=30.8mm (1)Calculate the supporting reaction of the shaft Horizontal support reaction Vertical support reaction (2) Calculate the bending moment of the shaft and draw the bending moment diagram The horizontal bending moment at section C The vertical bending moment at section C Draw the bending moment diagram of horizontal plane (fig.b) and vertical plane (fig.c) The resultant bending moment at section C (3) Make composite bending moment diagram (figure d) Make torque diagram (figure e) Figure 7-6 Diagram of force and bending moment of low speed shaft 4. Check the strength of the shaft Because the bending moment on the left side of C is large and the action has torque, the left side of C is the dangerous section Its bending section coefficient: Its torsion cross section coefficient: The maximum bending stress: Its shear stress: Check and calculate according to the strength of bending and torsion. For the shaft of one-way drive, torque is processed according to pulsating cycle. So the reduced coefficient =0.6, then the equivalent stress: Refer to the the table, get 45(tempering) treatment, tensile strength limitσB=640MPa,then the allowable bending stress of the axis[σ-1b]=60MPa, σca<[σ-1b], so the strength is good. Chapter 8 Rolling bearing life check 8.1 Bearing check on high speed shaft Bearing code d(mm) D(mm) B(mm) Cr(kN) C0r(kN) 7206AC 30 62 16 22 14.2 Adopt 7206AC angular contact ball bearing, inner diameter d=30mm, outer diameter D=62mm, width B=16mm, Basic dynamic load rating Cr=22kN,Rated static load C0r=14.2kN. Life expectancy is Lh=48000h. According to the horizontal and vertical bearing reaction calculated previously, we can calculate the resultant bearing reaction: Axial force Fae=435N According to the calculations, bearing 1 is "pressed", while bearing 2 is “relaxing”. Refer to the table, X1=0.41,Y1=0.87,X2=1,Y2=0 Refer to the table, ft=1,fp=1 Then, take the bigger one into Bearing life is sufficient. 8.2 Bearing check on the jack shaft Bearing code d(mm) D(mm) B(mm) Cr(kN) C0r(kN) 7207AC 35 72 17 29 19.2 Adopt 7207AC angular contact ball bearing, inner diameter d=35mm, outer diameter D=72mm, width B=17mm, Basic dynamic load ratingCr=29kN, Rated static load C0r=19.2kN Life expectancy is Lh=48000h. According to the horizontal and vertical bearing reaction calculated previously, we can calculate the resultant bearing reaction: Axial force Fae=775N According to the calculations, bearing 1 is "pressed", while bearing 2 is “relaxing”. Refer to the table, X1=0.41,Y1=0.87,X2=1,Y2=0 Refer to the table, ft=1,fp=1 Then, take the bigger one into Bearing life is sufficient. 8.3 Bearing check on the low speed shaft Bearring code d(mm) D(mm) B(mm) Cr(kN) C0r(kN) 7212AC 60 110 22 58.2 46.2 Adopt 7212AC angular contact ball bearing, inner diameter d=60mm, outer diameter D=110mm, width B=22mm, Basic dynamic load rating Cr=58.2kN,Rated static load C0r=46.2kN Life expectancy is Lh=48000h。 According to the horizontal and vertical bearing reaction calculated previously, we can calculate the resultant bearing reaction: Axial force Fae=1145N According to the calculations, bearing 1 is "pressed", while bearing 2 is “relaxing”. Refer to the table, X1=0.41,Y1=0.87,X2=1,Y2=0 Refer to the table, ft=1,fp=1 Then, take the bigger one into Bearing life is sufficient. Chapter 9 Key connection design calculation 9.1 Calculation check of coupling key connection The chosen type of key is A-type: 6×6(GB/T 1096-2003) Working length of key: l=L-b=40-6=34mm Contact height of the hub keyway: k=h/2=3mm According to the material of the coupling which is 45 and the stability of loading, we can get [σp]=120MPa, then it’s compression strength is It meets the strength requirement. 9.2 Calculation check of low speed pinion’s key connection The chosen type of key is A-type: 10×8(GB/T 1096-2003) Working length of key: l=L-b=70-10=60mm Contact height of the hub keyway: k=h/2=4mm According to the material of the low speed pinion which is 40Cr and the stability of loading, we can get [σp]=120MPa, then it’s compression strength is It meets the strength requirement. 9.3 Calculation check of high speed main gear’s key connection The chosen type of key is A-type: 10×8(GB/T 1096-2003) Working length of key: l=L-b=36-10=26mm Contact height of the hub keyway: k=h/2=4mm According to the material of the high speed main gear which is 45 and the stability of loading, we can get [σp]=120MPa, then it’s compression strength is It meets the strength requirement. 9.4 Calculation check of low speed main gear’s key connection The chosen type of key is A-type: 18×11(GB/T 1096-2003) Working length of key: l=L-b=63-18=45mm Contact height of the hub keyway: k=h/2=5.5mm According to the material of the low speed main gear which is 45 and the stability of loading, we can get [σp]=120MPa, then it’s compression strength is It meets the strength requirement. Chapter 10 Coupling selection 10.1 Coupling on the high speed shaft (1)Calculate the load on the coupling Refer to the table, the load coefficient of the coupling is KA=1.3 Then calculate the torque is Tc=KA×T=1.3×48.84=63.5N•m (2)Select the type of coupling Primary coupling model is LX3 elastic pin coupling (GB/ t4323-2002). Refer to the table, Nominal torque Tn=1250N•m, Allowable speed[n]=4700r/min, thus: Tc=63.5N•m
δ 12.5mm Case cover and seat rib thickness m1、m m1≈0.85×δ1、m≈0.85×δ 8mm、8mm Outer diameter of high speed bearing end cap D1 D+(5~5.5)d3;D--bearing outer diameter 102mm Outer diameter of end cover of jack bearing D2 D+(5~5.5)d3;D--bearing outer diameter 112mm Outer diameter of low speed bearing end cap D3 D+(5~5.5)d3;D--bearing outer diameter 150mm Chapter 14 Drawing of structure analysis of reduce 14.1 Drawing of assembly 14.2 Housing 14.3 Drawing of gears High speed main gear Low speed pinion 14.4 Drawing of shafts High speed shaft Jack speed shaft Low speed shaft Chapter 15 Conclusion 15.1 Summary After hard work, I finally finished the mechanical design course. In the process of this operation, I encountered many difficulties. The repeated calculation and the design scheme modification exposed my lack of knowledge and experience in this aspect in the early stage, and I learned the lesson of blind calculation. As for drawing assembly drawing and part drawing, due to sufficient preliminary calculation, the whole process took less than three days. During this period, I also received a lot of help from my classmates and teachers. Here I would like to express my most sincere thanks to them. Although the time of this assignment is long and the process is tortuous, for me, the biggest gain is the method and ability. The ability to analyze and solve problems. In the whole process, I found that what students like us most lack is experience, no perceptual knowledge, empty theoretical knowledge, and some things may be out of touch with the reality. In general, I think doing this type of homework is of great help to us. It requires us to systematically connect the relevant knowledge we have learned, expose our shortcomings and make improvements. Sometimes a person's power is limited, the wisdom of all people, I believe our work will be more perfect! Due to the limited time, there are many shortcomings in this design, such as the huge box structure and large weight. The gear calculation is not accurate enough and other defects, I believe, through this practice, I can avoid a lot of unnecessary work in the future design, have the ability to design a more compact structure, transmission more stable and accurate equipment. 15.2 Job description of team members Team leader: 陈旭颖 Finish the designation and calculation of transmission device, motor, dynamic parameters, rolling bearings, keys and couplings. Draw the CAD of assembly drawing and reducer housing drawing. Write the design specification. Team members: 方琢 Finish the designation and calculation of high speed gear, jack gear and low speed gear. Draw the CAD of high speed gear, jack gear and low speed gear. 李成雍 Finish the designation and calculation of high speed shaft, intermediate shaft and low speed shaft. Draw the CAD of high speed shaft, intermediate shaft and low speed shaft. Reference [1] Kunwoo Lee, Principles of CAD/CAM/CAE Systems, Pearson, Jan., 1999. [2] Chris McMahon and Jimmie Browne, CAD/CAM Principles, Practices and Manufacturing Management (2/e), Prentice Hall, July, 1999. [3] Andrew D. Dimarogonas, Machine Design - A CAD Approach, John Wiley & Sons, Dec. 2000. [4] E. Paul Degarmo, J. T. Black and Ronald A. Kohser, Materials and Processes in Manufacturing (11th edition), Wiley, Dec. 2011. [5] 李育锡. 机械设计课程设计(第⼆版). 北京:⾼等教育出版社. in Chinese [6] 陈秀宁. 机械设计课程设计(第四版). 杭州:浙江⼤学出版社. 2010. in Chinese [7] 吴宗泽. 机械设计课程设计. 北京:⾼等教育出版社. 2007. in Chinese [8] 闻邦椿. 机械设计⼿册 1-6 卷(第五版). 北京:机械⼯业出版社. 2011. in Chinese Attachment 1.The drawing of assembly; 2.The drawing of reducer housing; 3.The drawing of pinion; 4.The drawing of main gear; 5.The drawing of low speed shaft; 6.The drawing of jack shaft; 7.The drawing of high speed shaft;
The Algorithm Design Manual (2rd Edition)
I Practical Algorithm Design 1 Introduction to Algorithm Design 1.1 Robot Tour Optimization 1.2 Selecting the Right Jobs 1.3 Reasoning about Correctness 1.4 Modeling the Problem 1.5 About theWar Stories 1.6 War Story: PsychicModeling 1.7 Exercises 2 Algorithm Analysis 2.1 The RAM Model of Computation 2.2 The Big Oh Notation 2.3 Growth Rates and Dominance Relations 2.4 Working with the Big Oh 2.5 Reasoning About Efficiency 2.6 Logarithms and Their Applications 2.7 Properties of Logarithms 2.8 War Story: Mystery of the Pyramids 2.9 Advanced Analysis (*) 2.10 Exercises 3 Data Structures 3.1 Contiguous vs. Linked Data Structures 3.2 Stacks and Queues 3.3 Dictionaries 3.4 Binary Search Trees 3.5 Priority Queues 3.6 War Story: Stripping Triangulations 3.7 Hashing and Strings 3.8 Specialized Data Structures 3.9 War Story: String ’em Up 3.10 Exercises 4 Sorting and Searching 4.1 Applications of Sorting 4.2 Pragmatics of Sorting 4.3 Heapsort: Fast Sorting via Data Structures 4.4 War Story: Give me a Ticket on an Airplane 4.5 Mergesort: Sorting by Divide-and-Conquer 4.6 Quicksort: Sorting by Randomization 4.7 Distribution Sort: Sorting via Bucketing 4.8 War Story: Skiena for the Defense 4.9 Binary Search and Related Algorithms 4.10 Divide-and-Conquer 4.11 Exercises 5 Graph Traversal 5.1 Flavors of Graphs 5.2 Data Structures for Graphs 5.3 War Story: I was a Victim ofMoore’s Law 5.4 War Story: Getting the Graph 5.5 Traversing a Graph 5.6 Breadth-First Search 5.7 Applications of Breadth-First Search 5.8 Depth-First Search 5.9 Applications of Depth-First Search 5.10 Depth-First Search on Directed Graphs 5.11 Exercises 6 Weighted Graph Algorithms 6.1 Minimum Spanning Trees 6.2 War Story: Nothing but Nets 6.3 Shortest Paths 6.4 War Story: Dialing for Documents 6.5 Network Flows and Bipartite Matching 6.6 Design Graphs, Not Algorithms 6.7 Exercises 7 Combinatorial Search and Heuristic Methods 7.1 Backtracking 7.2 Search Pruning 7.3 Sudoku 7.4 War Story: Covering Chessboards 7.5 Heuristic SearchMethods 7.6 War Story: Only it is Not a Radio 7.7 War Story: Annealing Arrays 7.8 Other Heuristic SearchMethods 7.9 Parallel Algorithms 7.10 War Story: Going Nowhere Fast 7.11 Exercises 8 Dynamic Programming 8.1 Caching vs. Computation 8.2 Approximate String Matching 8.3 Longest Increasing Sequence 8.4 War Story: Evolution of the Lobster 8.5 The Partition Problem 8.6 Parsing Context-Free Grammars 8.7 Limitations of Dynamic Programming: TSP 8.8 War Story: What’s Past is Prolog 8.9 War Story: Text Compression for Bar Codes 8.10 Exercises 9 Intractable Problems and Approximation Algorithms 9.1 Problems and Reductions 9.2 Reductions for Algorithms 9.3 Elementary Hardness Reductions 9.4 Satisfiability 9.5 Creative Reductions 9.6 The Art of Proving Hardness 9.7 War Story: Hard Against the Clock 9.8 War Story: And Then I Failed 9.9 P vs. NP 9.10 Dealing with NP-complete Problems 9.11 Exercises 10 How to Design Algorithms II The Hitchhiker’s Guide to Algorithms 11 A Catalog of Algorithmic Problems 12 Data Structures 12.1 Dictionaries 12.2 Priority Queues 12.3 Suffix Trees and Arrays 12.4 Graph Data Structures 12.5 Set Data Structures 12.6 Kd-Trees 13 Numerical Problems 13.1 Solving Linear Equations 13.2 Bandwidth Reduction 13.3 Matrix Multiplication 13.4 Determinants and Permanents 13.5 Constrained and Unconstrained Optimization 13.6 Linear Programming 13.7 Random Number Generation 13.8 Factoring and Primality Testing 13.9 Arbitrary-Precision Arithmetic 13.10 Knapsack Problem 13.11 Discrete Fourier Transform 14 Combinatorial Problems 14.1 Sorting 14.2 Searching 14.3 Median and Selection 14.4 Generating Permutations 14.5 Generating Subsets 14.6 Generating Partitions 14.7 Generating Graphs 14.8 Calendrical Calculations 14.9 Job Scheduling 14.10 Satisfiability 15 Graph Problems: Polynomial-Time 15.1 Connected Components 15.2 Topological Sorting 15.3 Minimum Spanning Tree 15.4 Shortest Path 15.5 Transitive Closure and Reduction 15.6 Matching 15.7 Eulerian Cycle/Chinese Postman 15.8 Edge and Vertex Connectivity 15.9 Network Flow 15.10 Drawing Graphs Nicely 15.11 Drawing Trees 15.12 Planarity Detection and Embedding 16 Graph Problems: Hard Problems 16.1 Clique 16.2 Independent Set 16.3 Vertex Cover 16.4 Traveling Salesman Problem 16.5 Hamiltonian Cycle 16.6 Graph Partition 16.7 Vertex Coloring 16.8 Edge Coloring 16.9 Graph Isomorphism 16.10 Steiner Tree 16.11 Feedback Edge/Vertex Set 17 Computational Geometry 562 17.1 Robust Geometric Primitives 17.2 Convex Hull 17.3 Triangulation 17.4 Voronoi Diagrams 17.5 Nearest Neighbor Search 17.6 Range Search 17.7 Point Location 17.8 Intersection Detection 17.9 Bin Packing 17.10 Medial-Axis Transform 17.11 Polygon Partitioning 17.12 Simplifying Polygons 17.13 Shape Similarity 17.14 Motion Planning 17.15 Maintaining Line Arrangements 17.16 Minkowski Sum 18 Set and String Problems 18.1 Set Cover 18.2 Set Packing 18.3 String Matching 18.4 Approximate String Matching 18.5 Text Compression 18.6 Cryptography 18.7 Finite State Machine Minimization 18.8 Longest Common Substring/Subsequence 18.9 Shortest Common Superstring 19 Algorithmic Resources 19.1 Software Systems 19.2 Data Sources 19.3 Online Bibliographic Resources 19.4 Professional Consulting Services Bibliography Index
Dundas.Chart.for.Winform.Enterprise.v7.1.0.1812.for.VS2008
Add advanced charting to your ASP.NET applications. Dundas Chart ASP.NET Enterprise Edition is a fully managed, CLR (Common Language Runtime) compliant charting component designed for ASP.NET development. Included is support for all standard and many advanced chart types, drilldown functionality, full Visual Studio Integrated help, a variety of different image formats and intuitive samples and examples to speed up development time. Graphics take full advantage of GDI+ and the use of transparency, anti-aliasing, gradients and more. Dundas Chart for ASP.NET Enterprise Edition includes many advanced features including: formula support, data grouping, data filtering and advanced chart types. Dundas Chart for .NET is the industry leader in .NET Charting Solutions. Providing you with the most comprehensive features, the most complete sample framework, and the best live technical support available. From start to finish, our team is dedicated to providing what you need to make your project successful. Whether you are implementing charting into internal projects, or building applications for clients, Dundas Chart offers advanced, award-winning technology and advanced results to get the most out of data What’s new in Dundas Chart for ASP.NET? Now supports Visual Studio 2010 What’s new in Dundas Chart V7.1? - V7.1 fixes these issues: AlwaysRecreateHotregions="True" in WinForms templates or templates generated by Chart Builder causes the Exception Can't deserialize property. Unknown property name "AlwaysRecreateHotregions" in object Dundas.Charting.WebControl.Chart" when de-serialized in ASP.NET Chart. This property only exists in the WinForms Chart. The ASP.NET Chart ignores this property by default now. Chart .NET: Stacked Column + 3D throws an Index was out of range exception when series have a different number of data points The accumulation distribution formula is incorrect; if open and close are the same it will divide by zero. A friendlier exception message is th
数位板压力测试
sdk LCS/Telegraphics Wintab* Interface Specification 1.1: 16- and 32-bit API Reference By Rick Poyner Revised February 11, 2012 This specification was developed in response to a perceived need for a standardized programming inter-face to digitizing tablets, three dimensional position sensors, and other pointing devices by a group of lead-ing digitizer manufacturers and applications developers. The availability of drivers that support the features of the specification will simplify the process of developing Windows appli¬cation programs that in-corporate absolute coordinate input, and enhance the acceptance of ad¬vanced pointing de¬vices among users. This specification is intended to be an open standard, and as such the text and information contained herein may be freely used, copied, or distributed without compensation or licensing restrictions. This document is copyright 1991-2012 by LCS/Telegraphics.* Address questions and comments to: LCS/Telegraphics 150 Rogers St. Cambridge, MA 02142 (617)225-7970 (617)225-7969 FAX Compuserve: 76506,1676 Internet: wintab@pointing.com Note: sections marked with the “(1.1)” are new sections added for specification version 1.1. Sec-tions bearing the “(1.1 modified)” notation contain updated information for specification version 1.1. Version 1.1 Update Notation Conventions 1 1. Background Information 1 1.1. Features of Digitizers 1 1.2. The Windows Environment 1 2. Design Goals 2 2.1. User Control 2 2.2. Ease of Programming 2 2.3. Tablet Sharing 3 2.4. Tablet Feature Support 3 3. Design Concepts 3 3.1. Device Conventions 3 3.2. Device Information 4 3.3. Tablet Contexts 4 3.4. Event Packets 4 3.5. Tablet Managers 5 3.6. Extensions 5 3.7. Persistent Binding of Interface Features (1.1) 6 4. Interface Implementations 6 4.1. File and Module Conventions 6 4.2. Feature Support Options 6 5. Function Reference 7 5.1. Basic Functions 7 5.1.1. WTInfo 8 5.1.2. WTOpen 9 5.1.3. WTClose 10 5.1.4. WTPacketsGet 10 5.1.5. WTPacket 11 5.2. Visibility Functions 11 5.2.1. WTEnable 11 5.2.2. WTOverlap 12 5.3. Context Editing Functions 12 5.3.1. WTConfig 12 5.3.2. WTGet 13 5.3.3. WTSet (1.1 modified) 13 5.3.4. WTExtGet 14 5.3.5. WTExtSet 14 5.3.6. WTSave 15 5.3.7. WTRestore 15 5.4. Advanced Packet and Queue Functions 16 5.4.1. WTPacketsPeek 16 5.4.2. WTDataGet 17 5.4.3. WTDataPeek 17 5.4.4. WTQueuePackets (16-bit only) 18 5.4.5. WTQueuePacketsEx 18 5.4.6. WTQueueSizeGet 19 5.4.7. WTQueueSizeSet 19 5.5. Manager Handle Functions 19 5.5.1. WTMgrOpen 19 5.5.2. WTMgrClose 20 5.6. Manager Context Functions 20 5.6.1. WTMgrContextEnum 20 5.6.2. WTMgrContextOwner 21 5.6.3. WTMgrDefContext 22 5.6.4. WTMgrDefContextEx (1.1) 22 5.7. Manager Configuration Functions 23 5.7.1. WTMgrDeviceConfig 23 5.7.2. WTMgrConfigReplace (16-bit only) 24 5.7.3. WTMgrConfigReplaceEx 24 5.8. Manager Packet Hook Functions 25 5.8.1. WTMgrPacketHook (16-bit only) 26 5.8.2. WTMgrPacketHookEx 26 5.8.3. WTMgrPacketUnhook 29 5.8.4. WTMgrPacketHookDefProc (16-bit only) 30 5.8.5. WTMgrPacketHookNext 30 5.9. Manager Preference Data Functions 31 5.9.1. WTMgrExt 31 5.9.2. WTMgrCsrEnable 32 5.9.3. WTMgrCsrButtonMap 32 5.9.4. WTMgrCsrPressureBtnMarks (16-bit only) 33 5.9.5. WTMgrCsrPressureBtnMarksEx 33 5.9.6. WTMgrCsrPressureResponse 34 5.9.7. WTMgrCsrExt 35 6. Message Reference 36 6.1. Event Messages 36 6.1.1. WT_PACKET 36 6.1.2. WT_CSRCHANGE (1.1) 37 6.2. Context Messages 37 6.2.1. WT_CTXOPEN 37 6.2.2. WT_CTXCLOSE 37 6.2.3. WT_CTXUPDATE 38 6.2.4. WT_CTXOVERLAP 38 6.2.5. WT_PROXIMITY 38 6.3. Information Change Messages 39 6.3.1. WT_INFOCHANGE 39 7. Data Reference 39 7.1. Common Data Types (1.1 modified) 39 7.2. Information Data Structures 41 7.2.1. AXIS 41 7.2.2. Information Categories and Indices (1.1 modified) 42 7.3. Context Data Structures 50 7.3.1. LOGCONTEXT (1.1 modified) 50 7.4. Event Data Structures 55 7.4.1. PACKET (1.1 modified) 55 7.4.2. ORIENTATION 57 7.4.3. ROTATION (1.1) 58 Appendix A. Using PKTDEF.H 59 Appendix B. Extension Definitions 60 B.1. Extensions Programming 60 B.2. Out of Bounds Tracking 61 OBT Programming 61 Information Category 61 Turning OBT On and Off 61 B.3. Function Keys 62 FKEYS Programming 62 Information Category 62 B.4. Tilt 62 TILT Programming 63 Information Category 63 B.5. Cursor Mask 63 CSRMASK Programming 64 Information Category 64 B.6. Extended Button Masks 64 XBTNMASK Programming 64 Information Category 65 VERSION 1.1 UPDATE NOTATION CONVENTIONS Sections marked with the “(1.1)” are new sections added for specification version 1.1. Sections bearing the “(1.1 modified)” notation contain updated information for specification version 1.1. The “(1.1)” notation also marks the definitions of new functions, messages, and data structures. The nota-tion “1.1:” marks new text or commentaries explaining new functionality added to existing features. 1 BACKGROUND INFORMATION This document describes a programming interface for using digitizing tablets and other advanced pointing de¬vices with Microsoft Windows Version 3.0 and above. The design presented here is based on the input of numerous professionals from the pointing device manufacturing and Windows soft¬ware development industries. In this document, the words "tablet" and "digitizer" are used interchange¬ably to mean all absolute point¬ing or digitizing devices that can be made to work with this interface. The definition is not lim¬ited to de¬vices that use a physical tablet. In fact, this specification can support de¬vices that combine rela¬tive and absolute pointing as well as purely relative devices. The following sections describe features of tablets and of the Windows environment that helped mo¬tivate the design. 1.1 Features of Digitizers Digitizing tablets present several problems to device interface authors. • Many tablets have a very high report rate. • Many tablets have many configurable features and types of input information. • Tablets often control the system cursor, provide additional digitizing input, and provide template or macro functions. 1.2 The Windows Environment Programming for tablets in the Windows environment presents additional problems. • Multitasking means multiple applications may have to share the tablet. • The tablet must also be able to control the system cursor and/or the pen (in Pen Windows). • The tablet must work with legacy applications, and with applications written to take advan¬tage of tablet services. • The tablet driver must add minimal speed and memory overhead, so as many applications as possible can run as efficiently as possible. • The user should be able to control how applications use the tablet. The user interface must be ef-ficient, consistent, and customizable. 2 DESIGN GOALS While the tablet interface design must address the technical problems stated above, it must also be useful to the programmers who will write tablet programs, and ultimately, to the tablet users. Four design goals will help clarify these needs, and provide some criteria for evaluating the interface speci¬fication. The goals are user control, ease of programming, tablet sharing, and tablet feature support. 2.1 User Control The user should be able to use and control the tablet in as natural and easy a manner as possible. The user's preferences should take precedence over application requests, where possible. Here are questions to ask when thinking about user control as a design goal: • Can the user understand how applications use the tablet? • Is the interface for controlling tablet functions natural and unobtrusive? • Is the user allowed to change things that help to customize the work environment, but pre¬vented from changing things over which applications must have control? 2.2 Ease of Programming Programming is easiest when the amount of knowledge and effort required matches the task at hand. Writing simple programs should require only a few lines of code and a minimal understanding of the en-vironment. On the other hand, more advanced features and functions should be available to those who need them. The interface should accommodate three kinds of programmers: those who wish to write sim-ple tablet programs, programmers who wish to write complex applications that take full ad¬vantage of tab-let capabilities, and programmers who wish to provide tablet device control features. In addition, the inter-face should accommodate programmers in as many different programming lan¬guages, situations, and en-vironments as possible. Questions to ask when thinking about ease of programming include: • How hard is it to learn the interface and write a simple program that uses tablet input? • Can programmers of complex applications control the features they need? • Are more powerful tablet device control features available? • Can the interface be used in different programming environments? • Is the interface logical, consistent, and robust? 2.3 Tablet Sharing In the Windows environment, multiple applications that use the tablet may be running at once. Each ap-plication will require different services. Applications must be able to get the services they need without getting in each others' way. Questions to ask when thinking about tablet sharing include: • Can tablet applications use the tablet features they need, independent of other applications? • Does the interface prevent a rogue application from "hijacking" the tablet, or causing dead¬locks? • Does the sharing architecture promote efficiency? 2.4 Tablet Feature Support The interface gives standard access to as many features as possible, while leaving room for future ex¬ten-sions and vendor-specific customizations. Applications should be able to get the tablet informa¬tion and services they want, just the way they want them. Users should be able to use the tablet to set up an effi-cient, comfortable work environment. Questions to ask when thinking about tablet feature support include: • Does the interface provide the features applications need? Are any commonly available fea¬tures not supported? • Does the interface provide what users need? Is anything missing? • Are future extensions possible and fairly easy? • Are vendor-specific extensions possible? 3 DESIGN CONCEPTS The proposed interface design depends on several fundamental concepts. Devices and cursor types de-scribe physical hardware configurations. The interface publishes read-only information through a single information interface. Applications interact with the interface by setting up tablet contexts and consuming event packets. Applications may assume interface and hardware control functions by be¬coming tablet managers. The interface provides explicit support for future extensions. 3.1 Device Conventions The interface provides access to one or more devices that produce pointing input. Devices sup¬ported by this interface have some common characteristics. The device must define an absolute or relative coordi-nate space in at least two dimensions for which it can return position data. The device must have a point-ing ap¬para¬tus or method (such as a stylus, or a finger touching a touch pad), called the cursor, that de¬fines the current position. The cursor must be able to return at least one bit of additional state (via a but¬ton, touching a digitizing surface, etc.). Devices may have multiple cursor types that have different physical configurations, or that have differ¬ent numbers of buttons, or return auxiliary information, such as pressure information. Cursor types may also describe different optional hardware configurations. The interface defines a standard orientation for reporting device native coordinates. When the user is viewing the device in its normal position, the coordinate origin will be at the lower left of the device. The coordinate system will be right-handed, that is, the positive x axis points from left to right, and the posi¬tive y axis points either upward or away from the user. The z axis, if supported, points either to¬ward the user or upward. For devices that lay flat on a table top, the x-y plane will be horizontal and the z axis will point upward. For devices that are oriented vertically (for example, a touch screen on a conventional dis¬play), the x-y plane will be vertical, and the z axis will point toward the user. 3.2 Device Information Any program can get descriptive information about the tablet via the WTInfo function. The interface specifies certain information that must be available, but allows new implementations to add new types of information. The basic information includes device identifiers, version numbers, and overall ca¬pabilities. The information items are organized by category and index numbers. The combination of a category and index specifies a single information data item, which may be a scalar value, string, structure, or array. Applica¬tions may retrieve single items or whole categories at once. Some categories are multiplexed. A single category code represents the first of a group of identically in-dexed categories, one for each of a set of similar objects. Multiplexed categories in¬clude those for devices and cur¬sor types. One constructs the category number by adding the defined cate¬gory code to a zero-based device or cursor identification number. The information is read-only for normal tablet applications. Some information items may change during the course of a Windows session; tablet applications receive messages notifying them of changes in tablet information. 3.3 Tablet Contexts Tablet contexts play a central role in the interface; they are the objects that applications use to specify their use of the tablet. Con¬texts include not only the physical area of the tablet that the application will use, but also information about the type, con¬tents, and delivery method for tablet events, as well as other information. Tablet contexts are somewhat analo¬gous to display contexts in the GDI interface model; they contain context information about a spe¬cific application's use of the tablet. An application can open more than one context, but most only need one. Applications can customize their contexts, or they can open a context using a default context specification that is always available. The WTInfo function provides access to the default context specification. Opening a context requires a window handle. The window handle becomes the context's owner and will receive any window messages associated with the context. Contexts are remotely similar to screen windows in that they can physically overlap. The tablet inter¬face uses a combination of context overlap order and context attributes to decide which context will process a given event. The topmost context in the overlap order whose input context encompasses the event, and whose event masks select the event, will process the event. (Note that the notion of overlap order is sepa-rate from the notion of the physical z dimension.) Tablet managers (described below) provide a way to modify and overlap contexts. 3.4 Event Packets Tablet contexts generate and report tablet activity via event packets. Applications can control how they receive events, which events they receive, and what information they contain. Applications may receive events either by polling, or via Windows messages. • Polling: Any application that has opened a context can call the WTPacketsGet function to get the next state of the tablet for that context. • Window Messages: Applications that request messages will receive the WT_PACKET mes¬sage (described below), which indicates that something happened in the context and provides a refer-ence to more information. Applications can control which events they receive by using event masks. For example, some appli¬ca¬tions may only need to know when a button is pressed, while others may need to receive an event every time the cursor moves. Tablet context event masks implement this type of control. Applications can control the contents of the event packets they receive. Some tablets can return data that many applications will not need, like button pressure and three dimensional position and orien¬tation in-formation. The context object provides a way of specifying which data items the appli¬cation needs. This allows the driver to improve the efficiency of packet delivery to applications that only need a few items per packet. Packets are stored in context-specific packet queues and retrieved by explicit function calls. The interface provides ways to peek at and get packets, to query the size and contents of the queue, and to re-size the queue. 3.5 Tablet Managers The interface provides functions for tablet management. An application can become a tablet manager by opening a tablet manager handle. This handle allows the manager access to spe¬cial functions. These man-agement functions allow the application to arrange, overlap, and modify tablet contexts. Man¬agers may also perform other functions, such as changing default values used by applica¬tions, chang¬ing ergo¬nomic, preference, and configuration settings, controlling tablet behavior with non-tablet aware applica¬tions, modi¬fy¬ing user dialogs, and recording and playing back tablet packets. Opening a manager handle re¬quires a window handle. The window becomes a manager window and receives window messages about interface and con¬text activity. 3.6 Extensions The interface allows implementations to define additional features called extensions. Extensions can be made available to new applications without the need to modify ex¬isting applications. Extensions are sup-ported through the information categories, through the flexible definition of packets, and through special context and manager functions. Designing an extension involves defining the meaning and behavior of the extension packet and/or prefer-ence data, filling in the information category, defining the extension's interface with the special functions, and possibly defining additional functions to support the extension. Each extension will be assigned a unique tag for identification. Not all implementations will support all extensions. A multiplexed information category contains descriptive data about extensions. Note that applica¬tions must find their extensions by iterating through the categories and matching tags. While tags are fixed across all implementations, category numbers may vary among implementations. 3.7 Persistent Binding of Interface Features (1.1) The interface provides access to many of its features using consecutive numeric indices whose value is not guaranteed from session to session. However, sufficient information is provided to create unique identifi¬ers for devices, cursors, and interface extensions. Devices should be uniquely identified by the contents of their name strings. If multiple identical devices are present, implementation providers should provide unique, persistent id strings to the extent possible. Identical devices that return unique serial numbers are ideal. If supported by the hardware, cursors also may have a physical cursor id that uniquely identifies the cursor in a persistent and stable manner. Interface extensions are uniquely identified by their tag. 4 INTERFACE IMPLEMENTATIONS Implementations of this interface usually support one specific device, a class of similar devices, or a com-mon combination of devices. The following sections discuss guidelines for implementations. 4.1 File and Module Conventions For 16-bit implementations, the interface functions, and any additional vendor- or device-specific func-tions, reside in a dynamic link library with the file name "WINTAB.DLL" and module name "WINTAB"; 32-bit implementations use the file name "WINTAB32.DLL" and module name "WINTAB32." Any other file or module con¬ventions are implementation specific. Implementations may include other library mod-ules or data files as necessary. Installation processes are likewise implementa¬tion-specific. Wintab programs written in the C language require two header files. WINTAB.H contains definitions of all of the functions, constants, and fixed data types. PKTDEF.H contains a parameterized definition of the PACKET data structure, that can be tailored to fit the application. The Wintab Programmer's Kit con¬tains these and other files necessary for Wintab programming, plus several example programs with C-lan¬guage source files. The Wintab Programmer's Kit is available from the author. 4.2 Feature Support Options Some features of the interface are optional and may be left out by some implementations. Support of defined data items other than x, y, and buttons is optional. Many devices only report x, y, and button information. Support of system-cursor contexts is optional. This option relieves implementations of replacing the sys¬tem mouse driver in Windows versions before 3.1. Support of Pen Windows contexts is optional. Not all systems will have the Pen Windows hardware and software necessary. Support of external tablet manager applications is optional, and the number of manager handles is imple-mentation-dependent. However, the manager functions should be present in all implementa¬tions, return¬ing appropriate failure codes if not fully implemented. An implementation may provide context- and hardware-management support internally only, if desired. On the other hand, providing the external man-ager interface may relieve the implementation of a considerable amount of user in¬terface code, and make improvements to the manager interface easier to implement and distribute later. Support of extension data items is optional. Most extensions will be geared to unusual hardware features. 5 FUNCTION REFERENCE All tablet function names have the prefix "WT" and have attributes equivalent to WINAPI. Applica¬tions gain access to the tablet interface functions through a dynamic-link library with standard file and module names, as defined in the previous section. Applications may link to the functions by using the Windows functions LoadLibrary, FreeLibrary, and GetProcAddress, or use an import library. Specific to 32-bit Wintab: The functions WTInfo, WTOpen, WTGet, and WTSet have both ANSI and Unicode versions, using the same ANSI/Unicode porting conventions used in the Win32 API. Five non-portable functions, WTQueuePackets, WTMgrCsrPressureBtnMarks, WTMgrConfigReplace, WTMgrPacketHook, and WTMgrPacketHookDefProc are replaced by new portable functions WTQueuePacketsEx, WTMgrCsrPressureBtnMarksEx, WTMgrConfigReplaceEx, WTMgrPack-etHookEx, WTMgrPacketUnhook, and WTMgrPacketHookNext. WTMgrConfigReplaceEx and WTMgrPacketHookEx have both ANSI and Unicode versions. Table 5.1. Ordinal Function Numbers for Dynamic Linking Ordinal numbers for dynamic linking are defined in the table below. Where two ordinal entries appear, the first entry identifies the 16-bit and 32-bit ANSI versions of the function. The second entry identifies the 32-bit Unicode version. Function Name Ordinal Function Name Ordinal WTInfo 20, 1020 WTMgrOpen 100 WTOpen 21, 1021 WTMgrClose 101 WTClose 22 WTMgrContextEnum 120 WTPacketsGet 23 WTMgrContextOwner 121 WTPacket 24 WTMgrDefContext 122 WTEnable 40 WTMgrDefContextEx (1.1) 206 WTOverlap 41 WTMgrDeviceConfig 140 WTConfig 60 WTMgrConfigReplace 141 WTGet 61, 1061 WTMgrConfigReplaceEx 202, 1202 WTSet 62, 1062 WTMgrPacketHook 160 WTExtGet 63 WTMgrPacketHookEx 203, 1203 WTExtSet 64 WTMgrPacketUnhook 204 WTSave 65 WTMgrPacketHookDefProc 161 WTRestore 66 WTMgrPacketHookNext 205 WTPacketsPeek 80 WTMgrExt 180 WTDataGet 81 WTMgrCsrEnable 181 WTDataPeek 82 WTMgrCsrButtonMap 182 WTQueuePackets 83 WTMgrCsrPressureBtnMarks 183 WTQueuePacketsEx 200 WTMgrCsrPressureBtnMarksEx 201 WTQueueSizeGet 84 WTMgrCsrPressureResponse 184 WTQueueSizeSet 85 WTMgrCsrExt 185 5.1 Basic Functions The functions in the following section will be used by most tablet-aware applications. They include getting interface and device information, opening and closing contexts, and retrieving packets by polling or via Windows messages. 5.1.1 WTInfo Syntax UINT WTInfo(wCategory, nIndex, lpOutput) This function returns global information about the interface in an application-sup-plied buffer. Different types of information are specified by different index argu-ments. Applications use this function to receive information about tablet coordi-nates, physical dimensions, capabilities, and cursor types. Parameter Type/Description wCategory UINT Identifies the category from which information is being re-quested. nIndex UINT Identifies which information is being requested from within the category. lpOutput LPVOID Points to a buffer to hold the requested information. Return Value The return value specifies the size of the returned information in bytes. If the infor-mation is not supported, the function returns zero. If a tablet is not physi¬cally pres-ent, this function always returns zero. Comments Several important categories of information are available through this function. First, the function provides identification information, including specification and software version numbers, and tablet vendor and model information. Sec¬ond, the function provides general capability information, including dimensions, resolutions, optional features, and cursor types. Third, the function provides categories that give defaults for all tablet context attributes. Finally, the func¬tion may provide any other implementation- or vendor-specific information cat¬egories necessary. The information returned by this function is subject to change during a Win¬dows session. Applications cannot change the information returned here, but tablet man-ager applications or hardware changes or errors can. Applications can respond to information changes by fielding the WT_INFOCHANGE message. The parameters of the message indicate which information has changed. If the wCategory argument is zero, the function copies no data to the output buffer, but returns the size in bytes of the buffer necessary to hold the largest complete category. If the nIndex argument is zero, the function returns all of the information entries in the category in a single data structure. If the lpOutput argument is NULL, the function just returns the required buffer size. See Also Category and index definitions in tables 7.3 through 7.9, and the WT_INFOCHANGE message in section 6.3.1. 5.1.2 WTOpen Syntax HCTX WTOpen(hWnd, lpLogCtx, fEnable) This function establishes an active context on the tablet. On successful comple¬tion of this function, the application may begin receiving tablet events via mes¬sages (if they were requested), and may use the handle returned to poll the con¬text, or to per-form other context-related functions. Parameter Type/Description hWnd HWND Identifies the window that owns the tablet context, and receives messages from the context. lpLogCtx LPLOGCONTEXT Points to an application-provided LOGCONTEXT data structure describing the context to be opened. fEnable BOOL Specifies whether the new context will immediately begin processing input data. Return Value The return value identifies the new context. It is NULL if the context is not opened. Comments Opening a new context allows the application to receive tablet input or creates a context that controls the system cursor or Pen Windows pen. The owning window (and all manager windows) will immediately receive a WT_CTXOPEN message when the context has been opened. If the fEnable argument is zero, the context will be created, but will not process input. The context can be enabled using the WTEnable function. If tablet event messages were requested in the context specification, the owning window will receive them. The application can control the message numbers used the lcMsgBase field of the LOGCONTEXT structure. The window that owns the new context will receive context and information change messages even if event messages were not requested. It is not necessary to handle these in many cases, but some applications may wish to do so. The newly opened tablet context will be placed on the top of the context overlap or-der. Invalid or out-of-range attribute values in the logical context structure will ei¬ther be validated, or cause the open to fail, depending on the attributes involved. Upon a successful return from the function, the context specification pointed to by lpLogCtx will contain the validated values. See Also The WTEnable function in section 5.2.1, the LOGCONTEXT data structure in section 7.3.1, and the context and infor¬mation change messages in sections 6.2 and 6.3. 5.1.3 WTClose Syntax BOOL WTClose(hCtx) This function closes and destroys the tablet context object. Parameter Type/Description hCtx HCTX Identifies the context to be closed. Return Value The function returns a non-zero value if the context was valid and was destroyed. Otherwise, it returns zero. Comments After a call to this function, the passed handle is no longer valid. The owning win¬dow (and all manager windows) will receive a WT_CTXCLOSE message when the context has been closed. See Also The WTOpen function in section 5.1.2. 5.1.4 WTPacketsGet Syntax int WTPacketsGet(hCtx, cMaxPkts, lpPkts) This function copies the next cMaxPkts events from the packet queue of context hCtx to the passed lpPkts buffer and removes them from the queue. Parameter Type/Description hCtx HCTX Identifies the context whose packets are being returned. cMaxPkts int Specifies the maximum number of packets to return. lpPkts LPVOID Points to a buffer to receive the event packets. Return Value The return value is the number of packets copied in the buffer. Comments The exact structure of the returned packet is determined by the packet infor¬mation that was requested when the context was opened. The buffer pointed to by lpPkts must be at least cMaxPkts * sizeof(PACKET) bytes long to prevent overflow. Applications may flush packets from the queue by calling this function with a NULL lpPkt argument. See Also The WTPacketsPeek function in section 5.4.1, and the descriptions of the LOGCONTEXT (section 7.3.1) and PACKET (section 7.4.1) data structures. 5.1.5 WTPacket Syntax BOOL WTPacket(hCtx, wSerial, lpPkt) This function fills in the passed lpPkt buffer with the context event packet having the specified serial number. The returned packet and any older packets are removed from the context's internal queue. Parameter Type/Description hCtx HCTX Identifies the context whose packets are being returned. wSerial UINT Serial number of the tablet event to return. lpPkt LPVOID Points to a buffer to receive the event packet. Return Value The return value is non-zero if the specified packet was found and returned. It is zero if the specified packet was not found in the queue. Comments The exact structure of the returned packet is determined by the packet infor¬mation that was requested when the context was opened. The buffer pointed to by lpPkts must be at least sizeof(PACKET) bytes long to pre-vent overflow. Applications may flush packets from the queue by calling this function with a NULL lpPkts argument. See Also The descriptions of the LOGCONTEXT (section 7.3.1) and PACKET (section 7.4.1) data structures. 5.2 Visibility Functions The functions in this section allow applications to control contexts' visibility, whether or not they are pro-cessing input, and their overlap order. 5.2.1 WTEnable Syntax BOOL WTEnable(hCtx, fEnable) This function enables or disables a tablet context, temporarily turning on or off the processing of packets. Parameter Type/Description hCtx HCTX Identifies the context to be enabled or disabled. fEnable BOOL Specifies enabling if non-zero, disabling if zero. Return Value The function returns a non-zero value if the enable or disable request was satis¬fied, zero otherwise. Comments Calls to this function to enable an already enabled context, or to disable an al¬ready disabled context will return a non-zero value, but otherwise do nothing. The context’s packet queue is flushed on disable. Applications can determine whether a context is currently enabled by using the WTGet function and examining the lcStatus field of the LOGCONTEXT struc¬ture. See Also The WTGet function in section 5.3.2, and the LOGCONTEXT structure in sec¬tion 7.3.1. 5.2.2 WTOverlap Syntax BOOL WTOverlap(hCtx, fToTop) This function sends a tablet context to the top or bottom of the order of over¬lapping tablet contexts. Parameter Type/Description hCtx HCTX Identifies the context to move within the overlap order. fToTop BOOL Specifies sending the context to the top of the overlap or-der if non-zero, or to the bottom if zero. Return Value The function returns non-zero if successful, zero otherwise. Comments Tablet contexts' input areas are allowed to overlap. The tablet interface main¬tains an overlap order that helps determine which context will process a given event. The topmost context in the overlap order whose input context encom¬passes the event, and whose event masks select the event will process the event. This function is useful for getting access to input events when the application's con-text is overlapped by other contexts. The function will fail only if the context argument is invalid. 5.3 Context Editing Functions This group of functions allows applications to edit, save, and restore contexts. 5.3.1 WTConfig Syntax BOOL WTConfig(hCtx, hWnd) This function prompts the user for changes to the passed context via a dialog box. Parameter Type/Description hCtx HCTX Identifies the context that the user will modify via the dialog box. hWnd HWND Identifies the window that will be the parent window of the dialog box. Return Value The function returns a non-zero value if the tablet context was changed, zero oth-erwise. Comments Tablet applications can use this function to let the user choose context attributes that the application doesn't need to control. Applications can control the editing of con¬text attributes via the lcLocks logical context structure member. Applications should consider providing access to this function through a menu item or command. See Also The LOGCONTEXT structure in section 7.3.1 and the context lock values in table 7.13. 5.3.2 WTGet Syntax BOOL WTGet(hCtx, lpLogCtx) This function fills the passed structure with the current context attributes for the passed handle. Parameter Type/Description hCtx HCTX Identifies the context whose attributes are to be copied. lpLogCtx LPLOGCONTEXT Points to a LOGCONTEXT data structure to which the context attributes are to be copied. Return Value The function returns a non-zero value if the data is retrieved successfully. Oth¬er¬wise, it returns zero. See Also The LOGCONTEXT structure in section 7.3.1. 5.3.3 WTSet (1.1 modified) Syntax BOOL WTSet(hCtx, lpLogCtx) This function allows some of the context's attributes to be changed on the fly. Parameter Type/Description hCtx HCTX Identifies the context whose attributes are being changed. lpLogCtx LPLOGCONTEXT Points to a LOGCONTEXT data structure containing the new context attributes. Return Value The function returns a non-zero value if the context was changed to match the passed context specification; it returns zero if any of the requested changes could not be made. Comments If this function is called by the task or process that owns the context, any context attribute may be changed. Otherwise, the function can change attributes that do not affect the format or meaning of the context's event packets and that were not speci-fied as locked when the context was opened. Context lock values can only be changed by the context’s owner. 1.1: If the hCtx argument is a default context handle returned from WTMgrDef-Context or WTMgrDefContextEx, and the lpLogCtx argument is WTP_LPDEFAULT, the default context will be reset to its initial factory default values. See Also The LOGCONTEXT structure in section 7.3.1 and the context lock values in table 7.13. 5.3.4 WTExtGet Syntax BOOL WTExtGet(hCtx, wExt, lpData) This function retrieves any context-specific data for an extension. Parameter Type/Description hCtx HCTX Identifies the context whose extension attributes are being retrieved. wExt UINT Identifies the extension tag for which context-specific data is being retrieved. lpData LPVOID Points to a buffer to hold the retrieved data. Return Value The function returns a non-zero value if the data is retrieved successfully. Oth¬er¬wise, it returns zero. See Also The extension definitions in Appendix B. 5.3.5 WTExtSet Syntax BOOL WTExtSet(hCtx, wExt, lpData) This function sets any context-specific data for an extension. Parameter Type/Description hCtx HCTX Identifies the context whose extension attributes are being modified. wExt UINT Identifies the extension tag for which context-specific data is being modified. lpData LPVOID Points to the new data. Return Value The function returns a non-zero value if the data is modified successfully. Oth¬er¬wise, it returns zero. Comments Extensions may forbid their context-specific data to be changed during the life¬time of a context. For such extensions, calls to this function would always fail. Extensions may also limit context data editing to the task of the owning window, as with the context locks. See Also The extension definitions in Appendix B, the LOGCONTEXT data structure in section 7.3.1 and the context locking values in table 7.13. 5.3.6 WTSave Syntax BOOL WTSave(hCtx, lpSaveInfo) This function fills the passed buffer with binary save information that can be used to restore the equivalent context in a subsequent Windows session. Parameter Type/Description hCtx HCTX Identifies the context that is being saved. lpSaveInfo LPVOID Points to a buffer to contain the save information. Return Value The function returns non-zero if the save information is successfully retrieved. Oth-erwise, it returns zero. Comments The size of the save information buffer can be determined by calling the WTInfo function with category WTI_INTERFACE, index IFC_CTXSAVESIZE. The save information is returned in a private binary data format. Applications should store the information unmodified and recreate the context by passing the save information to the WTRestore function. Using WTSave and WTRestore allows applications to easily save and restore ex-tension data bound to contexts. See Also The WTRestore function in section 5.3.7. 5.3.7 WTRestore Syntax HCTX WTRestore(hWnd, lpSaveInfo, fEnable) This function creates a tablet context from save information returned from the WTSave function. Parameter Type/Description hWnd HWND Identifies the window that owns the tablet context, and receives messages from the context. lpSaveInfo LPVOID Points to a buffer containing save information. fEnable BOOL Specifies whether the new context will immediately begin processing input data. Return Value The function returns a valid context handle if successful. If a context equivalent to the save information could not be created, the function returns NULL. Comments The save information is in a private binary data format. Applications should only pass save information retrieved by the WTSave function. This function is much like WTOpen, except that it uses save in¬formation for input instead of a logical context. In particular, it will generate a WT_CTXOPEN mes¬sage for the new context. See Also The WTOpen function in section 5.1.2, the WTSave function in section 5.3.6, and the WT_CTXOPEN message in section 6.2.1. 5.4 Advanced Packet and Queue Functions These functions provide advanced packet retrieval and queue manipulation. The packet retrieval functions require the application to provide a packet output buffer. To prevent overflow, the buffer must be large enough to hold the requested number of packets from the specified context. It is up to the caller to deter¬mine the packet size (by interrogating the context, if necessary), and to allocate a large enough buffer. Ap¬plications may flush packets from the queue by passing a NULL buffer pointer. 5.4.1 WTPacketsPeek Syntax int WTPacketsPeek(hCtx, cMaxPkts, lpPkts) This function copies the next cMaxPkts events from the packet queue of context hCtx to the passed lpPkts buffer without removing them from the queue. Parameter Type/Description hCtx HCTX Identifies the context whose packets are being read. cMaxPkts int Specifies the maximum number of packets to return. lpPkts LPVOID Points to a buffer to receive the event packets. Return Value The return value is the number of packets copied in the buffer. Comments The buffer pointed to by lpPkts must be at least cMaxPkts * sizeof(PACKET) bytes long to prevent overflow. See Also the WTPacketsGet function in section 5.1.4. 5.4.2 WTDataGet Syntax int WTDataGet(hCtx, wBegin, wEnd, cMaxPkts, lpPkts, lpNPkts) This function copies all packets with serial numbers between wBegin and wEnd in-clusive from the context's queue to the passed buffer and removes them from the queue. Parameter Type/Description hCtx HCTX Identifies the context whose packets are being returned. wBegin UINT Serial number of the oldest tablet event to return. wEnd UINT Serial number of the newest tablet event to return. cMaxPkts int Specifies the maximum number of packets to return. lpPkts LPVOID Points to a buffer to receive the event packets. lpNPkts LPINT Points to an integer to receive the number of packets ac-tually copied. Return Value The return value is the total number of packets found in the queue between wBegin and wEnd. Comments The buffer pointed to by lpPkts must be at least cMaxPkts * sizeof(PACKET) bytes long to prevent overflow. See Also The WTDataPeek function in section 5.4.3, and the WTQueuePacketsEx function in section 5.4.5. 5.4.3 WTDataPeek Syntax int WTDataPeek(hCtx, wBegin, wEnd, cMaxPkts, lpPkts, lpNPkts) This function copies all packets with serial numbers between wBegin and wEnd in-clusive, from the context's queue to the passed buffer without removing them from the queue. Parameter Type/Description hCtx HCTX Identifies the context whose packets are being read. wBegin UINT Serial number of the oldest tablet event to return. wEnd UINT Serial number of the newest tablet event to return. cMaxPkts int Specifies the maximum number of packets to return. lpPkts LPVOID Points to a buffer to receive the event packets. lpNPkts LPINT Points to an integer to receive the number of packets ac-tually copied. Return Value The return value is the total number of packets found in the queue between wBegin and wEnd. Comments The buffer pointed to by lpPkts must be at least cMaxPkts * sizeof(PACKET) bytes long to prevent overflow. See Also The WTDataGet function in section 5.4.2, and the WTQueuePacketsEx function in section 5.4.5. 5.4.4 WTQueuePackets (16-bit only) Syntax DWORD WTQueuePackets(hCtx) This function returns the serial numbers of the oldest and newest packets cur¬rently in the queue. Parameter Type/Description hCtx HCTX Identifies the context whose queue is being queried. Return Value The high word of the return value contains the newest packet's serial number; the low word contains the oldest. Comments This function is non-portable and is superseded by WTQueuePacketsEx. See Also The WTQueuePacketsEx function in section 5.4.5. 5.4.5 WTQueuePacketsEx Syntax BOOL WTQueuePacketsEx(hCtx, lpOld, lpNew) This function returns the serial numbers of the oldest and newest packets cur¬rently in the queue. Parameter Type/Description hCtx HCTX Identifies the context whose queue is being queried. lpOld UINT FAR * Points to an unsigned integer to receive the oldest packet's serial number. lpNew UINT FAR * Points to an unsigned integer to receive the newest packet's serial number. Return Value The function returns non-zero if successful, zero otherwise. 5.4.6 WTQueueSizeGet Syntax int WTQueueSizeGet(hCtx) This function returns the number of packets the context's queue can hold. Parameter Type/Description hCtx HCTX Identifies the context whose queue size is being re¬turned. Return Value The return value is the number of packet the queue can hold. See Also The WTQueueSizeSet function in section 5.4.7. 5.4.7 WTQueueSizeSet Syntax BOOL WTQueueSizeSet(hCtx, nPkts) This function attempts to change the context's queue size to the value specified in nPkts. Parameter Type/Description hCtx HCTX Identifies the context whose queue size is being set. nPkts int Specifies the requested queue size. Return Value The return value is non-zero if the queue size was successfully changed. Other¬wise, it is zero. Comments If the return value is zero, the context has no queue because the function deletes the original queue before attempting to create a new one. The application must continue calling the function with a smaller queue size until the function returns a non-zero value. See Also The WTQueueSizeGet function in section 5.4.6. 5.5 Manager Handle Functions The functions described in this and subsequent sections are for use by tablet manager applications. The functions of this section create and destroy manager handles. These handles allow the interface code to limit the degree of simultaneous access to the powerful manager functions. Also, opening a manager handle lets the application receive messages about tablet interface activity. 5.5.1 WTMgrOpen Syntax HMGR WTMgrOpen(hWnd, wMsgBase) This function opens a tablet manager handle for use by tablet manager and con¬figu-ration applications. This handle is required to call the tablet management func¬tions. Parameter Type/Description hWnd HWND Identifies the window which owns the manager handle. wMsgBase UINT Specifies the message base number to use when notifying the manager window. Return Value The function returns a manager handle if successful, otherwise it returns NULL. Comments While the manager handle is open, the manager window will receive context mes-sages from all tablet contexts. Manager windows also receive information change messages. The number of manager handles available is interface implementation-dependent, and can be determined by calling the WTInfo function with category WTI_INTERFACE and index IFC_NMANAGERS. See Also The WTInfo function in section 5.1.1, the WTMgrClose function in section 5.5.2, the description of message base numbers in section 6 and the context and in¬for¬ma-tion change messages in sections 6.2 and 6.3. 5.5.2 WTMgrClose Syntax BOOL WTMgrClose(hMgr) This function closes a tablet manager handle. After this function returns, the passed manager handle is no longer valid. Parameter Type/Description hMgr HMGR Identifies the manager handle to close. Return Value The function returns non-zero if the handle was valid; otherwise, it returns zero. 5.6 Manager Context Functions These functions provide access to all open contexts and their owners, and allow changing context de¬faults. Only tablet managers are allowed to manipulate tablet contexts belonging to other applica¬tions. 5.6.1 WTMgrContextEnum Syntax BOOL WTMgrContextEnum(hMgr, lpEnumFunc, lParam) This function enumerates all tablet context handles by passing the handle of each context, in turn, to the callback function pointed to by the lpEnumFunc pa¬rameter. The enumeration terminates when the callback function returns zero. Parameter Type/Description hMgr HMGR Is the valid manager handle that identifies the caller as a manager application. lpEnumFunc WTENUMPROC Is the procedure-instance address of the call-back function. See the following "Comments" section for details. lParam LPARAM Specifies the value to be passed to the callback func-tion for the application's use. Return Value The return value specifies the outcome of the function. It is non-zero if all con¬texts have been enumerated. Otherwise, it is zero. Comments The address passed as the lpEnumFunc parameter must be created by using the MakeProcInstance function. The callback function must have attributes equivalent to WINAPI. The callback function must have the following form: Callback BOOL WINAPI EnumFunc(hCtx, lParam) HCTX hCtx; LPARAM lParam; EnumFunc is a place holder for the application-supplied function name. The actual name must be exported by including it in an EXPORTS statement in the applica-tion's module-definition file. Parameter Description hCtx Identifies the context. lParam Specifies the 32-bit argument of the WTMgrContextEnum func-tion. Return Value The function must return a non-zero value to continue enumeration, or zero to stop it. 5.6.2 WTMgrContextOwner Syntax HWND WTMgrContextOwner(hMgr, hCtx) This function returns the handle of the window that owns a tablet context. Parameter Type/Description hMgr HMGR Is the valid manager handle that identifies the caller as a manager application. hCtx HCTX Identifies the context whose owner is to be returned. Return Value The function returns the context owner's window handle if the passed arguments are valid. Otherwise, it returns NULL. Comments This function allows the tablet manager to coordinate tablet context manage¬ment with the states of the context-owning windows. 5.6.3 WTMgrDefContext Syntax HCTX WTMgrDefContext(hMgr, fSystem) This function retrieves a context handle that allows setting values for the current default digit¬izing or system context. Parameter Type/Description hMgr HMGR Is the valid manager handle that identifies the caller as a manager application. fSystem BOOL Specifies retrieval of the default system context if non-zero, or the default digitizing context if zero. Return Value The return value is the context handle for the specified default context, or NULL if the arguments were invalid. Comments The default digitizing context is the context whose attributes are returned by the WTInfo function WTI_DEFCONTEXT category. The default system context is the context whose attributes are returned by the WTInfo function WTI_DEFSYSCTX category. Editing operations on the retrieved handles will fail if the new default contexts do not meet certain requirements. The digitizing context must include at least buttons, x, and y in its packet data, and must return absolute coordinates. 1.1: Editing the current default digitizing context will also update the device-spe¬cific default context for the device listed in the lcDevice field of the default con¬text’s LOGCONTEXT structure. See Also The WTInfo function in section 5.1.1 the WTMgrDefContextEx function in section 5.6.4, and the category and index definitions in tables 7.3 through 7.9. 5.6.4 WTMgrDefContextEx (1.1) Syntax HCTX WTMgrDefContextEx(hMgr, wDevice, fSystem) This function retrieves a context handle that allows setting values for the default digit¬izing or system context for a specified device. Parameter Type/Description hMgr HMGR Is the valid manager handle that identifies the caller as a manager application. wDevice UINT Specifies the device for which a default context handle will be returned. fSystem BOOL Specifies retrieval of the default system context if non-zero, or the default digitizing context if zero. Return Value The return value is the context handle for the specified default context, or NULL if the arguments were invalid. Comments The default digitizing contexts are contexts whose attributes are returned by the WTInfo function WTI_DDCTXS multiplexed category. The default system con-texts are contexts whose attributes are returned by the WTInfo function WTI_DSCTXS multiplexed category. Editing operations on the retrieved handles will fail if the new default contexts do not meet certain requirements. The digitizing context must include at least buttons, x, and y in its packet data, and must return absolute coordinates. See Also The WTInfo function in section 5.1.1, and the category and index definitions in tables 7.3 through 7.9. 5.7 Manager Configuration Functions These functions allow manager applications to replace the default context configuration dialog and to display a configuration dialog for each hardware device. 5.7.1 WTMgrDeviceConfig Syntax UINT WTMgrDeviceConfig(hMgr, wDevice, hWnd) This function displays a custom modal tablet-hardware configuration dialog box, if one is supported. Parameter Type/Description hMgr HMGR Is the valid manager handle that identifies the caller as a manager application. wDevice UINT Identifies the device that the user will configure via the dialog box. hWnd HWND Identifies the window that will be the parent window of the dialog box. If this argument is NULL, the function will return non-zero if the dialog is supported, or zero otherwise. Return Value The return value is zero if the dialog box is not supported. Otherwise, it is one of the following non-zero values. Value Meaning WTDC_CANCEL The user canceled the dialog without making any changes. WTDC_OK The user made and confirmed changes. WTDC_RESTART The user made and confirmed changes that require a sys-tem restart in order to take effect. The calling program should query the user to determine whether to restart. Restart Windows using the function call ExitWin-dows(EW_RESTARTWINDOWS, 0);. 5.7.2 WTMgrConfigReplace (16-bit only) Syntax BOOL WTMgrConfigReplace(hMgr, fInstall, lpConfigProc) This function allows a manager application to replace the default behavior of the WTConfig function. Parameter Type/Description hMgr HMGR Is the valid manager handle that identifies the caller as a manager application. fInstall BOOL Specifies installation of a replacement function if non-zero, or removal of the current replacement if zero. lpConfigProc WTCONFIGPROC Is the procedure-instance address of the new configuration function. This argument is ignored during a re¬moval request. Return Value The function return non-zero if the installation or removal request succeeded. Oth-erwise, it returns zero. Comments This function is non-portable and is superseded by WTMgrConfigReplaceEx. See Also The WTConfig function in section 5.3.1, and for a description of the configuration callback function, see the WTMgrConfigReplaceEx function in section 5.7.3. 5.7.3 WTMgrConfigReplaceEx Syntax BOOL WTMgrConfigReplaceEx(hMgr, fInstall, lpszModule, lpszCfgProc) This function allows a manager application to replace the default behavior of the WTConfig function. Parameter Type/Description hMgr HMGR Is the valid manager handle that identifies the caller as a manager application. fInstall BOOL Specifies installation of a replacement function if non-zero, or removal of the current replacement if zero. lpszModule LPCTSTR Points to a null-terminated string that names a DLL module containing the new configuration function. This argument is ignored during a re¬moval request lpszCfgProc LPCSTR Points to a null-terminated string that names the new configuration function. This argument is ignored during a re¬moval request. Return Value The function return non-zero if the installation or removal request succeeded. Oth-erwise, it returns zero. Comments The configuration callback function must have attributes equivalent to WINAPI. Only one callback function may be installed at a time. The manager handle passed with the removal request must match the handle passed with the corre¬sponding in-stallation request. Tablet managers that install a replacement context configuration function must re-move it before exiting. Callback BOOL WINAPI ConfigProc(hWnd, hCtx) HWND hWnd; HCTX hCtx; ConfigProc is a place holder for the application-supplied function name. The actual name must be exported by including it in an EXPORTS statement in the applica-tion's module-definition file. Parameter Description hWnd Identifies the window that will be the parent window of the dialog box. hCtx Identifies the context that the user will modify via the dialog box. Return Value The function returns a non-zero value if the tablet context was changed, zero oth-erwise. Comments The configuration function and resulting dialog box should analyze the lcLocks context structure member, and only allow editing of unlocked context attributes. See Also The WTConfig function in section 5.3.1. 5.8 Manager Packet Hook Functions These functions allow manager applications to monitor, record, and play back sequences of tablet packets. 5.8.1 WTMgrPacketHook (16-bit only) Syntax WTHOOKPROC WTMgrPacketHook(hMgr, fInstall, nType, lpFunc) This function installs or removes a packet hook function. Parameter Type/Description hMgr HMGR Is the valid manager handle that identifies the caller as a manager application. fInstall BOOL Specifies installation of a hook function if non-zero, or removal of the specified hook if zero. nType int Specifies the packet hook to be installed. It can be any one of the following values: Value Meaning WTH_PLAYBACK Installs a packet playback hook. WTH_RECORD Installs a packet record hook. lpFunc WTHOOKPROC Is the procedure-instance address of the hook function to be installed. See the "Comments" section under WTMgrPacketHookEx for details. Return Value When installing a hook, the return value points to the procedure-instance ad¬dress of the previously installed hook (if any). It is NULL if there is no previous hook; it is negative one if the hook cannot be installed. The application or library that calls this func¬tion should save this return value in the library's data segment. The fourth argument of the WTPacketHookDefProc function points to the location in memory where the library saves this return value. When removing a hook, the return value is the passed lpFunc if successful, NULL otherwise. Comments This function is non-portable and is superseded by WTMgrPacketHookEx and WTMgrPacketUnhook. See Also the WTMgrPacketHookEx function in section 5.8.2, and the WTMgrPacketUn-hook function in section 5.8.3. 5.8.2 WTMgrPacketHookEx Syntax HWTHOOK WTMgrPacketHookEx(hMgr, nType, lpszModule, lpszHookProc) This function installs a packet hook function. Parameter Type/Description hMgr HMGR Is the valid manager handle that identifies the caller as a manager application. nType int Specifies the packet hook to be installed. It can be any one of the following values: Value Meaning WTH_PLAYBACK Installs a packet playback hook. WTH_RECORD Installs a packet record hook. lpszModule LPCTSTR Points to a null-terminated string that names a DLL module containing the new hook function. See the following "Comments" section for details. lpszHookProc LPCSTR Points to a null-terminated string that names the new hook function. See the following "Comments" section for details. Return Value If the function succeeds, the return value is the handle of the installed hook func-tion. Otherwise, the return value is NULL. Comments Packet hooks are a shared resource. Installing a hook affects all applications using the interface. All Wintab hook functions must be exported functions residing in a DLL module. The following section describes how to support the individual hook functions. WTH_PLAYBACK Wintab calls the WTH_PLAYBACK hook whenever a request for an event packet is made. The function is intended to be used to supply a previously recorded event packet for a compatible context. The hook function must have attributes equivalent to WINAPI. The filter function must have the following form: Hook Function LRESULT WINAPI HookFunc(nCode, wParam, lParam); int nCode; WPARAM wParam; LPARAM lParam; HookFunc is a place holder for the library-supplied function name. The actual name must be exported by including it in an EXPORTS statement in the library's mod¬ule-definition file. Parameter Description nCode Specifies whether the hook function should process the mes¬sage or call the WTMgrPacketHookDefProc (if installed by WTMgrPacketHook)or WTMgrPacketHookNext (if installed by WTMgrPacketHookEx) function. If the nCode parame¬ter is less than zero, the hook function should pass the message to the appropriate function without further process¬ing. wParam Specifies the context handle whose event is being requested. lParam Points to the packet being processed by the hook function. Comments The WTH_PLAYBACK function should copy an event packet to the buffer pointed to by the lParam pa¬rameter. The packet must have been previously recorded by us-ing the WTH_RECORD hook. It should not modify the packet. The return value should be the amount of time (in milliseconds) Wintab should wait before pro¬cess¬ing the mes¬sage. This time can be computed by calculation the difference between the time stamps of the current and previous packets. If the function returns zero, the message is processed immediately. Once it returns control to Wintab, the packet continues to be processed. If the nCode parameter is WTHC_SKIP, the hook func-tion should prepare to return the next recorded event message on its next call. The packet pointed to by lParam will have the same structure as packets re¬trieved from the context normally. Wintab will validate the following packet items to en¬sure consistency: context handle, time stamp, and serial number. The remaining fields will be valid if the context used for playback is equivalent to the context from which the events were recorded. The WTH_PLAYBACK hook will not be called to notify it of the display or re¬moval of system modal dialog boxes. It is expected that applications playing back packets will also be playing back window event messages using Windows' own hook functions. While the WTH_PLAYBACK function is in effect, Wintab ignores all hardware in-put. WTH_RECORD The interface calls the WTH_RECORD hook whenever it processes a packet from a context event queue. The hook can be used to record the packet for later playback. The hook function must have attributes equivalent to WINAPI. The hook function must have the following form: Hook Function LRESULT WINAPI HookFunc(nCode, wParam, lParam); int nCode; WPARAM wParam; LPARAM lParam; HookFunc is a place holder for the library-supplied function name. The actual name must be exported by including it in an EXPORTS statement in the library's mod¬ule-definition file. Parameter Description nCode Specifies whether the hook function should process the mes¬sage or call the WTMgrPacketHookDefProc (if installed by WTMgrPacketHook)or WTMgrPacketHookNext (if installed by WTMgrPacketHookEx) function. If the nCode parame¬ter is less than zero, the hook function should pass the message to the appropriate function without further process¬ing. wParam Specifies the context handle whose event is being processed. lParam Points to the packet being processed by the hook function. Comments The WTH_RECORD function should save a copy of the packet for later play¬back. It should not modify the packet. Once it returns control to Wintab, the message con-tinues to be processed. The filter function does not require a return value. The packet pointed to by lParam will have the same structure as packets re¬trieved from the context normally. The WTH_RECORD hook will not be called to notify it of the display or re¬moval of system modal dialog boxes. It is expected that applications recording packets will also be recording window event messages using Windows' own hook functions. 5.8.3 WTMgrPacketUnhook Syntax BOOL WTMgrPacketUnhook(hHook) This function removes a hook function installed by the WTMgrPacketHookEx function. Parameter Type/Description hHook HWTHOOK Identifies the hook function to be removed. Return Value The function returns a non-zero value if successful, zero otherwise. See Also The WTMgrPacketHookEx function in section 5.8.2, and the WTMgrPack-etHookNext function in section 5.8.5. 5.8.4 WTMgrPacketHookDefProc (16-bit only) Syntax LRESULT WTMgrPacketHookDefProc(nCode, wParam, lParam, lplpFunc) This function calls the next function in a chain of packet hook functions. A packet hook function is a function that processes packets before they are re¬trieved from a context's queue. When applications define more than one hook function by using the WTMgrPacketHook function, Wintab places func¬tions of the same type in a chain. Parameter Type/Description nCode int Specifies a code used by the hook function to determine how to process the message. wParam WPARAM Specifies the word parameter of the message that the hook function is processing. lParam LPARAM Specifies the long parameter of the message that the hook function is processing. lplpFunc WTHOOKPROC FAR * Points to a memory location that con-tains the WTHOOKPROC returned by the WTMgrPacketHook function. Wintab changes the value at this location after an appli-cation unhooks the hook using the WTMgrPacketHook function. Return Value The return value specifies a value that is directly related to the nCode parameter. Comments This function is non-portable and is superseded by the WTMgrPacketHookNext function. See Also The WTMgrPacketHookNext function in section 5.8.5. 5.8.5 WTMgrPacketHookNext Syntax LRESULT WTMgrPacketHookNext(hHook, nCode, wParam, lParam) This function passes the hook information to the next hook function in the current hook chain. Parameter Type/Description hHook HWTHOOK Identifies the current hook. nCode int Specifies the hook code passed to the current hook function. wParam WPARAM Specifies the wParam value
非技术区
23,409
社区成员
70,517
社区内容
发帖
与我相关
我的任务
非技术区
Java 非技术区
复制链接
扫一扫
分享
社区描述
Java 非技术区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章