Skip to content

Commit

Permalink
Merge pull request #476 from Serg-Norseman/feature/complex-kinship
Browse files Browse the repository at this point in the history
Feature/complex kinship
  • Loading branch information
Serg-Norseman authored Jul 2, 2023
2 parents 6b55ccf + 4bc9fcf commit 5cff68c
Show file tree
Hide file tree
Showing 13 changed files with 202 additions and 103 deletions.
2 changes: 2 additions & 0 deletions locales/English.lng
Original file line number Diff line number Diff line change
Expand Up @@ -907,3 +907,5 @@
903=Age at year
904=Keep overall size of info panels
905=Identifiers (XRef)
906=father's wife
907=mother's husband
7 changes: 3 additions & 4 deletions locales/Hungarian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@
358=fiú testvér
359=lánytestvér
360=Vő
361=meny
361=meny
362=após
363=anyós
364=após
Expand Down Expand Up @@ -403,7 +403,7 @@
402=Nem tartalmaz
403=Pontos
404=Előtte
405=Utánna
405=Utánna
406=Között
407=Időszak előtt
408=Időszak tól
Expand Down Expand Up @@ -807,7 +807,7 @@
805=Szovjetunió: Elnyomott
806=Vallása: Iszlám
807=Vallása: katolikus
808=Vallása: ortodox
808=Vallása: ortodox
809=Vallás: Régen hívők

810=Relatív hivatkozás a fájlhoz
Expand Down Expand Up @@ -907,4 +907,3 @@
903=Életkor évben
904=Tartsa meg az információs panelek teljes méretét
905=Azonosítók (XRef)

1 change: 1 addition & 0 deletions locales/help_enu/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1>Change log</h1>

<p>
<b>??.??.2023 [v2.26.2 &amp; v3.2.2]</b><ul>
<li>Added a definition for the Icelandic relationship of father/mother brother (uncle) and father/mother sister (aunt).
<li>Added display of citations of sources of events in the information panel.
<li>Added output of all associations from the database to Navigator.
<li>Name display options extended to more places.
Expand Down
1 change: 1 addition & 0 deletions locales/help_rus/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1>История версий</h1>

<p>
<b>??.??.2023 [v2.26.2 &amp; v3.2.2]</b><ul>
<li>Добавлено определение характерных для Исландии родственных отношений брат отца/матери (дядя) и сестра отца/матери (тетя).
<li>Добавлен вывод цитат источников событий в информационной панели.
<li>В Навигатор добавлен вывод всех ассоциаций из базы данных.
<li>Распространены в большее число мест параметры отображения имён.
Expand Down
2 changes: 2 additions & 0 deletions locales/russian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -907,3 +907,5 @@
903=Возраст в году
904=Сохранять общий размер информационных панелей
905=Идентификаторы (XRef)
906=жена отца
907=муж матери
74 changes: 40 additions & 34 deletions projects/GKCore/GKCore/GKData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,40 +254,46 @@ static GKData()
};

RelationKinds = new LSID[] {
LSID.LSID_RK_Unk,
LSID.LSID_None,
LSID.LSID_None,
LSID.LSID_None,
LSID.LSID_RK_Father,
LSID.LSID_RK_Mother,
LSID.LSID_RK_Husband,
LSID.LSID_RK_Wife,
LSID.LSID_RK_Son,
LSID.LSID_RK_Daughter,
LSID.LSID_RK_Grandfather,
LSID.LSID_RK_Grandmother,
LSID.LSID_RK_Grandson,
LSID.LSID_RK_Granddaughter,
LSID.LSID_RK_Brother,
LSID.LSID_RK_Sister,
LSID.LSID_RK_SonInLaw,
LSID.LSID_RK_DaughterInLaw,
LSID.LSID_RK_HusbandFather,
LSID.LSID_RK_HusbandMother,
LSID.LSID_RK_WifeFather,
LSID.LSID_RK_WifeMother,
LSID.LSID_RK_Uncle,
LSID.LSID_RK_Aunt,
LSID.LSID_RK_Nephew,
LSID.LSID_RK_Niece,
LSID.LSID_RK_CousinM,
LSID.LSID_RK_CousinF,
LSID.LSID_RK_BrotherInLaw_H,
LSID.LSID_RK_SisterInLaw_H,
LSID.LSID_RK_BrotherInLaw_W,
LSID.LSID_RK_SisterInLaw_W,
LSID.LSID_None,
LSID.LSID_RK_Unk
/* 00 */ LSID.LSID_RK_Unk,
/* 01 */ LSID.LSID_None,
/* 02 */ LSID.LSID_None,
/* 03 */ LSID.LSID_None,
/* 04 */ LSID.LSID_RK_Father,
/* 05 */ LSID.LSID_RK_Mother,
/* 06 */ LSID.LSID_RK_Husband,
/* 07 */ LSID.LSID_RK_Wife,
/* 08 */ LSID.LSID_RK_Son,
/* 09 */ LSID.LSID_RK_Daughter,
/* 10 */ LSID.LSID_RK_Grandfather,
/* 11 */ LSID.LSID_RK_Grandmother,
/* 12 */ LSID.LSID_RK_Grandson,
/* 13 */ LSID.LSID_RK_Granddaughter,
/* 14 */ LSID.LSID_RK_Brother,
/* 15 */ LSID.LSID_RK_Sister,
/* 16 */ LSID.LSID_RK_SonInLaw,
/* 17 */ LSID.LSID_RK_DaughterInLaw,
/* 18 */ LSID.LSID_RK_HusbandFather,
/* 19 */ LSID.LSID_RK_HusbandMother,
/* 20 */ LSID.LSID_RK_WifeFather,
/* 21 */ LSID.LSID_RK_WifeMother,
/* 22 */ LSID.LSID_RK_Uncle_FatherBrother,
/* 23 */ LSID.LSID_RK_Aunt_FatherSister,
/* 24 */ LSID.LSID_RK_Uncle_MotherBrother,
/* 25 */ LSID.LSID_RK_Aunt_MotherSister,
/* 26 */ LSID.LSID_RK_Nephew,
/* 27 */ LSID.LSID_RK_Niece,
/* 28 */ LSID.LSID_RK_CousinM,
/* 29 */ LSID.LSID_RK_CousinF,
/* 30 */ LSID.LSID_RK_BrotherInLaw_H,
/* 31 */ LSID.LSID_RK_SisterInLaw_H,
/* 32 */ LSID.LSID_RK_BrotherInLaw_W,
/* 33 */ LSID.LSID_RK_SisterInLaw_W,
/* 34 */ LSID.LSID_RK_Stepfather,
/* 35 */ LSID.LSID_RK_Stepmother,
/* 36 */ LSID.LSID_RK_FathersWife,
/* 37 */ LSID.LSID_RK_MothersHusband,
/* 38 */ LSID.LSID_None,
/* 39 */ LSID.LSID_RK_Unk
};

SpecialUserRefs = new SpecialUserRef[] {
Expand Down
6 changes: 4 additions & 2 deletions projects/GKCore/GKCore/Kinships/KinshipRec.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* "GEDKeeper", the personal genealogical database editor.
* Copyright (C) 2009-2022 by Sergey V. Zhdanovskih.
* Copyright (C) 2009-2023 by Sergey V. Zhdanovskih.
*
* This file is part of "GEDKeeper".
*
Expand All @@ -27,14 +27,16 @@ namespace GKCore.Kinships

public sealed class KinshipRec
{
public RelationSet PrevPrevRels;
public RelationSet PrevRels;
public RelationSet CurrRels;
public RelationKind FinRel;
public short Great;
public short Degree;

public KinshipRec(RelationSet prevRels, RelationSet currRels, RelationKind finRel, short great, short degree)
public KinshipRec(RelationSet prevprevRels, RelationSet prevRels, RelationSet currRels, RelationKind finRel, short great, short degree)
{
PrevPrevRels = prevprevRels;
PrevRels = prevRels;
CurrRels = currRels;
FinRel = finRel;
Expand Down
10 changes: 7 additions & 3 deletions projects/GKCore/GKCore/Kinships/KinshipsGraph.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* "GEDKeeper", the personal genealogical database editor.
* Copyright (C) 2009-2022 by Sergey V. Zhdanovskih.
* Copyright (C) 2009-2023 by Sergey V. Zhdanovskih.
*
* This file is part of "GEDKeeper".
*
Expand Down Expand Up @@ -98,6 +98,7 @@ public string GetRelationship(GDMIndividualRecord targetRec, bool fullFormat = f
if (target == null) return "???";

try {
RelationKind prevprevRel = RelationKind.rkNone;
RelationKind prevRel = RelationKind.rkNone;
RelationKind finRel = RelationKind.rkNone;
int great = 0;
Expand Down Expand Up @@ -130,7 +131,7 @@ public string GetRelationship(GDMIndividualRecord targetRec, bool fullFormat = f
g = -1;
deg = +1;
} else {
finRel = KinshipsMan.FindKinship(prevRel, curRel, out g, out deg);
finRel = KinshipsMan.FindKinship(prevprevRel, prevRel, curRel, out g, out deg);
}

great += g;
Expand All @@ -143,16 +144,19 @@ public string GetRelationship(GDMIndividualRecord targetRec, bool fullFormat = f
starting = prev_tgt;
great = 0;
degree = 0;

prevprevRel = prevRel;
prevRel = RelationKind.rkNone;

if (fullRel.Length > 0) fullRel += ", ";
fullRel += part;

finRel = KinshipsMan.FindKinship(prevRel, curRel, out g, out deg);
finRel = KinshipsMan.FindKinship(prevprevRel, prevRel, curRel, out g, out deg);
great += g;
degree += deg;
}

prevprevRel = prevRel;
prevRel = finRel;
}
}
Expand Down
Loading

0 comments on commit 5cff68c

Please sign in to comment.