Summary of the invention
The invention mainly solves the technical problem of providing one kind to realize printing stamping general utility functions based on the new platform of drivingMethod, in the driving of the new Platform Designing module, only for the printing function of each project, only need to patrolling according to applicationVolume, the character string parsing into ginseng is completed inside driving layer, the logic of modules is called, so that it may complete the printing stamping of this projectFunction, exploitation amount is small, improves development efficiency.Drive inner function module degree high, each functions of modules solidification, processing is surelyIt is fixed, and each function is realized according to the characteristic of bottom hardware itself, processing is comprehensively, independence is strong, abnormality processing mode is clevererIt is living reasonable, meet the various cases of client traffic logical process.
In order to solve the above technical problems, one technical scheme adopted by the invention is that: it provides a kind of based on the new platform of drivingThe method for realizing printing stamping general utility functions, the order issued according to different driving caller and parameter carry out printing stamping, firstFirst it will be converted into the internal general parameter of driving using the order and parameter that issue, flexibly to call in each driving convenient for application interfacePortion's function simultaneously reduces the coupling between each functional module, according to printing stamping module hardware attribute, by printing stamping logic flowJourney is probably split are as follows: internal common variable function of initializing module, print module, module of affixing one's seal, judgement printing (affixing one's seal) terminateModule, these modules are called according to the logic function demand combinations of command in combination and repeatedly realizes that bulk print is affixed one's seal function;If applied business does not need module of affixing one's seal, inside can be driven to never call function of affixing one's seal according to the adjustment of configuration;
Further, the process for driving internal general parameter processing is converted into using the order and parameter that issue include the following:
A, it first determines whether to apply into whether ginseng is empty, directly return failure if sky;If not empty, judge that input parameter is longDegree whether≤0? if≤0 returns to failure;
B, effective into ginseng using issuing, internal general parameter variable is emptied, and to all initialization of variable assignment, parsing is answeredPrinter driver is arrived according to the driving naming method assignment of definition according to the information of specific field with each field issuedIn structural body variable, according to the information of specific field, assignment is into structural body variable, every other field all assignment to structural bodyIn corresponding variable;
C, each field processing mode of structural body is as follows: the field being resolved to before specific field, is worth after assignment and no longer changes;The corresponding variable of all arrays is unified assignment after obtaining corresponding data by the field being resolved to after specific field;
D, the processing of mimeograph documents field are as follows: specific field is often resolved to, just by the file information assignment to structural body variableIn, and be pressed into internal general aray variable, it may know that by the length of array using the quantity of documents to be printed, andThe storage sequence of file is the page order of file in variable data array, is arranged and prints fully according to application transmitting sequence;
E, all Parameter analysis of electrochemical are completed and are stored in the internal general array of driving, start to execute printing function, and according toThe printing stamping information stored in array completes the printing of file.
The beneficial effects of the present invention are: driving of the present invention in the new Platform Designing module, only to the printing of each projectFor function, only the logic tune that the character string parsing into ginseng, modules are completed inside layer need to be driven according to the logic of applicationWith, so that it may the printing stamping function of this project is completed, exploitation amount is small, improves development efficiency.Drive inner function module journeyDegree is high, and each functions of modules solidification, processing is stablized, and realizes each function according to the characteristic of bottom hardware itself, and processing is comprehensively, solelyVertical property is strong, abnormality processing mode is more flexible rationally, meets the various cases of client traffic logical process.
Specific embodiment
The preferred embodiments of the present invention will be described in detail with reference to the accompanying drawing, so that advantages and features of the invention energyIt is easier to be readily appreciated by one skilled in the art, so as to make a clearer definition of the protection scope of the present invention.
Fig. 1 and Fig. 2 are please referred to, the embodiment of the present invention includes:
A method of based on driving new platform to realize printing stamping general utility functions, drive layer by way of configurable,Adapt to projects the switching of function and do not realize whether use function of affixing one's seal between upper layer caller;Definition driving is internal multipleThe independent module of simple function is met at the different service logic of upper layer caller by the logical combination of simple function moduleReason;Definition drives internal general data storage organization body, meets the stability of driving built-in function and logical process;In exceptionReason aspect, by another thread monitor printer modes, completes recovery and the immediate updating of printer modes.
In the present invention, a set of driver of new platform can meet the calling of different upper layer applications.If Fig. 1 is new flatPlatform drives printing stamping general utility functions architecture design figure, for application calling interface and the difference for issuing parameter, realizes hardware phaseSame printing stamping function.It is as follows using the order and parameter declaration that issue: CmdRawData1~N and ControlMediaA~B is that different application is to realize that bulk print is affixed one's seal the same class command in combination issued respectively, and Param1~N and ParamA~B areUsing the parameter for the different printing stamping functions of issuing respectively;In some projects, according to the definition of upper layer application oneself, only makeWith CmdRawData1~N and Param1~N, the ControlMediaA~B and ParamA~B of dotted line frame are not used.
Firstly the need of the order issued and parameter will be applied to be converted into the internal general parameter of driving, for convenient for application interface spiritIt is living to call each driving built-in function and reduce the coupling between each functional module, it, will according to printing stamping module hardware attributePrinting stamping logic flow is probably split are as follows: internal common variable function of initializing module, print module, module of affixing one's seal, judgementPrint (affixing one's seal) ending module, these modules according to CmdRawDataN and ControlMediaN logic function demand combinations andIt repeatedly calls and realizes that bulk print is affixed one's seal function.If applied business does not need module of affixing one's seal, can be driven according to the adjustment of configurationNever call the function of affixing one's seal of dotted line frame in inside.
By taking certain embodiment as an example, it is to drive internal general parameter flow processing figure if Fig. 2 is using Parameter Switch is issued, answersWith issuing parameter format are as follows:
" pagesource=A4;Copies=2;File [0]=
C:\pr_A4.html;File [1]=C: pr_1/3A4.html;Stamp=0;Duplex=2;Color=0;Direction=0;"
Flow chart for ease of understanding, the variable declaration used in figure are as follows:
Char*lpbData: the parameter that application issues;
Int nLen: the length of parameter lpbData;
PRINTINFO m_stPrintInfo: storage monofile print out task drives internal generic structures body;
Single file type information structural body is defined as follows:
Information structure of affixing one's seal is defined as follows:
Vector<PRINTINFO>m_vecInfo: the internal general number of storage batch (multiple files) print out task drivingGroup;
M_vecInfo.pushBack (): current type information structural body is pressed into array;
ClearRawData (): initializing variable is emptied;
PrintRawData (): printer realizes printing (affixing one's seal) function;
It is described below and parameter is issued by application, parsing is converted to the process for driving internal general parameter processing:
A, it first determines whether to apply into whether ginseng is empty, directly return failure if sky;If not empty, judge that input parameter is longDegree whether≤0? if≤0 returns to failure;
B, effective into ginseng using issuing, internal general parameter variable is emptied, and to all initialization of variable assignment, parsing is answeredWith each field issued, according to the information of field " pagesource=" and " direction=", by printer driver according toThe driving naming method assignment that we define is into structural body variable m_stPrintInfo.pchDriverName, according to fieldThe information of " copies=", into structural body variable m_stPrintInfo.nCopies, every other field all assignment arrive assignmentIn the corresponding variable of structural body.
C, every time application to print several files be it is unknown uncertain, issue parameter by application and learn, each taskIn addition to file is different, other it is all printing and information of affixing one's seal all be it is identical, each field processing mode of structural body is as follows:The field being resolved to before " file [" field is worth after assignment and no longer changes;The field being resolved to after " file [" field, is obtainingAfter corresponding data, the corresponding variable of all arrays is unified into assignment, ensures that issue task using primary in this way, it is all to beatPrint task can be consistent in addition to mimeograph documents, other printing stamping information.
D, the processing of mimeograph documents field are as follows: be often resolved to field " file [", just become the file information assignment to structural bodyIt measures in m_stPrintInfo.pchFiles, and is pressed into internal general array m_vecInfo variable, pass through m_vecInfoThe length of array may know that using the quantity of documents to be printed, and the storage sequence of file is beating for file in variable data arrayPrint sequence is arranged and is printed fully according to application transmitting sequence.
E, all Parameter analysis of electrochemical are completed and are stored in the internal general array of driving, start to execute printing functionPrintRawData (), and according to the printing of the printing stamping information completion file stored in array.
In terms of abnormality processing, because some exceptions are to need artificial participation to solve, and manually solving the time is often notIt is determining, so in the case where following hardware self character and applied business process, opens another thread and specially monitor and beatPrint machine state, after occurring extremely, driving layer deletes print out task, etc. equipment states be in when can restore state, execute recoveryPrinter printing function.
The present invention only need to be according to answering only for the printing function of each project in the driving of the new Platform Designing moduleLogic, the character string parsing into ginseng is completed in driving layer inside, the logic of modules is called, so that it may complete beating for this projectStamp cover Zhang Gongneng, exploitation amount is small, improves development efficiency.Drive inner function module degree high, each functions of modules solidification, placeReason is stablized, and realizes each function according to the characteristic of bottom hardware itself, processing is comprehensively, independence is strong, abnormality processing mode moreIt is flexibly reasonable to add, and meets the various cases of client traffic logical process.
The above description is only an embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hairEquivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skillsArt field, is included within the scope of the present invention.