Skip to content

Commit

Permalink
Merge pull request #27 from pipauwel/master
Browse files Browse the repository at this point in the history
TTL examples converted
  • Loading branch information
timchipman authored Jan 24, 2017
2 parents b396a41 + 5fa80bf commit 308e4fd
Show file tree
Hide file tree
Showing 5 changed files with 568 additions and 480 deletions.
4 changes: 2 additions & 2 deletions DocumentationISO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2761,9 +2761,9 @@ public static void GeneratePublication(
{
switch(docFormat.FormatType)
{
case DocFormatSchemaEnum.OWL:
case DocFormatSchemaEnum.TTL:
mapFormatSchema.Add(docFormat.FormatType, new FormatOWL());
mapFormatData.Add(docFormat.FormatType, new FormatTTL_Stream());
mapFormatData.Add(docFormat.FormatType, new FormatTTL());
break;

case DocFormatSchemaEnum.SQL:
Expand Down
8 changes: 5 additions & 3 deletions FormEdit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8767,7 +8767,7 @@ private void toolStripMenuItemToolsConvert_Click(object sender, EventArgs e)
{
dlgImport.Title = "Convert [Step 1 of 2]: Choose the input file";
dlgImport.Filter = "IFC-SPF (*.ifc)|*.ifc";
if(dlgImport.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
if (dlgImport.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
{
using(SaveFileDialog dlgExport = new SaveFileDialog())
{
Expand All @@ -8776,9 +8776,10 @@ private void toolStripMenuItemToolsConvert_Click(object sender, EventArgs e)
"IFC-RDF (*.ttl)|*.ttl|" +
"IFC-XML (*.ifcxml)|*.ifcxml";

dlgExport.FilterIndex = 2;
dlgExport.Title = "Convert [Step 2 of 2]: Specify the output file and format";
dlgExport.FileName = System.IO.Path.GetFileNameWithoutExtension(dlgImport.FileName);
if(dlgExport.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
if (dlgExport.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
{
//todo: run in background, show progress

Expand Down Expand Up @@ -8846,7 +8847,7 @@ private void toolStripMenuItemToolsConvert_Click(object sender, EventArgs e)
break;

case 2:
formatter = new FormatTTL_Stream(new System.IO.MemoryStream(), ifcowlns);
formatter = new FormatTTL(new System.IO.MemoryStream(), ifcowlns);
break;

case 3:
Expand All @@ -8858,6 +8859,7 @@ private void toolStripMenuItemToolsConvert_Click(object sender, EventArgs e)
{
string content = formatter.FormatData(this.m_project, null, null, mapEntity, instances, rootproject, false);

System.IO.File.WriteAllText(dlgExport.FileName, "");
using (System.IO.FileStream filestream = System.IO.File.OpenWrite(dlgExport.FileName))
{
System.IO.TextWriter writer = new System.IO.StreamWriter(filestream);
Expand Down
Loading

0 comments on commit 308e4fd

Please sign in to comment.