Visual programming editor program, computer and method

The visual programming editor addresses the issue of non-adjacent program parts and comments in text-based code by linking them based on positional relationships and user interactions, improving code readability.

JP7581671B2Active Publication Date: 2024-11-13OMRON CORP
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
JP2020112588
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2020-06-30
Publication Date
2024-11-13
Estimated Expiration
2040-06-30

AI Technical Summary

Technical Problem

Existing visual programming editors fail to maintain the adjacency of program parts and their corresponding comments when converting code from a visual format to text-based code, leading to reduced readability.

Method used

A visual programming editor that arranges program parts and comments adjacent to each other in text-based code by determining the positional relationship and distance between them, using a threshold value to link or unlink comments based on user operations, and displaying associations visually.

Benefits of technology

Improves the readability of text-based code by ensuring program parts and comments are placed nearby, enhancing the clarity and understandability of the generated code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007581671000001
    Figure 0007581671000001
  • Figure 0007581671000002
    Figure 0007581671000002
  • Figure 0007581671000003
    Figure 0007581671000003
Patent Text Reader

Abstract

To arrange a program component and a comment for the program component in the vicinity when converting a code created using a program editor into a text-based code.SOLUTION: A program causes one or more processors to execute the steps of: arranging one or more program components 110 and one or more comments 130 on a screen of a visual programming editor 100 upon receiving an operation; determining whether or not to associate a specific comment with a specific program component on the basis of a positional relation between the specific comment included in the one or more comments and the specific program component included in the one or more program components; and generating a text-based code 150 with a text of the specific comment and a text of the specific program component arranged nearby on the basis of the determination to associate the specific comment with the specific program component.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present disclosure relates to a program for a visual programming editor, and more particularly to a conversion technique for a program created with a visual programming editor. [Background technology]

[0002] In recent years, visual programming, in which a program is created by combining block-shaped program parts and the like using a visual program editor, has become widespread. Some visual program editors have a function of converting code created using the visual program editor into text-based code. However, when code created using the visual program editor is converted into text-based code, program parts and comments for the program parts may not be arranged adjacent to each other, resulting in low-readability text-based code.

[0003] Regarding visual programming, for example, International Publication No. 2018 / 092237 (Patent Document 1) discloses a program code generation device that "has a block diagram acquisition unit that acquires a block diagram that defines a data processing procedure to be reflected in program code by connecting multiple blocks, and a contradiction checking unit that traces the connections between blocks in the block diagram and checks whether there is a contradiction in the data processing procedure defined in the block diagram" (see paragraph

[0006] ).

[0004] Other techniques related to visual programming are disclosed, for example, in International Publication No. 2019 / 026248 (Patent Document 2) and International Publication No. 2019 / 132037 (Patent Document 3). [Prior art documents] [Patent documents]

[0005] [Patent Document 1] International Publication No. 2018 / 092237 [Patent Document 2] International Publication No. 2019 / 026248 [Patent Document 3] International Publication No. 2019 / 132037 Summary of the Invention [Problem to be solved by the invention]

[0006] According to the techniques disclosed in Patent Documents 1 to 3, when code created using a program editor is converted into text-based code, it is not possible to arrange program parts and comments for the program parts adjacent to each other. Therefore, there is a need for a technique for arranging program parts and comments for the program parts adjacent to each other when converting code created using a program editor into text-based code.

[0007] The present disclosure has been made in consideration of the above-described background, and an object of one aspect is to provide a technique for arranging program parts and comments for the program parts in close proximity when converting code created using a program editor into text-based code. [Means for solving the problem]

[0008] In one example of the present disclosure, a program is provided that causes one or more processors to perform the steps of: arranging one or more program parts and one or more comments on a screen of a visual programming editor based on receiving an operation; determining whether or not to link a specific comment to a specific program part based on a positional relationship between a specific comment included in the one or more comments and a specific program part included in the one or more program parts; and generating text-based code in which the text of the specific comment and the text of the specific program part are arranged adjacent to each other based on the determination that the specific comment is to be linked to the specific program part.

[0009] According to the above disclosure, a program can place related program parts and comments close together in text-based code.

[0010] In the above disclosure, the step of determining whether to link a specific comment to a specific program part includes a step of determining whether the distance from the specific comment to the specific program part is within a predetermined threshold, and a step of linking the specific comment and the specific program part based on the distance being equal to or less than the threshold.

[0011] According to the above disclosure, the program can link a particular comment to a particular program part based on a threshold value.

[0012] In the above disclosure, the one or more processors are further caused to execute a step of placing, in the text-based code, text of a comment that is not associated with any of the one or more program parts at the beginning of the text-based code based on the presence of a comment that is not associated with any of the one or more program parts.

[0013] According to the above disclosure, a program can place comments that are not associated with any program part in an appropriate position within text-based code.

[0014] In the above disclosure, the program further causes one or more processors to execute a step of displaying a threshold range based on receiving an operation that brings a specific comment closer to a certain range of a specific program part.

[0015] According to the above disclosure, the program can visually indicate the threshold range to the user.

[0016] In the above disclosure, the step of arranging one or more program parts and one or more comments on a screen of a visual programming editor includes a step of arranging a first program part, a second program part, and a specific comment. The program further causes one or more processors to execute a step of linking the specific comment to a program part that is closer to the first program part or the second program part, based on the fact that the distance between the specific comment and each of the first program part and the second program part is equal to or less than a threshold.

[0017] According to the above disclosure, the program can uniquely select a program part to which a comment is linked.

[0018] In the above disclosure, the program further causes one or more processors to execute a step of setting a certain range close to both the first program part and the second program part as an invalid range in which a specific comment is not linked to each of the first program part and the second program part when the first program part and the second program part are arranged adjacent to each other.

[0019] According to the above disclosure, the program can uniquely select a program part to which a comment is linked.

[0020] In the above disclosure, the step of arranging one or more program parts and one or more comments on a screen of a visual programming editor includes a step of arranging a specific program part, a first comment, and a second comment, and the program further includes a step of determining a display order of the first comment and the second comment in the text-based code based on a distance from each of the first comment and the second comment to the specific program part, based on the fact that both the first comment and the second comment are linked to the specific program part.

[0021] According to the above disclosure, the program can appropriately determine the placement of multiple comments within text-based code.

[0022] In the above disclosure, the program further causes one or more processors to execute a step of unlinking a specific comment and a specific program part based on receiving an operation that causes the distance between the linked specific comment and the specific program part to be greater than a threshold value.

[0023] According to the above disclosure, the program can provide a means for unlinking a program part and a comment.

[0024] In the above disclosure, the program further causes one or more processors to execute a step of unlinking a specific comment and a specific program part based on double-clicking a specific comment linked to a specific program part, and increasing the distance between the specific comment and the specific program part to greater than a threshold value.

[0025] According to the above disclosure, the program can provide a means for unlinking a program part and a comment.

[0026] In the above disclosure, the program further causes one or more processors to execute a step of performing a process of linking or unlinking a specific comment and a specific program part, regardless of the distance between the specific comment and the specific program part, based on receiving a manual input of a linking control command.

[0027] According to the above disclosure, the program can provide a means for unlinking a program part and a comment.

[0028] In the above disclosure, the program further causes one or more processors to execute a step of changing the color of the linked specific comment and specific program part based on the linking of the specific comment and the specific program part.

[0029] According to the above disclosure, the program can visually display the association between program parts and comments.

[0030] In the above disclosure, the program further causes one or more processors to execute a step of displaying a connecting line between the associated specific comment and the associated specific program part based on the association of the specific comment and the specific program part.

[0031] According to the above disclosure, the program can visually display the association between program parts and comments.

[0032] In the above disclosure, the program further causes one or more processors to execute a step of displaying a frame surrounding the linked specific comment and specific program part based on linking the specific comment and specific program part.

[0033] According to the above disclosure, the program can visually display the association between program parts and comments.

[0034] In another example of the disclosure, a computer is provided that includes a memory having stored therein any of the above programs and one or more processors for executing the programs.

[0035] According to the above disclosure, a program can place related program parts and comments close together in text-based code.

[0036] Another disclosed example provides a method for converting code in a computer, the method including the steps of: arranging one or more program parts and one or more comments on a screen of a visual programming editor based on receiving an operation, determining whether or not to link a specific comment to a specific program part based on a positional relationship between a specific comment included in the one or more comments and a specific program part included in the one or more program parts, and generating text-based code in which the text of the specific comment and the text of the specific program part are arranged adjacent to each other based on the determination that the specific comment is to be linked to the specific program part.

[0037] According to the above disclosure, a program can place related program parts and comments close together in text-based code. Effect of the Invention

[0038] According to one embodiment, when code created using a program editor is converted into text-based code, it is possible to place program parts and comments for those program parts adjacent to each other.

[0039] The above and other objects, features, aspects and advantages of the present disclosure will become apparent from the following detailed description of the disclosure taken in conjunction with the accompanying drawings. [Brief description of the drawings]

[0040] [Figure 1] FIG. 1 illustrates an example of a visual programming editor 100 according to an embodiment. [Diagram 2] 13 is a diagram showing a first example of association between a comment 130 and a program part 110. FIG. [Diagram 3] 13 is a diagram showing a second example of linking a comment 130 and a program part 110. FIG. [Figure 4]13 is a diagram showing a third example of linking a comment 130 and a program part 110. FIG. [Diagram 5] 13 is a diagram showing a fourth example of linking a comment 130 and a program part 110. FIG. [Figure 6] 1A and 1B are diagrams showing an example of a change in the display of a program part 110 on an editor 102. [Figure 7] FIG. 11 is a diagram showing another example of a visual program. [Figure 8] FIG. 1 is a diagram illustrating an example of a flow-type visual program. [Figure 9] FIG. 1 is a diagram showing an example of a block-type visual program. [Figure 10] 10 is a diagram showing an example of a text program 1050 generated based on a program P. FIG. [Figure 11] FIG. 2 is a diagram illustrating an example of functional blocks of a visual programming editor 100. [Figure 12] FIG. 12 is a diagram showing an example of a hardware configuration of an apparatus 1200 for executing a program of the visual programming editor 100. [Figure 13] 13 is an example of a first linking process between the comment 130 and the program part 110. [Figure 14] 13 is an example of a second linking process between the comment 130 and the program part 110. [Figure 15] 13 is an example of a third linking process between the comment 130 and the program part 110. [Figure 16] 13 is an example of a fourth linking process between the comment 130 and the program part 110. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0041] Hereinafter, an embodiment of the technical idea according to the present disclosure will be described with reference to the drawings. In the following description, the same components are denoted by the same reference numerals. The names and functions of the components are also the same. Therefore, detailed descriptions thereof will not be repeated.

[0042] <A. Application Example> FIG. 1 is a diagram showing an example of a visual programming editor 100 according to the present embodiment. With reference to FIG. 1, the conversion function of the source code of the visual programming editor 100 will be described. The visual programming editor 100 can provide a function for performing flow-type visual programming that combines, for example, block-shaped program components and connectors as shown in FIG. 1. In one aspect, the visual programming editor 100 may provide a function for programming by stacking blocks as shown in FIG. 7. In another aspect, the visual programming editor 100 may provide a function for programming using an arbitrary visual representation.

[0043] Hereinafter, for the sake of distinction, the program code visually created using the visual programming editor 100 will be referred to as a "visual program". On the other hand, the text-based program code will be referred to as a "text program". The visual programming editor 100 includes a program component list 101 and an editor 102.

[0044] The program component list 101 includes a list of program components 110. The program component 110 is, for example, a component of a program having a certain function. The editor 102 is an area for creating a visual program. The user can insert, for example, the program component 110 selected from the program component list 101 into the editor 102 by drag and drop. Also, the user can define the connection between the program components 110 using the connector 120, set the output data of a certain program component 110 as the input data of another program component 110, and create one program as a whole.

[0045] In the example shown in FIG. 1, program parts 110A to 110C exist on editor 102. Furthermore, program part 110A and program part 110B are connected by connector 120A. This indicates that output data of program part 110A is passed as input data of program part 110B. Furthermore, program part 110B and program part 110C are connected by connector 120B. This indicates that output data of program part 110B is passed as input data of program part 110C. Furthermore, program part 110B and the terminal part are connected by connector 120C. This indicates that, for example, output data of program part 110B is output as output of visual program 105.

[0046] The user can further place a comment 130 on the editor 102. In the example of FIG. 1, comments 130A to 130C are placed on the editor 102. Each of these comments 130A to 130C is a comment for each of the program parts 110A to 110C. The comment 130 may be linked to a specific program part 110, or may not be linked to any program part 110. The comment 130 that is not linked to any program part 110 is, for example, a comment for the entire program.

[0047] The visual programming editor 100 has a function of converting a visual program 105 created by a combination of program components 110, connectors 120, and comments 130 into a text program 150. The comments and code included in the text program 150 have the same content as the comments and code included in the visual program 105. For example, comments 151A to 151C included in the text program 150 correspond to comments 130A to 130C included in the visual program 105. Also, codes 152A to 152C included in the text program 150 correspond to program components 110A to 110C included in the visual program 105. As an example, each of the codes 152A to 152C may also include information on the connectors 120 within the visual program 105.

[0048] Normally, in source code written in text, comments are often written immediately before the corresponding code. If the distance between a comment and the code corresponding to the comment becomes large, the readability of the program is significantly impaired. Therefore, based on the positional relationship or distance between each comment 130 and program component 110, the visual program 105 arranges the associated comments 130 and program components 110 adjacent to or next to each other on the text program 150.

[0049] In a certain aspect, the user may be able to freely move each program component 110, connector 120, and comment 130 arranged on the editor 102 by drag and drop. Also, in another aspect, the user may be able to directly input the coordinates of each program component 110, connector 120, and comment 130 arranged on the editor 102. Also, in another aspect, the user may be able to set properties, etc. for each program component 110, connector 120, and comment 130 arranged on the editor 102 using another screen, side menu, dialog, or the like.

[0050] <B. Association of Comments and Program Components> Next, with reference to Figures 2 to 7, we will explain how the visual programming editor 100 links each comment 130 and each program part 110, and how it places the linked comments 130 and program parts 110 adjacent to each other on the text program 150.

[0051] 2 is a diagram showing a first example of linking between comment 130 and program part 110. On editor 102, a linking area 201 is set around program part 110. When a block of comment 130 comes into contact with linking area 201, comment 130 and program part 110 are linked. In other words, when the distance between comment 130 and program part 110 is equal to or less than a predetermined threshold, comment 130 and program part 110 are linked.

[0052] In one aspect, the distance between the comment 130 and the program part 110 may include the distance between the centers of the block of the comment 130 and the block of the program part 110, the distance between specific corners, the distance between frames, etc. In another aspect, the visual programming editor 100 may link the comment 130 and the program part 110 based on the fact that the mouse cursor holding the comment 130 has come into contact with the linking area 201.

[0053] As an example, the visual programming editor 100 may dynamically perform linking between each comment 130 and each program component 110 by comparing the threshold value with the distance between each comment 130 and each program component 110 each time a user operation is received.

[0054] Additionally, the visual programming editor 100 may change the display of linked comments 130 and program parts 110 to visually indicate to the user that particular comments 130 and program parts 110 are linked.

[0055] The displays 210, 220, and 230 are examples of displays showing the associated comment 130 and program part 110. In one aspect, the visual programming editor 100 may connect the associated comment 130 and program part 110 with a comment connector. The comment connector may have a different thickness and / or color from the connector 120 for distinction. In another aspect, the visual programming editor 100 may surround the associated comment 130 and program part 110 with a frame. In another aspect, the visual programming editor 100 may change the color of the associated comment 130 and program part 110. In still another aspect, the visual programming editor 100 may combine the displays 210, 220, and 230 as appropriate.

[0056] As described above, the visual programming editor 100 can determine whether or not there is a clear link between the comment 130 and the program part 110, based on the positional relationship between the comment 130 and the program part 110, or the distance between the comment 130 and the program part 110. Furthermore, the visual programming editor 100 can visually present the link between the comment 130 and the program part 110 to the user by changing the display of the linked comment 130 and program part 110.

[0057] 3 is a diagram showing a second example of linking between the comment 130 and the program component 110. The comments of a program may include a comment for a specific code and a comment that refers to the entire program. The visual programming editor 100 determines that a comment 130 that is not linked to any program component 110 is a comment that refers to the entire program. In other words, the visual programming editor 100 determines that a comment 130 that is away from any program component 110 by a distance equal to or greater than the linking threshold is a comment that refers to the entire program.

[0058] 3, comment 130D is a comment that refers to the entire program because it is not linked to any of program parts 110A to 110C. Conversely, comment 130C is a comment that refers to a specific code (program part 110C) because it is linked to program part 110C.

[0059] The visual programming editor 100 outputs a text program based on, for example, receiving an input of a command to generate a text program from a user. The text program 350 corresponds to the visual program 300.

[0060] The codes 352A to 352C correspond to the program parts 110A to 110C, respectively. The comment 351C corresponds to the comment 130C. The comment 351D corresponds to the comment 130D.

[0061] The visual programming editor 100 places a comment 130D that is not linked to any program component 110 at the beginning of the text program 350. In a certain aspect, when the visual program 300 includes multiple comments 130 that are not linked to any program component 110, the visual programming editor 100 may place all of these comments 130 at the beginning of the text program 150.

[0062] The visual programming editor 100 places the comment 351C adjacent to the code 352C. In one aspect, the visual programming editor 100 may place the comment 351C on the line immediately before or after the code 352C. In another aspect, the visual programming editor 100 may add the comment 351C to the end of the code 352C.

[0063] As described above, the visual programming editor 100 places linked comments 130 and program parts 110 adjacent to each other in the text program, and places comments 130 that are not linked to any program parts 110 at the beginning of the text program. In this way, for example, comments for the entire program are placed near the beginning of the text program, and comments for each piece of code are placed on the line immediately preceding each piece of code, etc. As a result, the readability of the text program generated from the visual program is improved.

[0064] Fig. 4 is a diagram showing a third example of the association between the comment 130 and the program part 110. In the example shown in Fig. 4, in a visual program 400, a plurality of comments 130A and 130B are associated with one program part 110A.

[0065] It is assumed that visual programming editor 100 has generated text program 450 based on visual program 400. Text program 450 includes comments 451A and 451B corresponding to comments 130A and 130B, respectively, and code 452A corresponding to program part 110A.

[0066] In such a case, the visual programming editor 100 may determine the arrangement order of the comments 451A and 451B based on the distance from the program part 110A to each of the comments 130A and 130B. In the example of Fig. 4, the comment 130A is closer to the program part 110A than the comment 130B. Therefore, the visual programming editor 100 arranges the comments 451A and 451B in this order, immediately before the code 452A.

[0067] In one aspect, the visual programming editor 100 may prioritize a comment 130 located closer to a certain program part 110 when arranging the comment 130 in the text program. In another aspect, the visual programming editor 100 may prioritize a comment 130 located farther from a certain program part 110 when arranging the comment 130 in the text program.

[0068] As described above, multiple comments 130 may be associated with a certain program part 110. In this case, the visual programming editor 100 may determine the priority of the placement of each comment 130 on the text program based on the distance from the program part 110 to each comment 130. This function allows the user to change the order of the comments placed on the text program by adjusting the position of the comment 130 on the editor 102.

[0069] 5 is a diagram showing a fourth example of linking between the comment 130 and the program part 110. The fourth example includes a special linking example 501 and a linking example 502. The linking example 501 shows linking control between the comment 130 and the program part 110 by a user operation. By receiving an input of manual linking control from the user, the visual programming editor 100 can execute linking or deletion of linking between the comment 130 and the program part 110 regardless of the distance between the comment 130 and the program part 110.

[0070] For example, the visual programming editor 100 may link the comment 130A outside the linking area 201 to the program part 110A based on receiving a manual linking control input from the user. The visual programming editor 100 may also delete the link between the comment 130B in the linking area 201 and the program part 110A based on receiving a manual linking control input from the user. In one aspect, the visual programming editor 100 may delete the link based on receiving an operation to move the comment 130 or the comment connector outside the linking area 201. In another aspect, the visual programming editor 100 may delete the link based on double-clicking the comment 130 or the comment connector. In addition, at that time, the visual programming editor 100 may move the comment 130 from which the linking has been deleted outside the linking area 201.

[0071] Linking example 502 shows linking control of comment 130A when comment 130A touches linking regions 201 of multiple program parts 110A and 110B. In a case like linking example 502, the visual programming editor 100 compares the distance between comment 130A and program part 110A with the distance between comment 130B and program part 110A, and links the program part 110 closer to comment 130A to comment 130A.

[0072] Similarly, when the comment 130 touches the linking regions 201 of three or more program parts 110, the visual programming editor 100 links the comment 130 to the program part 110 that is closest in distance.

[0073] As described above, the visual programming editor 100 provides a function for manually linking the comment 130 and the program part 110. This function allows the user to link the comment 130 and the program part 110 more flexibly. In addition, the visual programming editor 100 provides a function for controlling the linking of the comment 130 when the comment 130 touches the linking areas 201 of multiple program parts 110. This function allows the program part 110 to always execute consistent linking control of the comment 130 and the program part 110.

[0074] 6 is a diagram showing an example of a change in the display of a program component 110 on the editor 102. Around the program component 110, there is a linking area 201 and an even larger reaction area 601. When a comment 130 comes into contact with the linking area 201, the visual programming editor 100 links the comment 130 to the program component 110.

[0075] When a comment 130 touches a reaction area 601, the visual programming editor 100 displays the linking area 201 on the editor 102. This function allows the user to clearly recognize the linking area 201 of the program part 110. Note that the program part 110, the linking area 201, and the reaction area 601 may each be of any size.

[0076] Fig. 7 is a diagram showing another example of a visual program. The visual program shown in Fig. 7 differs from the flow-type visual program shown in Fig. 1 in that program parts 110 are stacked. Visual programming editor 100 may provide an editing function for the block-type visual program of Fig. 7.

[0077] The visual programming editor 100 sets an area around each program component 110 as an association area in a block-type visual program. For example, area 701A is the association area of program component 110A. Similarly, each of areas 701B to 701E is the association area of each of program components 110B to 110E.

[0078] In a block-type visual program, each program component 110 may be adjacent to each other, such as the adjacent part 705 between program components 110A and 110B. The area near the adjacent part 705 is unclear as to which adjacent program component 110 it belongs to. Therefore, the visual programming editor 100 may set the area around the adjacent part 705 as an invalid area 710 where no association is made. Even if the comment 130 touches the invalid area 710, the visual programming editor 100 does not associate the comment 130 with any program component 110. The visual programming editor 100 associates the comment 130 with the program component 110 only when the comment 130 touches any of the association areas 701.

[0079] As described above, the visual programming editor 100 can provide a function of associating the comment 130 and the program component 110 even in a block-type visual program. Also, the visual programming editor 100 can clearly associate the comment 130 with any one of the program components 110 by setting the area near the contact part between adjacent program components 110 as an invalid area.

[0080] <C. Example of conversion from visual program to text program> Next, an example of generating a text program from a visual program will be described with reference to Figs. 8 to 10. Fig. 8 is a diagram showing an example of a flow-type visual program. Fig. 9 is a diagram showing an example of a block-type visual program. The visual programs shown in Figs. 8 and 9 show the same program (hereinafter, referred to as "program P"). Program P includes program parts 810A to 810D. Program P also includes comments 830A and 830B that are not linked to any program parts, and comments 830B to 830F that are linked to any of the program parts 810A to 810D.

[0081] 10 is a diagram showing an example of a text program 1050 generated based on a program P. The text program 1050 includes comments 1030A to 1030F and codes 1010A to 1010D. Note that parameters and the like included in each code can be set on the visual programming editor 100.

[0082] Each of the comments 1030A and 1030B corresponds to each of the comments 830A and 830B that are not linked to any program parts. Therefore, the comments 1030A and 1030B are arranged at the beginning of the text program 1050. Note that, when there are multiple comments that are not linked to any program parts, the visual programming editor 100 may determine the display priority of the comments based on any criterion, such as the distance from the upper left coordinate of the editor 102 to each comment.

[0083] Comments 1030C and 1030D correspond to comments 830C and 830D linked to program part 810A, respectively. Therefore, comments 1030C and 1030D are placed immediately before code 1010A corresponding to program part 810A.

[0084] Comment 1030E corresponds to comment 830E associated with program component 810C. Therefore, comment 1030E is placed immediately before code 1010C corresponding to program component 810C.

[0085] Comment 1030F corresponds to comment 830F associated with program component 810D. Therefore, comment 1030F is placed immediately before code 1010D corresponding to program component 810D.

[0086] As described above, visual programming editor 100 generates a text program based on the visual program created on editor 102. At that time, visual programming editor 100 can place comments at appropriate positions on the text program based on the information on the association between comments and program components. With this function, the user can obtain a highly readable text program.

[0087] <D. System Configuration> FIG. 11 is a diagram showing an example of the functional blocks of visual programming editor 100. Each functional block shown in FIG. 11 may be implemented as a program. Also, these functional blocks can be executed on the hardware shown in FIG. 12.

[0088] Visual programming editor 100 includes a program component / comment placement unit 1101, an association range display unit 1102, an association selection unit 1103, an association display unit 1104, a dynamic association unit 1105, a manual association unit 1106, an association storage unit 1107, and an output unit 1108.

[0089] Based on receiving a user operation, program component / comment placement unit 1101 places program component 110 or comment 130 on editor 102. Alternatively, based on receiving a user operation, program component / comment placement unit 1101 moves program component 110 or comment 130 on editor 102.

[0090] The linking range display unit 1102 displays the linking area 201 on the editor 102. In one aspect, the linking range display unit 1102 may always display the linking area 201. In another aspect, the linking range display unit 1102 may display the linking area 201 based on the fact that the comment 130 has come within a certain distance (the reaction area 601) of the program part 110.

[0091] The linking selection unit 1103 selects the comment 130 to be linked and the program part 110. For example, when the comment 130 is in contact with the linking areas 201 of multiple program parts 110, the linking selection unit 1103 may select the program part 110 that is closest to the comment 130.

[0092] The association display unit 1104 displays the association between the comment 130 and the program part 110 on the editor 102. In one aspect, the association display unit 1104 may display a comment connector that connects the comment 130 and the program part 110. In another aspect, the association display unit 1104 may surround the associated comment 130 and program part 110 with a frame. In another aspect, the association display unit 1104 may change the color of the associated comment 130 and program part 110.

[0093] The dynamic linking unit 1105 executes a linking process between the comment 130 and the program part 110 based on the detection of the placement or movement of the comment 130 or the program part 110.

[0094] Based on receiving a manual linking control input from the user, the manual linking unit 1106 executes a linking process between the comment 130 and the program part 110. This process corresponds to the process described with reference to FIG.

[0095] The linking storage unit 1107 stores linking information between the linked comment 130 and the program part 110. The linking storage unit 1107 can store the linking information between the linked comment 130 and the program part 110 in either the primary storage device 1202 or the secondary storage device 1203, which will be described later.

[0096] Based on receiving an input of a request to output a text program from a user, output unit 1108 outputs the text program by referring to the linking information between comment 130 and program part 110 stored in linking storage unit 1107. In one aspect, output unit 1108 may automatically output the text program every time a change occurs in the linking information between comment 130 and program part 110.

[0097] 12 is a diagram showing an example of a hardware configuration of an apparatus 1200 for executing a program of the visual programming editor 100. In one aspect, the visual programming editor 100 may be executed as a program on one apparatus 1200. In another aspect, the visual programming editor 100 may be executed as a program on a system made up of a plurality of apparatuses 1200. In another aspect, the visual programming editor 100 may be executed in a cloud environment made up of a plurality of apparatuses 1200, and may be operated from another terminal via a browser.

[0098] The device 1200 includes a CPU (Central Processing Unit) 1201 , a primary storage device 1202 , a secondary storage device 1203 , an external device interface 1204 , an input interface 1205 , an output interface 1206 , and a communication interface 1207 .

[0099] The CPU 1201 may execute programs for implementing various functions of the device 1200. The CPU 1201 may be configured, for example, by at least one integrated circuit. The integrated circuit may be configured, for example, by at least one CPU, at least one FPGA (Field Programmable Gate Array), or a combination thereof.

[0100] The primary storage device 1202 stores programs executed by the CPU 1201 and data referenced by the CPU 1201. In one aspect, the primary storage device 1202 may be realized by a dynamic random access memory (DRAM), a static random access memory (SRAM), or the like.

[0101] Secondary storage device 1203 is a non-volatile memory, and may store programs executed by CPU 1201 and data referenced by CPU 1201. In this case, CPU 1201 executes programs read from secondary storage device 1203 to primary storage device 1202, and references data read from secondary storage device 1203 to primary storage device 1202. In one aspect, secondary storage device 1203 may be realized by a hard disk drive (HDD), a solid state drive (SSD), an erasable programmable read only memory (EPROM), an electrically erasable programmable read only memory (EEPROM), a flash memory, or the like.

[0102] The external device interface 1204 can be connected to any external device such as a printer, a scanner, an external HDD, etc. In one aspect, the external device interface 1204 may be realized by a USB (Universal Serial Bus) terminal or the like.

[0103] The input interface 1205 may be connected to any input device such as a keyboard, a mouse, a touchpad, or a gamepad. In one aspect, the input interface 1205 may be realized by a USB terminal, a PS / 2 terminal, a Bluetooth (registered trademark) module, or the like.

[0104] The output interface 1206 can be connected to any output device such as a cathode ray tube display, a liquid crystal display, an organic electro-luminescence (EL) display, etc. In one aspect, the output interface 1206 may be realized by a USB terminal, a D-sub terminal, a DVI (Digital Visual Interface) terminal, an HDMI (registered trademark) (High-Definition Multimedia Interface) terminal, etc.

[0105] The communication interface 1207 is connected to a wired or wireless network device. In one aspect, the communication interface 1207 may be realized by a wired LAN (Local Area Network) port, a Wi-Fi (Wireless Fidelity) (registered trademark) module, or the like. In another aspect, the communication interface 1207 may transmit and receive data using a communication protocol such as TCP / IP (Transmission Control Protocol / Internet Protocol) or UDP (User Datagram Protocol).

[0106] <E.フローチャート> Next, a processing procedure for controlling the association of comments 130 and program components 110 will be described with reference to Figures 13 to 16. In one aspect, CPU 1201 may load a program for performing the processes of Figures 13 to 16 from secondary storage device 1203 to primary storage device 1202 and execute the program. In another aspect, some or all of the processes may be realized as a combination of circuit elements configured to perform the processes.

[0107] Fig. 13 shows an example of a first linking process between the comment 130 and the program part 110. The process in Fig. 13 is a process performed when the user moves the comment 130 on the visual programming editor 100 by dragging it with the mouse.

[0108] In step S1305, the visual programming editor 100 detects the movement of the comment 130 by the mouse. In step S1310, the visual programming editor 100 repeatedly executes the processes of steps S1315 to S1335 while the mouse cursor is moving while holding the comment 130.

[0109] In step S1315, the visual programming editor 100 determines whether or not the mouse cursor is present within the linking area 201 of the placed program component 110. If the visual programming editor 100 determines that the mouse cursor is present within the linking area 201 of the placed program component 110 (YES in step S1315), the visual programming editor 100 transfers control to step S1325. If not (NO in step S1315), the visual programming editor 100 executes the process of step S1315 again. In a certain aspect, the visual programming editor 100 may determine whether or not the comment 130 held by the mouse cursor is present within the linking area 201 of the placed program component 110.

[0110] In step S1320, the visual programming editor 100 displays the linking region 201 of the program part 110 that the mouse cursor is approaching. More specifically, when the mouse cursor or the comment 130 being held by the mouse cursor comes into contact with the reaction region 601 of the program part 110, the visual programming editor 100 displays the linking region 201 of the program part 110.

[0111] In step S1325, the visual programming editor 100 determines the number of linked regions 201 touched by the mouse cursor. In one aspect, the visual programming editor 100 may determine the number of linked regions 201 touched by the comment 130 grabbed by the mouse cursor.

[0112] If the visual programming editor 100 determines that the number of tied regions 201 touched by the mouse cursor is two or more, it transfers control to step S1330. If the visual programming editor 100 determines that the number of tied regions 201 touched by the mouse cursor is one, it transfers control to step S1335. If the visual programming editor 100 determines that the number of tied regions 201 touched by the mouse cursor is zero, it transfers control to step S1315.

[0113] In step S1330, the visual programming editor 100 selects the program part 110 whose outline is the shortest distance from the mouse cursor as the object to be linked with the comment 130. In one aspect, the visual programming editor 100 may select the program part 110 whose outline is the shortest distance from the outline of the comment 130 grabbed by the cursor as the object to be linked with the comment 130.

[0114] In step S1335, the visual programming editor 100 displays a link between the program part 110 corresponding to the linking area 201 in contact with the mouse cursor or the comment 130 grabbed by the mouse cursor, and the comment 130 being moved by the mouse cursor. In one aspect, the visual programming editor 100 may connect the linked comment 130 and the program part 110 with a comment connector. In another aspect, the visual programming editor 100 may surround the linked comment 130 and the program part 110 with a frame. In another aspect, the visual programming editor 100 may change the color of the linked comment 130 and the program part 110. In still another aspect, the visual programming editor 100 may combine these display methods as appropriate.

[0115] In step S 1340 , the visual programming editor 100 stores the link information between the linked comment 130 and the program part 110 in the link storage unit 1107 .

[0116] In step S1345, the visual programming editor 100 outputs a text program corresponding to the visual program created by the visual programming editor 100 in response to a user operation.

[0117] Fig. 14 shows an example of a second linking process between the comment 130 and the program part 110. The process in Fig. 14 differs from the process in Fig. 13 in that it is a process performed when the user moves the program part 110 by dragging on the visual programming editor 100.

[0118] In step S1405, the visual programming editor 100 detects the movement of the program part 110 by the mouse. In step S1410, the visual programming editor 100 detects whether the mouse cursor is Program Part 110While the program part 110 is being moved while being grasped, the process of steps S1415 to S1430 is repeatedly executed. In step S1415, the visual programming editor 100 displays the linking region 201 of the program part 110 being moved.

[0119] In step S1420, the visual programming editor 100 determines the number of comments 130 touching the linked region 201 of the moving program component 110. If the visual programming editor 100 determines that the number of comments 130 touching the linked region 201 of the moving program component 110 is two or more, the visual programming editor 100 transfers control to step S1425. If the visual programming editor 100 determines that the number of comments touching the linked region 201 of the moving program component 110 is one, the visual programming editor 100 transfers control to step S1430. If the visual programming editor 100 determines that the number of comments touching the linked region 201 of the moving program component 110 is zero, the visual programming editor 100 transfers control to step S1415.

[0120] In step S1425, the visual programming editor 100 selects the comment 130 whose outline is the shortest distance from the mouse cursor as the comment to be linked to the program component 110. In one aspect, the visual programming editor 100 may select the comment 130 whose outline is the shortest distance from the outline of the comment 130 to the outline of the program component 110 grabbed by the cursor as the comment to be linked to the program component 110.

[0121] In step S1430, the visual programming editor 100 displays a link between the program part 110 being moved by the mouse cursor and the comment 130. In one aspect, the visual programming editor 100 may connect the linked comment 130 and program part 110 with a comment connector. In another aspect, the visual programming editor 100 may surround the linked comment 130 and program part 110 with a frame. In another aspect, the visual programming editor 100 may change the color of the linked comment 130 and program part 110. In still another aspect, the visual programming editor 100 may combine these display methods as appropriate.

[0122] In step S 1435 , the visual programming editor 100 stores the link information between the linked comment 130 and the program part 110 in the link storage unit 1107 .

[0123] In step S1440, the visual programming editor 100 outputs a text program corresponding to the visual program created by the visual programming editor 100 in response to a user operation.

[0124] Fig. 15 is an example of a third linking process between the comment 130 and the program part 110. The process in Fig. 15 differs from the processes in Fig. 13 and Fig. 14 in that the process in Fig. 15 is a process for the user to manually delete the link between the comment 130 and the program part 110.

[0125] In step S1510, the visual programming editor 100 detects that a link between an existing comment 130 and a program part 110 has been selected. In one aspect, the visual programming editor 100 may detect that a link between an existing comment 130 and a program part 110 has been selected based on an arbitrary input, such as a user right-clicking a comment connector with a mouse to open a menu.

[0126] In step S1520, the visual programming editor 100 detects that the deletion of the link between the comment 130 and the program part 110 has been selected from the menu. In one aspect, the visual programming editor 100 may detect a double click on the comment connector, instead of a menu operation.

[0127] In step S 1530 , the visual programming editor 100 deletes the link information of the specified comment 130 and program part 110 from the link storage unit 1107 .

[0128] In step S1540, visual programming editor 100 outputs a text program corresponding to the visual program reflecting the processes in steps S1510 to S1530 in response to the user's operation.

[0129] Fig. 16 is an example of a fourth linking process between the comment 130 and the program part 110. The process in Fig. 16 differs from the processes in Figs. 13 to 15 in that the process is a process for the user to manually link the comment 130 and the program part 110.

[0130] In step S1610, the visual programming editor 100 detects that one placed program part 110 and one placed comment 130 have been selected. In one aspect, the visual programming editor 100 may detect that one placed program part 110 and one placed comment 130 have been selected based on an arbitrary input, such as a user clicking the program part 110 and the comment 130 with a mouse.

[0131] In step S1620, the visual programming editor 100 detects that linking of the comment 130 and the program part 110 has been selected from the menu. In one aspect, the visual programming editor 100 may detect that linking has been selected from a menu in a menu bar of the visual programming editor 100. In another aspect, the visual programming editor 100 may detect that linking has been selected from a menu displayed by right-clicking the mouse.

[0132] In step S 1630 , the visual programming editor 100 stores the link information of the linked comment 130 and program part 110 in the link storage unit 1107 .

[0133] In step S1640, visual programming editor 100 outputs a text program corresponding to the visual program reflecting the processes in steps S1610 to S1630 in response to the user's operation.

[0134] In one aspect, the visual programming editor 100 can be executed on any information processing device such as a personal computer, a smartphone, or a tablet. In another aspect, any operation on the visual programming editor 100, such as moving the comment 130 or the program part 110, or displaying a menu, can be performed via any input means such as a keyboard, a mouse, a touch panel, or voice.

[0135] As described above, the visual programming editor 100 generates a text program based on the visual program created on the editor 102. At this time, the visual programming editor 100 can place comments at appropriate positions on the text program based on the information on the association between comments and program components. With this function, the user can obtain a highly readable text program.

[0136] In addition, the visual programming editor 100 provides a function for manually associating or deleting the association between the comment 130 and the program component 110. With this function, the user can perform the association operation between the comment 130 and the program component 110 more flexibly.

[0137] <F. Supplementary Note> The present embodiment as described above includes the following technical ideas.

[0138] [Configuration 1] Causing one or more processors (1201) to Based on receiving an operation, arranging one or more program components (110) and one or more comments (130) on the screen of a visual programming editor (100); Determining whether to associate a specific comment included in the one or more comments with a specific program component included in the one or more program components based on a positional relationship between the specific comment and the specific program component; Based on determining that the specific comment is to be associated with the specific program component, generating a text-based code (150) in which the text of the specific comment and the text of the specific program component are arranged adjacent to each other. A program for executing the steps.

[0139] [Configuration 2] The step of determining whether to link the specific comment to the specific program part includes: determining whether a distance from the particular comment to the particular program part is within a predetermined threshold; and linking the particular comment and the particular program part based on the distance being equal to or less than the threshold.

[0140] [Configuration 3] The program of configuration 2, further causing the one or more processors to execute a step of placing, based on the presence of a comment that is not linked to any of the one or more program components, text of a comment that is not linked to any of the one or more program components at the beginning of the text-based code in the text-based code.

[0141] [Configuration 4] The program according to configuration 2 or 3, further causing the one or more processors to execute a step of displaying the range of the threshold value based on receiving an operation to bring the specific comment closer to a certain range of the specific program part.

[0142] [Configuration 5] the step of arranging the one or more program parts and the one or more comments on a screen of the visual programming editor includes the step of arranging a first program part, a second program part, and the specific comment; The program described in any of configurations 2 to 4, further causing the one or more processors to execute a step of linking the specific comment to the first program part or the second program part, whichever is closer, based on the fact that the distance between the specific comment and each of the first program part and the second program part is less than the threshold.

[0143] [Configuration 6] The program described in configuration 5 further causes the one or more processors to execute a step of setting a certain range close to both the first program part and the second program part as an invalid range in which the specific comment is not linked to each of the first program part and the second program part when the first program part and the second program part are arranged adjacent to each other.

[0144] [Configuration 7] the step of arranging the one or more program parts and the one or more comments on a screen of the visual programming editor includes a step of arranging the specific program part, a first comment, and a second comment; The program described in any of configurations 2 to 6, further comprising a step of determining a display order of the first comment and the second comment in the text-based code based on a distance from each of the first comment and the second comment to the specific program part, based on the fact that both the first comment and the second comment are linked to the specific program part.

[0145] [Configuration 8] The program described in any of configurations 2 to 7, further causing the one or more processors to execute a step of releasing the link between the specific comment and the specific program part based on receiving an operation that increases the distance between the linked specific comment and the specific program part beyond the threshold.

[0146] [Configuration 9] The program described in any of configurations 2 to 8, further causing the one or more processors to execute a step of releasing the link between the specific comment and the specific program part based on double-clicking the specific comment linked to the specific program part, and increasing the distance between the specific comment and the specific program part beyond the threshold value.

[0147] [Configuration 10] The program described in any one of configurations 2 to 9, further causing the one or more processors to execute a step of performing a process of linking or unlinking the specific comment and the specific program part based on receiving a manual input of a linking control command, regardless of the distance between the specific comment and the specific program part.

[0148] [Configuration 11] The program described in any one of configurations 2 to 10, further causing the one or more processors to execute a step of changing the color of the linked specific comment and the linked specific program part based on the linking of the specific comment and the specific program part.

[0149] [Configuration 12] The program described in any one of configurations 2 to 11, further causing the one or more processors to execute a step of displaying a connection line between the linked specific comment and the linked specific program part based on linking the specific comment and the linked specific program part.

[0150] [Configuration 13] The program described in any one of configurations 2 to 12, further causing the one or more processors to execute a step of displaying a frame surrounding the linked specific comment and the specific program part based on the linking of the specific comment and the specific program part.

[0151] [Configuration 14] A memory (1202) storing a program according to any one of configurations 1 to 13; A computer (1200) comprising one or more processors for executing the program.

[0152] [Configuration 15] 1. A method for converting code in a computer, comprising: arranging one or more program parts and one or more comments on a screen of a visual programming editor based on the received operation; determining whether or not to link a specific comment included in the one or more comments to a specific program part included in the one or more program parts based on a positional relationship between the specific comment and the specific program part; and generating text-based code in which the text of the particular comment and the text of the particular program part are placed proximately based on determining that the particular comment is linked to the particular program part.

[0153] The embodiments disclosed herein should be considered to be illustrative and not restrictive in all respects. The scope of the present disclosure is indicated by the claims, not by the above description, and is intended to include all modifications within the meaning and scope of the claims. In addition, the disclosure contents described in the embodiments and each modified example are intended to be implemented, as far as possible, either alone or in combination. [Explanation of symbols]

[0154] 100 Visual programming editor, 101 Program parts list, 102 Editor, 105, 300, 400 Visual program, 110, 110A, 110B, 110C, 110E, 810A, 810C, 810D Program parts, 120, 120A, 120B Connector, 130, 130A, 130B, 130C, 130D, 151A, 151C, 351C, 451A, 451B, 830A, 830B, 830C, 830E, 830F, 1030A, 1030C, 1030E, 1030F Comment, 150, 350, 450, 1050 Text program, 152A, 152C, 352A, 352C, 452A, 1010A, 1010C, 1010D code, 201, 701 linking area, 210, 220, 230 display, 601 reaction area, 705 adjacent portion, 710 invalid area, 1101 comment placement section, 1102 linking range display section, 1103 linking selection section, 1104 linking display section, 1105 dynamic linking section, 1106 manual linking section, 1107 linking storage section, 1108 output section, 1200 device, 1201 CPU, 1202 primary storage device, 1203 secondary storage device, 1204 external device interface, 1205 input interface, 1206 output interface, 1207 communication interface.

Claims

1. One or more processors, arranging one or more program parts and one or more comments on a screen of a visual programming editor based on the received operation; determining whether or not to link a specific comment included in the one or more comments to a specific program part included in the one or more program parts based on a positional relationship between the specific comment and the specific program part; and generating text-based code in which the text of the specific comment is placed on the line immediately preceding the text of the specific program part based on a determination that the specific comment is linked to the specific program part.

2. The step of determining whether to link the specific comment to the specific program part includes: determining whether a distance from the particular comment to the particular program part is within a predetermined threshold; and linking the particular comment and the particular program part based on the distance being equal to or less than the threshold.

3. 3. The program of claim 2, further comprising causing the one or more processors to execute a step of placing, based on the presence of a comment that is not associated with any of the one or more program components, text of a comment that is not associated with any of the one or more program components at the beginning of the text-based code in the text-based code.

4. 4. The program according to claim 2, further comprising causing the one or more processors to execute a step of displaying the range of the threshold value based on receiving an operation to bring the specific comment closer to a certain range of the specific program part.

5. the step of arranging the one or more program parts and the one or more comments on a screen of the visual programming editor includes the step of arranging a first program part, a second program part, and the specific comment; The program of any one of claims 2 to 4, further comprising causing the one or more processors to execute a step of linking the specific comment to the first program part or the second program part, whichever is closer, based on the distance between the specific comment and each of the first program part and the second program part being less than the threshold.

6. The program of claim 5, further comprising causing the one or more processors to execute a step of setting a certain range close to both the first program part and the second program part as an invalid range in which the specific comment is not linked to each of the first program part and the second program part when the first program part and the second program part are arranged adjacent to each other.

7. the step of arranging the one or more program parts and the one or more comments on a screen of the visual programming editor includes a step of arranging the specific program part, a first comment, and a second comment; The program of any one of claims 2 to 6, further comprising a step of determining a display order of the first comment and the second comment in the text-based code based on a distance from each of the first comment and the second comment to the specific program part, based on the fact that both the first comment and the second comment are linked to the specific program part.

8. The program of any one of claims 2 to 7, further causing the one or more processors to execute a step of unlinking the specific comment and the specific program part based on receiving an operation that increases the distance between the linked specific comment and the specific program part beyond the threshold.

9. The program of any one of claims 2 to 8, further causing the one or more processors to execute a step of unlinking the specific comment and the specific program part based on double-clicking the specific comment linked to the specific program part, and increasing the distance between the specific comment and the specific program part beyond the threshold value.

10. The program according to any one of claims 2 to 9, further causing the one or more processors to execute a step of executing a process of linking or unlinking the specific comment and the specific program part based on receiving a manual input of a linking control command, regardless of the distance between the specific comment and the specific program part.

11. The program according to any one of claims 2 to 10, further causing the one or more processors to execute a step of changing the color of the linked specific comment and the linked specific program part based on the linking of the specific comment and the specific program part.

12. The program according to any one of claims 2 to 11, further causing the one or more processors to execute a step of displaying a connection line between the linked specific comment and the linked specific program part based on the linking of the specific comment and the specific program part.

13. The program according to any one of claims 2 to 12, further causing the one or more processors to execute a step of displaying a frame surrounding the linked specific comment and the specific program part based on the linking of the specific comment and the specific program part.

14. A memory storing the program according to any one of claims 1 to 13; A computer comprising one or more processors for executing the program.

15. 1. A method for converting code in a computer, comprising: arranging one or more program parts and one or more comments on a screen of a visual programming editor based on the received operation; determining whether or not to link a specific comment included in the one or more comments to a specific program part included in the one or more program parts based on a positional relationship between the specific comment and the specific program part; and generating text-based code based on determining that the particular comment is linked to the particular program part, the text of the particular comment being placed on the line immediately preceding the text of the particular program part.

Citation Information

Patent Citations

  • Program preparation device for programmable controller

    JP1996339208A

  • Screen preparation device, and screen preparation program, and record medium recording its program

    JP2007065910A

  • Program, method and device for generating control program

    JP2007206798A

  • Software development support system and method, and program for the method

    JP2009193181A

  • Program code generation apparatus, program code generation method, and program code generation program

    WO2018092237A1