-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae1bbb6
commit b60f4eb
Showing
7 changed files
with
260 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> | ||
</startup> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{8B7A7545-6257-44BF-8868-F429E1B72C77}</ProjectGuid> | ||
<OutputType>Exe</OutputType> | ||
<RootNamespace>EDSSharp</RootNamespace> | ||
<AssemblyName>EDSSharp</AssemblyName> | ||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Program.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="App.config" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\libEDSsharp\libEDSsharp.csproj"> | ||
<Project>{cc0fa4b1-2bfc-43b3-8c56-b428df2d24e7}</Project> | ||
<Name>libEDSsharp</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"> | ||
<StartArguments> | ||
</StartArguments> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using libEDSsharp; | ||
|
||
namespace EDSSharp | ||
{ | ||
class Program | ||
{ | ||
|
||
static libEDSsharp.EDSsharp eds = new EDSsharp(); | ||
static string gitversion = ""; | ||
|
||
static void Main(string[] args) | ||
{ | ||
try | ||
{ | ||
|
||
Dictionary<string, string> argskvp = new Dictionary<string, string>(); | ||
|
||
int argv = 0; | ||
|
||
for (argv = 0; argv < (args.Length - 1); argv++) | ||
{ | ||
if (args[argv] == "--infile") | ||
{ | ||
argskvp.Add("--infile", args[argv + 1]); | ||
} | ||
|
||
if (args[argv] == "--outfile") | ||
{ | ||
argskvp.Add("--outfile", args[argv + 1]); | ||
} | ||
|
||
if (args[argv] == "--type") | ||
{ | ||
argskvp.Add("--type", args[argv + 1]); | ||
} | ||
|
||
argv++; | ||
} | ||
|
||
|
||
if (argskvp.ContainsKey("--type") && argskvp.ContainsKey("--infile") && argskvp.ContainsKey("--outfile")) | ||
{ | ||
string infile = argskvp["--infile"]; | ||
string outfile = argskvp["--outfile"]; | ||
|
||
switch (Path.GetExtension(infile).ToLower()) | ||
{ | ||
case ".xdd": | ||
openXDDfile(infile, outfile); | ||
break; | ||
|
||
case ".xml": | ||
openXMLfile(infile,outfile); | ||
break; | ||
|
||
case ".eds": | ||
openEDSfile(infile, outfile,InfoSection.Filetype.File_EDS); | ||
break; | ||
|
||
|
||
default: | ||
return; | ||
|
||
} | ||
} | ||
else | ||
{ | ||
Console.WriteLine("Usage EDSEditor --type CanOpenNode --infile file.[xdd|eds|xml] --outfile CO_OD.c"); | ||
} | ||
} | ||
catch(Exception e) | ||
{ | ||
Console.WriteLine(e.ToString()); | ||
} | ||
} | ||
|
||
private static void openEDSfile(string infile, string outfile, InfoSection.Filetype ft) | ||
{ | ||
|
||
eds.Loadfile(infile); | ||
|
||
exportCOOD(outfile); | ||
|
||
} | ||
|
||
private static void exportCOOD(string outpath) | ||
{ | ||
|
||
outpath = Path.GetFullPath(outpath); | ||
|
||
string savePath = Path.GetDirectoryName(outpath); | ||
|
||
eds.fi.exportFolder = savePath; | ||
|
||
Warnings.warning_list.Clear(); | ||
|
||
CanOpenNodeExporter cone = new CanOpenNodeExporter(); | ||
cone.export(savePath, Path.GetFileNameWithoutExtension(outpath), gitversion, eds); | ||
|
||
foreach(string warning in Warnings.warning_list) | ||
{ | ||
Console.WriteLine("WARNING :" + warning); | ||
} | ||
|
||
} | ||
|
||
private static void openXMLfile(string path,string outpath) | ||
{ | ||
|
||
CanOpenXML coxml = new CanOpenXML(); | ||
coxml.readXML(path); | ||
|
||
Bridge b = new Bridge(); | ||
|
||
eds = b.convert(coxml.dev); | ||
eds.xmlfilename = path; | ||
|
||
exportCOOD(outpath); | ||
|
||
} | ||
|
||
private static void openXDDfile(string path, string outpath) | ||
{ | ||
CanOpenXDD coxml = new CanOpenXDD(); | ||
eds = coxml.readXML(path); | ||
|
||
if (eds == null) | ||
return; | ||
|
||
eds.xddfilename = path; | ||
exportCOOD(outpath); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("EDSSharp")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("EDSSharp")] | ||
[assembly: AssemblyCopyright("Copyright © 2019")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("8b7a7545-6257-44bf-8868-f429e1b72c77")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |