WO2025201045A1 - Program running state indication system and physical code block - Google Patents
Program running state indication system and physical code blockInfo
- Publication number
- WO2025201045A1 WO2025201045A1 PCT/CN2025/081981 CN2025081981W WO2025201045A1 WO 2025201045 A1 WO2025201045 A1 WO 2025201045A1 CN 2025081981 W CN2025081981 W CN 2025081981W WO 2025201045 A1 WO2025201045 A1 WO 2025201045A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- program
- program statement
- block
- statement block
- indicator
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H05—ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
- H05B—ELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
- H05B45/00—Circuit arrangements for operating light-emitting diodes [LED]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/362—Debugging of software
- G06F11/3636—Debugging of software by tracing the execution of the program
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/362—Debugging of software
- G06F11/3644—Debugging of software by instrumenting at runtime
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/362—Debugging of software
- G06F11/3648—Debugging of software using additional hardware
-
- H—ELECTRICITY
- H05—ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
- H05B—ELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
- H05B47/00—Circuit arrangements for operating light sources in general, i.e. where the type of light source is not relevant
- H05B47/10—Controlling the light source
- H05B47/155—Coordinated control of two or more light sources
-
- H—ELECTRICITY
- H05—ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
- H05B—ELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
- H05B47/00—Circuit arrangements for operating light sources in general, i.e. where the type of light source is not relevant
- H05B47/10—Controlling the light source
- H05B47/165—Controlling the light source following a pre-assigned programmed sequence; Logic control [LC]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02B—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
- Y02B20/00—Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
- Y02B20/40—Control techniques providing energy savings, e.g. smart controller or presence detection
Definitions
- the light-emitting units of the light-emitting indicator water light strip are lit in sequence according to the running direction of the specified program module, and when the specified program module runs to any program statement, the light-emitting units of the program statement block corresponding to the program statement are lit, wherein different program running states correspond to different lighting forms of the light-emitting indicator water light strip, and each program statement block in the program running indication board corresponds one-to-one to a program statement in the specified program module;
- At least one program block includes at least two exit indicator bars
- the program statement block corresponding to the previously completed program statement is called the predecessor program statement block
- the program statement block corresponding to the currently running program statement is called the current program statement block
- the program statement block corresponding to the next program statement to be run is called the successor program statement block;
- the program running status includes a program expression calculation status
- the indicator bar includes a Boolean data indicator bar and/or a numerical data indicator bar
- the Boolean data indicator bar and/or the numerical data indicator bar are respectively arranged in a specified statement block in the program statement block.
- the Boolean data indicator bar and/or the numerical data indicator bar lights up according to the lighting form corresponding to the program expression calculation status.
- each of the program statement blocks is a program statement block of the same or/and different types, and the types of the program statement blocks include at least two of the flow control type, the data structure type, the input and output type, and the operator type.
- the program statement block includes a jump semantics program statement block
- the jump semantics program statement block is provided with a spotlight or a projection light, and the lighting direction of the spotlight or the projection light is the same as the jump direction of the designated program module.
- the Boolean data indicator bar lights up in different colors when the value calculated by the program expression calculation state is Boolean true and Boolean false; the numerical data indicator bar lights up brighter when the absolute value of the value calculated by the program expression calculation state is larger.
- the system also includes an input device, and the light-emitting unit on the program statement block corresponding to the input device is lit according to the input state of the input device; when the input state of the input device is in different states, the light-emitting unit on the program statement block corresponding to the input device is lit in different colors, brightness or patterns.
- the program statement blocks are graphic controls on a screen graphic interface
- the program running indicator board is formed by dragging and splicing the program statement blocks on the screen graphic interface.
- the program statement block is a physical code building block
- the physical code building block is provided with an electronic interface, and the physical code building blocks are connected through the electronic interface.
- the present invention also provides a physical code building block, comprising a building block body, wherein the building block body is the program statement block in the above-mentioned program running status indication system.
- FIG1 is a schematic diagram of the structure of a program running status indication system according to an embodiment of the present invention.
- FIG2 is a schematic diagram of the structure of a program statement block in an embodiment of the present invention.
- Figure 1 shows a program execution status indicator system, which uses multiple program blocks to create a complete program.
- This system can be constructed from physical program blocks or a graphical programming IDE running on a mobile phone, computer, or tablet.
- the program running status indication system includes multiple program statement blocks, which are building blocks with graphic or text symbols that represent program statements.
- the above-mentioned building blocks can be physical building blocks, such as plastic building blocks with circuit boards inside, or virtual building blocks displayed on a screen graphical interface, such as graphic controls.
- the program running status indication system shown in FIG1 includes multiple program blocks, such as a loop start program block 101 and an if start program block 102.
- an indicator bar indicating the program running status is provided thereon, and the indicator bar includes a plurality of independently controllable light emitting units 401 .
- a light-emitting unit can be one or more LEDs, screen pixels, small light bulbs, lasers, and so on.
- a single LED, or multiple LEDs connected in series or parallel, can constitute a light-emitting unit.
- An indicator bar consists of multiple light-emitting units. By lighting these units on and off, the indicator bar can be animated, with changes in color, brightness, and pattern indicating the corresponding program logic.
- a plurality of program statement blocks are spliced together to form a program running indicator board for representing a specified program module.
- the above-mentioned specified program module is defined by the spliced program statement blocks, and the specified program module can be a program consisting of any number of lines and any type of code. It can be a complete program, or a subroutine in a complete program, or an incomplete program.
- the program semantics can be correct or erroneous. When the program is incomplete or the program semantics are erroneous, the system can indicate the error state by lighting up or animating a portion of the indicator bar or a separate light-emitting unit when the error prompt function is enabled.
- the above-mentioned luminous indicator light strip is used to represent the program running status of the above-mentioned specified program module.
- the light-emitting units of the above-mentioned luminous indicator light strip are lit in sequence according to the running direction of the above-mentioned specified program module, and when the above-mentioned specified program module runs to any program statement, the light-emitting units of the program statement block corresponding to the above-mentioned program statement are lit.
- the specified program module running direction includes the sequential execution, jump, and other directions between one line of program and another line of program.
- the program in Figure 1 takes the left branch from the if start program statement block 102 to the if end program statement block 105; or the if start program statement block 102 takes the right branch and executes sequentially to the subroutine call program statement block 103; the specified program module running direction also includes the direction of data transfer when calculating expressions.
- the expression composed of the first variable program statement block 2011, the comparison operator program statement block 202, and the first constant program statement block 203 in Figure 1 is: x>1234, where the value of the variable x is passed to the comparison operator from left to right, and the value of the constant 1234 is passed to the comparison operator from right to left.
- the lights on the luminous indicator light strip composed of the first indicator bar 3031 and the second indicator bar 3032 will light up and go out in sequence from top to bottom, presenting a flowing lighting effect from top to bottom. This lighting effect is used to simulate the flow of the program process and present the user with the current location and direction of the program.
- the light-emitting unit on the second indicator bar 3032 on the if-end program statement block 105 lights up, indicating that the program has run to this line of program.
- the end program statement block 105 has two entry branches, namely the upper left branch and the upper right branch of the Y shape, and one exit branch, namely the lower branch of the Y shape, therefore when the program running state is to enter the if end program statement block 105 from the right branch of the if end program statement block 105, the luminous indicator light strip on the right branch of the if end program statement block 105 will light up in sequence from top to bottom; and when the program running state is to enter the if end program statement block 105 from the left branch of the if end program statement block 105, the luminous indicator light strip on the left branch of the if end program statement block 105 will light up in sequence from top to bottom.
- each program statement block in the program execution indicator board corresponds one-to-one to a program statement in a designated program module.
- the if-start program statement block 102 in Figure 1 provides an inverted Y-shaped indicator bar in the program running indicator panel to indicate the program running branch, which represents the program semantics of the starting position of the branch statement in the specified program module.
- the light-emitting unit on the inverted Y-shaped indicator bar on the if-start program statement block 102 in the program running indicator panel will also light up accordingly.
- the light-emitting indicator flow light strip on the right side of the inverted Y-shaped indicator bar of the program running indicator panel will also light up in sequence from top to bottom.
- the program statement block corresponding to the previous completed program statement is called the predecessor program statement block
- the program statement block corresponding to the currently running program statement is called the current program statement block
- the program statement block corresponding to the next program statement to be run is called the successor program statement block.
- the program running environment sends a lighting control instruction to the corresponding program statement block, controlling the light-emitting units of the entry indicator bar of the current program statement block connected to the previous program statement block to light up in sequence from the previous program statement block to the current program statement block, while the brightness of the other entry indicator bars of the current program statement block remains unchanged;
- the program execution environment performs calculations or operations on the program statements corresponding to the current program block
- the program running environment sends lighting control instructions to the corresponding program statement block, controlling the light-emitting units of the exit indicator bar of the current program statement block connected to the subsequent program statement block to light up in sequence from the current program statement block to the subsequent program statement block, and the brightness of the remaining exit indicator bars of the current program statement block remains unchanged.
- the program execution environment sends a lighting control instruction to the if start program statement block 102 to control the entry indicator bar that interfaces with the preceding program statement block, i.e., the indicator bar in the middle position above the if start program statement block 102, to light up in sequence from top to bottom, indicating that the program has entered the if start program statement block for calculation;
- the program running environment calculates the program statement corresponding to the current program statement block, that is, it determines whether the conditional branch corresponding to the "if start program statement block" should run the left branch or the right branch. In Figure 1, this judgment process is to calculate whether the expression x>1234 on the right side is true. If the expression calculation result is true, the right branch of the "if start program statement block 102" is executed, and if the expression calculation result is false, the left branch of the "if start program statement block 102" is executed.
- the program running environment sends a lighting control instruction to the if program statement block 102, controlling the exit indicator bar connected to the subsequent program statement block, that is, the indicator bar at the lower right of the if program statement block 102, lights up in sequence from top to bottom, and the brightness of the remaining exit indicator bars, that is, the indicator bar at the lower left, remains unchanged.
- the program running state includes a program flow control state, a program expression calculation state, and the like.
- the above-mentioned program flow control state includes at least any one of the program sequential running state, loop state, branch state, jump state, waiting state, and subroutine call state.
- the luminous indicator light strip lights up according to the lighting form corresponding to the program flow control state when the program running indicator board is working.
- loop start block 101 in FIG1 represents the program logic semantics of the starting point of a program loop.
- this constitutes the program semantics of a program loop, indicating that the program loops through the program statements between loop start block 101 and loop end block 106.
- the program flow control state is in a loop state, indicating that the program is about to loop back to the beginning of the loop, i.e., the program position represented by loop start block 101.
- the luminous indicator light strip including the third indicator bar 3033 lights up in sequence according to the direction of program execution.
- the light-emitting unit arranged below the upright U-shaped third indicator bar 3033 on the loop end program statement block 106 will light up and go out in sequence in a clockwise direction.
- the light-emitting unit arranged below the inverted U-shaped indicator bar on the loop start program statement block 101 will light up and go out in sequence in a clockwise direction.
- the program execution direction has changed from the original top-to-bottom operation, and the loop returns to the loop start program statement block 101 located above, and then continues to run sequentially from the loop start program statement block 101 downward.
- the process of the program running from the subroutine calling program statement block 103 to the motor rotation program statement block 104 is sequential running, and the program flow control state is the sequential running state.
- the light-emitting indicator light strip including the indicator bars of the subroutine calling program statement block 103 and the motor rotation program statement block 104, lights up from top to bottom, and then goes out in turn, indicating that the program is running downward in sequence.
- the if-start program statement block 102 and the if-end program statement block 105 constitute the starting point and end point of the branch, respectively.
- the program calculates the result based on the expression spliced to the right of the if-start program statement block 102, and then chooses to run the left branch based on the calculation result, that is, directly jump to the if-end program statement block 105, or run the right branch, that is, run sequentially to the subroutine call program statement block 103, the motor rotation program statement block 104, and the if-end program statement block 105.
- the indicator bars on the left half of the branch shape in the luminous indicator light strip will light up from top to bottom, indicating that the program has taken the left branch; if the program runs the right branch, the indicator bars on the right half of the branch shape in the luminous indicator light strip will light up from top to bottom, indicating that the program has taken the right branch.
- a progress bar-shaped indicator light strip will gradually illuminate from one side of the bar to the other, indicating that the program is waiting at the next block.
- the progress bar can be in a long, circular, or folded shape.
- the luminous indicator light strip set above or around the subroutine identifier that is, "f()" here, lights up according to a certain pattern.
- the luminous indicator light strip surrounding the subroutine identifier rotates and lights up and goes out; or the luminous indicator light strip here gradually brightens and then gradually dims; or the luminous indicator light strip here flashes as a whole.
- the program expression calculation status includes the value of a variable or constant, the value of intermediate data in the expression calculation, the data type, the expression operation priority, the order of calculation of each part of the expression, etc.
- the indicator bar includes a Boolean data indicator bar and/or a numerical data indicator bar.
- the Boolean data indicator bar and/or the numerical data indicator bar are respectively arranged in a specified statement block in the program statement block.
- the Boolean data indicator bar and/or the numerical data indicator bar lights up according to the lighting form corresponding to the program expression calculation status.
- conditional branch program semantics jointly constituted by the if start program statement block 102 and the if end program statement block 105.
- a conditional expression of the conditional branch is spliced on the right side of the if start program statement block 102.
- the content of this expression is x>1234, specifically, it is composed of the first variable program statement block 2011, the comparison operator program statement block 202, and the first constant program statement block 203.
- the designated statement blocks in this expression are all provided with indicator bars for indicating Boolean data transfer, namely the above-mentioned Boolean data indicator bars, and the three indicator bars are adjacent to each other, and together constitute a luminous indicator water light strip, which is used to indicate the Boolean data transfer relationship between the program statements represented by these program statement blocks.
- the specified statement blocks in this expression are all provided with indicator bars for indicating the transfer of numerical data, namely the above-mentioned numerical data indicator bars.
- the three indicator bars are adjacent to each other and together constitute a luminous indicator flow light strip, which is used to indicate the numerical data transfer relationship between the program statements represented by these program statement blocks.
- the Boolean data indicator bar and the numerical data indicator bar are divided into two independent indicator bars.
- the Boolean data indicator bar and the numerical data indicator bar can also be set as the same indicator bar, or only one of them can be set, or neither can be set.
- Boolean data indicator bar and the numerical data indicator bar are only set in the specified statement block, such as the program statement block involving data generation, data calculation, data transfer, and data use of the corresponding data type.
- the start program statement block 102 requires the calculation result of a Boolean expression as the basis for the left branch or right branch of the program operation, a Boolean data indicator bar is set on the start program statement block 102; if the start program statement block 102 cannot receive numerical data, there is no numerical data indicator bar on the start program statement block 102.
- the first variable program statement block 2011 is provided with a numerical data indicator bar because it represents the numerical variable x; the first variable program statement block 2011 can constitute a part of an expression whose return value is Boolean type data in the expression, so it has the function of transferring Boolean data, and therefore a Boolean data indicator bar is provided.
- the indicator bar on the if-start program statement block 102 representing the starting point of the conditional branch will light up the light-emitting units on the right branch of the indicator bar from top to bottom in accordance with the program running direction, indicating that the program has run the right branch, and the light-emitting units of the adjacent indicator bars on the subsequent program statement block subroutine call program statement block 103 and the motor rotation program statement block 104 on the right branch will also light up in sequence from top to bottom in accordance with the program running direction;
- the conditional expression is not true, that is, when the judgment result of x>1234 is false
- the indicator bar on the if-start program statement block 102 representing the starting point of the conditional branch will light up the light-emitting units on the left branch of the indicator bar from top to bottom in accordance with the program running direction, indicating that the program has run the left branch, and through the left branch of the if-start program statement
- these adjacent indicator bars constitute a luminous indicator flow light strip, which is used to indicate the program running status transfer relationship between the program statements represented by these program statement blocks, that is, after the program runs to the right branch of the start program statement block 102, the next step will be to run the program statement represented by the subroutine calling program statement block 103, and the next step will be to run the program statement represented by the motor rotation program statement block 104, and the program running status is transferred between the program statements represented by the above-mentioned blocks.
- the first step is to obtain the current variable value x.
- the first variable program block 2011 displays the value represented by the numeric variable x through the numeric data indicator bar below it.
- the light below the first variable program block 2011 illuminates at a corresponding brightness based on the value of x.
- the brightness or color of the numeric data indicator bar when it illuminates is related to the value or data type of the data being transferred. For example, when transferring numeric data, blue indicates positive numbers and purple indicates negative numbers; when transferring Boolean data, red indicates false and green indicates true.
- the indicator bar used to indicate data transfer is lit, the brightness of the indicator bar is positively correlated with the size of the transferred numeric data or the absolute value of the numeric data. For example, when the value of x is 50, the light brightness is 50%, and when the value of x is 20, the light brightness is 20%, which directly reflects the current value of x. In this calculation, it is assumed that the current value of x is 20.
- the second step is to take the value represented by the first constant program statement block 203.
- the first constant program statement block 203 displays the value represented by the numeric constant 1234 through the numerical data indicator bar below it. For example, if the value of constant 1234 is 1234, the light brightness is 100%. By observing the brightness of the numerical data indicator bar in the first variable program statement block 2011 and the brightness of the numerical data indicator bar in the first constant program statement block 203, the user can intuitively see the relationship between the two.
- the comparison operator program block 202 which connects the first variable program block 2011 and the first constant program block 203, compares the two numerical data and generates Boolean comparison result data.
- the numerical data transfer process is as follows: the first variable program block 2011 transfers the numerical data of the value of x to the comparison operator program block 202 from left to right, and the left half of the indicator bar below the comparison operator program block 202, which represents the numerical data transfer, lights up the light-emitting units from left to right.
- the first constant program block 203 transfers the numerical data of the value 1234 from right to left to the comparison operator program block 202, and the right half of the indicator bar below the comparison operator program block 202, which represents the numerical data transfer, lights up the light-emitting units from right to left.
- the fourth step is to perform a greater-than check.
- the value on the left is not greater than the value on the right, so the result is false.
- the indicator bar indicating data transfer is illuminated, the semantics of the transfer are Boolean data.
- the indicator bar illuminates in different colors when transferring true and false. Here, red represents false and green represents true.
- Comparison operator program block 202 illuminates the upper Boolean data indicator bar in red, indicating that the greater-than check results in a false Boolean result.
- Step 5 Pass the expression calculation result to the if-start program statement block 102.
- the greater-than judgment statement represented by the comparison operator program statement block 202 evaluates to false, and this Boolean data needs to be passed to the if-start program statement block 102. Therefore, the indicator bars indicating Boolean data transfer on the comparison operator program statement block 202, the first variable program statement block 2011, and the if-start program statement block 102 sequentially light up the red light-emitting units representing false from right to left, reflecting the false data transfer process.
- the potential data transfer path represented by the indicator bar for indicating data transfer is invisible if it is not constructed as a valid data transfer path.
- the data transfer path refers to the path taken from the program statement that generates the data to the program statement that uses the data.
- the Boolean data is generated from the comparison operator program statement block 202 and is represented by the Boolean data indicator bar above the comparison operator program statement block 202.
- the data transfer passes through the first Boolean data indicator bar 3021 above the first variable program statement block 2011, is transferred to the "if start” program statement block 102, and is represented by the Boolean data indicator bar to the upper right of the "if start” program statement block 102.
- the data transfer path in this case is the comparison operator program statement block 202, the first variable program statement block 2011, and the indicator bar indicating the Boolean data transfer above the "if start” program statement block 102.
- a potential data delivery path refers to an indicator bar that may be part of a data delivery path.
- the program blocks that can be spliced together to form a light-emitting indicator light strip for indicating the program flow control status include all program blocks at the beginning of the line, including the loop start program block 101, the if start program block 102, the subroutine call program block 103, the motor rotation program block 104, the if end program block 105, and the loop end program block 106.
- These program blocks all contain indicator bars that can be spliced together to form a light-emitting indicator light strip for indicating the program flow control status, such as the first indicator bar 3031, the second indicator bar 3032, the third indicator bar 3033, etc.
- the docking end face is the graphic edge where the two program statement block graphics dock with each other;
- the docking end face is the outer surface where the physical code building block is connected with each other.
- one or more program statement blocks constitute a line of program statement units, each line of program statement units represents a line of code in a specified program module, and the program running indicator board is composed of multiple lines of program statement units.
- the first line of program includes only a loop start program statement block 101, which constitutes a line of program statement units, representing the first line of code "loop start" in the specified program module;
- the second line of program includes an if start program statement block 102, a first variable program statement block 2011, a comparison operator program statement block 202, and a first constant program statement block 203.
- These four program statement blocks constitute a line of program statement units, representing the second line of code "if start (x>1234)" in the specified program module; the third line of program includes a subroutine call program statement block 103, a second constant program statement block, a plus operator program statement block, and a second variable program statement block 2012.
- the four program statement blocks constitute a line of program statement unit, representing the third line of code "f(1234+x)" in the specified program module; the fourth line of the program includes a motor rotation program statement block 104 and a Boolean constant program statement block.
- These two program statement blocks constitute a line of program statement unit, representing the fourth line of code "Motor rotation (true)" in the specified program module;
- the fifth line of the program includes only an if-end program statement block 105, which constitutes a line of program statement unit, representing the first line of code "if-end” in the specified program module;
- the sixth line of the program includes only a loop-end program statement block 106, which constitutes a line of program statement unit, representing the first line of code "loop-end” in the specified program module.
- the aforementioned six-line program statement unit collectively constitutes a program execution indicator panel
- the corresponding luminous indicator light strip includes a first luminous light strip for representing the program flow control state and a second luminous light strip for representing the program expression calculation state.
- the first indicator bar 3031, the second indicator bar 3032, and the third indicator bar 3033 collectively constitute the luminous indicator light strip for indicating the program flow control state, referred to as the first luminous light strip
- the fourth indicator bar 3041, the fifth indicator bar 3042, and the sixth indicator bar 3043 collectively constitute the luminous indicator light strip for indicating the program expression calculation state, referred to as the second luminous light strip.
- the first luminous light strip extends from the first row of the above-mentioned program statement units to the last row of the above-mentioned program statement units.
- the luminous indicator light strip located on the far left in Figure 1 that runs through all the program statement blocks at the beginning of the row is composed of partial indicator bars on each program statement block at the beginning of the row, such as the first indicator bar 3031, the second indicator bar 3032, and the third indicator bar 3033.
- the second light-emitting indicator light strip is horizontally distributed along the program statement unit of the specified row, such as the numerical data indicator bar below the horizontally distributed expression in the third line of program f(1234+x) in Figure 1, and the fourth is composed of indicator bar 3041, fifth indicator bar 3042, and sixth indicator bar 3043.
- the program statement unit of a specified line is composed of multiple program statement blocks.
- the program statement unit of the third line is composed of a subroutine call program statement block 103, a second constant program statement block, a plus operator program statement block, and a second variable program statement block 2012.
- each program statement block can be a program statement block of the same or/and different types, and the types of program statement blocks include at least two of process control class, data structure class, input and output class and operator class, wherein the process control class includes loop start program statement block 101, loop end program statement block 106, if start program statement block 102, otherwise program statement block, if end program statement block 105, etc.; the data structure class includes variable program statement block, constant program statement block, Boolean constant program statement block, etc.; the input and output class includes motor rotation program statement block 104, motor stop program statement block, sensor read program statement block, etc.; the operator class includes comparison operator program statement block 202, plus operator program statement block, etc.
- process control class includes loop start program statement block 101, loop end program statement block 106, if start program statement block 102, otherwise program statement block, if end program statement block 105, etc.
- the data structure class includes variable program statement block, constant program statement block, Boolean constant program statement block, etc.
- the input and output class includes
- the program execution indicator board includes a loop start program statement block 101 of the process control class, a variable program statement block of the data structure class, a motor rotation program statement block 104 of the input and output class, a plus operator program statement block of the operator class, and the like.
- the program running indicator board can be used to represent jump semantics, and the corresponding spliced program statement block can be called a jump semantic program statement block.
- the program running indicator board can be used to represent jump semantics, and the corresponding spliced program statement block can be called a jump semantic program statement block.
- loop end program statement block 106 and the loop start program statement block 101 when the loop end program statement block 106 on the sixth row runs to the leftmost branch, the program will jump back to the leftmost branch of the loop start program statement block 101 on the first row after reaching the exit indicator bar.
- a spotlight or projection light is provided for a jump semantic program statement block, and the lighting direction of the spotlight or projection light is the same as the program jump direction.
- loop end block 106 indicates that when the program reaches this loop end block, the program jumps back to the program start block represented by loop start block 101. Therefore, a spotlight or second projection light 3012 and a first projection light 3011 are respectively provided on loop end block 106, the jump start point, and loop start block 101, the jump end point.
- the spotlight or second projection light 3012 illuminates from the jump start point to the jump end point
- the spotlight or first projection light 3011 illuminates from the jump end point to the jump start point.
- spotlights or projection lights can be set on only some of the program blocks.
- spotlights or projection lights can be set on both program blocks, or only on one of them.
- the system further includes input devices, such as a range sensor and a light sensor.
- the system includes program blocks corresponding to the input devices, such as the "Read range sensor reading” and “Read light sensor reading” blocks corresponding to the range sensor.
- the light-emitting units in the program blocks corresponding to the input devices illuminate according to the input state of the input devices. When the input state of the input devices is in different states, the light-emitting units in the program blocks corresponding to the input devices illuminate with different colors, brightness, or patterns.
- the distance sensor acquires sensor information and passes the reading or the corresponding display content to the "Read Distance Sensor Reading” block.
- the "Read Distance Sensor Reading” block then illuminates the light-emitting units located therein based on the reading or the corresponding display content. For example, the greater the reading, the brighter the light-emitting unit; the light-emitting unit may be green when the reading is greater than a certain threshold, and orange when the reading is less than a certain threshold; the reading may be displayed directly on a digital tube using a pattern; or the greater the reading, the more light-emitting units may be illuminated, displaying different patterns based on the reading size.
- program blocks are displayed on a screen graphical interface, wherein the program blocks are graphical controls on the screen graphical interface, the indicator bar is a striped pattern, and the light-emitting units are graphical elements or screen pixels within the striped pattern.
- a user can drag the program blocks on the graphical interface using a mouse or touch screen to form the program execution indicator board, thereby splicing the program blocks and building a program.
- the program statement blocks are physical code building blocks, and the physical code building blocks are provided with electronic interfaces, and the physical code building blocks can be connected through the electronic interfaces.
- the indicator bar is a plastic part with a silk-screen pattern, and the light-emitting unit is a lamp bead or a small screen embedded in the program statement block.
- the lamp bead can be an LED, and the small screen can be an OLED screen, an ink screen, or a TTF screen. Users can build programs by connecting the electronic interfaces of the physical code building blocks.
- the present invention also provides a physical code building block, including a building block body, which is the program statement block described in the above embodiment.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Programmable Controllers (AREA)
Abstract
Description
本发明涉及程序调试领域,尤指一种程序运行状态指示系统及实体代码积木块。The present invention relates to the field of program debugging, and in particular to a program running state indication system and a physical code building block.
当前程序调试过程中,对程序当前运行状态的指示很有限,一般在集成开发环境当中在程序运行时只会显示程序是否在运行,不会显示当前程序运行位置,更不会显示当前程序运行的分支。当程序暂停下来,有些集成开发环境能够显示程序所暂停的行号,有些集成开发环境能够对程序正在运行的行进行高亮显示,但是程序运行了哪个分支,通过哪条程序逻辑路径发生了跳转,表达式如何进行了计算,表达式运算优先级是怎样,表达式计算中间过程是怎样的,表达式计算结果是什么,这些信息程序开发人员无从得知。During current program debugging, the display of the program's current running status is very limited. Typically, integrated development environments (IDEs) only indicate whether the program is running, without displaying the current program location or the branch it is currently executing on. When a program is paused, some IDEs can display the line number where the program was paused, while others can highlight the line where the program is currently executing. However, the program developer has no way of knowing which branch the program is executing on, which logical path it is jumping through, how expressions are being calculated, what the expression operation priority is, what the intermediate steps in the expression calculation are, and what the expression calculation results are.
本发明要解决的技术问题在于,针对现有技术的上述缺陷,提供一种程序运行状态指示系统及实体代码积木块,旨在克服当前代码调试系统无法指示程序运行具体程序语句之间的流转关系,使得用户能够非常直观高效地获取程序调试所需的信息,直观理解程序运行流程和状态。The technical problem to be solved by the present invention is to provide a program running status indication system and a physical code building block in response to the above-mentioned defects of the prior art, aiming to overcome the current code debugging system's inability to indicate the flow relationship between specific program statements during program execution, so that users can obtain the information required for program debugging very intuitively and efficiently, and intuitively understand the program running process and status.
本发明解决其技术问题所采用的技术方案是提供一种程序运行状态指示系统,包括多个程序语句块,所述程序语句块设有包括多个发光单元的指示条,多个所述程序语句块拼接形成用于代表指定程序模块的程序运行指示板,所述程序运行指示板中的指示条对接形成发光指示流水灯带,所述发光指示流水灯带用于代表所述指定程序模块的程序运行状态,当所述指定程序模块运行时,所述发光指示流水灯带的发光单元按所述指定程序模块运行方向依次点亮,且所述指定程序模块运行到任一程序语句时,所述程序语句所对应的程序语句块的发光单元亮起,其中,不同的所述程序运行状态对应的所述发光指示流水灯带点亮形式不同,所述程序运行指示板中的各所述程序语句块与所述指定程序模块中的程序语句一一对应;The technical solution adopted by the present invention to solve its technical problem is to provide a program running status indication system, including multiple program statement blocks, each of which is provided with an indicator bar including multiple light-emitting units. Multiple program statement blocks are spliced to form a program running indication board for representing a specified program module, and the indicator bars in the program running indication board are connected to form a light-emitting indicator water light strip, and the light-emitting indicator water light strip is used to represent the program running status of the specified program module. When the specified program module is running, the light-emitting units of the light-emitting indicator water light strip are lit in sequence according to the running direction of the specified program module, and when the specified program module runs to any program statement, the light-emitting units of the program statement block corresponding to the program statement are lit, wherein different program running states correspond to different lighting forms of the light-emitting indicator water light strip, and each program statement block in the program running indication board corresponds one-to-one to a program statement in the specified program module;
拼接后的所述发光指示流水灯带用于指示程序流程控制状态,每一所述程序语句块的指示条包括至少一个入口指示条及至少一个出口指示条,所述入口指示条一端延伸至所述程序语句块的一对接端面,另一端连接所述出口指示条的一端,所述出口指示条的另一端延伸至所述程序语句块的一对接端面;The spliced luminous indicator light strip is used to indicate the program flow control status. The indicator bar of each program statement block includes at least one entry indicator bar and at least one exit indicator bar. One end of the entry indicator bar extends to a docking end surface of the program statement block, and the other end is connected to one end of the exit indicator bar. The other end of the exit indicator bar extends to a docking end surface of the program statement block.
各所述程序语句块拼接时,程序语句块之间的入口指示条与出口指示条对接,以形成所述发光指示流水灯带;When the program blocks are connected, the entry indicator strips and exit indicator strips between the program blocks are connected to form the luminous indicator light strip;
程序运行状态指示系统当中至少有一个程序语句块内包括至少两个出口指示条;In the program running status indication system, at least one program block includes at least two exit indicator bars;
在程序运行时,前一条运行完成的程序语句所对应的程序语句块称为前序程序语句块,当前运行的程序语句所对应的程序语句块称为当前程序语句块,下一条即将运行的程序语句所对应的程序语句块称为后序程序语句块;When a program is running, the program statement block corresponding to the previously completed program statement is called the predecessor program statement block, the program statement block corresponding to the currently running program statement is called the current program statement block, and the program statement block corresponding to the next program statement to be run is called the successor program statement block;
程序运行到任一程序语句块所对应的程序语句时,包含以下步骤:When the program runs to the program statement corresponding to any program statement block, it includes the following steps:
当前程序语句块对接前序程序语句块的入口指示条的发光单元从前序程序语句块向当前程序语句块方向依次点亮,当前程序语句块的其余入口指示条亮度不变;The light-emitting units of the entry indicator bar of the current program statement block connected to the previous program statement block light up in sequence from the previous program statement block to the current program statement block, and the brightness of the other entry indicator bars of the current program statement block remains unchanged;
进行当前程序语句块对应程序语句的计算或操作;Perform calculations or operations on the program statements corresponding to the current program block;
当前程序语句块对接后序程序语句块的出口指示条的发光单元从当前程序语句块向后序程序语句块方向依次点亮,当前程序语句块的其余出口指示条亮度不变。The light-emitting units of the exit indicator bar of the current program statement block connected to the subsequent program statement block are lit in sequence from the current program statement block to the subsequent program statement block, and the brightness of the other exit indicator bars of the current program statement block remains unchanged.
优选的,所述程序运行状态包括程序流程控制状态,所述程序流程控制状态至少包括程序顺序运行状态、循环状态、分支状态、跳转状态、等待状态、子程序调用状态中的任一种,所述发光指示流水灯带在所述程序运行指示板工作时按所述程序流程控制状态所对应的点亮形式亮起。Preferably, the program running status includes a program flow control status, and the program flow control status includes at least any one of a program sequential running status, a loop status, a branch status, a jump status, a waiting status, and a subroutine call status. When the program running indicator board is working, the luminous indicator light strip lights up in the lighting form corresponding to the program flow control status.
优选的,所述程序运行状态包括程序表达式计算状态,所述指示条包括布尔数据指示条或/和数值数据指示条,所述布尔数据指示条或/和所述数值数据指示条分别设于所述程序语句块中的指定语句块,当所述指定程序模块进行程序表达式计算时,所述布尔数据指示条或/和所述数值数据指示条依据所述程序表达式计算状态所对应的点亮形式亮起。Preferably, the program running status includes a program expression calculation status, and the indicator bar includes a Boolean data indicator bar and/or a numerical data indicator bar, and the Boolean data indicator bar and/or the numerical data indicator bar are respectively arranged in a specified statement block in the program statement block. When the specified program module performs a program expression calculation, the Boolean data indicator bar and/or the numerical data indicator bar lights up according to the lighting form corresponding to the program expression calculation status.
优选的,一个或多个所述程序语句块组成一行程序语句单元,每一行所述程序语句单元代表所述指定程序模块中的一行代码,所述程序运行指示板由多行所述程序语句单元组成;Preferably, one or more of the program statement blocks constitute a line of program statement units, each line of the program statement units represents a line of code in the designated program module, and the program execution indicator board is composed of multiple lines of the program statement units;
所述发光指示流水灯带包括用于代表程序流程控制状态的第一发光灯带和用于代表程序表达式计算状态的第二发光灯带,所述第一发光灯带从第一行所述程序语句单元分布延伸至最后一行所述程序语句单元,所述第二发光灯带沿指定行的程序语句单元横向分布,所述指定行的程序语句单元由多个所述程序语句块拼接组成。The luminous flow indicator light strip includes a first luminous light strip for representing the program flow control state and a second luminous light strip for representing the program expression calculation state. The first luminous light strip extends from the first row of program statement units to the last row of program statement units. The second luminous light strip is horizontally distributed along the program statement units in the specified row. The program statement units in the specified row are composed of multiple program statement blocks.
优选的,各所述程序语句块为相同或/和不同类型的程序语句块,所述程序语句块的类型至少包括流程控制类、数据结构类、输入输出类以及运算符类中的至少两种。Preferably, each of the program statement blocks is a program statement block of the same or/and different types, and the types of the program statement blocks include at least two of the flow control type, the data structure type, the input and output type, and the operator type.
优选的,所述程序语句块包括跳转语义程序语句块,所述跳转语义程序语句块设有射灯或投影灯,所述射灯或所述投影灯光照方向为与所述指定程序模块跳转方向相同。Preferably, the program statement block includes a jump semantics program statement block, and the jump semantics program statement block is provided with a spotlight or a projection light, and the lighting direction of the spotlight or the projection light is the same as the jump direction of the designated program module.
优选的,所述布尔数据指示条在所述程序表达式计算状态计算的值为布尔真和布尔假时布尔数据指示条点亮颜色不同;所述数值数据指示条在所述程序表达式计算状态计算的值的绝对值越大时数据指示条点亮亮度越高。Preferably, the Boolean data indicator bar lights up in different colors when the value calculated by the program expression calculation state is Boolean true and Boolean false; the numerical data indicator bar lights up brighter when the absolute value of the value calculated by the program expression calculation state is larger.
优选的,系统还包括输入设备,与输入设备有对应关系的所述程序语句块上的所述发光单元,根据输入设备的输入状态点亮;当输入设备的输入状态处于不同状态下,与输入设备有对应关系的所述程序语句块上的所述发光单元点亮的颜色或亮度或图案不同。Preferably, the system also includes an input device, and the light-emitting unit on the program statement block corresponding to the input device is lit according to the input state of the input device; when the input state of the input device is in different states, the light-emitting unit on the program statement block corresponding to the input device is lit in different colors, brightness or patterns.
优选的,所述程序语句块为屏幕图形界面上的图形控件,通过拖拽屏幕图形界面上的所述程序语句块进行拼接形成所述程序运行指示板。Preferably, the program statement blocks are graphic controls on a screen graphic interface, and the program running indicator board is formed by dragging and splicing the program statement blocks on the screen graphic interface.
优选的,所述程序语句块为实体代码积木块,所述实体代码积木块设有电子接口,各所述实体积木块之间通过电子接口相连接。Preferably, the program statement block is a physical code building block, and the physical code building block is provided with an electronic interface, and the physical code building blocks are connected through the electronic interface.
本发明还提供了一种实体代码积木块,包括积木块本体,所述积木本体为上述的程序运行状态指示系统中的所述程序语句块。The present invention also provides a physical code building block, comprising a building block body, wherein the building block body is the program statement block in the above-mentioned program running status indication system.
通过上述程序运行状态指示系统或实体代码积木块,用户能够非常直观高效地获取程序调试所需的信息,直观理解程序运行流程和状态,通过观察程序语句块上的指示条的发光单元点亮的路径、发光单元依次点亮所形成的光点的流动方向,用户能够直观地了解程序每时每刻运行到了哪里,走了哪一个分支,程序跳转是怎样跳转的,从哪里跳转到了哪里,输入设备读取结果是多少,输出设备输出状态是什么,变量当前值是什么,各种数据的数据类型和值是什么,表达式的计算顺序是怎样的,表达式计算结果是什么,大大提升了开发者的程序调试效率以及对于程序开发的学习效率。Through the above-mentioned program running status indicator system or physical code building blocks, users can very intuitively and efficiently obtain the information required for program debugging, intuitively understand the program running process and status, and by observing the path of the light-emitting units of the indicator bar on the program statement block and the flow direction of the light spots formed by the light-emitting units lighting up in sequence, users can intuitively understand where the program is running at every moment, which branch it has taken, how the program jumps, from where it jumps to where, what the input device reads the result, what is the output status of the output device, what is the current value of the variable, what are the data types and values of various data, what is the calculation order of the expression, and what is the result of the expression calculation, which greatly improves the developer's program debugging efficiency and learning efficiency for program development.
图1为本发明一实施例中程序运行状态指示系统的结构示意图。FIG1 is a schematic diagram of the structure of a program running status indication system according to an embodiment of the present invention.
图2为本发明一实施例中一程序语句块的结构示意图。。FIG2 is a schematic diagram of the structure of a program statement block in an embodiment of the present invention.
以下结合附图实施例对本发明作进一步详细描述。全文当中的多个指两个或两个以上。The present invention will be described in further detail below with reference to the accompanying drawings.
图1中呈现了一个程序运行状态指示系统,系统中通过多个程序语句块拼接了一个完整的程序。程序运行状态指示系统可以为实体程序语句块积木拼接构成的系统,也可以为手机、电脑、平板上运行的图形化编程IDE系统。Figure 1 shows a program execution status indicator system, which uses multiple program blocks to create a complete program. This system can be constructed from physical program blocks or a graphical programming IDE running on a mobile phone, computer, or tablet.
在一个可选实施例中,程序运行状态指示系统包括多个程序语句块,程序语句块为带有图形或文字符号的,代表程序语句的积木块,上述积木块可以为实体的积木块,例如内部带有电路板的塑料积木,也可以为屏幕图形化界面上显示的虚拟的积木块,例如图形控件。In an optional embodiment, the program running status indication system includes multiple program statement blocks, which are building blocks with graphic or text symbols that represent program statements. The above-mentioned building blocks can be physical building blocks, such as plastic building blocks with circuit boards inside, or virtual building blocks displayed on a screen graphical interface, such as graphic controls.
多个程序语句块相互拼接后能够构建代码。图1中呈现的程序运行状态指示系统包括多个程序语句块,例如循环开始程序语句块101、如果开始程序语句块102等。Multiple program blocks can be connected to form a code. The program running status indication system shown in FIG1 includes multiple program blocks, such as a loop start program block 101 and an if start program block 102.
以图2所示的循环开始程序语句块101为例,其上设置有指示程序运行状态的指示条,指示条包括多个可以独立控制的发光单元401。Taking the loop start program statement block 101 shown in FIG2 as an example, an indicator bar indicating the program running status is provided thereon, and the indicator bar includes a plurality of independently controllable light emitting units 401 .
发光单元可以为一个或多个LED、屏幕的像素点、小灯泡、激光器等。以LED为例,单颗的LED,或多颗LED通过串联或并联连接,能够构成一个发光单元。一个指示条包括多个发光单元。通过发光单元的点亮和熄灭,可以使得指示条能够呈现动态效果,通过颜色、亮度、图案的变化指示相应的程序逻辑语义。A light-emitting unit can be one or more LEDs, screen pixels, small light bulbs, lasers, and so on. For example, a single LED, or multiple LEDs connected in series or parallel, can constitute a light-emitting unit. An indicator bar consists of multiple light-emitting units. By lighting these units on and off, the indicator bar can be animated, with changes in color, brightness, and pattern indicating the corresponding program logic.
本实施例中,多个程序语句块拼接形成用于代表指定程序模块的程序运行指示板。上述指定程序模块由被拼接的程序语句块所定义,指定程序模块可以为任意行数、任意类型代码组成的程序。可以为完整的程序、或完整程序中的一个子程序,也可以为不完整的程序。程序语义可以是正确的,也可以是有错误的。当程序不完整时或程序语义错误时,本系统在启用错误提示功能的情况下,本系统能够通过部分指示条或单独的发光单元的点亮或动画来指示错误状态。In this embodiment, a plurality of program statement blocks are spliced together to form a program running indicator board for representing a specified program module. The above-mentioned specified program module is defined by the spliced program statement blocks, and the specified program module can be a program consisting of any number of lines and any type of code. It can be a complete program, or a subroutine in a complete program, or an incomplete program. The program semantics can be correct or erroneous. When the program is incomplete or the program semantics are erroneous, the system can indicate the error state by lighting up or animating a portion of the indicator bar or a separate light-emitting unit when the error prompt function is enabled.
例如图1中呈现的指定程序模块所代表的程序语义为:For example, the program semantics represented by the specified program module shown in Figure 1 are:
循环开始Loop starts
如果开始(x>1024)If start(x>1024)
f(1234+x)f(1234+x)
电机旋转(真)Motor rotation (true)
如果结束If it ends
循环结束End of loop
对应到C语言程序为:The corresponding C language program is:
while(true){while(true){
if(x>1024){if(x>1024){
f(1234+x);f(1234+x);
motorRotate(true);MotorRotate(true);
}}
}}
上述程序运行指示板为拼接完后的程序语句块的集合,包括指示条。The above program running indicator board is a collection of spliced program statement blocks, including indicator bars.
上述程序运行指示板中的指示条对接形成发光指示流水灯带。例如图1中的第一指示条3031、第二指示条3032、第三指示条3033这几个指示条相互对接形成发光指示流水灯带,用于指示程序运行流程控制和分支选择。再例如图1中的第四指示条3041、第五指示条3042、第六指示条3043这几个指示条相互对接形成发光指示流水灯带,用于指示程序表达式计算顺序、运算优先级、计算中间量和计算结果等信息。The indicator bars in the program execution indicator panel are connected to form a luminous indicator light strip. For example, the first indicator bar 3031, the second indicator bar 3032, and the third indicator bar 3033 in Figure 1 are connected to form a luminous indicator light strip, which is used to indicate program execution flow control and branch selection. Another example is the fourth indicator bar 3041, the fifth indicator bar 3042, and the sixth indicator bar 3043 in Figure 1. The indicator bars are connected to form a luminous indicator light strip, which is used to indicate information such as the program expression calculation order, operation priority, intermediate calculation quantities, and calculation results.
上述发光指示流水灯带用于代表上述指定程序模块的程序运行状态,当上述指定程序模块运行时,上述发光指示流水灯带的发光单元按上述指定程序模块运行方向依次点亮,且上述指定程序模块运行到任一程序语句时,上述程序语句所对应的程序语句块的发光单元亮起。The above-mentioned luminous indicator light strip is used to represent the program running status of the above-mentioned specified program module. When the above-mentioned specified program module is running, the light-emitting units of the above-mentioned luminous indicator light strip are lit in sequence according to the running direction of the above-mentioned specified program module, and when the above-mentioned specified program module runs to any program statement, the light-emitting units of the program statement block corresponding to the above-mentioned program statement are lit.
指定程序模块运行方向既包括一行程序到另一行程序之间的顺序执行、跳转等方向,例如图1中的程序从如果开始程序语句块102走左分支跳转到如果结束程序语句块105;或如果开始程序语句块102走右分支顺序执行到子程序调用程序语句块103;指定程序模块运行方向也包含表达式计算时数据传递的方向,例如图1 中由第一变量程序语句块2011、比较运算符程序语句块202、第一常量程序语句块203构成的表达式:x>1234,其中变量x的数值从左到右传递给比较运算符,常量1234的数值从右到左传递给比较运算符,二者的数值大小在比较运算符进行比较,然后得到比较结果true或false,然后将这个布尔运算结果从右到左传递给行首的如果开始程序语句块102,作为程序流程控制在false情况下走左分支或在true情况下走右分支的依据。The specified program module running direction includes the sequential execution, jump, and other directions between one line of program and another line of program. For example, the program in Figure 1 takes the left branch from the if start program statement block 102 to the if end program statement block 105; or the if start program statement block 102 takes the right branch and executes sequentially to the subroutine call program statement block 103; the specified program module running direction also includes the direction of data transfer when calculating expressions. For example, the expression composed of the first variable program statement block 2011, the comparison operator program statement block 202, and the first constant program statement block 203 in Figure 1 is: x>1234, where the value of the variable x is passed to the comparison operator from left to right, and the value of the constant 1234 is passed to the comparison operator from right to left. The values of the two are compared in the comparison operator, and then the comparison result true or false is obtained, and then this Boolean operation result is passed from right to left to the if start program statement block 102 at the beginning of the line as the basis for program flow control to take the left branch in the case of false or the right branch in the case of true.
例如当图1中的程序运行完电机旋转程序语句块104所代表的控制电机旋转的程序语句后,即将运行到如果结束程序语句块105的右侧分支。因此由第一指示条3031、第二指示条3032共同构成的发光指示流水灯带上的灯会从上到下依次点亮并依次熄灭,呈现从上到下的流动的灯光效果,通过该灯光效果类比程序的流程流转,向用户呈现程序当前运行的位置和走向。当程序运行到如果结束程序语句块105时,如果结束程序语句块105上的第二指示条3032上的发光单元亮起,指示程序运行到了这一行程序。For example, after the program in FIG. 1 has finished running the program statement for controlling motor rotation represented by the motor rotation program statement block 104, it will soon run to the right branch of the if-end program statement block 105. Therefore, the lights on the luminous indicator light strip composed of the first indicator bar 3031 and the second indicator bar 3032 will light up and go out in sequence from top to bottom, presenting a flowing lighting effect from top to bottom. This lighting effect is used to simulate the flow of the program process and present the user with the current location and direction of the program. When the program runs to the if-end program statement block 105, the light-emitting unit on the second indicator bar 3032 on the if-end program statement block 105 lights up, indicating that the program has run to this line of program.
其中,不同的上述程序运行状态对应的上述发光指示流水灯带点亮形式不同。Among them, different program running states correspond to different lighting forms of the above-mentioned luminous indicator water light strip.
例如如果结束程序语句块105存在两个入口分支,即Y字形的左上角分支和右上角分支,和一个出口分支,即Y字形的下方分支,因此当程序运行状态为从如果结束程序语句块105右侧分支进入如果结束程序语句块105时,如果结束程序语句块105右侧分支上的发光指示流水灯带会从上到下依次点亮;而当程序运行状态为从如果结束程序语句块105左侧分支进入如果结束程序语句块105时,如果结束程序语句块105左侧分支上的发光指示流水灯带会从上到下依次点亮。For example, if the end program statement block 105 has two entry branches, namely the upper left branch and the upper right branch of the Y shape, and one exit branch, namely the lower branch of the Y shape, therefore when the program running state is to enter the if end program statement block 105 from the right branch of the if end program statement block 105, the luminous indicator light strip on the right branch of the if end program statement block 105 will light up in sequence from top to bottom; and when the program running state is to enter the if end program statement block 105 from the left branch of the if end program statement block 105, the luminous indicator light strip on the left branch of the if end program statement block 105 will light up in sequence from top to bottom.
本实施例中,程序运行指示板中的各程序语句块与指定程序模块中的程序语句一一对应。In this embodiment, each program statement block in the program execution indicator board corresponds one-to-one to a program statement in a designated program module.
例如图1 中的如果开始程序语句块102在程序运行指示板当中提供了倒Y字形的指示条,用于指示程序运行分支,其在指定程序模块当中代表了分支语句开始位置的程序语义,当程序运行到如果开始程序语句块102所代表的分支判断程序语句时,程序运行指示板中如果开始程序语句块102上的倒Y字形指示条上的发光单元也会对应亮起,当程序运行到如果开始程序语句块102右侧分支时,程序运行指示板的该倒Y字形指示条右侧的发光指示流水灯带也会从上到下依次点亮。For example, the if-start program statement block 102 in Figure 1 provides an inverted Y-shaped indicator bar in the program running indicator panel to indicate the program running branch, which represents the program semantics of the starting position of the branch statement in the specified program module. When the program runs to the branch judgment program statement represented by the if-start program statement block 102, the light-emitting unit on the inverted Y-shaped indicator bar on the if-start program statement block 102 in the program running indicator panel will also light up accordingly. When the program runs to the right branch of the if-start program statement block 102, the light-emitting indicator flow light strip on the right side of the inverted Y-shaped indicator bar of the program running indicator panel will also light up in sequence from top to bottom.
在程序运行时,前一条运行完成的程序语句所对应的程序语句块称为前序程序语句块,当前运行的程序语句所对应的程序语句块称为当前程序语句块,下一条即将运行的程序语句所对应的程序语句块称为后序程序语句块。When the program is running, the program statement block corresponding to the previous completed program statement is called the predecessor program statement block, the program statement block corresponding to the currently running program statement is called the current program statement block, and the program statement block corresponding to the next program statement to be run is called the successor program statement block.
例如图1中当程序刚刚运行完循环开始程序语句块101后,运行到如果开始程序语句块102时,并即将从如果开始程序语句块102的右侧分支离开如果开始程序语句块102,并即将在下一条运行子程序调用程序语句块103的情况下,称循环开始程序语句块101为前序程序语句块,称如果开始程序语句块102为当前程序语句块,称子程序调用程序语句块103为后续程序语句块。For example, in Figure 1, when the program has just finished running the loop start program statement block 101 and runs to the if start program statement block 102, and is about to leave the if start program statement block 102 from the right branch of the if start program statement block 102, and is about to run the subroutine call program statement block 103 in the next line, the loop start program statement block 101 is called the predecessor program statement block, the if start program statement block 102 is called the current program statement block, and the subroutine call program statement block 103 is called the subsequent program statement block.
程序运行到任一程序语句块所对应的程序语句时,包含以下步骤:When the program runs to the program statement corresponding to any program statement block, the following steps are included:
程序运行环境发送灯光控制指令给对应的程序语句块,控制当前程序语句块对接前序程序语句块的入口指示条的发光单元从前序程序语句块向当前程序语句块方向依次点亮,当前程序语句块的其余入口指示条亮度不变;The program running environment sends a lighting control instruction to the corresponding program statement block, controlling the light-emitting units of the entry indicator bar of the current program statement block connected to the previous program statement block to light up in sequence from the previous program statement block to the current program statement block, while the brightness of the other entry indicator bars of the current program statement block remains unchanged;
程序运行环境进行当前程序语句块对应程序语句的计算或操作;The program execution environment performs calculations or operations on the program statements corresponding to the current program block;
程序运行环境发送灯光控制指令给对应的程序语句块,控制当前程序语句块对接后序程序语句块的出口指示条的发光单元从当前程序语句块向后序程序语句块方向依次点亮,当前程序语句块的其余出口指示条亮度不变。The program running environment sends lighting control instructions to the corresponding program statement block, controlling the light-emitting units of the exit indicator bar of the current program statement block connected to the subsequent program statement block to light up in sequence from the current program statement block to the subsequent program statement block, and the brightness of the remaining exit indicator bars of the current program statement block remains unchanged.
例如图1中的程序,刚刚运行完成循环开始程序语句块101所对应的程序语句,开始运行如果开始程序语句块102所对应的程序语句时,程序运行环境发送灯光控制指令给如果开始程序语句块102,控制其与前序程序语句块对接的入口指示条,即如果开始程序语句块102上方中间位置的指示条,从上到下依次点亮,指示程序进入如果开始程序语句块进行计算;For example, in the program in FIG1 , when the program statement corresponding to the loop start program statement block 101 has just been completed and the program statement corresponding to the if start program statement block 102 has begun to be executed, the program execution environment sends a lighting control instruction to the if start program statement block 102 to control the entry indicator bar that interfaces with the preceding program statement block, i.e., the indicator bar in the middle position above the if start program statement block 102, to light up in sequence from top to bottom, indicating that the program has entered the if start program statement block for calculation;
此时程序运行环境进行当前程序语句块对应程序语句的计算,即判断如果开始程序语句块对应的条件分支应当运行左分支还是右分支,在图1当中,这个判断过程即计算右侧的表达式x>1234是否成立,在表达式计算结果为真的情况下运行如果开始程序语句块102的右分支,在表达计算结果为假的情况下运行如果开始程序语句块102的左分支;At this time, the program running environment calculates the program statement corresponding to the current program statement block, that is, it determines whether the conditional branch corresponding to the "if start program statement block" should run the left branch or the right branch. In Figure 1, this judgment process is to calculate whether the expression x>1234 on the right side is true. If the expression calculation result is true, the right branch of the "if start program statement block 102" is executed, and if the expression calculation result is false, the left branch of the "if start program statement block 102" is executed.
假设本次计算结果判定如果开始程序语句块102走右分支,即下一条即将运行的子程序调用程序语句块103,则程序运行环境发送灯光控制指令给如果开始程序语句块102,控制其与后序程序语句块对接的出口指示条,即如果开始程序语句块102的右下方的指示条,从上到下依次点亮,其余出口指示条,即左下方的指示条亮度保持不变。Assuming that the calculation result determines that if the program statement block 102 is started, it takes the right branch, that is, the next subroutine to be run calls the program statement block 103, then the program running environment sends a lighting control instruction to the if program statement block 102, controlling the exit indicator bar connected to the subsequent program statement block, that is, the indicator bar at the lower right of the if program statement block 102, lights up in sequence from top to bottom, and the brightness of the remaining exit indicator bars, that is, the indicator bar at the lower left, remains unchanged.
在一个可选实施例中,程序运行状态包括程序流程控制状态、程序表达式计算状态等。In an optional embodiment, the program running state includes a program flow control state, a program expression calculation state, and the like.
上述程序流程控制状态至少包括程序顺序运行状态、循环状态、分支状态、跳转状态、等待状态、子程序调用状态中的任一种,本实施例中,发光指示流水灯带在程序运行指示板工作时按程序流程控制状态所对应的点亮形式亮起。The above-mentioned program flow control state includes at least any one of the program sequential running state, loop state, branch state, jump state, waiting state, and subroutine call state. In this embodiment, the luminous indicator light strip lights up according to the lighting form corresponding to the program flow control state when the program running indicator board is working.
以循环状态举例,例如图1中循环开始程序语句块101代表程序循环起点的程序逻辑语义,配合图1中的循环结束程序语句块106使用时,可以构成程序循环的程序语义,代表程序循环运行循环开始程序语句块101和循环结束程序语句块106之间的程序语句。当程序运行到循环结束程序语句块106所代表的程序时,程序流程控制状态为循环状态,程序即将通过循环,循环回到循环开始处,即循环开始程序语句块101所代表的程序位置。Taking the loop state as an example, loop start block 101 in FIG1 represents the program logic semantics of the starting point of a program loop. When used in conjunction with loop end block 106 in FIG1 , this constitutes the program semantics of a program loop, indicating that the program loops through the program statements between loop start block 101 and loop end block 106. When the program reaches the program represented by loop end block 106, the program flow control state is in a loop state, indicating that the program is about to loop back to the beginning of the loop, i.e., the program position represented by loop start block 101.
此时包含第三指示条3033在内的发光指示流水灯带按照程序运行的方向依次点亮,例如循环结束程序语句块106上的正U字形第三指示条3033下方设置的发光单元将按照顺时针方向依次点亮并依次熄灭,此时循环开始程序语句块101上的倒U字形指示条下方设置的发光单元将按照顺时针方向依次点亮并依次熄灭,通过发光指示流水灯带的这种点亮形式,呈现出程序运行方向从原本的从上到下运行转变了方向,循环回到了位于上方的循环开始程序语句块101,然后继续从循环开始程序语句块101向下顺序运行。At this time, the luminous indicator light strip including the third indicator bar 3033 lights up in sequence according to the direction of program execution. For example, the light-emitting unit arranged below the upright U-shaped third indicator bar 3033 on the loop end program statement block 106 will light up and go out in sequence in a clockwise direction. At this time, the light-emitting unit arranged below the inverted U-shaped indicator bar on the loop start program statement block 101 will light up and go out in sequence in a clockwise direction. Through this lighting form of the luminous indicator light strip, it is shown that the program execution direction has changed from the original top-to-bottom operation, and the loop returns to the loop start program statement block 101 located above, and then continues to run sequentially from the loop start program statement block 101 downward.
以顺序运行状态举例,例如图1中,程序由子程序调用程序语句块103运行到电机旋转程序语句块104的过程为顺序运行,程序流程控制状态为顺序运行状态。包含子程序调用程序语句块103、电机旋转程序语句块104的指示条在内的发光指示流水灯带,从上到下依次点亮,然后又依次熄灭,指示程序顺序向下运行。当程序运行到子程序调用程序语句块103时,发光指示流水灯带在子程序调用程序语句块103上的部分发光单元点亮,指示当前程序运行到了这一行;当程序运行到电机旋转程序语句块104时,发光指示流水灯带在电机旋转程序语句块104上的部分发光单元点亮,指示当前程序运行到了这一行。Taking the sequential running state as an example, for example, in Figure 1, the process of the program running from the subroutine calling program statement block 103 to the motor rotation program statement block 104 is sequential running, and the program flow control state is the sequential running state. The light-emitting indicator light strip, including the indicator bars of the subroutine calling program statement block 103 and the motor rotation program statement block 104, lights up from top to bottom, and then goes out in turn, indicating that the program is running downward in sequence. When the program runs to the subroutine calling program statement block 103, some of the light-emitting units of the light-emitting indicator light strip on the subroutine calling program statement block 103 light up, indicating that the current program has run to this line; when the program runs to the motor rotation program statement block 104, some of the light-emitting units of the light-emitting indicator light strip on the motor rotation program statement block 104 light up, indicating that the current program has run to this line.
以分支状态举例,例如图1中,如果开始程序语句块102和如果结束程序语句块105分别构成了分支的起点和分支的终点,在如果开始程序语句块102所代表的程序位置,程序根据如果开始程序语句块102右侧拼接的表达式计算出结果,然后根据计算结果选择运行左分支,即直接跳转至如果结束程序语句块105,或运行右分支,即顺序运行至子程序调用程序语句块103、电机旋转程序语句块104、如果结束程序语句块105。当程序流程控制状态处于分支状态时,如果程序运行了左分支,则发光指示流水灯带中位于分支形状左半边的指示条会从上到下依次点亮,指示程序走了左分支;如果程序运行了右分支,则发光指示流水灯带中位于分支形状右半边的指示条会从上到下依次点亮,指示程序走了右分支。Taking the branch state as an example, for example, in Figure 1, the if-start program statement block 102 and the if-end program statement block 105 constitute the starting point and end point of the branch, respectively. At the program position represented by the if-start program statement block 102, the program calculates the result based on the expression spliced to the right of the if-start program statement block 102, and then chooses to run the left branch based on the calculation result, that is, directly jump to the if-end program statement block 105, or run the right branch, that is, run sequentially to the subroutine call program statement block 103, the motor rotation program statement block 104, and the if-end program statement block 105. When the program flow control state is in the branch state, if the program runs the left branch, the indicator bars on the left half of the branch shape in the luminous indicator light strip will light up from top to bottom, indicating that the program has taken the left branch; if the program runs the right branch, the indicator bars on the right half of the branch shape in the luminous indicator light strip will light up from top to bottom, indicating that the program has taken the right branch.
以跳转状态举例,例如图1中循环结束程序语句块106循环回到循环开始程序语句块101的过程中,实际发生了一次程序从后向前的跳转。该跳转过程中程序流程控制状态为跳转状态,第二投影灯3012和第一投影灯3011依次亮起或同时亮起或亮起某一个,代表程序发生了从循环结束程序语句块106跳转到了循环开始程序语句块101。Taking the jump state as an example, in FIG1 , when loop-end program statement block 106 loops back to loop-start program statement block 101, a program jump from back to front actually occurs. During this jump, the program flow control state is in the jump state, and the second projection light 3012 and the first projection light 3011 illuminate sequentially, simultaneously, or one of them illuminates, indicating that the program has jumped from loop-end program statement block 106 to loop-start program statement block 101.
以等待状态举例,当程序运行到等待程序语句块时,等待程序语句块上进度条形状的发光指示流水灯带会从进度条一侧逐渐亮到进度条另一侧,指示程序在次程序块处正在等待。进度条可为长条形状、环形、折现形等。For example, when the program reaches the waiting block, a progress bar-shaped indicator light strip will gradually illuminate from one side of the bar to the other, indicating that the program is waiting at the next block. The progress bar can be in a long, circular, or folded shape.
以子程序调用状态举例,例如图1中子程序调用程序语句块103,当目标子程序,即此处的子程序“f()”,正在被调用运行时,子程序标识符,即此处的“f()”上方或周围设置的发光指示流水灯带按照一定规律点亮。例如环绕子程序标识符的发光指示流水灯带旋转点亮、熄灭;或此处的发光指示流水灯带整体逐渐变亮然后逐渐变暗;或此处的发光指示流水灯带整体闪烁。Taking the subroutine call state as an example, for example, the subroutine call program statement block 103 in Figure 1, when the target subroutine, that is, subroutine "f()" here, is being called and executed, the luminous indicator light strip set above or around the subroutine identifier, that is, "f()" here, lights up according to a certain pattern. For example, the luminous indicator light strip surrounding the subroutine identifier rotates and lights up and goes out; or the luminous indicator light strip here gradually brightens and then gradually dims; or the luminous indicator light strip here flashes as a whole.
在一个可选实施例中,程序表达式计算状态包括变量或常量的值、表达式计算中间数据的值、数据类型、表达式运算优先级、表达式各部分计算的顺序等,指示条包括布尔数据指示条或/和数值数据指示条,布尔数据指示条或/和数值数据指示条分别设于程序语句块中的指定语句块,当指定程序模块进行程序表达式计算时,布尔数据指示条或/和数值数据指示条依据所程序表达式计算状态所对应的点亮形式亮起。In an optional embodiment, the program expression calculation status includes the value of a variable or constant, the value of intermediate data in the expression calculation, the data type, the expression operation priority, the order of calculation of each part of the expression, etc. The indicator bar includes a Boolean data indicator bar and/or a numerical data indicator bar. The Boolean data indicator bar and/or the numerical data indicator bar are respectively arranged in a specified statement block in the program statement block. When the specified program module performs the program expression calculation, the Boolean data indicator bar and/or the numerical data indicator bar lights up according to the lighting form corresponding to the program expression calculation status.
参照图1,如果开始程序语句块102和如果结束程序语句块105所共同构成的条件分支程序语义。如果开始程序语句块102右侧拼接有条件分支的条件表达式。这个表达式内容为x>1234,具体来说由第一变量程序语句块2011、比较运算符程序语句块202、第一常量程序语句块203构成。这个表达式中的指定语句块,如第一变量程序语句块2011、比较运算符程序语句块202、第一常量程序语句块203上方均设置有用于指示布尔数据传递的指示条,即为上述布尔数据指示条,三个指示条相互邻接,共同构成了发光指示流水灯带,该发光指示流水灯带用于指示这几个程序语句块所代表的程序语句之间的布尔数据传递关系。Referring to Figure 1, the conditional branch program semantics jointly constituted by the if start program statement block 102 and the if end program statement block 105. A conditional expression of the conditional branch is spliced on the right side of the if start program statement block 102. The content of this expression is x>1234, specifically, it is composed of the first variable program statement block 2011, the comparison operator program statement block 202, and the first constant program statement block 203. The designated statement blocks in this expression, such as the first variable program statement block 2011, the comparison operator program statement block 202, and the first constant program statement block 203, are all provided with indicator bars for indicating Boolean data transfer, namely the above-mentioned Boolean data indicator bars, and the three indicator bars are adjacent to each other, and together constitute a luminous indicator water light strip, which is used to indicate the Boolean data transfer relationship between the program statements represented by these program statement blocks.
这个表达式中的指定语句块,如第一变量程序语句块2011、比较运算符程序语句块202、第一常量程序语句块203下方均设置有用于指示数值数据传递的指示条,即为上述数值数据指示条,三个指示条相互邻接,共同构成了发光指示流水灯带,该发光指示流水灯带用于指示这几个程序语句块所代表的程序语句之间的数值数据传递关系。The specified statement blocks in this expression, such as the first variable program statement block 2011, the comparison operator program statement block 202, and the first constant program statement block 203, are all provided with indicator bars for indicating the transfer of numerical data, namely the above-mentioned numerical data indicator bars. The three indicator bars are adjacent to each other and together constitute a luminous indicator flow light strip, which is used to indicate the numerical data transfer relationship between the program statements represented by these program statement blocks.
在本实施例当中将布尔数据指示条和数值数据指示条分为了两个独立的指示条,在其他实施例当中,布尔数据指示条和数值数据指示条也可以设置为同一个指示条,或只设置二者之一,或不设置。In this embodiment, the Boolean data indicator bar and the numerical data indicator bar are divided into two independent indicator bars. In other embodiments, the Boolean data indicator bar and the numerical data indicator bar can also be set as the same indicator bar, or only one of them can be set, or neither can be set.
值得注意的是,布尔数据指示条、数值数据指示条仅设置指定语句块中,如在涉及到相应数据类型的数据产生、数据计算、数据传递、数据使用的程序语句块上。例如如果开始程序语句块102需要布尔类型的表达式计算结果作为程序运行左分支或右分支的依据,因此如果开始程序语句块102上设置有布尔数据指示条;如果开始程序语句块102无法接收数值型数据,因此如果开始程序语句块102上没有数值数据指示条。第一变量程序语句块2011因为本身代表的是数值型变量x,因此其上设置有数值数据指示条;第一变量程序语句块2011在表达式当中,能够构成一个返回值为布尔类型数据的表达式的一部分,因此存在传递布尔数据的功能,因此设置有布尔数据指示条。It is worth noting that the Boolean data indicator bar and the numerical data indicator bar are only set in the specified statement block, such as the program statement block involving data generation, data calculation, data transfer, and data use of the corresponding data type. For example, if the start program statement block 102 requires the calculation result of a Boolean expression as the basis for the left branch or right branch of the program operation, a Boolean data indicator bar is set on the start program statement block 102; if the start program statement block 102 cannot receive numerical data, there is no numerical data indicator bar on the start program statement block 102. The first variable program statement block 2011 is provided with a numerical data indicator bar because it represents the numerical variable x; the first variable program statement block 2011 can constitute a part of an expression whose return value is Boolean type data in the expression, so it has the function of transferring Boolean data, and therefore a Boolean data indicator bar is provided.
例如当条件表达式成立时,即x>1234判断结果为true时,代表条件分支起点的如果开始程序语句块102上的指示条会按照程序运行方向从上到下依次点亮指示条靠右的分支上的发光单元,指示程序运行了右侧分支,且右侧分支上的后续程序语句块子程序调用程序语句块103、电机旋转程序语句块104上的相互邻接的指示条的发光单元也会按照程序运行方向从上到下依次亮起;当条件表达式不成立时,即x>1234判断结果为false时,代表条件分支起点的如果开始程序语句块102上的指示条会按照程序运行方向从上到下依次点亮指示条靠左的分支上的发光单元,指示程序运行了左侧分支,且通过如果开始程序语句块102的左分支程序会直接跳转至如果结束程序语句块105的左侧分支,如果结束程序语句块105的指示条左侧分支会按照程序运行方向从上到下依次点亮靠左的分支上的发光单元。For example, when the conditional expression is true, that is, when the judgment result of x>1234 is true, the indicator bar on the if-start program statement block 102 representing the starting point of the conditional branch will light up the light-emitting units on the right branch of the indicator bar from top to bottom in accordance with the program running direction, indicating that the program has run the right branch, and the light-emitting units of the adjacent indicator bars on the subsequent program statement block subroutine call program statement block 103 and the motor rotation program statement block 104 on the right branch will also light up in sequence from top to bottom in accordance with the program running direction; when the conditional expression is not true, that is, when the judgment result of x>1234 is false, the indicator bar on the if-start program statement block 102 representing the starting point of the conditional branch will light up the light-emitting units on the left branch of the indicator bar from top to bottom in accordance with the program running direction, indicating that the program has run the left branch, and through the left branch of the if-start program statement block 102, the program will directly jump to the left branch of the if-end program statement block 105, and the left branch of the indicator bar of the if-end program statement block 105 will light up the light-emitting units on the left branch in sequence from top to bottom in accordance with the program running direction.
如果开始程序语句块102右侧分支的指示条、子程序调用程序语句块103的指示条、电机旋转程序语句块104的指示条相互邻接,这几个邻接的指示条构成发光指示流水灯带,该发光指示流水灯带用于指示这几个程序语句块所代表程序语句之间的程序运行状态转移关系,即程序运行到如果开始程序语句块102右侧分支后,下一步会运行子程序调用程序语句块103所代表的程序语句,再下一步会运行电机旋转程序语句块104所代表的程序语句,程序运行状态在上述几个块所代表的程序语句之间进行转移。If the indicator bar on the right branch of the start program statement block 102, the indicator bar on the subroutine calling program statement block 103, and the indicator bar on the motor rotation program statement block 104 are adjacent to each other, these adjacent indicator bars constitute a luminous indicator flow light strip, which is used to indicate the program running status transfer relationship between the program statements represented by these program statement blocks, that is, after the program runs to the right branch of the start program statement block 102, the next step will be to run the program statement represented by the subroutine calling program statement block 103, and the next step will be to run the program statement represented by the motor rotation program statement block 104, and the program running status is transferred between the program statements represented by the above-mentioned blocks.
上述程序语句块包括条件分支块,条件分支块的指示条包括至少一个程序入口指示条和至少两个程序出口指示条。The program statement block includes a conditional branch block, and the indicator bar of the conditional branch block includes at least one program entry indicator bar and at least two program exit indicator bars.
参照图1,如果开始程序语句块102为条件分支块的一种,设有倒Y字形指示条,该程序语句块上方为本程序语句的程序入口指示条,下方设有本程序语句的两个程序出口指示条。1 , if the start program statement block 102 is a conditional branch block, an inverted Y-shaped indicator bar is provided, with the program entry indicator bar for the program statement above and two program exit indicator bars for the program statement below.
本实施例中,上述数值数据包括整数、浮点数、小数、分数等。上述布尔数据包括true、false。数据传递包括表达式计算过程中变量或常量将其所代表的数据传递给运算符以进行运算的逻辑过程、表达式计算中间值或结果传递的逻辑过程等。In this embodiment, the numerical data includes integers, floating-point numbers, decimals, fractions, etc. The Boolean data includes true and false. Data transfer includes the logical process of transferring the data represented by a variable or constant to an operator for calculation during expression calculation, and the logical process of transferring intermediate values or results of expression calculation.
例如x>1234这个表达式,参与这个表达式计算的程序语句对应第一变量程序语句块2011、比较运算符程序语句块202、第一常量程序语句块203。以第一变量程序语句块2011为例,其上方设置有代表布尔数据传递的第一布尔数据指示条3021,其下方设置有代表数值数据传递的数值数据指示条。For example, in the expression x>1234, the program statements involved in calculating this expression correspond to first variable program statement block 2011, comparison operator program statement block 202, and first constant program statement block 203. Taking first variable program statement block 2011 as an example, a first Boolean data indicator bar 3021 representing Boolean data transfer is located above it, and a numerical data indicator bar representing numerical data transfer is located below it.
0058.下面以x>1234这个表达式的计算和数据传递过程为例说明布尔数据指示条、数值数据指示条的工作方式。0058. The following uses the calculation and data transfer process of the expression x>1234 as an example to illustrate how the Boolean data indicator bar and the numerical data indicator bar work.
第一步,先取当前变量值x,第一变量程序语句块2011会将数值型变量x所代表的值通过其下方的数值数据指示条呈现,根据x值的大小来以相应的亮度点亮第一变量程序语句块2011下方的灯。数值数据指示条亮起时亮度或颜色与所传递数据的值或数据类型相关。例如传递数据类型为数值型的数据时,通过了蓝色表示正数、通过紫色表示负数;传递数据类型为布尔型的数据时,通过红色表示false,通过绿色表示true。用于指示数据传递的指示条点亮时的语义为数值数据的传递时,上述指示条亮度与所传递数值数据大小或数值数据绝对值大小正相关。例如x的值为50时,灯光亮度为50%,x的值为20时,灯光亮度为20%,直观反映x的实时值的大小。在这个计算过程中假设x当前值为20。The first step is to obtain the current variable value x. The first variable program block 2011 displays the value represented by the numeric variable x through the numeric data indicator bar below it. The light below the first variable program block 2011 illuminates at a corresponding brightness based on the value of x. The brightness or color of the numeric data indicator bar when it illuminates is related to the value or data type of the data being transferred. For example, when transferring numeric data, blue indicates positive numbers and purple indicates negative numbers; when transferring Boolean data, red indicates false and green indicates true. When the indicator bar used to indicate data transfer is lit, the brightness of the indicator bar is positively correlated with the size of the transferred numeric data or the absolute value of the numeric data. For example, when the value of x is 50, the light brightness is 50%, and when the value of x is 20, the light brightness is 20%, which directly reflects the current value of x. In this calculation, it is assumed that the current value of x is 20.
第二步,取第一常量程序语句块203所代表的值,第一常量程序语句块203会将数值型常量1234所代表的值通过其下方的数值数据指示条呈现,例如常量1234值为1234,灯光亮度为100%。用户通过观察第一变量程序语句块2011的数值数据指示条亮度和第一常量程序语句块203的数值数据指示条亮度,可以直观看出两者之间的大小关系。The second step is to take the value represented by the first constant program statement block 203. The first constant program statement block 203 displays the value represented by the numeric constant 1234 through the numerical data indicator bar below it. For example, if the value of constant 1234 is 1234, the light brightness is 100%. By observing the brightness of the numerical data indicator bar in the first variable program statement block 2011 and the brightness of the numerical data indicator bar in the first constant program statement block 203, the user can intuitively see the relationship between the two.
第三步,通过连接第一变量程序语句块2011和第一常量程序语句块203的比较运算符程序语句块202对两个数值数据进行比较判断,产生布尔型比较结果数据。该计算过程中数值型数据传递过程为第一变量程序语句块2011将x的值的数值型数据从左向右传递给比较运算符程序语句块202,比较运算符程序语句块202下方代表数值数据传递的指示条左半部分从左向右依次点亮发光单元;第一常量程序语句块203将1234的值的数值型数据从右向左传递给比较运算符程序语句块202,比较运算符程序语句块202下方代表数值数据传递的指示条右半部分从右向左依次点亮发光单元。In the third step, the comparison operator program block 202, which connects the first variable program block 2011 and the first constant program block 203, compares the two numerical data and generates Boolean comparison result data. In this calculation process, the numerical data transfer process is as follows: the first variable program block 2011 transfers the numerical data of the value of x to the comparison operator program block 202 from left to right, and the left half of the indicator bar below the comparison operator program block 202, which represents the numerical data transfer, lights up the light-emitting units from left to right. The first constant program block 203 transfers the numerical data of the value 1234 from right to left to the comparison operator program block 202, and the right half of the indicator bar below the comparison operator program block 202, which represents the numerical data transfer, lights up the light-emitting units from right to left.
第四步,进行大于判断,判断左侧的值不大于右侧的值,因此判断结果产生的为false。用于指示数据传递的指示条点亮时的语义为布尔数据的传递时,上述指示条在传递true、false时点亮不同颜色。这里以红色代表false,绿色代表true为例。比较运算符程序语句块202点亮上方的布尔数据指示条并呈现红色,表示大于判断产生的布尔型结果为false。The fourth step is to perform a greater-than check. The value on the left is not greater than the value on the right, so the result is false. When the indicator bar indicating data transfer is illuminated, the semantics of the transfer are Boolean data. The indicator bar illuminates in different colors when transferring true and false. Here, red represents false and green represents true. Comparison operator program block 202 illuminates the upper Boolean data indicator bar in red, indicating that the greater-than check results in a false Boolean result.
第五步,将表达式计算结果传递给如果开始程序语句块102。比较运算符程序语句块202所代表的大于判断程序语句判断结果为false,该布尔数据需要传递给如果开始程序语句块102,因此比较运算符程序语句块202、第一变量程序语句块2011、如果开始程序语句块102这几个程序语句块上的指示布尔数据传递的指示条从右向左依次点亮代表false的红色发光单元,体现false数据的传递过程。Step 5: Pass the expression calculation result to the if-start program statement block 102. The greater-than judgment statement represented by the comparison operator program statement block 202 evaluates to false, and this Boolean data needs to be passed to the if-start program statement block 102. Therefore, the indicator bars indicating Boolean data transfer on the comparison operator program statement block 202, the first variable program statement block 2011, and the if-start program statement block 102 sequentially light up the red light-emitting units representing false from right to left, reflecting the false data transfer process.
任一程序语句块在和其他程序语句块连接并构成表达式后,用于指示数据传递的指示条所代表的潜在数据传递路径在没有构建为有效数据传递路径时该指示条不可见。After any program statement block is connected with other program statement blocks to form an expression, the potential data transfer path represented by the indicator bar for indicating data transfer is invisible if it is not constructed as a valid data transfer path.
数据传递路径指的是数据产生的程序语句到使用数据的程序语句所经过的路径。例如在上述将表达式x>1234计算结果的布尔数据传递给如果开始程序语句块102的过程中,布尔数据从比较运算符程序语句块202产生,由比较运算符程序语句块202上方的布尔数据指示条呈现,数据传递的呈现经过了第一变量程序语句块2011上方的第一布尔数据指示条3021,传递给如果开始程序语句块102,并由如果开始程序语句块102右上方的布尔数据指示条呈现。这个案例当中的数据传递路径为比较运算符程序语句块202、第一变量程序语句块2011、如果开始程序语句块102上方的指示布尔数据传递的指示条。The data transfer path refers to the path taken from the program statement that generates the data to the program statement that uses the data. For example, in the process of transferring the Boolean data resulting from the expression x>1234 to the "if start" program statement block 102, the Boolean data is generated from the comparison operator program statement block 202 and is represented by the Boolean data indicator bar above the comparison operator program statement block 202. The data transfer passes through the first Boolean data indicator bar 3021 above the first variable program statement block 2011, is transferred to the "if start" program statement block 102, and is represented by the Boolean data indicator bar to the upper right of the "if start" program statement block 102. The data transfer path in this case is the comparison operator program statement block 202, the first variable program statement block 2011, and the indicator bar indicating the Boolean data transfer above the "if start" program statement block 102.
潜在数据传递路径指的是可能作为数据传递路径的一部分的指示条。A potential data delivery path refers to an indicator bar that may be part of a data delivery path.
例如第一变量程序语句块2011和第二变量程序语句块2012上方的第一布尔数据指示条3021和第二布尔数据指示条3022。由于第一变量程序语句块2011上方的第一布尔数据指示条3021在表达式x>1234当中参与传递了表达式的计算结果布尔数据,因此其潜在数据传递路径构成了有效数据传递路径,因此第一布尔数据指示条3021可见。For example, the first Boolean data indicator bar 3021 and the second Boolean data indicator bar 3022 above the first variable program statement block 2011 and the second variable program statement block 2012. Since the first Boolean data indicator bar 3021 above the first variable program statement block 2011 participates in transmitting the Boolean data of the calculation result of the expression x>1234, its potential data transmission path constitutes a valid data transmission path, and therefore the first Boolean data indicator bar 3021 is visible.
而由于第二变量程序语句块2012上方的第二布尔数据指示条3022在表达式1234+x当中没有参与传递了任何布尔数据,因此其潜在数据传递路径没有构成有效数据传递路径,因此第二布尔数据指示条3022不可见。However, since the second Boolean data indicator bar 3022 above the second variable program statement block 2012 does not participate in the transmission of any Boolean data in the expression 1234+x, its potential data transmission path does not constitute a valid data transmission path, so the second Boolean data indicator bar 3022 is not visible.
如图1为例的程序运行状态指示系统当中,第一指示条3031、第二指示条3032、第三指示条3033共同构成了用于指示程序流程控制状态发光指示流水灯带;第四指示条3041、第五指示条3042、第六指示条3043共同构成了用于指示程序表达式计算状态发光指示流水灯带。In the program running status indication system shown in Figure 1, the first indicator bar 3031, the second indicator bar 3032, and the third indicator bar 3033 together constitute a light-emitting indicator flow light strip for indicating the program flow control status; the fourth indicator bar 3041, the fifth indicator bar 3042, and the sixth indicator bar 3043 together constitute a light-emitting indicator flow light strip for indicating the program expression calculation status.
如图1为例,拼接后能够构成用于指示程序流程控制状态发光指示流水灯带的程序语句块包括所有位于行首的程序语句块,包括循环开始程序语句块101、如果开始程序语句块102、子程序调用程序语句块103、电机旋转程序语句块104、如果结束程序语句块105、循环结束程序语句块106。这些程序语句块都包含能够拼接后构成用于指示程序流程控制状态发光指示流水灯带的指示条,例如第一指示条3031、第二指示条3032、第三指示条3033等。Taking Figure 1 as an example, the program blocks that can be spliced together to form a light-emitting indicator light strip for indicating the program flow control status include all program blocks at the beginning of the line, including the loop start program block 101, the if start program block 102, the subroutine call program block 103, the motor rotation program block 104, the if end program block 105, and the loop end program block 106. These program blocks all contain indicator bars that can be spliced together to form a light-emitting indicator light strip for indicating the program flow control status, such as the first indicator bar 3031, the second indicator bar 3032, the third indicator bar 3033, etc.
在一个可选实施例中,上述程序语句块为实体积木块,拼接后发光指示流水灯带用于指示程序流程控制状态,此时,拼接得到的程序运行指示板中每一上述程序语句块的指示条包括至少一个入口指示条及至少一个出口指示条。例如如果结束程序语句块105上设置的Y字形指示条,分为左上方的一个入口指示条、右上方的一个入口指示条、下方的一个出口指示条。上述入口指示条一端延伸至程序语句块的一对接端面,另一端连接出口指示条的一端,出口指示条的另一端延伸至程序语句块的一对接端面。In an optional embodiment, the above-mentioned program statement blocks are solid building blocks, and after splicing, the light-emitting indicator light strips are used to indicate the program flow control status. At this time, the indicator bars of each of the above-mentioned program statement blocks in the spliced program operation indicator board include at least one entry indicator bar and at least one exit indicator bar. For example, if the Y-shaped indicator bar set on the end program statement block 105 is divided into an entry indicator bar on the upper left, an entry indicator bar on the upper right, and an exit indicator bar at the bottom. One end of the above-mentioned entry indicator bar extends to a docking end face of the program statement block, and the other end is connected to one end of the exit indicator bar, and the other end of the exit indicator bar extends to a docking end face of the program statement block.
具体地,两个入口指示条与出口指示条的一端在Y字形的中心点连接,另一端分别延伸至程序语句块的一个对接端面。例如右上方的入口指示条延伸至了与上方直接连接的程序语句块接口的对接端面,参照图1,其对接了电机旋转程序语句块104;左上方的入口指示条延伸至了与上方间接连接的程序语句块逻辑接口的对接端面,该指示条的延长线上逻辑语义上对接了如果开始程序语句块102;下方的出口指示条延伸至了与下方直接连接的程序语句块接口的对接端面,如图1中,其对接了循环结束程序语句块106。当上述程序语句块为屏幕图形界面上的图形控件时,对接端面为两个程序语句块图形相互对接的图形边缘;当上述程序语句块为实体代码积木块时,对接端面为实体代码积木块相互接合的外表面。Specifically, one end of the two entry indicator bars and the exit indicator bar are connected at the center point of the Y shape, and the other end extends to a docking end face of the program statement block. For example, the entry indicator bar on the upper right extends to the docking end face of the program statement block interface directly connected to the top, and with reference to FIG1 , it docks with the motor rotation program statement block 104; the entry indicator bar on the upper left extends to the docking end face of the program statement block logic interface indirectly connected to the top, and the extension line of the indicator bar logically and semantically docks with the if start program statement block 102; the exit indicator bar below extends to the docking end face of the program statement block interface directly connected to the bottom, and with reference to FIG1 , it docks with the loop end program statement block 106. When the above-mentioned program statement block is a graphic control on the screen graphical interface, the docking end face is the graphic edge where the two program statement block graphics dock with each other; when the above-mentioned program statement block is a physical code building block, the docking end face is the outer surface where the physical code building block is connected with each other.
各上述程序语句块拼接时,程序语句块之间的入口指示条与出口指示条对接,以形成上述发光指示流水灯带。例如图1中的如果结束程序语句块105的右上方的入口指示条对接了电机旋转程序语句块104下方的出口第一指示条3031;如果结束程序语句块105的左上方的入口指示条隔空对接了如果开始程序语句块102左下方的出口指示条,隔空对接指的是对接双方指示条其延长线能够直接连接,呈现对接的逻辑语义;如果结束程序语句块105的下方的出口指示条对接了循环结束程序语句块106上方的入口第三指示条3033。这些指示条对接后形成了发光指示流水灯带。When each of the above-mentioned program statement blocks is spliced together, the entry indicator bars and exit indicator bars between the program statement blocks are docked to form the above-mentioned luminous indicator water light strip. For example, in Figure 1, the entry indicator bar on the upper right of the if-end program statement block 105 is docked with the first exit indicator bar 3031 below the motor rotation program statement block 104; the entry indicator bar on the upper left of the if-end program statement block 105 is docked with the exit indicator bar on the lower left of the if-start program statement block 102. Docking in the air means that the extension lines of the docked indicator bars of both parties can be directly connected, presenting the logical semantics of docking; the exit indicator bar below the if-end program statement block 105 is docked with the third entry indicator bar 3033 above the loop end program statement block 106. After these indicator bars are docked, a luminous indicator water light strip is formed.
在一个可选实施例中,一个或多个程序语句块组成一行程序语句单元,每一行程序语句单元代表指定程序模块中的一行代码,程序运行指示板由多行程序语句单元组成。参照图1,第一行程序当中仅包括一个循环开始程序语句块101,该程序语句块组成了一行程序语句单元,代表指定程序模块当中的第一行代码“循环开始”;第二行程序当中包括一个如果开始程序语句块102、一个第一变量程序语句块2011、一个比较运算符程序语句块202、一个第一常量程序语句块203,这4个程序语句块组成一行程序语句单元,代表指定程序模块当中的第二行代码“如果开始(x>1234)”;第三行程序当中包括一个子程序调用程序语句块103、一个第二常量程序语句块、一个加号运算符程序语句块、一个第二变量程序语句块2012,这4个程序语句块组成一行程序语句单元,代表指定程序模块当中的第三行代码“f(1234+x)”;第四行程序当中包括一个电机旋转程序语句块104、一个布尔常量程序语句块,这2个程序语句块组成一个行程序语句单元,代表指定程序模块当中的第四行代码“电机旋转(真)”;第五行程序当中仅包括一个如果结束程序语句块105,该程序语句块组成了一行程序语句单元,代表指定程序模块当中的第一行代码“如果结束”;第六行程序当中仅包括一个循环结束程序语句块106,该程序语句块组成了一行程序语句单元,代表指定程序模块当中的第一行代码“循环结束”。In an optional embodiment, one or more program statement blocks constitute a line of program statement units, each line of program statement units represents a line of code in a specified program module, and the program running indicator board is composed of multiple lines of program statement units. Referring to Figure 1, the first line of program includes only a loop start program statement block 101, which constitutes a line of program statement units, representing the first line of code "loop start" in the specified program module; the second line of program includes an if start program statement block 102, a first variable program statement block 2011, a comparison operator program statement block 202, and a first constant program statement block 203. These four program statement blocks constitute a line of program statement units, representing the second line of code "if start (x>1234)" in the specified program module; the third line of program includes a subroutine call program statement block 103, a second constant program statement block, a plus operator program statement block, and a second variable program statement block 2012. The four program statement blocks constitute a line of program statement unit, representing the third line of code "f(1234+x)" in the specified program module; the fourth line of the program includes a motor rotation program statement block 104 and a Boolean constant program statement block. These two program statement blocks constitute a line of program statement unit, representing the fourth line of code "Motor rotation (true)" in the specified program module; the fifth line of the program includes only an if-end program statement block 105, which constitutes a line of program statement unit, representing the first line of code "if-end" in the specified program module; the sixth line of the program includes only a loop-end program statement block 106, which constitutes a line of program statement unit, representing the first line of code "loop-end" in the specified program module.
本实施例中,包括上述的6行程序语句单元共同构成了程序运行指示板,对应的发光指示流水灯带包括用于代表程序流程控制状态的第一发光灯带和用于代表程序表达式计算状态的第二发光灯带。如第一指示条3031、第二指示条3032、第三指示条3033共同构成了用于指示程序流程控制状态发光指示流水灯带,称为第一发光灯带;第四指示条3041、第五指示条3042、第六指示条3043共同构成了用于指示程序表达式计算状态发光指示流水灯带,称为第二发光灯带。In this embodiment, the aforementioned six-line program statement unit collectively constitutes a program execution indicator panel, and the corresponding luminous indicator light strip includes a first luminous light strip for representing the program flow control state and a second luminous light strip for representing the program expression calculation state. For example, the first indicator bar 3031, the second indicator bar 3032, and the third indicator bar 3033 collectively constitute the luminous indicator light strip for indicating the program flow control state, referred to as the first luminous light strip; the fourth indicator bar 3041, the fifth indicator bar 3042, and the sixth indicator bar 3043 collectively constitute the luminous indicator light strip for indicating the program expression calculation state, referred to as the second luminous light strip.
第一发光灯带从第一行上述程序语句单元分布延伸至最后一行上述程序语句单元,例如图1中位于最左侧的贯穿了所有位于行首的程序语句块的发光指示流水灯带,由每一个位于行首的程序语句块上的部分指示条共同构成,例如第一指示条3031、第二指示条3032、第三指示条3033共同构成。The first luminous light strip extends from the first row of the above-mentioned program statement units to the last row of the above-mentioned program statement units. For example, the luminous indicator light strip located on the far left in Figure 1 that runs through all the program statement blocks at the beginning of the row is composed of partial indicator bars on each program statement block at the beginning of the row, such as the first indicator bar 3031, the second indicator bar 3032, and the third indicator bar 3033.
第二发光指示流水灯带沿指定行的程序语句单元横向分布,例如图1中位于第三行程序f(1234+x)当中的横向分布的表达式下方的数值数据指示条,第四由指示条3041、第五指示条3042、第六指示条3043共同构成。The second light-emitting indicator light strip is horizontally distributed along the program statement unit of the specified row, such as the numerical data indicator bar below the horizontally distributed expression in the third line of program f(1234+x) in Figure 1, and the fourth is composed of indicator bar 3041, fifth indicator bar 3042, and sixth indicator bar 3043.
在一个可选实施例中,指定行的程序语句单元由多个程序语句块拼接组成,例如第三行程序语句单元由子程序调用程序语句块103、第二常量程序语句块、加号运算符程序语句块、第二变量程序语句块2012共同构成。In an optional embodiment, the program statement unit of a specified line is composed of multiple program statement blocks. For example, the program statement unit of the third line is composed of a subroutine call program statement block 103, a second constant program statement block, a plus operator program statement block, and a second variable program statement block 2012.
在一个可选实施例中,各程序语句块可以为相同或/和不同类型的程序语句块,程序语句块的类型至少包括流程控制类、数据结构类、输入输出类以及运算符类中的至少两种,其中,流程控制类包括循环开始程序语句块101、循环结束程序语句块106、如果开始程序语句块102、否则程序语句块、如果结束程序语句块105等;数据结构类包括变量程序语句块、常量程序语句块、布尔常量程序语句块等,输入输出类包括电机旋转程序语句块104、电机停止程序语句块、传感器读入程序语句块等,运算符类包括比较运算符程序语句块202、加号运算符程序语句块等等。In an optional embodiment, each program statement block can be a program statement block of the same or/and different types, and the types of program statement blocks include at least two of process control class, data structure class, input and output class and operator class, wherein the process control class includes loop start program statement block 101, loop end program statement block 106, if start program statement block 102, otherwise program statement block, if end program statement block 105, etc.; the data structure class includes variable program statement block, constant program statement block, Boolean constant program statement block, etc.; the input and output class includes motor rotation program statement block 104, motor stop program statement block, sensor read program statement block, etc.; the operator class includes comparison operator program statement block 202, plus operator program statement block, etc.
参照图1,程序运行指示板包括流程控制类的循环开始程序语句块101、数据结构类的变量程序语句块、输入输出类的电机旋转程序语句块104、运算符类的加号运算符程序语句块等。1 , the program execution indicator board includes a loop start program statement block 101 of the process control class, a variable program statement block of the data structure class, a motor rotation program statement block 104 of the input and output class, a plus operator program statement block of the operator class, and the like.
在一个可选实施例中,程序运行指示板可用于表示跳转语义,对应的拼接程序语句块可称为跳转语义程序语句块。参照图1,如果开始程序语句块102和如果结束程序语句块105,在如果开始程序语句块102走左分支的情况下,程序会从第二行的如果开始程序语句块102左分支直接跳转至第五行的如果结束程序语句块105左分支。再例如循环结束程序语句块106和循环开始程序语句块101,在第六行循环结束程序语句块106运行到最左侧分支时,程序走到出口指示条后,会跳转回到第一行循环开始程序语句块101的最左侧分支。In an optional embodiment, the program running indicator board can be used to represent jump semantics, and the corresponding spliced program statement block can be called a jump semantic program statement block. Referring to Figure 1, if the start program statement block 102 and the if end program statement block 105, in the case where the if start program statement block 102 takes the left branch, the program will directly jump from the left branch of the if start program statement block 102 on the second row to the left branch of the if end program statement block 105 on the fifth row. For another example, the loop end program statement block 106 and the loop start program statement block 101, when the loop end program statement block 106 on the sixth row runs to the leftmost branch, the program will jump back to the leftmost branch of the loop start program statement block 101 on the first row after reaching the exit indicator bar.
本实施例中,跳转语义程序语句块设置有射灯或投影灯,射灯或投影灯光照方向为与程序跳转方向相同。In this embodiment, a spotlight or projection light is provided for a jump semantic program statement block, and the lighting direction of the spotlight or projection light is the same as the program jump direction.
例如循环结束程序语句块106代表在程序运行到此循环结束程序语句时,程序跳转回到循环开始程序语句块101所代表的程序开始程序语句。因此在跳转起点循环结束程序语句块106和跳转终点循环开始程序语句块101上分别设置有射灯或第二投影灯3012和第一投影灯3011,射灯或第二投影灯3012从跳转起点照射向跳转终点,射灯或第一投影灯3011从跳转终点照射向跳转起点。For example, loop end block 106 indicates that when the program reaches this loop end block, the program jumps back to the program start block represented by loop start block 101. Therefore, a spotlight or second projection light 3012 and a first projection light 3011 are respectively provided on loop end block 106, the jump start point, and loop start block 101, the jump end point. The spotlight or second projection light 3012 illuminates from the jump start point to the jump end point, and the spotlight or first projection light 3011 illuminates from the jump end point to the jump start point.
系统当中可能存在多个跳转语义程序语句块,可以只在部分程序语句块上设置射灯或投影灯。例如循环开始程序语句块101和循环结束程序语句块106,可以在这两个程序语句块上均设置射灯或投影灯,也可以只在其中一个上面设置射灯或投影灯。There may be multiple jump semantic program blocks in the system, and spotlights or projection lights can be set on only some of the program blocks. For example, for loop start program block 101 and loop end program block 106, spotlights or projection lights can be set on both program blocks, or only on one of them.
在一个可选实施例中,系统还包括输入设备,例如测距传感器、光敏传感器等。系统中存在和输入设备有对应关系的程序语句块,例如和测距传感器对应的“读取测距传感器读数”的程序语句块、“读取光敏传感器读数”的程序语句块等。本实施例中,与输入设备有对应关系的程序语句块上的发光单元,根据输入设备的输入状态点亮;当输入设备的输入状态处于不同状态下,与输入设备有对应关系的程序语句块上的发光单元点亮的颜色或亮度或图案不同。In an optional embodiment, the system further includes input devices, such as a range sensor and a light sensor. The system includes program blocks corresponding to the input devices, such as the "Read range sensor reading" and "Read light sensor reading" blocks corresponding to the range sensor. In this embodiment, the light-emitting units in the program blocks corresponding to the input devices illuminate according to the input state of the input devices. When the input state of the input devices is in different states, the light-emitting units in the program blocks corresponding to the input devices illuminate with different colors, brightness, or patterns.
举例地,在程序运行状态下,当程序运行到“读取测距传感器读数”这个程序语句块所对应的程序时,测距传感器获取传感器信息,将读数或读数对应的显示内容传递给“读取测距传感器读数”的程序语句块,“读取测距传感器读数”的程序语句块根据读数或读数对应的显示内容点亮其上设置的发光单元。例如读数越大发光单元亮度越高;或读数大于某阈值时发光单元颜色为绿色,读数小于某阈值时发光单元为橙色;或直接通过数码管将读数通过数码管图案显示出来;或读数越大时点亮的发光单元数量越多,根据读数大小呈现出不同的图案。For example, when the program is running and reaches the program block corresponding to the "Read Distance Sensor Reading" block, the distance sensor acquires sensor information and passes the reading or the corresponding display content to the "Read Distance Sensor Reading" block. The "Read Distance Sensor Reading" block then illuminates the light-emitting units located therein based on the reading or the corresponding display content. For example, the greater the reading, the brighter the light-emitting unit; the light-emitting unit may be green when the reading is greater than a certain threshold, and orange when the reading is less than a certain threshold; the reading may be displayed directly on a digital tube using a pattern; or the greater the reading, the more light-emitting units may be illuminated, displaying different patterns based on the reading size.
在一个可选实施例中,在前述基础上,程序语句块显示在屏幕图形界面上,程序语句块为屏幕图形界面上的图形控件,指示条为条带状的图案,发光单元为条带状的图案中的图形元素或屏幕像素点。用户可以通过鼠标或触屏拖拽图形界面上的程序语句块拼接形成上述程序运行指示板,即进行程序语句块的拼接,搭建程序。In an optional embodiment, based on the above, program blocks are displayed on a screen graphical interface, wherein the program blocks are graphical controls on the screen graphical interface, the indicator bar is a striped pattern, and the light-emitting units are graphical elements or screen pixels within the striped pattern. A user can drag the program blocks on the graphical interface using a mouse or touch screen to form the program execution indicator board, thereby splicing the program blocks and building a program.
在一个可选实施例中,在前述基础上,程序语句块为实体代码积木块,实体代码积木块设有电子接口,各实体代码积木块之间能够通过电子接口相连接,指示条为塑料件和丝印图案,发光单元为灯珠或嵌入在程序语句块上的小型屏幕,灯珠可以为LED,小型屏幕可以为OLED屏幕或墨水屏或TTF屏幕。用户可以通过连接实体代码积木块的电子接口,搭建程序。In an optional embodiment, based on the above, the program statement blocks are physical code building blocks, and the physical code building blocks are provided with electronic interfaces, and the physical code building blocks can be connected through the electronic interfaces. The indicator bar is a plastic part with a silk-screen pattern, and the light-emitting unit is a lamp bead or a small screen embedded in the program statement block. The lamp bead can be an LED, and the small screen can be an OLED screen, an ink screen, or a TTF screen. Users can build programs by connecting the electronic interfaces of the physical code building blocks.
本发明还提供了一种实体代码积木块,包括积木块本体,此积木块本体即为前述实施例所阐述的程序语句块。The present invention also provides a physical code building block, including a building block body, which is the program statement block described in the above embodiment.
以上实施例仅表达了本发明的优选的实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。The above embodiments merely represent preferred embodiments of the present invention. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent. It should be noted that a person skilled in the art would be able to make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the patent for this invention shall be determined by the appended claims.
Claims (11)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410355255.3A CN117951037B (en) | 2024-03-27 | 2024-03-27 | Program running status indication system and physical code building blocks |
| CN202410355255.3 | 2024-03-27 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025201045A1 true WO2025201045A1 (en) | 2025-10-02 |
Family
ID=90792551
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2025/081981 Pending WO2025201045A1 (en) | 2024-03-27 | 2025-03-12 | Program running state indication system and physical code block |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN117951037B (en) |
| WO (1) | WO2025201045A1 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117951037B (en) * | 2024-03-27 | 2024-06-18 | 武汉派呦科技有限公司 | Program running status indication system and physical code building blocks |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6959431B1 (en) * | 1999-05-13 | 2005-10-25 | Compuware Corporation | System and method to measure and report on effectiveness of software program testing |
| CN102375475A (en) * | 2010-08-09 | 2012-03-14 | 联想(北京)有限公司 | Portable electronic equipment and light effect displaying method thereof |
| CN103257915A (en) * | 2013-05-21 | 2013-08-21 | 北京小米科技有限责任公司 | Method and device for providing operation state of software of display equipment |
| CN113094282A (en) * | 2021-04-28 | 2021-07-09 | 腾讯科技(深圳)有限公司 | Program block running method, device, equipment and storage medium |
| CN117951037A (en) * | 2024-03-27 | 2024-04-30 | 武汉派呦科技有限公司 | Program running state indicating system and entity code building block |
Family Cites Families (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US3540003A (en) * | 1968-06-10 | 1970-11-10 | Ibm | Computer monitoring system |
| DE2558910A1 (en) * | 1975-12-27 | 1977-07-07 | Hans Dr Ing Herrmann | Visual program testing for data processing installations - enabling program progess monitoring w.r.t. displayed flow chart using auxiliary programs identifying branch and initial addresses |
| JPH04337843A (en) * | 1991-05-15 | 1992-11-25 | Hitachi Ltd | Program operation display method |
| JP2000322295A (en) * | 1999-05-12 | 2000-11-24 | Nec Corp | Method and device for programming support for data base stored sub-program |
| JPWO2006075369A1 (en) * | 2005-01-13 | 2008-06-12 | 富士通株式会社 | Electronic equipment and control program |
| CN101645035A (en) * | 2009-09-08 | 2010-02-10 | 中兴通讯股份有限公司 | Method for detecting program code operation position and embedded system |
| JP5495968B2 (en) * | 2009-11-30 | 2014-05-21 | 株式会社野村総合研究所 | Discourse structure analysis system and discourse structure analysis program |
| CN108305529A (en) * | 2018-04-10 | 2018-07-20 | 广州大学 | A kind of hypostazation programing system |
| US11822468B2 (en) * | 2019-05-24 | 2023-11-21 | Microsoft Technology Licensing, Llc | Executable code branch annotations for objective branch verification |
| CN112131048A (en) * | 2020-09-18 | 2020-12-25 | 苏州浪潮智能科技有限公司 | A kind of control method and device of server indicator light |
| CN113985785B (en) * | 2021-10-28 | 2024-04-23 | 中国计量大学现代科技学院 | Distributed electrical equipment operation state monitoring method |
| CN114495934A (en) * | 2022-02-28 | 2022-05-13 | 海信视像科技股份有限公司 | Voice instruction response state prompting method and display device |
| CN116225858A (en) * | 2022-12-19 | 2023-06-06 | 北京东土科技股份有限公司 | Control method, device, electronic device and storage medium of LED indicator light |
| CN116737211A (en) * | 2023-06-26 | 2023-09-12 | 成都芯盛集成电路有限公司 | Method, system, device and medium for prompting upgrading state of embedded system |
| CN117238236B (en) * | 2023-10-07 | 2025-04-22 | 深圳市明上光电子有限公司 | Display control method, system, medium and equipment based on lamp strip |
| CN117707377A (en) * | 2024-01-30 | 2024-03-15 | 中国船舶集团有限公司第七〇七研究所 | Computer machine protection panel and method under interaction condition without display interface |
-
2024
- 2024-03-27 CN CN202410355255.3A patent/CN117951037B/en active Active
-
2025
- 2025-03-12 WO PCT/CN2025/081981 patent/WO2025201045A1/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6959431B1 (en) * | 1999-05-13 | 2005-10-25 | Compuware Corporation | System and method to measure and report on effectiveness of software program testing |
| CN102375475A (en) * | 2010-08-09 | 2012-03-14 | 联想(北京)有限公司 | Portable electronic equipment and light effect displaying method thereof |
| CN103257915A (en) * | 2013-05-21 | 2013-08-21 | 北京小米科技有限责任公司 | Method and device for providing operation state of software of display equipment |
| CN113094282A (en) * | 2021-04-28 | 2021-07-09 | 腾讯科技(深圳)有限公司 | Program block running method, device, equipment and storage medium |
| CN117951037A (en) * | 2024-03-27 | 2024-04-30 | 武汉派呦科技有限公司 | Program running state indicating system and entity code building block |
Also Published As
| Publication number | Publication date |
|---|---|
| CN117951037B (en) | 2024-06-18 |
| CN117951037A (en) | 2024-04-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2025201045A1 (en) | Program running state indication system and physical code block | |
| CN110362299B (en) | Online graphical programming system based on block and raspberry pie and using method thereof | |
| US8860581B2 (en) | Element mapping to control illumination of a device shell | |
| CN110908710B (en) | A visualization method for web front-end code dependencies | |
| CN113141690A (en) | Single-point controllable light-emitting device and system | |
| EP2455856A1 (en) | Program generation device | |
| CN102375475A (en) | Portable electronic equipment and light effect displaying method thereof | |
| CN100543672C (en) | Program creation device and program creation method | |
| CN113760256A (en) | Non-code programming method and hand-held programming device using same | |
| JP2003085001A (en) | Source code debugger, debugging method and debugging program | |
| CN222421159U (en) | Building block and building block system with indicator light | |
| JP2001087468A (en) | Illuminator for game machine | |
| KR100342049B1 (en) | Multi-color Back light system for Hand Phone | |
| CN222028713U (en) | Building block with projection device and building block system | |
| CN117601752A (en) | An interactive vehicle light control method, device, electronic device and storage medium | |
| CN100489648C (en) | Method for displaying on-off state of electronic equipment and on-off interactive device | |
| JP2022040959A (en) | Light emitting pattern creation device, light emitting pattern creation program, illumination device and illumination system | |
| CN115366788A (en) | Control method of vehicle interior lamp, vehicle and computer storage medium | |
| CN114494549A (en) | Model rendering method and device and electronic equipment | |
| CN115202549B (en) | Lamp control method and device, storage medium and terminal equipment | |
| CN223140358U (en) | LED display screen with small-volume driving chip | |
| CN201267712Y (en) | electronic game device | |
| CN222529906U (en) | Building block with operating piece and building block system | |
| CN119258546A (en) | Control method, device and electronic device of luminous building blocks based on encouragement effect | |
| CN118132059B (en) | Graphical programming method, device, equipment and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 25776188 Country of ref document: EP Kind code of ref document: A1 |