Skip to content

Commit

Permalink
IfcDoc 11.2 - UI, diagrams, documentation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
timchipman committed Jan 25, 2017
1 parent 308e4fd commit 66f8a37
Show file tree
Hide file tree
Showing 102 changed files with 14,750 additions and 4,667 deletions.
290 changes: 231 additions & 59 deletions ChangeLogGenerator.cs

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Compiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public Compiler(DocProject project, DocModelView[] views, DocExchangeDefinition
this.m_views = views;
this.m_exchange = exchange;

this.m_assembly = AppDomain.CurrentDomain.DefineDynamicAssembly(new AssemblyName("IFC4"), AssemblyBuilderAccess.RunAndSave);
string schemaid = project.GetSchemaIdentifier();
this.m_assembly = AppDomain.CurrentDomain.DefineDynamicAssembly(new AssemblyName(schemaid), AssemblyBuilderAccess.RunAndSave);
this.m_module = this.m_assembly.DefineDynamicModule("IFC4.dll", "IFC4.dll");
this.m_definitions = new Dictionary<string, DocObject>();
this.m_types = new Dictionary<string, Type>();
Expand Down
120 changes: 96 additions & 24 deletions CtlCheckGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,36 @@ protected override void OnPaint(PaintEventArgs pe)

// draw cell
CellValue val = this.m_datasource.GetCell(iRow, iCol);
Brush brush = Brushes.Gray; // incompatible
switch(val)
{
case CellValue.None:
brush = Brushes.LightGray;
break;

case CellValue.Mandatory:
brush = Brushes.LightGreen;
break;

case CellValue.Recommended:
brush = Brushes.Blue;
break;

case CellValue.NotRelevant:
brush = Brushes.White;
break;

case CellValue.NotRecommended:
brush = Brushes.Yellow;
break;

case CellValue.Excluded:
brush = Brushes.Red;
break;
}
g.FillRectangle(brush, new Rectangle(SX + iCol * CX + 1, SY + iRow * CY + 1, CX - 1, CY - 1));

#if false
if (val != CellValue.Unavailable)
{
g.FillRectangle(Brushes.White, new Rectangle(SX + iCol * CX + 1, SY + iRow * CY + 1, CX-1, CY-1));
Expand All @@ -134,6 +164,7 @@ protected override void OnPaint(PaintEventArgs pe)
{
g.FillRectangle(Brushes.DarkGray, new Rectangle(SX + iCol * CX + 1, SY + iRow * CY + 1, CX - 1, CY - 1));
}
#endif
}
}
}
Expand Down Expand Up @@ -192,19 +223,19 @@ private void CtlCheckGrid_MouseClick(object sender, MouseEventArgs e)
{

case CellValue.None:
newval = CellValue.Optional;
newval = CellValue.Recommended;
break;

case CellValue.Optional:
newval = CellValue.Required;
case CellValue.Recommended:
newval = CellValue.Mandatory;
break;

case CellValue.Required:
case CellValue.Mandatory:
newval = CellValue.None;
break;

default:
newval = CellValue.Required;
newval = CellValue.Mandatory;
break;
}
this.m_datasource.SetCell(iRow, iCol, newval);
Expand Down Expand Up @@ -314,24 +345,39 @@ public interface ICheckGrid
public enum CellValue
{
/// <summary>
/// Cannot be edited
/// Black -- entry is not possible (not compatible)
/// </summary>
Unavailable = -1,

/// <summary>
/// Blank value
/// Grey -- entry is possible but not defined
/// </summary>
None = 0,

/// <summary>
/// Half slash for optional
/// Green indicator
/// </summary>
Mandatory = 1,

/// <summary>
/// Blue indicator
/// </summary>
Recommended = 2,

/// <summary>
/// White indicator - entry defined
/// </summary>
Optional = 1,
NotRelevant = 3,

/// <summary>
/// X for required
/// Yellow indicator
/// </summary>
Required = 2,
NotRecommended = 4,

/// <summary>
/// Red indicator
/// </summary>
Excluded = 5,
}

/// <summary>
Expand All @@ -352,11 +398,17 @@ public CheckGridConcept(DocTemplateDefinition docTemplate, DocModelView docView,

public int GetColumnCount()
{
if (this.m_view == null)
return 0;

return this.m_view.Exchanges.Count;
}

public int GetRowCount()
{
if (this.m_view == null)
return 0;

return this.m_view.ConceptRoots.Count;
}

Expand Down Expand Up @@ -420,15 +472,24 @@ public CellValue GetCell(int row, int col)
switch (docEx.Requirement)
{
case DocExchangeRequirementEnum.Mandatory:
return CellValue.Required;
return CellValue.Mandatory;

case DocExchangeRequirementEnum.Optional:
return CellValue.Optional;
return CellValue.Recommended;

case DocExchangeRequirementEnum.NotRelevant:
return CellValue.NotRelevant;

case DocExchangeRequirementEnum.NotRecommended:
return CellValue.NotRecommended;

case DocExchangeRequirementEnum.Excluded:
return CellValue.Excluded;
}
}
}

return CellValue.None;
return CellValue.NotRelevant;
}
}

Expand Down Expand Up @@ -460,11 +521,11 @@ public void SetCell(int row, int col, CellValue val)
DocExchangeRequirementEnum req = DocExchangeRequirementEnum.NotRelevant;
switch (val)
{
case CellValue.Required:
case CellValue.Mandatory:
req = DocExchangeRequirementEnum.Mandatory;
break;

case CellValue.Optional:
case CellValue.Recommended:
req = DocExchangeRequirementEnum.Optional;
break;
}
Expand Down Expand Up @@ -618,10 +679,10 @@ public CellValue GetCell(int row, int col)
switch (docItem.Requirement)
{
case DocExchangeRequirementEnum.Mandatory:
return CellValue.Required;
return CellValue.Mandatory;

case DocExchangeRequirementEnum.Optional:
return CellValue.Optional;
return CellValue.Recommended;

default:
return CellValue.None;
Expand Down Expand Up @@ -659,11 +720,11 @@ public void SetCell(int row, int col, CellValue val)
DocExchangeRequirementEnum req = DocExchangeRequirementEnum.NotRelevant;
switch (val)
{
case CellValue.Required:
case CellValue.Mandatory:
req = DocExchangeRequirementEnum.Mandatory;
break;

case CellValue.Optional:
case CellValue.Recommended:
req = DocExchangeRequirementEnum.Optional;
break;
}
Expand Down Expand Up @@ -806,13 +867,24 @@ public CellValue GetCell(int row, int col)
switch (docExchangeItem.Requirement)
{
case DocExchangeRequirementEnum.Mandatory:
return CellValue.Required;
return CellValue.Mandatory;

case DocExchangeRequirementEnum.Optional:
return CellValue.Optional;
return CellValue.Recommended;

case DocExchangeRequirementEnum.NotRelevant:
return CellValue.NotRelevant;

case DocExchangeRequirementEnum.NotRecommended:
return CellValue.NotRecommended;

case DocExchangeRequirementEnum.Excluded:
return CellValue.Excluded;
}
}
}

return CellValue.NotRelevant;
}
}

Expand Down Expand Up @@ -844,11 +916,11 @@ public void SetCell(int row, int col, CellValue val)
DocExchangeRequirementEnum req = DocExchangeRequirementEnum.NotRelevant;
switch (val)
{
case CellValue.Required:
case CellValue.Mandatory:
req = DocExchangeRequirementEnum.Mandatory;
break;

case CellValue.Optional:
case CellValue.Recommended:
req = DocExchangeRequirementEnum.Optional;
break;
}
Expand Down
Loading

0 comments on commit 66f8a37

Please sign in to comment.