Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion EDSEditorGUI2/EDSEditorGUI2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.5" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
<PackageReference Include="DialogHost.Avalonia" Version="0.8.1" />
<PackageReference Include="AutoMapper" Version="13.0.1" />
<PackageReference Include="AutoMapper" Version="16.2.0" />
</ItemGroup>
</Project>
9 changes: 5 additions & 4 deletions EDSEditorGUI2/Mapper/ProtobufferViewModelMapper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using AutoMapper;
using Google.Protobuf.WellKnownTypes;
using LibCanOpen;
using Microsoft.Extensions.Logging;
using System;

namespace EDSEditorGUI2.Mapper
Expand All @@ -27,7 +28,7 @@ public static ViewModels.Device MapFromProtobuffer(CanOpenDevice source)
.ForMember(dest => dest.Objects, opt => opt.MapFrom(src => src.Objects));
cfg.CreateMap<CanOpen_DeviceInfo, ViewModels.DeviceInfo>();
cfg.CreateMap<CanOpen_DeviceCommissioning, ViewModels.DeviceCommissioning>();
});
}, LoggerFactory.Create(builder => { builder.AddDebug(); }));
config.AssertConfigurationIsValid();
var mapper = config.CreateMapper();
var result = mapper.Map<ViewModels.Device>(source);
Expand All @@ -42,7 +43,7 @@ public ViewModels.ObjectDictionary Convert(Google.Protobuf.Collections.MapField<
{
cfg.CreateMap<OdObject, ViewModels.OdObject>();
cfg.CreateMap<OdSubObject, ViewModels.OdSubObject>();
});
}, LoggerFactory.Create(builder => { builder.AddDebug(); }));
config.AssertConfigurationIsValid();
var mapper = config.CreateMapper();

Expand All @@ -59,7 +60,7 @@ public Google.Protobuf.Collections.MapField<string, OdObject> Convert(ViewModels
{
cfg.CreateMap<ViewModels.OdObject, OdObject>();
cfg.CreateMap<ViewModels.OdSubObject, OdSubObject>();
});
}, LoggerFactory.Create(builder => { builder.AddDebug(); }));
config.AssertConfigurationIsValid();
var mapper = config.CreateMapper();

Expand All @@ -77,7 +78,7 @@ public static CanOpenDevice MapToProtobuffer(ViewModels.Device source)
var config = new MapperConfiguration(cfg =>
{
//TODO
});
}, LoggerFactory.Create(builder => { builder.AddDebug(); }));
config.AssertConfigurationIsValid();
var mapper = config.CreateMapper();
var result = mapper.Map<CanOpenDevice>(source);
Expand Down
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,22 @@ Contributors
<sub><b>Regelink</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Sl-Alex">
<img src="https://avatars.githubusercontent.com/u/7002691?v=4" width="100;" alt="Sl-Alex"/>
<br />
<sub><b>Sl-Alex</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/rgruening">
<img src="https://avatars.githubusercontent.com/u/72022918?v=4" width="100;" alt="rgruening"/>
<br />
<sub><b>rgruening</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/Barzello">
<img src="https://avatars.githubusercontent.com/u/52344726?v=4" width="100;" alt="Barzello"/>
Expand Down Expand Up @@ -293,15 +300,15 @@ Contributors
<sub><b>DaMutz</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/StormOli">
<img src="https://avatars.githubusercontent.com/u/4819887?v=4" width="100;" alt="StormOli"/>
<br />
<sub><b>StormOli</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/possibly-not">
<img src="https://avatars.githubusercontent.com/u/12588174?v=4" width="100;" alt="possibly-not"/>
Expand Down
5 changes: 3 additions & 2 deletions libEDSsharp/CanOpenEDSMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using AutoMapper;
using Google.Protobuf.WellKnownTypes;
using LibCanOpen;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Globalization;
Expand Down Expand Up @@ -167,7 +168,7 @@
.ForMember(dest => dest.objecttype, opt => opt.Ignore())
.ForMember(dest => dest.Description, opt => opt.Ignore())
.ForMember(dest => dest.subobjects, opt => opt.Ignore());
});
}, LoggerFactory.Create(builder => { builder.AddDebug(); }));
config.AssertConfigurationIsValid();
var mapper = config.CreateMapper();

Expand Down Expand Up @@ -236,7 +237,7 @@
.ForMember(dest => dest.Pdo, opt => opt.MapFrom(src => src.accesstype))
.ForMember(dest => dest.Srdo, opt => opt.MapFrom(src => src.prop.CO_accessSRDO))
.ForMember(dest => dest.StringLengthMin, opt => opt.MapFrom(src => src.prop.CO_stringLengthMin));
});
}, LoggerFactory.Create(builder => { builder.AddDebug(); }));

config.AssertConfigurationIsValid();
var mapper = config.CreateMapper();
Expand Down Expand Up @@ -457,7 +458,7 @@
public class ODStringToShortTypeResolver : ITypeConverter<string, UInt16>
{
/// <summary>
/// Resolver to convert index & subindex string into short, will try hex, then descimal

Check warning on line 461 in libEDSsharp/CanOpenEDSMapping.cs

View workflow job for this annotation

GitHub Actions / build (net8, Release)

XML comment has badly formed XML -- 'Whitespace is not allowed at this location.'

Check warning on line 461 in libEDSsharp/CanOpenEDSMapping.cs

View workflow job for this annotation

GitHub Actions / build (net481, Release)

XML comment has badly formed XML -- 'Whitespace is not allowed at this location.'
/// </summary>
/// <param name="source">string containing index or subindex</param>
/// <param name="destination">short int interpreted from the string</param>
Expand Down
4 changes: 2 additions & 2 deletions libEDSsharp/libEDSsharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
<PackageReference Include="System.CodeDom" Version="8.0.0" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="Google.Protobuf" Version="3.27.2" />
<PackageReference Include="Google.Protobuf.Tools" Version="3.27.2" />
<PackageReference Include="AutoMapper" Version="10.0.0" Condition="'$(TargetFramework)' == 'net481'" />
<PackageReference Include="AutoMapper" Version="13.0.1" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="AutoMapper" Version="16.2.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="10.0.10" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading