Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RevitDeclarations: Скорректированы значения параметров декларации #140

Merged
merged 5 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
6 changes: 4 additions & 2 deletions src/RevitDeclarations/Models/RoomParamProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ public string GetTwoParamsWithHyphen(RoomElement room, bool addPrefix) {
string number = room.GetTextParamValue(_settings.RoomNumberParam);
if(addPrefix) {
string group = room.GetTextParamValue(_settings.ApartmentNumberParam);
return $"{group}-{number}";
if(!string.IsNullOrEmpty(group)) {
return $"{group}-{number}";
}
}
return number;
}
Expand Down Expand Up @@ -49,7 +51,7 @@ public string GetRoomsPosition(RoomGroup roomGroup) {
}
}

return string.Join("-", resultString);
return string.Join(", ", resultString);
}

public string GetAllLevels(IEnumerable<RoomElement> rooms) {
Expand Down
16 changes: 8 additions & 8 deletions src/RevitDeclarations/Models/Rooms/Apartment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ public Apartment(IEnumerable<RoomElement> rooms,
[JsonProperty("type")]
public override string Department => _paramProvider.GetDepartment(_firstRoom, "Квартира");
[JsonProperty("area_k")]
public double AreaCoef => _firstRoom.GetAreaParamValue(_settings.ApartmentAreaCoefParam, _accuracy);
public double AreaCoef => _firstRoom.GetAreaParamValue(_settings.ApartmentAreaCoefParam, _accuracyFoArea);
DivinN marked this conversation as resolved.
Show resolved Hide resolved
[JsonProperty("area_living")]
public double AreaLiving => _firstRoom.GetAreaParamValue(_settings.ApartmentAreaLivingParam, _accuracy);
public double AreaLiving => _firstRoom.GetAreaParamValue(_settings.ApartmentAreaLivingParam, _accuracyFoArea);
[JsonProperty("area_non_summer")]
public double AreaNonSummer => _firstRoom.GetAreaParamValue(_settings.ApartmentAreaNonSumParam, _accuracy);
public double AreaNonSummer => _firstRoom.GetAreaParamValue(_settings.ApartmentAreaNonSumParam, _accuracyFoArea);
[JsonProperty("room_size")]
public int RoomsAmount => _firstRoom.GetIntParamValue(_settings.RoomsAmountParam);
[JsonProperty("building_number")]
Expand All @@ -65,7 +65,7 @@ public Apartment(IEnumerable<RoomElement> rooms,
public string ConstrWorksNumber => _firstRoom.GetTextParamValue(_settings.ConstrWorksNumberParam);

[JsonProperty("ceiling_height")]
public double RoomsHeight => _firstRoom.GetLengthParamValue(_settings.RoomsHeightParam, _accuracy);
public double RoomsHeight => _firstRoom.GetLengthParamValue(_settings.RoomsHeightParam, _accuracyFoLength);

[JsonIgnore]
public string UtpTwoBaths => _utpTwoBaths;
Expand Down Expand Up @@ -129,7 +129,7 @@ public bool CheckActualApartmentAreas() {
// Все помещения в одной квартире должны иметь одинаковые значения.
public bool CheckEqualityOfRoomAreas() {
int amountOfAreas = _rooms
.Select(x => x.GetAreaParamValue(_settings.ApartmentAreaParam, _accuracy))
.Select(x => x.GetAreaParamValue(_settings.ApartmentAreaParam, _accuracyFoArea))
.Distinct()
.Count();

Expand All @@ -138,7 +138,7 @@ public bool CheckEqualityOfRoomAreas() {
}

int amountOfAreasCoef = _rooms
.Select(x => x.GetAreaParamValue(_settings.ApartmentAreaCoefParam, _accuracy))
.Select(x => x.GetAreaParamValue(_settings.ApartmentAreaCoefParam, _accuracyFoArea))
.Distinct()
.Count();

Expand All @@ -147,7 +147,7 @@ public bool CheckEqualityOfRoomAreas() {
}

int amountOfAreasLiving = _rooms
.Select(x => x.GetAreaParamValue(_settings.ApartmentAreaLivingParam, _accuracy))
.Select(x => x.GetAreaParamValue(_settings.ApartmentAreaLivingParam, _accuracyFoArea))
.Distinct()
.Count();

Expand All @@ -156,7 +156,7 @@ public bool CheckEqualityOfRoomAreas() {
}

int amountOfAreasNonSum = _rooms
.Select(x => x.GetAreaParamValue(_settings.ApartmentAreaNonSumParam, _accuracy))
.Select(x => x.GetAreaParamValue(_settings.ApartmentAreaNonSumParam, _accuracyFoArea))
.Distinct()
.Count();

Expand Down
2 changes: 1 addition & 1 deletion src/RevitDeclarations/Models/Rooms/CommercialRooms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public CommercialRooms(IEnumerable<RoomElement> rooms,
[JsonProperty("construction_works")]
public string ConstrWorksNumber => _firstRoom.GetTextParamValue(_settings.ConstrWorksNumberParam);
[JsonProperty("ceiling_height")]
public double RoomsHeight => _firstRoom.GetLengthParamValue(_settings.RoomsHeightParam, _accuracy);
public double RoomsHeight => _firstRoom.GetLengthParamValue(_settings.RoomsHeightParam, _accuracyFoLength);

[JsonProperty("type")]
public override string Department => _paramProvider.GetDepartment(_firstRoom, "Нежилые помещения");
Expand Down
8 changes: 5 additions & 3 deletions src/RevitDeclarations/Models/Rooms/RoomGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ internal abstract class RoomGroup {
protected readonly StringComparer _strComparer = StringComparer.OrdinalIgnoreCase;

protected readonly RoomParamProvider _paramProvider;
protected readonly int _accuracy;
protected readonly int _accuracyFoArea;
protected readonly int _accuracyFoLength;

protected readonly IEnumerable<RoomElement> _rooms;

Expand All @@ -22,7 +23,8 @@ internal abstract class RoomGroup {
public RoomGroup(IEnumerable<RoomElement> rooms, DeclarationSettings settings, RoomParamProvider paramProvider) {
_settings = settings;
_paramProvider = paramProvider;
_accuracy = settings.AccuracyForArea;
_accuracyFoArea = settings.AccuracyForArea;
_accuracyFoLength = settings.AccuracyForLength;

_rooms = rooms.ToList();
_firstRoom = rooms.FirstOrDefault();
Expand All @@ -46,7 +48,7 @@ public RoomGroup(IEnumerable<RoomElement> rooms, DeclarationSettings settings, R
public string Building => _firstRoom.GetTextParamValue(_settings.BuildingParam);

[JsonProperty("area")]
public virtual double AreaMain => _firstRoom.GetAreaParamValue(_settings.ApartmentAreaParam, _accuracy);
public virtual double AreaMain => _firstRoom.GetAreaParamValue(_settings.ApartmentAreaParam, _accuracyFoArea);

// Проверка актуальности площадей помещений.
// 1. Сравнивается системная площадь помещения с площадью из квартирографии.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@
Grid.Row="15"
Grid.Column="1"
Style="{StaticResource ParameterName}"
Text="11.2 Для группы из нескольких помещений:"/>
Text="11.1 Для группы из нескольких помещений:"/>
<ComboBox
Grid.Row="15"
Grid.Column="2"
Expand Down