Skip to content

Commit

Permalink
I dont even remember
Browse files Browse the repository at this point in the history
  • Loading branch information
TGNThump committed May 2, 2018
1 parent b77792a commit 541cb50
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 18 deletions.
2 changes: 1 addition & 1 deletion GroupProjectRASQL/Operations/Join.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public virtual string ToString(int depth = 0)

public override string ToJSON()
{
return "{'type':'" + "" + "', 'properties': '" + condition.TreeToString() + "'}";
return "{'type':'" + "" + "', 'properties': '" + Conditions.ToString(condition) + "'}";
}
}
}
2 changes: 1 addition & 1 deletion GroupProjectRASQL/Operations/Relation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public override string ToString()

public override string ToJSON()
{
return "{'type':'" + this.GetType().Name + "', 'properties': '" + getFieldNames().Aggregate((all, next) => all + ", " + next) + "'}";
return "{'type':'" + this.GetType().Name + "', 'properties': '" + name + "'}";
}
}
}
2 changes: 1 addition & 1 deletion GroupProjectRASQL/Operations/Selection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public string ToString(int depth = 0)

public override string ToJSON()
{
return "{'type':'" + "σ" + "', 'properties': '" + condition.TreeToString() + "'}";
return "{'type':'" + "σ" + "', 'properties': '" + Conditions.ToString(condition) + "'}";
}
}
}
17 changes: 2 additions & 15 deletions GroupProjectRASQL/View/src/components/views/output.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,6 @@
</div>
</column>
</div>


<div class="row">
<column>
<div class="card">
<div class="card-body">
<pre>{{ops}}</pre>
</div>
</div>
<div v-html="model.Output"></div>
</column>

</div>
</div>
</template>

Expand Down Expand Up @@ -191,7 +178,7 @@ export default {
node.select('text')
.attr("x", function(d){ return d.children ? -8 : 8; })
.style("text-anchor", function(d){ return d.children ? "end" : "start";})
.text(function(d){ return d.data.data.type; });
.text(function(d){ return d.data.data.type + ' '+ d.data.data.properties; });
// Enter
Expand Down Expand Up @@ -220,7 +207,7 @@ export default {
.attr("dy", -3)
.attr("x", function(d){ return d.children ? -8 : 8; })
.style("text-anchor", function(d){ return d.children ? "end" : "start";})
.text(function(d){ return d.data.data.type; });
.text(function(d){ return d.data.data.type + ' '+ d.data.data.properties; });
// Exit
Expand Down
27 changes: 27 additions & 0 deletions GroupProjectRASQL/ViewModel/ApplicationViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,33 @@ public ApplicationViewModel()
Output += "</div></div>";
this.OpsJSON = ops.Child().ToJSON().Replace("\"", "&quot;").Replace("'", "\"");
});

Reset = new RelaySimpleCommand(()=> {
List<State>[] stateSets = raParser.Parse(RA);
stateSets = raParser.FilterAndReverse(stateSets);
TreeNode<String> tree = raParser.parse_tree(RA, stateSets);
Squish(tree);
this.ops = RAToOps.Translate(tree, Relations.ToDictionary(relation => relation.name));
ops = new TreeNode<Operation>(new Query()) { ops };
Heuristic0 = new Heuristic0(ops);
Heuristic1 = new Heuristic1(ops);
Heuristic2 = new Heuristic2(ops);
Heuristic3 = new Heuristic3(ops);
Heuristic4 = new Heuristic4(ops);
Heuristic5 = new Heuristic5(ops);
Heuristic0.Complete();
this.Output = "<div class='card'><div class='card-body'>";
this.Output += ops.TreeToDebugString();
this.Output += "</div></div>";
this.OpsJSON = ops.Child().ToJSON().Replace("\"", "&quot;").Replace("'", "\"");
return;
});
}

bool Squish(TreeNode<String> root)
Expand Down
24 changes: 24 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 541cb50

Please sign in to comment.