-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAwpModels.cs
More file actions
131 lines (120 loc) · 5.17 KB
/
Copy pathAwpModels.cs
File metadata and controls
131 lines (120 loc) · 5.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
using System;
using System.Collections.Generic;
using Autodesk.Navisworks.Api;
namespace AutisAnalytics.NavisworksAtributos
{
internal sealed class AwpPropertyMapping
{
public int SourceLevel { get; set; }
public string CategoryInternal { get; set; }
public string CategoryDisplay { get; set; }
public string PropertyInternal { get; set; }
public string PropertyDisplay { get; set; }
[System.Web.Script.Serialization.ScriptIgnore]
public bool IsConfigured => !string.IsNullOrWhiteSpace(PropertyInternal) ||
!string.IsNullOrWhiteSpace(PropertyDisplay);
public static AwpPropertyMapping FromOption(SetNamePropertyOption option)
{
if (option == null) return null;
return new AwpPropertyMapping
{
SourceLevel = option.NivelOrigem,
CategoryInternal = option.CategoriaNomeInterno,
CategoryDisplay = option.CategoriaNomeExibicao,
PropertyInternal = option.PropriedadeNomeInterno,
PropertyDisplay = option.PropriedadeNomeExibicao
};
}
}
internal sealed class AwpProjectProfile
{
public string ProfileName { get; set; } = "Default AWP profile";
public string ProjectId { get; set; } = "PROJECT";
public string PackagePrefix { get; set; } = "AWP";
public int MaxItemsPerIwp { get; set; } = 200;
public bool UppercaseCodes { get; set; } = true;
public bool CreateSearchSets { get; set; } = true;
public bool CreateSnapshots { get; set; }
public AwpPropertyMapping CwaMapping { get; set; }
public AwpPropertyMapping DisciplineMapping { get; set; }
public AwpPropertyMapping CwpMapping { get; set; }
public AwpPropertyMapping IwpMapping { get; set; }
}
internal sealed class AwpElementAssignment
{
public ModelItem Item { get; set; }
public string ElementName { get; set; }
public string ElementUid { get; set; }
public string CwaId { get; set; }
public string Discipline { get; set; }
public string CwpId { get; set; }
public string IwpId { get; set; }
public string SourceCwa { get; set; }
public string SourceDiscipline { get; set; }
public bool CwpDerived { get; set; }
public bool IwpDerived { get; set; }
public int Sequence { get; set; }
public string Status { get; set; }
public string Message { get; set; }
public bool IsValid => !string.IsNullOrWhiteSpace(CwaId) &&
!string.IsNullOrWhiteSpace(Discipline) &&
!string.IsNullOrWhiteSpace(CwpId) &&
!string.IsNullOrWhiteSpace(IwpId);
}
internal sealed class AwpPackageGroup
{
public string Level { get; set; }
public string PackageId { get; set; }
public string ParentId { get; set; }
public string Discipline { get; set; }
public bool Derived { get; set; }
public ModelItemCollection Items { get; } = new ModelItemCollection();
public int Count => Items.Count;
}
internal sealed class AwpBuilderPreview
{
public List<AwpElementAssignment> Assignments { get; } = new List<AwpElementAssignment>();
public List<AwpPackageGroup> Packages { get; } = new List<AwpPackageGroup>();
public ModelItemCollection UnassignedItems { get; } = new ModelItemCollection();
public int ValidCount { get; set; }
public int InvalidCount { get; set; }
}
internal sealed class AwpBuildResult
{
public int ElementsWritten { get; set; }
public int WriteErrors { get; set; }
public int SearchSetsCreated { get; set; }
public int SearchSetsUpdated { get; set; }
public int SnapshotsCreated { get; set; }
public int UnassignedCount { get; set; }
public int SetErrors { get; set; }
}
internal enum AwpHealthSeverity
{
Error,
Warning,
Info
}
internal sealed class AwpHealthIssue
{
public AwpHealthSeverity Severity { get; set; }
public string Field { get; set; }
public string ElementName { get; set; }
public string ElementUid { get; set; }
public string CurrentValue { get; set; }
public string Issue { get; set; }
public string Recommendation { get; set; }
public ModelItem Item { get; set; }
}
internal sealed class AwpHealthReport
{
public string ScopeDescription { get; set; }
public int TotalElements { get; set; }
public int ValidElements { get; set; }
public List<AwpHealthIssue> Issues { get; } = new List<AwpHealthIssue>();
public int Errors => Issues.FindAll(item => item.Severity == AwpHealthSeverity.Error).Count;
public int Warnings => Issues.FindAll(item => item.Severity == AwpHealthSeverity.Warning).Count;
public int Information => Issues.FindAll(item => item.Severity == AwpHealthSeverity.Info).Count;
public double Coverage => TotalElements == 0 ? 0d : ValidElements * 100d / TotalElements;
}
}