- network drawing
This commit is contained in:
parent
9d96973811
commit
c3d6e29e9d
@ -81,10 +81,8 @@ class TruthTableTask extends PicturedTask
|
|||||||
public function randomize(): void
|
public function randomize(): void
|
||||||
{
|
{
|
||||||
if ($this->hasFlag("drawnetwork")) {
|
if ($this->hasFlag("drawnetwork")) {
|
||||||
///$svg_file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid("truthtable_") . ".svg";
|
|
||||||
$this->setImageData($this->lf->drawNetwork($this->output_variable));
|
$this->setImageData($this->lf->drawNetwork($this->output_variable));
|
||||||
$this->setImageType("svg");
|
$this->setImageType("svg");
|
||||||
//@unlink($svg_file);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::randomize();
|
parent::randomize();
|
||||||
|
|||||||
@ -238,6 +238,7 @@ class PicturedTask extends Task {
|
|||||||
margin: 1em auto;
|
margin: 1em auto;
|
||||||
border-radius: 0.3em;
|
border-radius: 0.3em;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
@ -259,7 +260,7 @@ class PicturedTask extends Task {
|
|||||||
break;
|
break;
|
||||||
case "svg":
|
case "svg":
|
||||||
{
|
{
|
||||||
this.img = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
this.img = document.createElement("section");
|
||||||
this.img.classList.add("question-image");
|
this.img.classList.add("question-image");
|
||||||
this.img.innerHTML = data;
|
this.img.innerHTML = data;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,4 +8,4 @@ if len(sys.argv) < 3:
|
|||||||
network = logicparse(sys.argv[1], outlabel=sys.argv[2], gateH=1.2)
|
network = logicparse(sys.argv[1], outlabel=sys.argv[2], gateH=1.2)
|
||||||
#network.save(sys.argv[3])
|
#network.save(sys.argv[3])
|
||||||
svg = network.get_imagedata()
|
svg = network.get_imagedata()
|
||||||
print(svg)
|
print(svg.decode("utf-8"))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user