CN115408968A - Construction method and system based on SVG virtual circuit - Google Patents

Construction method and system based on SVG virtual circuit Download PDF

Info

Publication number
CN115408968A
CN115408968A CN202211020803.4A CN202211020803A CN115408968A CN 115408968 A CN115408968 A CN 115408968A CN 202211020803 A CN202211020803 A CN 202211020803A CN 115408968 A CN115408968 A CN 115408968A
Authority
CN
China
Prior art keywords
component
starting
virtual circuit
vector
svg
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
Application number
CN202211020803.4A
Other languages
Chinese (zh)
Inventor
陈亮
陶永超
尹玲玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Academy of Aerospace Technology
Original Assignee
Shenzhen Academy of Aerospace Technology
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Academy of Aerospace Technology filed Critical Shenzhen Academy of Aerospace Technology
Priority to CN202211020803.4A priority Critical patent/CN115408968A/en
Publication of CN115408968A publication Critical patent/CN115408968A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/30Circuit design
    • G06F30/32Circuit design at the digital level
    • G06F30/33Design verification, e.g. functional simulation or model checking
    • G06F30/3308Design verification, e.g. functional simulation or model checking using simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/30Circuit design
    • G06F30/36Circuit design at the analogue level
    • G06F30/367Design verification, e.g. using simulation, simulation program with integrated circuit emphasis [SPICE], direct methods or relaxation methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Geometry (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a construction method and a system based on an SVG virtual circuit, which comprises the following steps: defining a metadata model of the component based on the SVG to generate a corresponding component; defining a front-end component between components based on the SVG, and generating a corresponding front-end component; defining a background model of the component based on the SVG to generate a corresponding background model; building a virtual circuit according to the components and the front-end components; after receiving a starting command sent by the background model, starting and operating the virtual circuit; dynamically switching the state of the front-end component according to state data returned by the background model during operation, and controlling interaction between components so as to simulate the operation condition of an actual circuit; wherein, when building the virtual circuit, include: and selecting the components, and automatically connecting the selected components to generate a lead. The invention achieves the purpose of reducing the difference of operation effects between the real circuit and the virtual circuit.

Description

Construction method and system based on SVG virtual circuit
Technical Field
The invention relates to the technical field of analog simulation, in particular to a construction method and a system based on an SVG virtual circuit.
Background
In teaching, experiments have a very important position, the practical ability of students can be improved, and the understanding of the students to knowledge can be enhanced. However, the traditional experiment components have many defects, such as huge purchase and maintenance cost, easy damage, potential safety hazard and the like, and the popularization of the experiment and the in-depth teaching of the experiment are severely limited in these aspects. Meanwhile, with the development of computer and network technologies, the technology of simulating experiments such as chemistry, physics, electrician and the like by using virtual simulation is becoming mature. The virtual simulation experiment is an important application of the virtual simulation technology in the field of education. The virtual simulation experiment refers to various experiments in simulation teaching through a computer, network equipment and the like, can make up for the defects of the traditional teaching equipment, and is an important means for assisting teaching in the future.
The virtual circuit is an important component of a virtual simulation experiment, namely, an actual experiment component and a wire are virtualized, so that various defects of the traditional experiment component are overcome, the problem of potential safety hazards is solved, and meanwhile, the virtual circuit can be used for verifying theoretical knowledge of the circuit. After the circuit theory knowledge is verified, hardware is built based on the virtual circuit, so that the flexibility of the experiment is improved, the learning interest and the learning cost of students are stimulated, the learning range of the students is expanded, and the understanding of the students on the teaching content is deepened.
However, the virtual circuit built in the prior art cannot accurately simulate the dynamic interaction between components, so that the operation effect of the virtual circuit is greatly different from that of the real circuit after the real circuit is built in the later period.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides a construction method and a system based on an SVG virtual circuit, which are used for solving the technical problem that the virtual circuit constructed in the prior art cannot accurately simulate the dynamic interaction between components, thereby achieving the purpose of reducing the difference of the operation effect between a real circuit and the virtual circuit.
In order to solve the problems, the technical scheme adopted by the invention is as follows:
a construction method based on an SVG virtual circuit comprises the following steps:
defining a metadata model of the component based on the SVG to generate a corresponding component;
defining a front-end component between components based on the SVG, and generating a corresponding front-end component;
defining a background model of the component based on the SVG, and generating a corresponding background model;
according to the component and the front-end component selected by the user, automatic connection is carried out, a lead is generated, and the construction of a virtual circuit is completed;
after receiving a starting command sent by the background model, starting and operating the virtual circuit;
and dynamically switching the state of the front-end component according to state data returned by the background model during operation so as to control interaction between the components and simulate the operation condition of an actual circuit.
As a preferred embodiment of the present invention, when defining a metadata model of a component, the method includes:
defining structural information of the component;
defining visual information of the components;
defining functional component information of the component;
defining state information of the components;
and generating a component according to the structural information, the visual information, the functional component information and the state information.
In a preferred embodiment of the present invention, the automatic connection and generation of the wire includes:
acquiring a starting point coordinate of a starting component and an ending point coordinate of an ending component;
obtaining a direct vector according to the starting point coordinate of the starting component and the ending point coordinate of the ending component;
obtaining the initial direction and the final direction of the orthogonal line according to the direct vector;
determining the number of inflection points according to the initial direction of the orthogonal line and the final direction of the orthogonal line, and obtaining inflection point coordinates;
automatically connecting lines according to the coordinates of the starting point of the starting component, the coordinates of the ending point of the ending component, the starting direction and the final direction of the orthogonal line and the coordinates of the inflection point to generate a lead;
wherein the conductive lines comprise orthogonal lines.
As a preferred embodiment of the present invention, the method for obtaining the initial direction and the final direction of the orthogonal line comprises:
acquiring a start point coordinate of the orthogonal line and an end point coordinate of the orthogonal line;
obtaining a starting point direction according to the starting point coordinate of the orthogonal line and the starting point coordinate of the starting component;
obtaining an end point direction according to the end point coordinate of the orthogonal line and the end point coordinate of the end component;
selecting a vector parallel to the starting point direction from the horizontal vector and the vertical vector, and judging whether the vector is in the same direction as the starting point direction, if so, the starting direction of the orthogonal line is in the same direction as the selected vector, and if not, the starting direction of the orthogonal line is in the same direction as the other vector;
selecting a vector parallel to the end point direction from a horizontal vector and a vertical vector, and judging whether the vector is in the same direction with the end point direction, if so, the end point direction of the orthogonal line is in the same direction with the selected vector, and if not, the end point direction of the orthogonal line is in the same direction with the other vector;
wherein the direct vectors include a horizontal vector and a vertical vector.
As a preferred embodiment of the present invention, the determining of the number of inflection points and the obtaining of the inflection point coordinates includes:
judging whether the initial direction of the orthogonal line and the final direction of the orthogonal line are in the same direction, if so, the number of inflection points is 2, and if not, the number of inflection points is 1;
when the number of inflection points is 1, the inflection point coordinates are obtained by formula 1, where formula 1 is specifically as follows:
g = Z + Q (equation 1);
wherein G is a coordinate of an inflection point, Z is a coordinate of a starting point of an orthogonal line, and Q is a vector of the starting direction of the orthogonal line;
when the number of inflection points is 2, the inflection point coordinates are obtained by a formula 2 and a formula 3, wherein the formula 2 and the formula 3 are specifically as follows:
G 1 = Z + Q0.5 (formula 2);
G 2 =G 1 + F (equation 3);
wherein G is 2 As a second inflection point coordinate, G 1 F is a vector perpendicular to the starting direction of the orthogonal line among the horizontal vector and the vertical vector, which is the first inflection point coordinate.
As a preferred embodiment of the present invention, when defining the background model, the method includes:
defining the name of each component;
defining the mutual information among the components;
and defining return data according to the interaction information.
As a preferred embodiment of the present invention, after completing the building of the virtual circuit, the method includes:
after the background model receives a generating command, generating a circuit diagram and a script file according to the virtual circuit;
and saving the circuit diagram and the script file into a visual file.
As a preferred embodiment of the present invention, the virtual circuit includes:
dynamically starting the virtual circuit through circuit configuration parameters in the script file;
dynamically switching the state of the front-end component through circuit configuration parameters in the script file;
and displaying the running states of the front-end component and the virtual circuit through the visual file.
In a preferred embodiment of the present invention, the method for dynamically switching the state of a front-end component includes:
traversing all script files through a monitoring tool of Vuex to obtain a plurality of state data;
monitoring the change state of the state data through the monitoring tool of the Vuex, and when the change of the state data is monitored, re-acquiring the state data through the monitoring tool of the Vuex to update the state data;
and switching the state of the front-end component according to the updated state data to obtain the updated state of the front-end component.
A construction system based on SVG virtual circuit includes:
the front end is used for defining a metadata model of the component and a front end component between the components, generating a corresponding component and the front end component, building a virtual circuit according to the component and the front end component, transmitting data of the virtual circuit to the server through an interactive protocol, receiving a starting command, circuit configuration parameters and state data from the server through websocket link, starting and operating the virtual circuit according to the starting command and the circuit configuration parameters, and dynamically switching the state of the front end component according to the state data;
and the server side receives the data from the virtual circuit of the front end, transmits the data to the back end through an interactive protocol, receives a starting command from the back end and returned circuit configuration parameters and state data, and transmits the data to the front end through the websocket link.
And the back end is used for defining the background model of the component, generating a corresponding background model, sending a starting command through the background model and returning circuit configuration parameters and state data to the server.
Compared with the prior art, the invention has the beneficial effects that:
(1) The virtual circuit is constructed based on the SVG, and can realize arbitrary scaling without damaging the definition and detail of the graph;
(2) The SVG is designed based on XML standard, and can establish contact with other technologies, thereby expanding the application range of the invention;
(3) The SVG can describe vector graphics by using elements such as rectangles, ellipses, circles, straight lines, broken lines, polygons, paths and the like, has strong drawing capability and can improve the simulation accuracy of the invention;
(4) The invention can accurately simulate the dynamic interaction between components based on the SVG, thereby effectively reducing the difference with the operation effect between real circuits.
The present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Drawings
FIG. 1 is a diagram of steps of a construction method based on an SVG virtual circuit according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating the structural information definition of components according to an embodiment of the present invention;
FIG. 3-is a visual representation of components of an embodiment of the present invention;
FIG. 4 is a diagram of a component metadata model on a serial communications assistant according to an embodiment of the present invention;
FIG. 5-is a metadata model definition diagram for a wire of an embodiment of the present invention;
FIG. 6 is a representation of a metadata model of a wire on a serial communication assistant in accordance with an embodiment of the present invention;
FIG. 7-is a schematic view of a lead configuration according to an embodiment of the present invention;
FIG. 8-is a direct vector diagram of an embodiment of the present invention;
FIG. 9-is a schematic view of a wire inflection point in accordance with an embodiment of the present invention;
fig. 10-is a diagram of a construction system architecture based on SVG virtual circuits according to an embodiment of the present invention.
The reference numbers illustrate: 1. a front end; 2. a server side; 3. a back end.
Detailed Description
The construction method based on the SVG virtual circuit, as shown in FIG. 1, comprises the following steps:
step S1: defining a metadata model of the component based on the SVG to generate a corresponding component;
step S2: defining a front-end component between components based on the SVG, and generating a corresponding front-end component;
and step S3: defining a background model of the component based on the SVG to generate a corresponding background model;
and step S4: according to the components and the front-end components selected by the user, automatic connection is carried out, a lead is generated, and the construction of a virtual circuit is completed;
step S5: after receiving a starting command sent by the background model, starting and operating the virtual circuit;
step S6: and dynamically switching the state of the front-end component according to state data returned by the background model during operation to control interaction between components, so as to simulate the operation condition of an actual circuit.
In the step S1, when defining the metadata model of the component, the method includes:
defining the structural information of the component;
defining visual information of the components;
defining the functional component information of the component;
defining state information of the components;
and generating the component according to the structural information, the visual information, the functional component information and the state information.
Further, the structural information definition of the component is in json format, as shown in fig. 2.
The attribute interpretation in fig. 2 is as follows:
component _ id: the type of the component is unique, and meanwhile, a corresponding component (svg) is packaged according to the requirement of the front end and is used for displaying a corresponding state in the debugging process;
and kindof: the component category is used for distinguishing whether the components belong to cores or peripherals and selecting values of 'CPU' and 'peripherals';
img: a cover picture of the component, namely a picture displayed in the circuit diagram building;
name: the name of the component is preset to distinguish which one of the components in the same category according to the fact that a plurality of components are possibly dragged by a user in a circuit diagram;
cname: the component Chinese name is the name displayed in the component list;
AlisName: the alias of the component displayed on the circuit diagram is used for conveniently customizing the name;
version: the version of the components, some components are upgraded subsequently, and the version attribute is preset for the compatibility with the old version in the old experiment;
docurl: some components need to be associated to realize a principle document or use a document, so a docurl attribute is preset;
and (2) width: the width of the component is read by default, namely the width of the cover map of the component, namely the width of the component displayed in the circuit diagram construction;
height: the height of the component is read by default, namely the height of the component displayed in the circuit diagram building process;
index: a component pin list, which is where the component shows the pins, and a unique name and a connection direction (start and end) need to be set for each pin;
x: the pin corresponds to the x coordinate of the upper left corner of the component;
y: the pin corresponds to the y coordinate of the upper left corner of the component;
name: the name of the pin is displayed when the mouse moves to the upper pin;
direction: the pin is connected in the direction (start, end).
Further, referring to the SVG standard, the basic tags used for defining the visual information are < line >, < rect >, < circle >, < polyline >, < polygon >, < path >, < text >, < image >, < forignobject >; wherein < line > represents a straight line, < rect > represents a rectangle, < circle > represents a circle, < polyline > represents a broken line, < polygon, < path > represents an arbitrary curve or broken line, < text > represents inserted text, and < image > represents an inserted image.
The visualized information is represented by the structure information of the components and parts through json automatic processing into the above basic labels, and the representation result is shown in fig. 3.
Further, functional components of the device include pins, a display panel and the like; when definition is performed, for example, a TX pin of a serial port communication assistant needs to be connected to a PA10 pin of the STM32, output content of the STM32 needs to be displayed on a display panel (i.e., a serial port communication assistant component), and a metadata model of a component is displayed by the serial port communication assistant, as shown in fig. 4.
Further, in the running process of the virtual simulation experiment, a certain component can be switched between different states according to the returned state data, for example, a switch has two states of "on" and "off", so that the state information of the component needs to be defined.
In the step S1, when performing automatic connection and generating a wire, the method includes:
acquiring a starting point coordinate of a starting component and an end point coordinate of an ending component;
obtaining a direct vector according to the starting point coordinate of the starting component and the end point coordinate of the ending component;
obtaining the initial direction and the final direction of the orthogonal line according to the direct vector;
determining the number of inflection points according to the initial direction of the orthogonal line and the final direction of the orthogonal line, and obtaining inflection point coordinates;
automatically connecting lines to generate a lead according to the starting point coordinate of the starting component, the end point coordinate of the ending component, the starting direction and the final direction of the orthogonal line and the inflection point coordinate;
the conductive line includes an orthogonal line, a start point extension line, and an end point extension line, and the orthogonal line includes a start point coordinate, an end point coordinate, a start direction, and a final direction, as shown in fig. 7.
When generating the wire, defining a metadata model of the wire is also included, as shown in fig. 5 in particular.
Wherein, the attribute explanation in fig. 5 is specifically as follows:
from: starting component information, including a component index and a component pin index;
to: finishing component information including component indexes and component pin indexes;
pointer: several inflection point coordinates of the wire;
concactArr: and (5) conducting wire connection sequence.
The metadata model of the wire is displayed by the serial communications assistant, as shown in fig. 6.
Further, when obtaining the initial direction and the final direction of the orthogonal line, the method comprises the following steps:
acquiring a start point coordinate of the orthogonal line and an end point coordinate of the orthogonal line;
obtaining a starting point direction according to the starting point coordinate of the orthogonal line and the starting point coordinate of the starting component;
obtaining an end point direction according to the end point coordinate of the orthogonal line and the end point coordinate of the end component;
selecting a vector parallel to the direction of the starting point from the horizontal vector and the vertical vector, and judging whether the vector is in the same direction with the direction of the starting point, if so, the starting direction of the orthogonal line is in the same direction with the selected vector, and if not, the starting direction of the orthogonal line is in the same direction with the other vector;
selecting a vector parallel to the end point direction from the horizontal vector and the vertical vector, and judging whether the vector is in the same direction with the end point direction, if so, the end point direction of the orthogonal line is in the same direction with the selected vector, and if not, the end point direction of the orthogonal line is in the same direction with the other vector;
wherein the direct vector includes a horizontal vector and a vertical vector, as shown in fig. 8.
Further, in determining the number of inflection points and obtaining an inflection point coordinate, the method includes:
judging whether the initial direction of the orthogonal line and the final direction of the orthogonal line are in the same direction, if so, the number of inflection points is 2, and if not, the number of inflection points is 1, as shown in fig. 9;
when the number of inflection points is 1, the inflection point coordinates are obtained from formula 1, where formula 1 is specifically as follows:
g = Z + Q (equation 1);
wherein G is a coordinate of an inflection point, Z is a coordinate of a starting point of an orthogonal line, and Q is a vector of the starting direction of the orthogonal line;
when the number of inflection points is 2, the inflection point coordinates are obtained from formula 2 and formula 3, and formula 2 and formula 3 are specifically as follows:
G 1 = Z + Q0.5 (formula 2);
G 2 =G 1 + F (equation 3);
wherein G is 2 As a second inflection point coordinate, G 1 F is a vector perpendicular to the starting direction of the orthogonal line among the horizontal vector and the vertical vector, which is the first inflection point coordinate.
In the step S3, when defining the background model, the method includes:
defining the name of each component;
defining the interaction information among the components;
and defining return data according to the interaction information.
In the step S5, after the building of the virtual circuit is completed, the method includes:
after receiving the generation command, the background model generates a circuit diagram and a script file according to the virtual circuit;
and saving the circuit diagram and the script file into a visual file.
In the step S5, when the virtual circuit is operated, the method includes:
dynamically starting a virtual circuit through circuit configuration parameters in the script file;
dynamically switching the state of the front-end component through circuit configuration parameters in the script file;
and displaying the running states of the front-end components and the virtual circuits through the visual file.
The script file is a config.cfg file, and the visual file is a view.json file.
Further, when dynamically switching the state of the front-end component, the method includes:
traversing all script files through a monitoring tool of Vuex to obtain a plurality of state data;
monitoring the change state of the state data through a monitoring tool of Vuex, and when the state data is monitored to be changed, re-acquiring the state data through the monitoring tool of Vuex to update the state data;
and switching the state of the front-end component according to the updated state data to obtain the updated state of the front-end component.
As shown in fig. 10, the construction system based on the SVG virtual circuit provided by the present invention includes:
the front end 1 is used for defining a metadata model of the component and a front end component between the components, generating the corresponding component and the front end component, building a virtual circuit according to the component and the front end component, transmitting data of the virtual circuit to the server 2 through an interaction protocol, receiving a starting command, circuit configuration parameters and state data from the server 2 through websocket link, starting and operating the virtual circuit according to the starting command and the circuit configuration parameters, and dynamically switching the state of the front end component according to the state data;
and the server 2 receives the data from the virtual circuit of the front end 1, transmits the data to the back end 3 through an interactive protocol, receives the starting command from the back end 3 and the returned circuit configuration parameters and state data, and transmits the data to the front end 1 through a websocket link.
And the back end 3 is used for defining the background model of the component, generating a corresponding background model, sending a starting command through the background model and returning circuit configuration parameters and state data to the server end 2.
Compared with the prior art, the invention has the beneficial effects that:
(1) The virtual circuit is constructed based on the SVG, and can realize arbitrary zooming without damaging the definition and detail of a graph;
(2) The SVG is designed based on XML standard, and can establish contact with other technologies, thereby expanding the application range of the invention;
(3) The SVG can describe vector graphics by using elements such as rectangles, ellipses, circles, straight lines, broken lines, polygons, paths and the like, has strong drawing capability and can improve the simulation accuracy of the invention;
(4) The invention can accurately simulate the dynamic interaction between components based on the SVG, thereby effectively reducing the difference of the operation effect between the SVG and a real circuit.
The above embodiments are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited thereby, and any insubstantial changes and substitutions made by those skilled in the art based on the present invention are within the protection scope of the present invention.

Claims (10)

1. A construction method based on an SVG virtual circuit is characterized by comprising the following steps:
defining a metadata model of the component based on the SVG to generate a corresponding component;
defining a front-end component between components based on the SVG to generate a corresponding front-end component;
defining a background model of the component based on the SVG to generate a corresponding background model;
according to the component and the front-end component selected by the user, automatic connection is carried out, a lead is generated, and the construction of a virtual circuit is completed;
after receiving a starting command sent by the background model, starting and operating the virtual circuit;
and dynamically switching the state of the front-end component according to state data returned by the background model during running so as to control interaction between the components and simulate the running condition of an actual circuit.
2. The SVG virtual circuit-based construction method of claim 1, wherein in defining the metadata model of the component, it comprises:
defining structural information of the component;
defining visual information of the components;
defining the functional component information of the component;
defining the state information of the components;
and generating a component according to the structural information, the visual information, the functional component information and the state information.
3. The SVG virtual circuit-based construction method according to claim 1, wherein in performing automatic wiring to generate a wire, the method comprises:
acquiring a starting point coordinate of a starting component and an ending point coordinate of an ending component;
obtaining a direct vector according to the starting point coordinate of the starting component and the end point coordinate of the ending component;
obtaining the initial direction and the final direction of the orthogonal line according to the direct vector;
determining the number of inflection points according to the initial direction of the orthogonal line and the final direction of the orthogonal line, and obtaining inflection point coordinates;
automatically connecting lines according to the coordinates of the starting point of the starting component, the coordinates of the finishing component, the initial direction and the final direction of the orthogonal line and the coordinates of the inflection point to generate a lead;
wherein the conductive lines comprise orthogonal lines.
4. A construction method based on an SVG virtual circuit according to claim 3, wherein in obtaining the starting direction and the final direction of the orthogonal line, it comprises:
acquiring a start point coordinate of the orthogonal line and an end point coordinate of the orthogonal line;
obtaining a starting point direction according to the starting point coordinate of the orthogonal line and the starting point coordinate of the starting component;
obtaining an end point direction according to the end point coordinate of the orthogonal line and the end point coordinate of the end component;
selecting a vector parallel to the starting point direction from a horizontal vector and a vertical vector, and judging whether the vector is in the same direction with the starting point direction, if so, the starting direction of the orthogonal line is in the same direction with the selected vector, and if not, the starting direction of the orthogonal line is in the same direction with the other vector;
selecting a vector parallel to the end point direction from a horizontal vector and a vertical vector, and judging whether the vector is in the same direction with the end point direction, if so, the end point direction of the orthogonal line is in the same direction with the selected vector, and if not, the end point direction of the orthogonal line is in the same direction with the other vector;
wherein the direct vectors include a horizontal vector and a vertical vector.
5. The SVG virtual circuit-based construction method of claim 4, characterized by, in determining the number of inflection points and obtaining inflection point coordinates, comprising:
judging whether the initial direction of the orthogonal line and the final direction of the orthogonal line are in the same direction, if so, the number of inflection points is 2, and if not, the number of inflection points is 1;
when the number of inflection points is 1, the inflection point coordinates are obtained by formula 1, where formula 1 is specifically as follows:
g = Z + Q (equation 1);
wherein G is a coordinate of a knee point, Z is a coordinate of a starting point of an orthogonal line, and Q is a vector of the starting direction of the orthogonal line;
when the number of inflection points is 2, the inflection point coordinates are obtained by a formula 2 and a formula 3, wherein the formula 2 and the formula 3 are specifically as follows:
G 1 = Z + Q0.5 (formula 2);
G 2 =G 1 + F (equation 3);
wherein G is 2 As a second inflection coordinate, G 1 F is a vector perpendicular to the starting direction of the orthogonal line among the horizontal vector and the vertical vector, which is the first inflection point coordinate.
6. The construction method based on the SVG virtual circuit of claim 1, characterized by, when defining the background model, comprising:
defining the name of each component;
defining the interaction information among the components;
and defining return data according to the interaction information.
7. The construction method based on the SVG virtual circuit of claim 1, characterized by that after completing the construction of the virtual circuit, it comprises:
after the background model receives a generating command, generating a circuit diagram and a script file according to the virtual circuit;
and saving the circuit diagram and the script file into a visual file.
8. The SVG virtual circuit-based construction method according to claim 7, wherein when the virtual circuit is run, it includes:
dynamically starting the virtual circuit through circuit configuration parameters in the script file;
dynamically switching the state of the front-end component through circuit configuration parameters in the script file;
and displaying the running states of the front-end component and the virtual circuit through the visual file.
9. The SVG virtual circuit-based construction method according to claim 7, wherein in dynamically switching the state of the front-end component, comprising:
traversing all script files through a monitoring tool of Vuex to obtain a plurality of state data;
monitoring the change state of the state data through the monitoring tool of the Vuex, and when the change of the state data is monitored, re-acquiring the state data through the monitoring tool of the Vuex to update the state data;
and switching the state of the front-end component according to the updated state data to obtain the updated state of the front-end component.
10. A construction system based on SVG virtual circuit, characterized by comprising:
the front end is used for defining a metadata model of the component and a front end component between the components, generating a corresponding component and the front end component, building a virtual circuit according to the component and the front end component, transmitting data of the virtual circuit to the server through an interactive protocol, receiving a starting command, circuit configuration parameters and state data from the server through websocket link, starting and operating the virtual circuit according to the starting command and the circuit configuration parameters, and dynamically switching the state of the front end component according to the state data;
and the server side receives the data from the virtual circuit of the front end, transmits the data to the back end through an interactive protocol, receives a starting command from the back end and returned circuit configuration parameters and state data, and transmits the starting command, the returned circuit configuration parameters and the returned state data to the front end through the websocket link.
And the back end is used for defining the background model of the component, generating the corresponding background model, sending a starting command through the background model and returning circuit configuration parameters and state data to the server.
CN202211020803.4A 2022-08-24 2022-08-24 Construction method and system based on SVG virtual circuit Pending CN115408968A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211020803.4A CN115408968A (en) 2022-08-24 2022-08-24 Construction method and system based on SVG virtual circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211020803.4A CN115408968A (en) 2022-08-24 2022-08-24 Construction method and system based on SVG virtual circuit

Publications (1)

Publication Number Publication Date
CN115408968A true CN115408968A (en) 2022-11-29

Family

ID=84162101

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211020803.4A Pending CN115408968A (en) 2022-08-24 2022-08-24 Construction method and system based on SVG virtual circuit

Country Status (1)

Country Link
CN (1) CN115408968A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116644701A (en) * 2023-05-09 2023-08-25 三峡高科信息技术有限责任公司 SVG-based configurable circuit diagram generation method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116644701A (en) * 2023-05-09 2023-08-25 三峡高科信息技术有限责任公司 SVG-based configurable circuit diagram generation method and system
CN116644701B (en) * 2023-05-09 2024-01-16 三峡高科信息技术有限责任公司 SVG-based configurable circuit diagram generation method and system

Similar Documents

Publication Publication Date Title
CN110838162B (en) Vegetation rendering method and device, storage medium and electronic equipment
CN110969687B (en) Collision detection method, device, equipment and medium
CN105975393B (en) Page display detection method and system
CN113268303A (en) Interface element configuration method and device, storage medium and electronic equipment
CN109671147B (en) Texture map generation method and device based on three-dimensional model
CN102798802A (en) Cable fault locating visual simulation experimental method
CN102651180A (en) OSG-based (open scene graph-based) electric-electronic virtual experiment simulation system
CN115408968A (en) Construction method and system based on SVG virtual circuit
CN108763188A (en) Text display method, device, equipment and storage medium
CN110910703A (en) Virtual simulation intelligent electrician wiring teaching training system
CN111639239A (en) Equipment running state monitoring method and system
CN108109580A (en) Parameter adaptation method, apparatus, equipment and the storage medium of LED display
CN105262880A (en) Mobile phone control demonstration system applied to WiFi network
CN104900094A (en) Method and device for realizing writing simulation in terminal
CN109815557A (en) A kind of methods of exhibiting of robot model, device and intelligent terminal
CN112001827A (en) Teaching aid control method and device, teaching equipment and storage medium
WO2023213094A1 (en) Dynamic data area selection method, system and device applied to integrated circuit device, and computer-readable storage medium
CN102819971A (en) Test experiment training simulation method of power equipment based on internet
CN102800224B (en) Simulation method for experimental training on electric power equipment test based on the Internet
CN112116852B (en) Remote experiment method, device and terminal equipment
CN111831497B (en) Equipment simulation method and device, storage medium and simulation terminal
CN104932467B (en) One kind being used for the central controlled method of program-controlled equipment
CN112233208B (en) Robot state processing method, apparatus, computing device and storage medium
CN113870394A (en) Animation generation method, device, equipment and storage medium
CN110794999B (en) Automatic control method and device based on interface segmentation and terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination