Disclosure of Invention
The application aims to provide a control method of scanning equipment, which can solve the problem of the clamping of a scanning control interface and the problem of the blockage of instructions of the scanning equipment and improves the experience of users.
In a first aspect, the present application provides a method for controlling a scanning apparatus, the method comprising:
creating an independent working thread, enabling the independent working thread to enter a loop calling process, and executing the following steps in each loop:
Acquiring state attributes of all the controls in the scanning control interface, determining a target control in a selected state based on the state attributes, determining working parameters of the scanning equipment according to the attributes of the target control, generating a control instruction based on the working parameters of the scanning equipment, and outputting the control instruction to the scanning equipment, wherein the state attributes are selected or unselected.
Further, the method further comprises:
And responding to response information returned by the scanning equipment, and executing the next cycle after a preset time threshold, wherein the response information is generated by the scanning equipment based on the control instruction.
Further, determining the target control in the selected state based on each state attribute includes:
Acquiring the attribute of the target control;
If the attribute of the target control is a first attribute value, determining that the target control is a low-precision scanning mode control;
And if the attribute of the target control is a second attribute value, determining that the target control is a high-precision scanning mode control.
Further, determining the working parameters of the scanning device according to the target control comprises:
Determining that the scanning mode of the scanning device is a low-precision scanning mode in response to the target control being a low-precision scanning mode control;
determining a corresponding first brightness control based on the low-precision scanning mode control, and acquiring a first brightness value corresponding to a triggering position of the first brightness control;
and determining the working parameters of the imaging module of the scanning equipment based on the low-precision scanning mode and the first brightness value, wherein the working parameters are at least one of exposure time, hardware analog gain and hardware digital gain of the speckle laser.
Further, determining the working parameters of the scanning device according to the target control comprises:
Responding to the target control as a high-precision scanning mode control, and determining that the scanning mode of the scanning equipment is a high-precision scanning mode;
Determining a corresponding second brightness control based on the high-precision scanning mode control, and acquiring a second brightness value corresponding to a triggering position of the second brightness control;
and determining the working parameters of the imaging module of the scanning equipment based on the high-precision scanning mode and the second brightness value, wherein the working parameters are at least one of exposure time, hardware analog gain and hardware digital gain.
Further, determining the working parameters of the scanning device according to the target control comprises:
Determining a first sub-control in a selected state in all sub-controls under the high-precision scanning mode control in response to the target control being the high-precision scanning mode control;
if the attribute of the first sub-control is a third attribute value, determining that the scanning mode corresponding to the first sub-control is a small-area speckle sub-mode;
Acquiring a second brightness value corresponding to a triggering position of a second brightness control;
And determining the working parameters of the imaging module of the scanning device based on the small-amplitude speckle sub-mode and the second brightness value, wherein the working parameters are at least one of exposure time, hardware analog gain and hardware digital gain of the speckle laser.
Further, determining the working parameters of the scanning device according to the target control comprises:
Determining a second sub-control in a selected state in each sub-control in the high-precision scanning mode control in response to the target control being the high-precision scanning mode control;
if the attribute of the second sub-control is a fourth attribute value, determining that the scanning mode corresponding to the second sub-control is an infrared-like laser sub-mode;
Acquiring a second brightness value corresponding to a triggering position of a second brightness control;
And determining the working parameters of the imaging module of the scanning device based on the infrared-like laser sub-mode and the second brightness value, wherein the working parameters are at least one of exposure time of the speckle laser, exposure time of the infrared-like laser, hardware analog gain and hardware digital gain.
Further, determining the working parameters of the scanning device according to the target control comprises:
Determining a third sub-control in a selected state in all sub-controls under the high-precision scanning mode control in response to the target control being the high-precision scanning mode control;
If the attribute of the third sub-control is a fifth attribute value, determining that the scanning mode corresponding to the third sub-control is a blue linear laser sub-mode;
Acquiring a second brightness value corresponding to a triggering position of a second brightness control;
And determining the working parameters of the imaging module of the scanning device based on the blue linear laser sub-mode and the second brightness value, wherein the working parameters are at least one of exposure time of the speckle laser, exposure time of the blue linear laser, hardware analog gain and hardware digital gain.
Further, creating an independent working thread, and enabling the independent working thread to enter a cyclic calling process, including:
in the independent working thread, a while loop task is constructed so that the independent working thread enters a loop calling process.
In a second aspect, the present application provides a control apparatus for a scanning device, the apparatus comprising:
The thread module is used for creating an independent working thread and enabling the independent working thread to enter a cyclic calling process;
The circulation execution module is used for acquiring the state attribute of each control in the scanning control interface, determining a target control in a selected state based on each state attribute, determining the working parameters of the scanning equipment according to the attribute of the target control, generating a control instruction based on the working parameters of the scanning equipment, and outputting the control instruction to the scanning equipment, wherein the state attribute is a selected state or an unselected state.
In a third aspect, the application provides a computer device comprising a memory in which a computer program is stored and a processor arranged to run the computer program to perform the steps of the method of controlling a scanning device as described above.
In a third aspect, the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of controlling a scanning device as described above.
According to the application, the independent working thread is created, the circulating task is executed in the independent working thread, the state attribute of each control of the scanning control interface is subjected to polling processing, the target control in the selected state is determined according to the state attribute of each control, the working parameters of the scanning equipment are determined according to the attribute of the target control, so that the control instruction is generated and output to the scanning equipment, the problem of the blocking of the scanning control interface and the problem of the instruction blocking of the scanning equipment can be solved, the operation efficiency of the terminal equipment is improved, the scanning efficiency of the scanning equipment is improved, and the user experience is further improved.
Detailed Description
The present application will be described in detail below with reference to the specific embodiments shown in the drawings, but these embodiments are not limited to the present application, and structural, method, or functional modifications made by those skilled in the art based on these embodiments are included in the scope of the present application.
QT is a cross-platform graphical user interface application development framework that can be used to develop both GUI programs and non-GUI programs, such as console tools and servers. QT is an object-oriented framework that uses special code generation extensions (called meta-object compilers (Meta Object Compiler, moc)) and some macros, which are easy to extend, allowing components to program. The signal and slot mechanism is the core mechanism of QT, applied to communication between objects. In QT, control reading of the user interface is accomplished by binding an event callback function to the control itself, for example, when the user interacts with the interface (e.g., clicks on a box or moves a slider), the box control (QRadioButton) or slider control (QSlider) will emit corresponding cliked signals, binding these signals to specific slots (slots) functions by connection (connect), i.e., binding the cliked signal of the box to a custom member function, or binding the valueChanged signal of the slider to a custom member function. When a radio box is clicked or the value of the slider bar changes, a corresponding slot function is invoked. The event callback mechanism enables the GUI application to run in an event-driven manner, but when the user frequently manipulates controls in the graphical interface, such as by dragging the slider continuously by a mouse to change the value of the slider, the valueChanged signal causing QSlider will be issued tens of times per second, which will result in tens of commands to the scanning device to modify the device parameters, which will be less than the time to process frequent instructions due to the limited processing speed of the scanning device, e.g., 400ms or more required to modify and calculate certain device parameters. The instructions to process these controls are typically in the main thread of the UI process, and thus this situation can cause significant jamming of the user interface, as well as blocking of instructions by the scanning device. Therefore, the application provides a control method of scanning equipment, which comprises the steps of creating an independent working thread, enabling the independent working thread to have a cyclic calling function, acquiring state attributes of all controls in a scanning control interface, determining a target control in a selected state based on the state attributes, determining working parameters of the scanning equipment according to the target control, generating a control instruction based on the working parameters of the scanning equipment, and outputting the control instruction to the scanning equipment, so that the technical problem of the occurrence of clamping of a user interface can be solved.
Fig. 1 is an application scenario diagram of a control method of a scanning apparatus according to an embodiment of the present application. As shown in fig. 1, a terminal device 101 is communicatively connected to a scanning device 102. The terminal equipment 101 creates an independent working thread, the independent working thread enters a loop calling process and is executed in each loop, the state attribute of each control in a scanning control interface in the terminal equipment 101 is acquired, a target control in a selected state is determined based on each state attribute, the working parameters of the scanning equipment 102 are determined according to the attribute of the target control, a control instruction is generated based on the working parameters of the scanning equipment 102, and the control instruction is output to the scanning equipment 102 so that the scanning equipment 102 can execute subsequent operations.
The scanning device 102 may be any optical scanning device for three-dimensional scanning. Such as a hand-held three-dimensional scanner or a tracking three-dimensional scanner. The terminal device 101 is any device having arithmetic capability and communication capability, and has a display interface. The terminal device 101 executes various functions and data processing by running a stored computer program. The communication connection between the terminal device 101 and the scanning device 102 may be wireless communication or wired communication.
The terminal device 101 includes, but is not limited to, a mobile terminal including, but not limited to, a smart phone, a tablet computer, a notebook computer, etc., and a fixed terminal including, but not limited to, a desktop computer, etc. The terminal device 101 may be a server, which may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms, but is not limited thereto.
It should be noted that fig. 1 is only a schematic diagram of an application scenario diagram provided by the embodiment of the present application, and the architecture and application scenario of the system described in the embodiment of the present application are for more clearly describing the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided by the embodiment of the present application. As can be known to those skilled in the art, with the evolution of the system architecture and the appearance of new application scenarios, the technical solution provided by the embodiment of the present application is also applicable to similar technical problems.
Referring to fig. 2, an embodiment of the present application provides a method for controlling a scanning device, including step S201.
S201, creating an independent working thread, enabling the independent working thread to enter a loop calling process, and executing the steps in each loop, wherein the state attribute of each control in a scanning control interface is obtained, a target control in a selected state is determined based on each state attribute, the working parameters of the scanning equipment are determined according to the attribute of the target control, a control instruction is generated based on the working parameters of the scanning equipment, and the control instruction is output to the scanning equipment, wherein the state attribute is a selected state or an unselected state.
In this embodiment, by creating an independent work thread, the independent work thread is independent of the UI main thread of the application main program. The independent working thread has a loop calling function, and each loop calling operation is executed through the loop function of the independent working thread.
Illustratively, in an independent worker thread, a while loop task is built to bring the independent worker thread into a loop call process. The task steps executed by each loop are realized through a while loop task.
Illustratively, the user is enabled to control the scanning device by operation of three-dimensional scanning software deployed at the terminal device. The three-dimensional scanning software displays a scanning control interface on the terminal equipment, so that a user can interact on the scanning control interface, and the interaction mode can be used for executing operations such as clicking a control on the interface, checking a check box and the like on the scanning control interface by the user so as to trigger the change of the state attribute of the control and detect the change by the terminal equipment. Illustratively, the controls in the scan control interface may include list controls, button controls, dialog controls, picture box controls, check box controls, text box controls, and prompt box controls.
In each cycle, the state attribute of each control in the scanning control interface is read, whether the control is selected or not is determined according to the read state attribute, if the state attribute is the selected state, the control is determined to be a target control in the selected state if the control is operated to be selected by a user, and if the state attribute is the unselected state, the control is indicated to be not operated to be selected by the user. Based on the selected target control, acquiring the attribute of the target control, determining the working parameter of the scanning equipment according to the attribute of the target control, generating a control instruction based on the working parameter of the scanning equipment, and outputting the control instruction to the scanning equipment, thereby realizing the control of the scanning equipment.
In one embodiment, QCheckBox the check box control is a commonly used control in the Qt framework that can perform the check/uncheck function, it can be determined whether the check box control is checked by ISCHECKED () function, when the function returns true, indicating that the check box control is checked, and when the function returns false, indicating that the check box control is unchecked.
For example, in the loop call in the independent working thread, a preset duration period may be used for the loop call, where the preset duration period may be reasonably set according to actual service experience. The specific preset duration period can be determined according to actual requirements, and is not limited in any way.
In this embodiment, by creating an independent working thread, executing a loop task in the independent working thread, performing polling processing on the state attribute of each control of the scanning control interface, obtaining the state attribute of each control, further determining a target control in a selected state, determining the working parameter of the scanning device according to the attribute of the target control, and generating and outputting a control instruction to the scanning device, the problem of the clamping of the scanning control interface and the problem of the instruction blocking of the scanning device can be solved, the operation efficiency of the terminal device is improved, the scanning efficiency of the scanning device is improved, and further the user experience is improved.
In one embodiment, as shown in FIG. 3, the method further comprises steps S301-S302.
S301, creating an independent working thread, enabling the independent working thread to enter a loop calling process, and executing the steps in each loop, wherein the state attribute of each control in a scanning control interface is obtained, a target control in a selected state is determined based on each state attribute, the working parameters of the scanning equipment are determined according to the attribute of the target control, a control instruction is generated based on the working parameters of the scanning equipment, and the control instruction is output to the scanning equipment, wherein the state attribute is a selected state or an unselected state;
S302, responding to response information returned by the scanning equipment, and executing the next cycle after a preset time threshold, wherein the response information is generated by the scanning equipment based on the control instruction.
The scanning device receives a control instruction sent by the terminal device, generates response information based on the control instruction, and sends the response information to the terminal device. And the terminal equipment receives the response information and continues to execute the next circulation operation after a preset time threshold. Illustratively, the time threshold may be set to 200ms. The time threshold may be set according to the actual situation.
In this embodiment, after a cycle, a control instruction is sent to the scanning device, and after a certain time delay is passed after response information of the scanning device is received, the next cycle is continuously executed, so that the scanning device does not receive a large number of control instructions, and the instruction is blocked, so that the instruction processing time of the scanning device is further ensured, and the user experience is further improved.
In one embodiment, as shown in FIG. 4, the step of determining the target control in the selected state based on the various state attributes includes S401-S403.
S401, acquiring the attribute of a target control;
S402, if the attribute of the target control is a first attribute value, determining that the target control is a low-precision scanning mode control;
s403, if the attribute of the target control is the second attribute value, determining that the target control is a high-precision scanning mode control.
In this embodiment, the control in the selected state is determined to be the target control, the attribute of the target control is obtained, and based on the attribute, which control the target control is can be determined. For example, the attribute may be a control name, based on which a corresponding control may be determined. And if the attribute of the target control is a first attribute value, determining that the target control is a low-precision scanning mode control, and if the attribute of the target control is a second attribute value, determining that the target control is a high-precision scanning mode control. By means of the attribute values of the target control, whether the target control is a low-precision scanning mode control or a high-precision scanning mode control can be determined.
In one embodiment, as shown in FIG. 5, the step of determining the operating parameters of the scanning device from the target control includes S501-S503.
S501, determining that a scanning mode of the scanning device is a low-precision scanning mode in response to the target control being the low-precision scanning mode control;
s502, determining a corresponding first brightness control based on the low-precision scanning mode control, and acquiring a first brightness value corresponding to a triggering position of the first brightness control;
s503, determining the working parameters of the imaging module of the scanning device based on the low-precision scanning mode and the first brightness value, wherein the working parameters are at least one of exposure time, hardware analog gain and hardware digital gain of the speckle laser.
When the target control is determined to be a low-precision scanning mode control, the scanning mode of the scanning equipment is determined to be a low-precision scanning mode, namely, the scanning mode selected by a user is the low-precision scanning mode, and a corresponding first brightness value is determined according to the triggering position of the first brightness control, so that the working parameters of the imaging module of the scanning equipment are further determined based on the low-precision scanning mode and the first brightness value.
For example, the difference of the scanning modes and the difference of the brightness values have different influences on the working parameters of the imaging module, for example, in the low-precision scanning mode, 0% -75% of the brightness values only affect the exposure time of each frame of the speckle laser, 75% -85% of the brightness values only affect the analog gain of hardware, and 85% -100% of the brightness values only affect the digital gain of hardware, so that the working parameters of the imaging module such as exposure time, analog gain, digital gain and the like can be determined according to the first brightness value and the low-precision scanning mode.
The first brightness control may be a slider control including a slider bar and a slider block movable on the slider bar. The triggering mode of the first brightness control comprises sliding triggering or clicking triggering. The trigger position may be the position information of the sliding end point corresponding to the sliding trigger, or the position information of the click point corresponding to the click trigger. The sliding trigger is that when the fact that the sliding exists in the area where the user acts on the first brightness control is detected, the fact that the first brightness control is triggered by sliding is determined, for example, the user drags the sliding slider of the first brightness control by using the hand is detected. And the click triggering is that when the user is detected to click on the position in the area where the first brightness control is located, the first brightness control is determined to be detected to be triggered by clicking. For example, the user clicks a slider of the first brightness control using the hand.
Illustratively, the mapping relationship between the trigger position of the brightness control and the brightness value is different in the low-precision scanning mode and the high-precision mode, i.e., the low-precision scanning mode corresponds to one brightness control, and the high-precision mode corresponds to one brightness control. Thus, when determining to be a low precision scan mode control, a corresponding brightness control, i.e., a first brightness control, needs to be determined.
Illustratively, the trigger position of the first brightness control has a mapping relationship with the brightness value. When the first brightness control is triggered, the brightness value which the user wants to adjust can be determined by acquiring the first brightness value corresponding to the triggering position of the first brightness control.
By way of example, the imaging module may include a camera, laser or light supplementing device, etc., hardware devices for imaging or assisting in imaging. The operating parameter may be one or a combination of parameters of exposure time of the speckle laser, hardware analog gain, hardware digital gain. After the imaging module is subjected to parameter adjustment based on the working parameters, a follow-up three-dimensional scanning function can be executed on the scanned object based on the adjusted working parameters.
In one embodiment, as shown in FIG. 6, the step of determining the operating parameters of the scanning device from the target control includes S601-S603.
S601, determining that a scanning mode of the scanning equipment is a high-precision scanning mode in response to the target control being the high-precision scanning mode control;
s602, determining a corresponding second brightness control based on the high-precision scanning mode control, and acquiring a second brightness value corresponding to a triggering position of the second brightness control;
S603, determining working parameters of an imaging module of the scanning device based on the high-precision scanning mode and the second brightness value, wherein the working parameters are at least one of exposure time, hardware analog gain and hardware digital gain.
When the target control is determined to be a high-precision scanning mode control, the scanning mode of the scanning equipment is determined to be a high-precision scanning mode, namely, the scanning mode selected by the user is the high-precision scanning mode, and the corresponding second brightness value is determined according to the triggering position of the second brightness control, so that the working parameters of the imaging module of the scanning equipment are further determined based on the high-precision scanning mode and the second brightness value.
The second brightness control may be a slider control including a slider bar and a slider block movable on the slider bar. The triggering mode of the second brightness control comprises sliding triggering or clicking triggering. The trigger position may be the position information of the sliding end point corresponding to the sliding trigger, or the position information of the click point corresponding to the click trigger.
As described above, the brightness control in the low-precision scanning mode and the brightness control in the high-precision mode are different, and thus when determining as the high-precision scanning mode control, it is necessary to determine the corresponding brightness control, that is, determine the second brightness control.
Illustratively, the trigger position of the second brightness control has a mapping relationship with the brightness value. When the second brightness control is triggered, the brightness value which the user wants to adjust can be determined by acquiring the second brightness value corresponding to the triggering position of the second brightness control.
The operating parameter may be one or a combination of parameters of exposure time, hardware analog gain, hardware digital gain. After the imaging module is subjected to parameter adjustment based on the working parameters, a follow-up three-dimensional scanning function can be executed on the scanned object based on the adjusted working parameters.
In one embodiment, three sub-modes are supported in the high precision scanning mode, namely a facet speckle sub-mode, an infrared-like laser mode, and a blue-line-like laser mode. As shown in fig. 7, the step of determining the operation parameters of the scanning device according to the target control includes S701 to S704.
S701, determining a first sub-control in a selected state in all sub-controls under the high-precision scanning mode control in response to the target control being the high-precision scanning mode control;
S702, if the attribute of the first sub-control is a third attribute value, determining that the scanning mode corresponding to the first sub-control is a small-area speckle sub-mode;
S703, acquiring a second brightness value corresponding to the triggering position of the second brightness control;
S704, based on the small-amplitude speckle sub-mode and the second brightness value, determining the working parameters of the imaging module of the scanning device, wherein the working parameters are at least one of exposure time, hardware analog gain and hardware digital gain of the speckle laser.
The high-precision scanning mode control comprises three sub-controls, wherein each sub-control corresponds to one sub-mode, and the brightness controls corresponding to the three sub-modes are the same control. When the target control is a high-precision scanning mode control, that is, the user selects a high-precision scanning mode, it is necessary to further determine which of the modes is the selected high-precision mode. The first sub-control in the selected state can be determined by acquiring the state attribute of each sub-control under the determined high-precision scanning mode control, and then the attribute value of the first sub-control can be determined. And if the attribute of the first sub-control is a third attribute value, determining that the scanning mode corresponding to the first sub-control is a small-area speckle sub-mode. And acquiring a second brightness value corresponding to the triggering position of the second brightness control, and determining the working parameters of the imaging module of the scanning equipment based on the small-area speckle sub-mode and the second brightness value.
Illustratively, in the small-scale speckle sub-mode, 0% -75% of the brightness value only affects the exposure time of each frame of the speckle laser, 75% -85% of the brightness value only affects the analog gain of the hardware, and 85% -100% of the brightness value only affects the digital gain of the hardware, so that the exposure time, the analog gain of the hardware, the digital gain of the hardware and other working parameters of the imaging module of the speckle laser can be determined according to the small-scale speckle sub-mode and the second brightness value.
In one embodiment, as shown in FIG. 8, the step of determining the operating parameters of the scanning device from the target control includes S801-S804.
S801, determining a second sub-control in a selected state in each sub-control under the high-precision scanning mode control in response to the target control being the high-precision scanning mode control;
S802, if the attribute of the second sub-control is a fourth attribute value, determining that the scanning mode corresponding to the second sub-control is an infrared-like laser sub-mode;
s803, obtaining a second brightness value corresponding to the triggering position of the second brightness control;
S804, based on the infrared-like laser sub-mode and the second brightness value, determining the working parameters of the imaging module of the scanning device, wherein the working parameters are at least one of exposure time of the speckle laser, exposure time of the infrared-like laser, hardware analog gain and hardware digital gain.
When the target control is a high-precision scanning mode control, that is, the user selects a high-precision scanning mode, it is necessary to further determine which of the modes is the selected high-precision mode. The second sub-control in the selected state can be determined by acquiring the state attribute of each sub-control in the high-precision scanning mode control, and then the attribute value of the second sub-control can be determined. And if the attribute of the first sub-control is a fourth attribute value, determining that the scanning mode corresponding to the second sub-control is an infrared-like laser sub-mode. And acquiring a second brightness value corresponding to the triggering position of the second brightness control, and determining the working parameters of the imaging module of the scanning equipment based on the infrared-shaped laser sub-mode and the second brightness value.
Illustratively, in the infrared laser sub-mode, 0% -60% of the brightness value only affects the exposure time of each frame of the infrared laser, 60% -75% of the brightness value only affects the exposure time of each frame of the speckle laser, 75% -85% of the brightness value only affects the analog gain of the hardware, and 85% -100% of the brightness value only affects the digital gain of the hardware, so that the exposure time of the speckle laser, the exposure time of the infrared laser, the analog gain of the hardware, the digital gain of the hardware, and other working parameters of the imaging module can be determined according to the infrared laser sub-mode and the second brightness value.
In one embodiment, as shown in FIG. 9, the step of determining the operating parameters of the scanning device from the target control includes S901-S904.
S901, determining a third sub-control in a selected state in all sub-controls under the high-precision scanning mode control in response to the target control being the high-precision scanning mode control;
s902, if the attribute of the third sub-control is a fifth attribute value, determining that the scanning mode corresponding to the second sub-control is a blue linear laser sub-mode;
s903, obtaining a second brightness value corresponding to the triggering position of the second brightness control;
S904, based on the blue linear laser sub-mode and the second brightness value, determining the working parameters of the imaging module of the scanning device, wherein the working parameters are at least one of exposure time of the speckle laser, exposure time of the blue linear laser, hardware analog gain and hardware digital gain.
When the target control is a high-precision scanning mode control, that is, the user selects a high-precision scanning mode, it is necessary to further determine which of the modes is the selected high-precision mode. By acquiring the state attribute of each sub-control under the high-precision scanning mode control, the third sub-control in the selected state can be determined, and then the attribute value of the third sub-control can be determined. And if the attribute of the third sub-control is a fifth attribute value, determining that the scanning mode corresponding to the third sub-control is a blue linear laser sub-mode. And acquiring a second brightness value corresponding to the triggering position of the second brightness control, and determining the working parameters of the imaging module of the scanning equipment based on the blue linear laser sub-mode and the second brightness value.
Illustratively, in the blue linear laser sub-mode, 0% -60% of the brightness value only affects the exposure time of each frame of the blue linear laser, 60% -75% of the brightness value only affects the exposure time of each frame of the speckle laser, 75% -85% of the brightness value only affects the analog gain of the hardware, and 85% -100% of the brightness value only affects the digital gain of the hardware, so that the exposure time of the speckle laser, the exposure time of the blue linear laser, the hardware analog gain, the hardware digital gain and other working parameters of the imaging module can be determined according to the blue linear laser sub-mode and the second brightness value.
Based on the same inventive concept, the embodiment of the application also provides a control device for realizing the above-mentioned related scanning equipment. The implementation scheme of the device for solving the problem is similar to that described in the above method, so the specific limitation in the embodiment of the control device for the scanning device provided below can be referred to the limitation of the control method for the scanning device hereinabove, and will not be repeated here.
As shown in fig. 10, the present application provides a control device of a scanning apparatus, the device comprising:
a thread module 1001, configured to create an independent working thread, and make the independent working thread enter a loop call process;
The loop execution module 1002 is configured to obtain a state attribute of each control in the scan control interface, determine a target control in a selected state based on each state attribute, determine an operating parameter of the scan device according to the attribute of the target control, generate a control instruction based on the operating parameter of the scan device, and output the control instruction to the scan device, where the state attribute is a selected state or an unselected state.
In this embodiment, the thread module 1001 performs polling processing on the state attribute of each control of the scan control interface by creating an independent working thread in which a loop task is executed, so as to obtain the state attribute of each control, further determine the target control in the selected state, and determine the working parameter of the scan device according to the attribute of the target control, so as to generate and output a control instruction to the scan device, thereby solving the problem of the blocking of the scan control interface and the problem of the blocking of the instruction of the scan device, improving the operation efficiency of the terminal device, improving the scanning efficiency of the scan device, and further improving the experience of the user.
Further, the loop execution module 1002 is specifically configured to:
And responding to response information returned by the scanning equipment, and executing the next cycle after a preset time threshold, wherein the response information is generated by the scanning equipment based on the control instruction.
Further, the loop execution module 1002 is specifically configured to:
Acquiring the attribute of the target control;
If the attribute of the target control is a first attribute value, determining that the target control is a low-precision scanning mode control;
And if the attribute of the target control is a second attribute value, determining that the target control is a high-precision scanning mode control.
Further, the loop execution module 1002 is specifically configured to:
Determining that the scanning mode of the scanning device is a low-precision scanning mode in response to the target control being a low-precision scanning mode control;
determining a corresponding first brightness control based on the low-precision scanning mode control, and acquiring a first brightness value corresponding to a triggering position of the first brightness control;
and determining the working parameters of the imaging module of the scanning equipment based on the low-precision scanning mode and the first brightness value, wherein the working parameters are at least one of exposure time, hardware analog gain and hardware digital gain of the speckle laser.
Further, the loop execution module 1002 is specifically configured to:
Responding to the target control as a high-precision scanning mode control, and determining that the scanning mode of the scanning equipment is a high-precision scanning mode;
Determining a corresponding second brightness control based on the high-precision scanning mode control, and acquiring a second brightness value corresponding to a triggering position of the second brightness control;
and determining the working parameters of the imaging module of the scanning equipment based on the high-precision scanning mode and the second brightness value, wherein the working parameters are at least one of exposure time, hardware analog gain and hardware digital gain.
Further, the loop execution module 1002 is specifically configured to:
Determining a first sub-control in a selected state in all sub-controls under the high-precision scanning mode control in response to the target control being the high-precision scanning mode control;
if the attribute of the first sub-control is a third attribute value, determining that the scanning mode corresponding to the first sub-control is a small-area speckle sub-mode;
Acquiring a second brightness value corresponding to a triggering position of a second brightness control;
And determining the working parameters of the imaging module of the scanning device based on the small-amplitude speckle sub-mode and the second brightness value, wherein the working parameters are at least one of exposure time, hardware analog gain and hardware digital gain of the speckle laser.
Further, the loop execution module 1002 is specifically configured to:
Determining a second sub-control in a selected state in each sub-control in the high-precision scanning mode control in response to the target control being the high-precision scanning mode control;
if the attribute of the second sub-control is a fourth attribute value, determining that the scanning mode corresponding to the second sub-control is an infrared-like laser sub-mode;
Acquiring a second brightness value corresponding to a triggering position of a second brightness control;
And determining the working parameters of the imaging module of the scanning device based on the infrared-like laser sub-mode and the second brightness value, wherein the working parameters are at least one of exposure time of the speckle laser, exposure time of the infrared-like laser, hardware analog gain and hardware digital gain.
Further, the loop execution module 1002 is specifically configured to:
Determining a third sub-control in a selected state in all sub-controls under the high-precision scanning mode control in response to the target control being the high-precision scanning mode control;
If the attribute of the third sub-control is a fifth attribute value, determining that the scanning mode corresponding to the third sub-control is a blue linear laser sub-mode;
Acquiring a second brightness value corresponding to a triggering position of a second brightness control;
And determining the working parameters of the imaging module of the scanning device based on the blue linear laser sub-mode and the second brightness value, wherein the working parameters are at least one of exposure time of the speckle laser, exposure time of the blue linear laser, hardware analog gain and hardware digital gain.
Further, the thread module 1001 is specifically configured to:
in the independent working thread, a while loop task is constructed so that the independent working thread enters a loop calling process.
The embodiment of the application also provides a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and when the computer program is executed by a processor, the steps of the control method of any one of the scanning devices are realized.
Fig. 11 is a schematic hardware structure of a computer device according to an embodiment of the present application. The computer device shown in fig. 11 includes a processor 1101, a communication interface 1102, a memory 1103 and a communication bus 1104, the processor 1101, the communication interface 1102 and the memory 1103 completing communication with each other through the communication bus 1104. The connection between the processor 1101, the communication interface 1102, and the memory 1103 shown in fig. 11 is merely exemplary, and in the implementation, the processor 1101, the communication interface 1102, and the memory 1103 may be communicatively connected to each other by other connection manners besides the communication bus 1104.
The memory 1103 may be used to store a computer program, which may include instructions and data to implement the steps of the method of controlling a scanning device, as any of the above. In an embodiment of the present application, the memory 1103 may be various types of storage media, such as random access memory (random access memory, RAM), read Only Memory (ROM), non-volatile RAM (NVRAM), programmable ROM (PROM), erasable PROM (erasable PROM, EPROM), electrically erasable PROM (ELECTRICALLY ERASABLE PROM, EEPROM), flash memory, optical memory, registers, and the like. The memory 1103 may include a hard disk and/or memory.
The processor 1101 may be a general-purpose processor, which may be a processor that performs certain steps and/or operations by reading and executing a computer program (e.g., a computer program) stored in a memory (e.g., the memory 1103), which may use data stored in the memory (e.g., the memory 1103) in performing the steps and/or operations, such as, but not limited to, a central processing unit (central processing unit, CPU) furthermore, the processor 1101 may also be a special purpose processor, which may be a specially designed processor for performing certain steps and/or operations, such as, but not limited to, an ASIC, FPGA, etc. furthermore, the processor 1101 may also be a combination of multiple processors, such as a multi-core processor.
Communication interface 1102 may include input/output (I/O) interfaces, physical and logical interfaces, and the like, for implementing device interconnections within a network device, as well as interfaces for implementing network device interconnections with other devices (e.g., network devices). The communication network may be an ethernet, a radio access network (radio access network, RAN), a wireless local area network (wireless local areanetworks, WLAN), or the like. The communication interface 1102 may be a module, circuit, transceiver, or any device capable of communicating.
In implementation, the steps of the above method may be performed by integrated logic circuitry in hardware in the processor 1101 or instructions in software. The method disclosed in connection with the embodiments of the present application may be directly embodied as a hardware processor executing or may be executed by a combination of hardware and software modules in the processor. The software modules may be located in a random access memory flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 1103, and the processor 1101 reads information in the memory 1103, and performs the steps of the above method in combination with hardware thereof. To avoid repetition, a detailed description is not provided herein.
Although the preferred embodiments of the present application have been disclosed for illustrative purposes, those skilled in the art will appreciate that various modifications, additions and substitutions are possible, without departing from the scope and spirit of the application as disclosed in the accompanying claims.