Skip to content

Commit

Permalink
fix linking break
Browse files Browse the repository at this point in the history
  • Loading branch information
malstraem committed Dec 24, 2024
1 parent 274007f commit d422255
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 18 deletions.
6 changes: 4 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
# Overview

While the **ARINC 424** specification describes entities (or records) with 132-byte fixed-length string, this library creates a database object model via building entities using reflection and runtime compilation.
While the **ARINC 424** specification describes entities with 132-byte fixed-length string, this library creates a database object model via building entities using reflection and runtime compilation.

Most terms are converted according to the specification into associated enumerations or numeric values ​​on the fly.

In addition, relationships between entities are established after the building stage. In practice, this allows you to explore and manipulate the tree-like representation of **ARINC 424** database.
In addition, relationships between entities are established after the building stage.

In practice, this allows you to explore and manipulate the tree-like representation of **ARINC 424** database.

## Specification map

Expand Down
9 changes: 5 additions & 4 deletions docs/package.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Overview

While the **ARINC 424** specification describes entities (or records) with 132-byte fixed-length string,
While the **ARINC 424** specification describes entities with 132-byte fixed-length string,
this library creates a database object model via building entities using reflection and runtime compilation.

Most terms are converted according to the specification into associated enumerations or numeric values ​​on the fly.

In addition, relationships between entities are established after the building stage. In practice,
this allows you to explore and manipulate the tree-like representation of **ARINC 424** database.
In addition, relationships between entities are established after the building stage.

In practice, this allows you to explore and manipulate the tree-like representation of **ARINC 424** database.

See [docs](https://malstraem.github.io/arinc424.net) to know how specification is mapped.

Expand All @@ -19,7 +20,7 @@ and entities created based on [supplement](https://malstraem.github.io/arinc424.
var meta = Meta424.Create(Supplement.V20);
```

And you can try to get navigation [data](https://malstraem.github.io/arinc424.net/api/Arinc424.Data424.html) from the strings
So you can try to get navigation [data](https://malstraem.github.io/arinc424.net/api/Arinc424.Data424.html) from the strings
leaving [builds](https://malstraem.github.io/arinc424.net/api/Arinc424.Building.Build.html) with diagnostics
(bad coded fields, missing links, etc) and skipped strings that don't match entity types.

Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

This is a long-term research and proof of concept to provide a model and reader for the globally used **`ARINC 424`** aircraft navigation data using metaprogramming.

While the **`ARINC 424`** specification describes entities (*or records in terms*) with 132-byte fixed-length strings, this library creates
While the **`ARINC 424`** specification describes entities with 132-byte fixed-length strings, this library creates
a database object model via building entities using reflection and runtime compilation.

Most terms are converted according to the specification into associated enumerations or numeric values ​​on the fly.
Expand All @@ -29,7 +29,7 @@ and entities created based on [supplement](https://malstraem.github.io/arinc424.
var meta = Meta424.Create(Supplement.V20);
```

And you can try to get navigation [data](https://malstraem.github.io/arinc424.net/api/Arinc424.Data424.html) from the strings
So you can try to get navigation [data](https://malstraem.github.io/arinc424.net/api/Arinc424.Data424.html) from the strings
leaving [builds](https://malstraem.github.io/arinc424.net/api/Arinc424.Building.Build.html) with diagnostics
(bad coded fields, missing links, etc) and skipped strings that don't match entity types.

Expand Down
5 changes: 2 additions & 3 deletions source/library/Arinc424.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<DefineConstants>$(DefineConstants);NOPARALLEL</DefineConstants>
</PropertyGroup>

<!--package -->
<PropertyGroup>
<IsPackable>true</IsPackable>
<IncludeSymbols>true</IncludeSymbols>
Expand All @@ -19,7 +18,7 @@
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>

<Version>0.1.1-alpha</Version>
<Version>0.1.2</Version>
<PackageId>arinc424</PackageId>
<Product>ARINC 424 object model</Product>

Expand All @@ -40,6 +39,6 @@
<ItemGroup>
<ProjectReference Include="../../codegen/Arinc424.Generators.csproj" OutputItemType="analyzer" ReferenceOutputAssembly="false" />

<None Include="../../docs/package.md" Pack="true" PackagePath="/readme.md" Visible="false"/>
<None Include="../../docs/package.md" Pack="true" PackagePath="/readme.md" Visible="false" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions source/library/linking/Known{TRecord, TType}.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal override bool TryLink(TRecord record, Unique unique, Meta424 meta, [Not

var type = property.PropertyType;

if (!foreign.TryGetKey(record.Source!, meta.TypeInfo[property.PropertyType].Primary! /* guarantee by design */, out string? key))
if (!foreign.TryGetKey(record.Source!, meta.TypeInfo[type].Primary! /* guarantee by design */, out string? key))
return true;

if (!unique.TryGetRecords(type, out var records))
Expand All @@ -41,7 +41,7 @@ internal override bool TryLink(TRecord record, Unique unique, Meta424 meta, [Not
// guarantee by design
set(record, Unsafe.As<TType>(referenced));

meta.TypeInfo[type].Relations?.Process(type, referenced, record);
meta.TypeInfo[type].Relations?.Process(referenced, record);

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion source/library/linking/Polymorph{TRecord, TType}.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ internal override bool TryLink(TRecord record, Unique unique, Meta424 meta, [Not
}
set(record, @ref);

meta.TypeInfo[type].Relations?.Process(type, referenced, record);
meta.TypeInfo[type].Relations?.Process(referenced, record);

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion source/library/linking/Possible{TRecord, TType}.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal override bool TryLink(TRecord record, Unique unique, Meta424 meta, [Not
&& records.TryGetValue(key, out var referenced))
{
set(record, (TType)referenced);
meta.TypeInfo[type].Relations!.Process(type, referenced, record);
meta.TypeInfo[type].Relations!.Process(referenced, record);
return true;
}
}
Expand Down
6 changes: 4 additions & 2 deletions source/library/linking/Relationships{TRecord}.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ internal abstract class Relationships(Type type)
#pragma warning restore CS8618
internal abstract void Link(IEnumerable<Build> builds, Unique unique, Meta424 meta);

internal void Process<TRecord>(Type type, Record424 self, TRecord referenced) where TRecord : Record424
internal void Process<TRecord>(Record424 self, TRecord referenced) where TRecord : Record424
{
var type = typeof(TRecord);

// todo: compiled one & many relations
if (many.TryGetValue(type, out var property))
{
Expand All @@ -26,7 +28,7 @@ internal void Process<TRecord>(Type type, Record424 self, TRecord referenced) wh
}
else if (one.TryGetValue(type, out property))
{
property.SetValue(referenced, referenced);
property.SetValue(self, referenced);
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/tests/Arinc424.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="all"
IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive"/>
IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />

<ProjectReference Include="../../source/library/Arinc424.csproj" />

Expand Down

0 comments on commit d422255

Please sign in to comment.