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
64 changes: 64 additions & 0 deletions FieldWorks.sln
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,22 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HCSynthByGlossDllTest", "Sr
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HCSynthByGlossTest", "Src\Utilities\HCSynthByGloss\HCSynthByGloss\HCSynthByGlossTest\HCSynthByGlossTest.csproj", "{5DB1CEDA-B7AA-4594-9CE0-6D3A6F5763DF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AlloGenModel", "Src\Utilities\AlloVarGen\AlloGenModel\AlloGenModel.csproj", "{996498A3-06F1-4B1B-B83F-15648DD8F514}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AlloGenService", "Src\Utilities\AlloVarGen\AlloGenService\AlloGenService.csproj", "{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AlloGenModelTests", "Src\Utilities\AlloVarGen\AlloGenModel\AlloGenModelTests\AlloGenModelTests.csproj", "{98A04BE3-5CDA-4616-9396-E40B33CC9256}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AlloGenServiceTests", "Src\Utilities\AlloVarGen\AlloGenService\AlloGenServiceTests\AlloGenServiceTests.csproj", "{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AllomorphGeneratorDll", "Src\Utilities\AlloVarGen\AllomorphGeneratorDll\AllomorphGeneratorDll.csproj", "{2C57CEB5-40DE-4229-89B8-BADE30687815}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VarGenService", "Src\Utilities\AlloVarGen\VarGenService\VarGenService.csproj", "{0EDB239B-A523-4259-9123-EBA3B7E0139F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VarGenServiceTest", "Src\Utilities\AlloVarGen\VarGenService\VarGenServiceTest\VarGenServiceTest.csproj", "{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VariantGeneratorDll", "Src\Utilities\AlloVarGen\VariantGeneratorDll\VariantGeneratorDll.csproj", "{91219E68-FF1D-4DED-BB06-3A6AF46C0419}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Bounds|x64 = Bounds|x64
Expand Down Expand Up @@ -973,6 +989,54 @@ Global
{5DB1CEDA-B7AA-4594-9CE0-6D3A6F5763DF}.Debug|x64.Build.0 = Debug|x64
{5DB1CEDA-B7AA-4594-9CE0-6D3A6F5763DF}.Release|x64.ActiveCfg = Release|x64
{5DB1CEDA-B7AA-4594-9CE0-6D3A6F5763DF}.Release|x64.Build.0 = Release|x64
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Bounds|x64.ActiveCfg = Debug|x64
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Bounds|x64.Build.0 = Debug|x64
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Debug|x64.ActiveCfg = Debug|x64
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Debug|x64.Build.0 = Debug|x64
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Release|x64.ActiveCfg = Release|x64
{996498A3-06F1-4B1B-B83F-15648DD8F514}.Release|x64.Build.0 = Release|x64
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Bounds|x64.ActiveCfg = Debug|x64
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Bounds|x64.Build.0 = Debug|x64
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Debug|x64.ActiveCfg = Debug|x64
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Debug|x64.Build.0 = Debug|x64
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Release|x64.ActiveCfg = Release|x64
{ECEC3C09-019A-4B31-B72A-C4A22DE88E84}.Release|x64.Build.0 = Release|x64
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Bounds|x64.ActiveCfg = Debug|x64
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Bounds|x64.Build.0 = Debug|x64
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Debug|x64.ActiveCfg = Debug|x64
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Debug|x64.Build.0 = Debug|x64
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Release|x64.ActiveCfg = Release|x64
{98A04BE3-5CDA-4616-9396-E40B33CC9256}.Release|x64.Build.0 = Release|x64
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Bounds|x64.ActiveCfg = Debug|x64
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Bounds|x64.Build.0 = Debug|x64
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Debug|x64.ActiveCfg = Debug|x64
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Debug|x64.Build.0 = Debug|x64
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Release|x64.ActiveCfg = Release|x64
{B4CDC940-DDA7-4EEC-87A6-8441CF47EE7E}.Release|x64.Build.0 = Release|x64
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Bounds|x64.ActiveCfg = Debug|x64
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Bounds|x64.Build.0 = Debug|x64
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Debug|x64.ActiveCfg = Debug|x64
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Debug|x64.Build.0 = Debug|x64
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Release|x64.ActiveCfg = Release|x64
{2C57CEB5-40DE-4229-89B8-BADE30687815}.Release|x64.Build.0 = Release|x64
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Bounds|x64.ActiveCfg = Debug|x64
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Bounds|x64.Build.0 = Debug|x64
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Debug|x64.ActiveCfg = Debug|x64
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Debug|x64.Build.0 = Debug|x64
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Release|x64.ActiveCfg = Release|x64
{0EDB239B-A523-4259-9123-EBA3B7E0139F}.Release|x64.Build.0 = Release|x64
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Bounds|x64.ActiveCfg = Debug|x64
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Bounds|x64.Build.0 = Debug|x64
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Debug|x64.ActiveCfg = Debug|x64
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Debug|x64.Build.0 = Debug|x64
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Release|x64.ActiveCfg = Release|x64
{AF29BF64-3F6E-4CD9-BC70-AFB68F563173}.Release|x64.Build.0 = Release|x64
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Bounds|x64.ActiveCfg = Debug|x64
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Bounds|x64.Build.0 = Debug|x64
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Debug|x64.ActiveCfg = Debug|x64
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Debug|x64.Build.0 = Debug|x64
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Release|x64.ActiveCfg = Release|x64
{91219E68-FF1D-4DED-BB06-3A6AF46C0419}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
114 changes: 114 additions & 0 deletions Src/Utilities/AlloVarGen/AlloGenModel/Action.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
// Copyright (c) 2022-2023 SIL International
// This software is licensed under the LGPL, version 2.1 or later
// (http://www.gnu.org/licenses/lgpl-2.1.html)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SIL.AlloGenModel
{
public class Action
{
public List<string> ReplaceOpRefs { get; set; }

// Environments and StemName used in Allomorph Generator
public List<Environment> Environments { get; set; }
public StemName StemName { get; set; } = new StemName();

// Variant Types, ShowInMinorEntry, and PublishEntryIn used in Variant Generator
public List<VariantType> VariantTypes { get; set; }
public bool ShowMinorEntry { get; set; } = true;
public List<PublishEntryInItem> PublishEntryInItems { get; set; } = new List<PublishEntryInItem>();

public Action()
{
ReplaceOpRefs = new List<string>();
Environments = new List<Environment>();
VariantTypes = new List<VariantType>();
}

public Action Duplicate()
{
Action newAction = new Action();
List<string> newReplaceOpRefs = new List<string>();
foreach (string repRef in ReplaceOpRefs)
{
newReplaceOpRefs.Add(repRef);
}
newAction.ReplaceOpRefs = newReplaceOpRefs;
List<Environment> newEnvironments = new List<Environment>();
foreach (Environment env in Environments)
{
var newEnv = new Environment();
newEnv.Active = env.Active;
newEnv.Guid = env.Guid;
newEnv.Name = env.Name;
newEnvironments.Add(newEnv);
}
newAction.Environments = newEnvironments;
var newSN = new StemName();
newSN.Active = StemName.Active;
newSN.Guid = StemName.Guid;
newSN.Name = StemName.Name;
newAction.StemName = newSN;
List<VariantType> newVariantTypes = new List<VariantType>();
foreach (VariantType vt in VariantTypes)
{
var newVT = new VariantType();
newVT.Active = vt.Active;
newVT.Guid = vt.Guid;
newVT.Name = vt.Name;
newVariantTypes.Add(newVT);
}
newAction.VariantTypes = newVariantTypes;
newAction.ShowMinorEntry = ShowMinorEntry;
List<PublishEntryInItem> newPublishEntryIn = new List<PublishEntryInItem>();
foreach (PublishEntryInItem pubItem in PublishEntryInItems)
{
var newPubItem = new PublishEntryInItem();
newPubItem.Active = pubItem.Active;
newPubItem.Guid = pubItem.Guid;
newPubItem.Name = pubItem.Name;
newPublishEntryIn.Add(newPubItem);
}
newAction.PublishEntryInItems = newPublishEntryIn;
return newAction;
}

public override bool Equals(Object obj)
{
//Check for null and compare run-time types.
if ((obj == null) || !this.GetType().Equals(obj.GetType()))
{
return false;
}
else
{
Action act = (Action)obj;
return (ReplaceOpRefs.SequenceEqual(act.ReplaceOpRefs))
&& (Environments.SequenceEqual(act.Environments))
&& (VariantTypes.SequenceEqual(act.VariantTypes))
&& (PublishEntryInItems.SequenceEqual(act.PublishEntryInItems))
&& (StemName.Equals(act.StemName))
&& (ShowMinorEntry == act.ShowMinorEntry);
}
}

public override int GetHashCode()
{
return Tuple
.Create(
ReplaceOpRefs,
Environments,
StemName,
VariantTypes,
ShowMinorEntry,
PublishEntryInItems
)
.GetHashCode();
}
}
}
36 changes: 36 additions & 0 deletions Src/Utilities/AlloVarGen/AlloGenModel/AlloGenBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright (c) 2022 SIL International
// This software is licensed under the LGPL, version 2.1 or later
// (http://www.gnu.org/licenses/lgpl-2.1.html)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace SIL.AlloGenModel
{
abstract public class AlloGenBase
{
[XmlAttribute("active")]
public bool Active { get; set; } = true;

public override bool Equals(Object obj)
{
//Check for null and compare run-time types.
if ((obj == null) || !this.GetType().Equals(obj.GetType()))
return false;
else
{
AlloGenBase agb = (AlloGenBase)obj;
return (Active == agb.Active);
}
}

public override int GetHashCode()
{
return Active.GetHashCode();
}
}
}
46 changes: 46 additions & 0 deletions Src/Utilities/AlloVarGen/AlloGenModel/AlloGenGuid.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Copyright (c) 2022-2023 SIL International
// This software is licensed under the LGPL, version 2.1 or later
// (http://www.gnu.org/licenses/lgpl-2.1.html)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace SIL.AlloGenModel
{
abstract public class AlloGenGuid : AlloGenBase
{
[XmlAttribute("guid")]
public string Guid { get; set; } = "";
public string Name { get; set; } = "";

override public string ToString()
{
return Name;
}

public override bool Equals(Object obj)
{
if (!base.Equals(obj))
return false;

//Check for null and compare run-time types.
if ((obj == null) || !this.GetType().Equals(obj.GetType()))
return false;
else
{
AlloGenGuid agg = (AlloGenGuid)obj;
return (Guid == agg.Guid) && (Name == agg.Name);
}
}

public override int GetHashCode()
{
int result = base.GetHashCode();
return result + Tuple.Create(Guid, Name).GetHashCode();
}
}
}
45 changes: 45 additions & 0 deletions Src/Utilities/AlloVarGen/AlloGenModel/AlloGenModel.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>AlloGenModel</AssemblyName>
<RootNamespace>SIL.AlloGenModel</RootNamespace>
<TargetFramework>net48</TargetFramework>
<OutputType>Library</OutputType> <NoWarn>168,169,219,414,649,1635,1702,1701</NoWarn>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize>
<DebugType>portable</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<DefineConstants>TRACE</DefineConstants>
<DebugSymbols>true</DebugSymbols>
<Optimize>true</Optimize>
<DebugType>portable</DebugType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="SIL.Core" />
<PackageReference Include="System.ValueTuple" />
</ItemGroup>
<ItemGroup>
<Reference Include="netstandard" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../../../Common/Filters/Filters.csproj" />
<ProjectReference Include="../../../Common/FwUtils/FwUtils.csproj" />
<ProjectReference Include="../../XMLUtils/XMLUtils.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Remove="AlloGenModelTests\**" />
<EmbeddedResource Remove="AlloGenModelTests\**" />
<None Remove="AlloGenModelTests\**" />
<Compile Include="..\..\..\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
</Compile>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>AlloGenModelTests</AssemblyName>
<RootNamespace>AlloGenModelTests</RootNamespace>
<TargetFramework>net48</TargetFramework>
<OutputType>Library</OutputType>
<IsTestProject>true</IsTestProject>
<NoWarn>168,169,219,414,649,1635,1702,1701</NoWarn>
<UseUiIndependentTestAssemblyInfo>true</UseUiIndependentTestAssemblyInfo>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize>
<DebugType>portable</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<DefineConstants>TRACE</DefineConstants>
<DebugSymbols>true</DebugSymbols>
<Optimize>true</Optimize>
<DebugType>portable</DebugType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="SIL.Core" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="SIL.LCModel.Core.Tests" PrivateAssets="All" />
<PackageReference Include="SIL.LCModel.Utils.Tests" PrivateAssets="All" />
<PackageReference Include="SIL.TestUtilities" />
</ItemGroup>
<ItemGroup>
<Reference Include="netstandard" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AlloGenModel.csproj" />
<ProjectReference Include="..\..\AlloGenService\AlloGenService.csproj" />
<ProjectReference Include="..\..\..\..\Common\FwUtils\FwUtilsTests\FwUtilsTests.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\..\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
</Compile>
</ItemGroup>
</Project>
Loading
Loading