Disclosure of Invention
The embodiment of the application provides a scanning gun output configuration method, a scanning gun output configuration system, electronic equipment and a storage medium, and at least solves the problem that the output mode of a scanning gun cannot be configured according to the requirements of a user in the existing scanning gun output method.
In a first aspect, an embodiment of the present application provides a scan gun output configuration method, including: acquiring device data, namely acquiring description parameters of a scanning gun, judging whether the scanning gun exists or not according to the description parameters, and acquiring pid, vid and descriptors of the scanning gun if the scanning gun exists; an output mode configuration step, wherein the pid, the vid and the descriptor form a system attribute value of the scanning gun, and an output mode is further given to the system attribute value so as to configure the output mode of the scanning gun; and a broadcast mode output step, wherein the output mode comprises a broadcast mode, a self-defined broadcast is defined, and when the last key event of the scanning gun is detected to be carriage return, the information scanned by the scanning gun is used as the parameter of the broadcast to be output along with the broadcast.
Preferably, the description parameter is description information of the target scanning gun device of the InputDevice type.
Preferably, the broadcasting mode outputting step further includes: defining a character string Buffer, storing the information codes of the scanning gun into the character string Buffer one by one when the key event of the scanning gun is detected, and outputting the information in the character string Buffer as the broadcast parameter along with the broadcast when the last key event of the scanning gun is detected as carriage return.
Preferably, the output mode further includes a keyboard form, and the keyboard form includes directly outputting the information in the character string Buffer in an interface display frame where a mouse is located.
In a second aspect, an embodiment of the present application provides a scan gun output configuration system, which is suitable for the scan gun output configuration method, and includes: the equipment data acquisition module is used for acquiring description parameters of a scanning gun, judging whether the scanning gun exists or not according to the description parameters, and if so, acquiring pid, vid and descriptors of the scanning gun; the output mode configuration module is used for forming a system attribute value of the scanning gun by the pid, the vid and the descriptor and further endowing an output mode to the system attribute value so as to configure the output mode of the scanning gun; and the broadcast mode output module is used for defining a self-defined broadcast, and outputting the information scanned by the scanning gun as the broadcast parameters along with the broadcast when the last key event of the scanning gun is detected as carriage return.
In some of these embodiments, the description parameter is target scan gun device description information of the InputDevice type.
In some embodiments, the broadcast mode output module further includes: defining a character string Buffer, storing the information codes of the scanning gun into the character string Buffer one by one when the key event of the scanning gun is detected, and outputting the information in the character string Buffer as the broadcast parameter along with the broadcast when the last key event of the scanning gun is detected as carriage return.
In some embodiments, the output mode further includes a keyboard form, and the keyboard form includes that the information in the character string Buffer is directly output in an interface display frame where a mouse is located.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor, when executing the computer program, implements a scan gun output configuration method as described in the first aspect.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements a scan gun output configuration method as described in the first aspect above.
Compared with the prior art, the output configuration method of the scanning gun provided by the embodiment of the application can configure the output mode of the scanning gun according to the user requirement, has flexibility and convenience, greatly reduces the manpower and time cost when the output mode of the scanning gun is customized and required by a large number of users, and improves the user experience.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments provided in the present application without any inventive step are within the scope of protection of the present application.
It is obvious that the drawings in the following description are only examples or embodiments of the present application, and that it is also possible for a person skilled in the art to apply the present application to other similar contexts on the basis of these drawings without inventive effort. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of ordinary skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments without conflict.
Unless defined otherwise, technical or scientific terms referred to herein shall have the ordinary meaning as understood by those of ordinary skill in the art to which this application belongs. Reference to "a," "an," "the," and similar words throughout this application are not to be construed as limiting in number, and may refer to the singular or the plural. The present application is directed to the use of the terms "including," "comprising," "having," and any variations thereof, which are intended to cover non-exclusive inclusions; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or elements, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Embodiments of the invention are described in detail below with reference to the accompanying drawings:
fig. 1 is a flowchart of a scan gun output configuration method of the present invention, and referring to fig. 1, the scan gun output configuration method of the present invention includes the following steps:
s1: obtaining description parameters of a scanning gun, judging whether the scanning gun exists or not according to the description parameters, and if so, obtaining pid, vid and descriptors of the scanning gun. Optionally, the description parameter is target scanning gun device description information of an InputDevice type.
In a specific implementation, the embodiments of the present application are implemented in the form of an interface. Configuring an interface of an output mode, and needing to transmit two parameters, wherein the parameter I is description information of target scanning gun equipment of an Inputdevice type; the second parameter is an output mode, and in specific implementation, the output mode parameter is an int type, which includes: 1, broadcasting; broadcast and keyboard; 3: a keyboard.
In specific implementation, whether the scanning gun exists or not is judged firstly through the parameters, if not, the scanning gun is not detected through a return value prompt, and if so, the pid and vid corresponding to the scanning gun and the description of the scanning gun are obtained. In the specific implementation, the description herein refers to a descriptor of a scan gun, and if pids and vids of scan guns of the same manufacturer and the same model are the same, but the descriptors are different, so in order to identify the differential scan, descriptor information of the scan gun is obtained on the basis of obtaining the pids and vids of the scan gun.
S2: composing the pid, the vid and the descriptor into a system attribute value of the scanning gun, and further assigning an output mode to the system attribute value to configure the output mode of the scanning gun
In the specific implementation, the information is used for forming a system attribute value representing the scanning gun in a 'connected mode', and then a parameter two value is assigned to the attribute value so as to configure the output mode of the scanning gun. The first few bits of the truncated descriptor information are used to form together with pid, vid the system attribute values referred to later. I.e., a system attribute value representing the scan gun is "pid of the scan gun". multidigit of the descriptor of the scan gun ".
In specific implementation, after configuration, when a user uses the scanning gun to scan a code, the user will check the value of the attribute value corresponding to the scanning gun, and output the value according to the corresponding output mode.
S3: the output mode comprises a broadcast mode, a self-defined broadcast is defined, and when the last key event of the scanning gun is detected to be carriage return, the information scanned by the scanning gun is used as the parameter of the broadcast to be output along with the broadcast.
Optionally, a character string Buffer is defined, when a key event of the scanning gun is detected, the information codes of the scanning gun are stored into the character string Buffer one by one, and when a last key event of the scanning gun is detected as a carriage return, the information in the character string Buffer is used as the broadcast parameter to be output along with the broadcast.
In the specific implementation, a character string Buffer is defined, and when a gun key scanning event is detected, the gun scanning information codes are stored into the character string Buffer one by one.
In a specific implementation, in the form of a broadcast: and defining a self-defined broadcast, and outputting the information in the character string Buffer as the broadcast parameters along with the broadcast when the last key event of the scanning gun is detected as carriage return. In a specific implementation, the scanning gun scanning information is a string of character strings, the string of character strings is obtained by one character and is transmitted into the Buffer, and when the last character of the string of information is obtained, a carriage return character exists, so that when the carriage return character is obtained, it is indicated that the scanning gun information is completely obtained, and at the moment, the information in the Buffer is sent in a broadcast mode, so that the scanning gun scanning information is sent in a broadcast mode.
Optionally, the output mode further includes a keyboard form, and the keyboard form includes directly outputting the information in the character string Buffer in an interface display frame where a mouse is located.
In a specific implementation, in the form of a keyboard: and directly outputting the information in the character string Buffer in an interface display frame where the mouse is positioned.
In a specific implementation, to implement the above technical solution, an interface for configuring an output mode is provided, and the interface may be a system attribute value or a method. The user interface menu for configuring the output mode by the user is further realized, the user can configure the output mode in the application menu, and the user can select three output modes: keyboard, broadcast, keyboard, and broadcast. The writing logic transmits the user configuration information to the interface, and when the scanning gun scans codes, the output mode of the scanning gun is judged through the interface, so that the scanning gun is output in the user configuration mode.
It should be noted that the steps illustrated in the above-described flow diagrams or in the flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order different than here.
The embodiment of the application provides a scanning gun output configuration system, which is suitable for the scanning gun output configuration method. As used below, the terms "unit," "module," and the like may implement a combination of software and/or hardware of predetermined functions. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware or a combination of software and hardware is also possible and contemplated.
FIG. 2 is a block diagram of a scan gun output configuration system according to the present invention, referring to FIG. 2, including:
the device data acquisition module 1: obtaining description parameters of a scanning gun, judging whether the scanning gun exists or not according to the description parameters, and if so, obtaining pid, vid and descriptors of the scanning gun. Optionally, the description parameter is target scanning gun device description information of an InputDevice type.
In a specific implementation, the embodiments of the present application are implemented in the form of an interface. Configuring an interface of an output mode, and needing to transmit two parameters, wherein the parameter I is description information of target scanning gun equipment of an Inputdevice type; the second parameter is an output mode, and in specific implementation, the output mode parameter is an int type, which includes: 1, broadcasting; broadcast and keyboard; 3: a keyboard.
In specific implementation, whether the scanning gun exists or not is judged firstly through the parameters, if not, the scanning gun is not detected through a return value prompt, and if so, the pid and vid corresponding to the scanning gun and the description of the scanning gun are obtained. In the specific implementation, the description herein refers to a descriptor of a scan gun, and if pids and vids of scan guns of the same manufacturer and the same model are the same, but the descriptors are different, so in order to identify the differential scan, descriptor information of the scan gun is obtained on the basis of obtaining the pids and vids of the scan gun.
Output mode configuration module 2: composing the pid, the vid and the descriptor into a system attribute value of the scanning gun, and further assigning an output mode to the system attribute value to configure the output mode of the scanning gun
In the specific implementation, the information is used for forming a system attribute value representing the scanning gun in a 'connected mode', and then a parameter two value is assigned to the attribute value so as to configure the output mode of the scanning gun. The first few bits of the truncated descriptor information are used to form together with pid, vid the system attribute values referred to later. I.e., a system attribute value representing the scan gun is "pid of the scan gun". multidigit of the descriptor of the scan gun ".
In specific implementation, after configuration, when a user uses the scanning gun to scan a code, the user will check the value of the attribute value corresponding to the scanning gun, and output the value according to the corresponding output mode.
Broadcast mode output module 3: the output mode comprises a broadcast mode, a self-defined broadcast is defined, and when the last key event of the scanning gun is detected to be carriage return, the information scanned by the scanning gun is used as the parameter of the broadcast to be output along with the broadcast.
Optionally, a character string Buffer is defined, when a key event of the scanning gun is detected, the information codes of the scanning gun are stored into the character string Buffer one by one, and when a last key event of the scanning gun is detected as a carriage return, the information in the character string Buffer is used as the broadcast parameter to be output along with the broadcast.
In the specific implementation, a character string Buffer is defined, and when a gun key scanning event is detected, the gun scanning information codes are stored into the character string Buffer one by one.
In a specific implementation, in the form of a broadcast: and defining a self-defined broadcast, and outputting the information in the character string Buffer as the broadcast parameters along with the broadcast when the last key event of the scanning gun is detected as carriage return. In a specific implementation, the scanning gun scanning information is a string of character strings, the string of character strings is obtained by one character and is transmitted into the Buffer, and when the last character of the string of information is obtained, a carriage return character exists, so that when the carriage return character is obtained, it is indicated that the scanning gun information is completely obtained, and at the moment, the information in the Buffer is sent in a broadcast mode, so that the scanning gun scanning information is sent in a broadcast mode.
Optionally, the output mode further includes a keyboard form, and the keyboard form includes directly outputting the information in the character string Buffer in an interface display frame where a mouse is located.
In a specific implementation, in the form of a keyboard: and directly outputting the information in the character string Buffer in an interface display frame where the mouse is positioned.
In a specific implementation, to implement the above technical solution, an interface for configuring an output mode is provided, and the interface may be a system attribute value or a method. The user interface menu for configuring the output mode by the user is further realized, the user can configure the output mode in the application menu, and the user can select three output modes: keyboard, broadcast, keyboard, and broadcast. The writing logic transmits the user configuration information to the interface, and when the scanning gun scans codes, the output mode of the scanning gun is judged through the interface, so that the scanning gun is output in the user configuration mode.
Additionally, one scan gun output configuration method described in connection with FIG. 1 may be implemented by an electronic device. Fig. 3 is a block diagram of an electronic device of the present invention.
The electronic device may comprise aprocessor 61 and amemory 62 in which computer program instructions are stored.
Specifically, theprocessor 61 may include a Central Processing Unit (CPU), or A Specific Integrated Circuit (ASIC), or may be configured to implement one or more Integrated circuits of the embodiments of the present Application.
Memory 62 may include, among other things, mass storage for data or instructions. By way of example, and not limitation,memory 62 may include a Hard Disk Drive (Hard Disk Drive, abbreviated HDD), a floppy Disk Drive, a Solid State Drive (SSD), flash memory, an optical Disk, a magneto-optical Disk, tape, or a Universal Serial Bus (USB) Drive or a combination of two or more of these.Memory 62 may include removable or non-removable (or fixed) media, where appropriate. Thememory 62 may be internal or external to the data processing apparatus, where appropriate. In a particular embodiment, thememory 62 is a Non-Volatile (Non-Volatile) memory. In particular embodiments,Memory 62 includes Read-Only Memory (ROM) and Random Access Memory (RAM). The ROM may be mask-programmed ROM, Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), Electrically rewritable ROM (EAROM), or FLASH Memory (FLASH), or a combination of two or more of these, where appropriate. The RAM may be a Static Random-Access Memory (SRAM) or a Dynamic Random-Access Memory (DRAM), where the DRAM may be a Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), an Extended data output Dynamic Random-Access Memory (EDODRAM), a Synchronous Dynamic Random-Access Memory (SDRAM), and the like.
Thememory 62 may be used to store or cache various data files that need to be processed and/or used for communication, as well as possible computer program instructions executed by theprocessor 61.
Theprocessor 61 implements any of the scan gun output configuration methods described in the above embodiments by reading and executing computer program instructions stored in thememory 62.
In some of these embodiments, the electronic device may also include acommunication interface 63 and abus 60. As shown in fig. 3, theprocessor 61, thememory 62, and thecommunication interface 63 are connected via abus 60 to complete communication therebetween.
Thecommunication port 63 may be implemented with other components such as: the data communication is carried out among external equipment, image/data acquisition equipment, a database, external storage, an image/data processing workstation and the like.
Thebus 60 includes hardware, software, or both to couple the components of the electronic device to one another.Bus 60 includes, but is not limited to, at least one of the following: data Bus (Data Bus), Address Bus (Address Bus), Control Bus (Control Bus), Expansion Bus (Expansion Bus), and Local Bus (Local Bus). By way of example, and not limitation,Bus 60 may include an Accelerated Graphics Port (AGP) or other Graphics Bus, an Enhanced Industry Standard Architecture (EISA) Bus, a Front-Side Bus (FSB), a Hyper Transport (HT) Interconnect, an ISA (ISA) Bus, an InfiniBand (InfiniBand) Interconnect, a Low Pin Count (LPC) Bus, a memory Bus, a microchannel Architecture (MCA) Bus, a PCI (Peripheral Component Interconnect) Bus, a PCI-Express (PCI-X) Bus, a Serial Advanced Technology Attachment (SATA) Bus, a Video Electronics Bus (audio Electronics Association), abbreviated VLB) bus or other suitable bus or a combination of two or more of these.Bus 60 may include one or more buses, where appropriate. Although specific buses are described and shown in the embodiments of the application, any suitable buses or interconnects are contemplated by the application.
The electronic device can execute a scan gun output configuration method in the embodiment of the application.
In addition, in combination with the scan gun output configuration method in the foregoing embodiments, the embodiments of the present application may provide a computer-readable storage medium to implement. The computer readable storage medium having stored thereon computer program instructions; the computer program instructions, when executed by a processor, implement any of the scan gun output configuration methods in the above embodiments.
And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.