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

fix the context query for the space settings override #68

Merged
merged 3 commits into from
Nov 2, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ namespace Elements
public partial class CollaborationSpaceBoundary : SpaceBoundary
{
[JsonConstructor]
public CollaborationSpaceBoundary(Profile @boundary, IList<Polygon> @cells, double @area, double? @length, double? @depth, double @height, string @programGroup, string @programType, System.Guid? @programRequirement, System.Guid? @level, System.Guid? @levelLayout, string @hyparSpaceType, Transform @transform, Material @material, Representation @representation, bool @isElementDefinition, System.Guid @id, string @name)
: base(boundary, cells, area, length, depth, height, programGroup, programType, programRequirement, level, levelLayout, hyparSpaceType, transform, material, representation, isElementDefinition, id, name)
public CollaborationSpaceBoundary(Profile @boundary, IList<Polygon> @cells, double @area, double? @length, double? @depth, double @height, string @programGroup, string @programType, System.Guid? @programRequirement, System.Guid? @level, System.Guid? @levelLayout, string @hyparSpaceType, string @defaultWallType, Transform @transform, Material @material, Representation @representation, bool @isElementDefinition, System.Guid @id, string @name)
: base(boundary, cells, area, length, depth, height, programGroup, programType, programRequirement, level, levelLayout, hyparSpaceType, defaultWallType, transform, material, representation, isElementDefinition, id, name)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Elements
public partial class LevelVolume : GeometricElement
{
[JsonConstructor]
public LevelVolume(Profile @profile, double @height, double @area, string @buildingName, System.Guid? @level, System.Guid? @mass, System.Guid? @planView, Transform @transform = null, Material @material = null, Representation @representation = null, bool @isElementDefinition = false, System.Guid @id = default, string @name = null)
public LevelVolume(Profile @profile, double @height, double @area, string @buildingName, System.Guid? @level, System.Guid? @mass, System.Guid? @planView, IList<Profile> @profiles, Transform @transform = null, Material @material = null, Representation @representation = null, bool @isElementDefinition = false, System.Guid @id = default, string @name = null)
: base(transform, material, representation, isElementDefinition, id, name)
{
this.Profile = @profile;
Expand All @@ -37,6 +37,7 @@ public LevelVolume(Profile @profile, double @height, double @area, string @build
this.Level = @level;
this.Mass = @mass;
this.PlanView = @planView;
this.Profiles = @profiles;
}


Expand Down Expand Up @@ -74,6 +75,10 @@ public LevelVolume()
[JsonProperty("Plan View", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Guid? PlanView { get; set; }

/// <summary>Multiple profiles used for a collection of volumes</summary>
[JsonProperty("Profiles", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public IList<Profile> Profiles { get; set; }


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,22 @@ public class OpenOfficeLayoutOutputs: SystemResults
/// The number of desks.
/// </summary>
[JsonProperty("Total Desk Count")]
public double TotalDeskCount {get; set;}


public double TotalDeskCount { get; set; }

/// <summary>
/// Construct a OpenOfficeLayoutOutputs with default inputs.
/// This should be used for testing only.
/// </summary>
public OpenOfficeLayoutOutputs() : base()
{

}


/// <summary>
/// Construct a OpenOfficeLayoutOutputs specifying all inputs.
/// </summary>
/// <returns></returns>
[JsonConstructor]
public OpenOfficeLayoutOutputs(double totalDeskCount): base()
public OpenOfficeLayoutOutputs(double totalDeskCount) : base()
{
this.TotalDeskCount = totalDeskCount;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Elements
public partial class SpaceBoundary : GeometricElement
{
[JsonConstructor]
public SpaceBoundary(Profile @boundary, IList<Polygon> @cells, double @area, double? @length, double? @depth, double @height, string @programGroup, string @programType, System.Guid? @programRequirement, System.Guid? @level, System.Guid? @levelLayout, string @hyparSpaceType, Transform @transform = null, Material @material = null, Representation @representation = null, bool @isElementDefinition = false, System.Guid @id = default, string @name = null)
public SpaceBoundary(Profile @boundary, IList<Polygon> @cells, double @area, double? @length, double? @depth, double @height, string @programGroup, string @programType, System.Guid? @programRequirement, System.Guid? @level, System.Guid? @levelLayout, string @hyparSpaceType, string @defaultWallType, Transform @transform = null, Material @material = null, Representation @representation = null, bool @isElementDefinition = false, System.Guid @id = default, string @name = null)
: base(transform, material, representation, isElementDefinition, id, name)
{
this.Boundary = @boundary;
Expand All @@ -42,6 +42,7 @@ public SpaceBoundary(Profile @boundary, IList<Polygon> @cells, double @area, dou
this.Level = @level;
this.LevelLayout = @levelLayout;
this.HyparSpaceType = @hyparSpaceType;
this.DefaultWallType = @defaultWallType;
}


Expand Down Expand Up @@ -97,6 +98,10 @@ public SpaceBoundary()
[JsonProperty("Hypar Space Type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string HyparSpaceType { get; set; }

/// <summary>What wall type should generally be created for this space type? This may get overridden later on for a specific wall.</summary>
[JsonProperty("Default Wall Type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string DefaultWallType { get; set; }


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public partial class SpaceSettingsOverride : IOverride
{
public static string Name = "Space Settings";
public static string Dependency = "Space Planning Zones";
public static string Context = "[*discriminator=Elements.SpaceBoundary&Name=Open Office]";
public static string Context = "[*discriminator=Elements.SpaceBoundary & Hypar Space Type = Open Office | Name = Open Office]";
public static string Paradigm = "Edit";

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion LayoutFunctions/OpenOfficeLayout/hypar.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
"overrides": {
"Space Settings": {
"dependency": "Space Planning Zones",
"context": "[*discriminator=Elements.SpaceBoundary&Name=Open Office]",
"context": "[*discriminator=Elements.SpaceBoundary & Hypar Space Type = Open Office | Name = Open Office]",
"identity": {
"ParentCentroid": {
"$ref": "https://schemas.hypar.io/Vector3.json"
Expand Down
16 changes: 4 additions & 12 deletions LayoutFunctions/OpenOfficeLayout/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Edits to this code will be overwritten the next time you run 'hypar init'.
// DO NOT EDIT THIS FILE.

using Amazon;
using Amazon.Lambda.Core;
using Hypar.Functions.Execution;
using Hypar.Functions.Execution.AWS;
Expand All @@ -19,9 +18,9 @@ public class Function
{
// Cache the model store for use by subsequent
// executions of this lambda.
private IModelStore<OpenOfficeLayoutInputs> store;
private UrlModelStore<OpenOfficeLayoutInputs> store;

public async Task<OpenOfficeLayoutOutputs> Handler(OpenOfficeLayoutInputs args, ILambdaContext context)
public async Task<OpenOfficeLayoutOutputs> Handler(OpenOfficeLayoutInputs args)
{
// Preload dependencies (if they exist),
// so that they are available during model deserialization.
Expand Down Expand Up @@ -61,15 +60,8 @@ public async Task<OpenOfficeLayoutOutputs> Handler(OpenOfficeLayoutInputs args,
Console.WriteLine($"Time to load assemblies: {sw.Elapsed.TotalSeconds})");

if(this.store == null)
{
if (args.SignedResourceUrls == null)
{
this.store = new S3ModelStore<OpenOfficeLayoutInputs>(RegionEndpoint.GetBySystemName("us-west-1"));
}
else
{
this.store = new UrlModelStore<OpenOfficeLayoutInputs>();
}
{
this.store = new UrlModelStore<OpenOfficeLayoutInputs>();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Elements
public partial class LevelVolume : GeometricElement
{
[JsonConstructor]
public LevelVolume(Profile @profile, double @height, double @area, string @buildingName, System.Guid? @level, System.Guid? @mass, System.Guid? @planView, Transform @transform = null, Material @material = null, Representation @representation = null, bool @isElementDefinition = false, System.Guid @id = default, string @name = null)
public LevelVolume(Profile @profile, double @height, double @area, string @buildingName, System.Guid? @level, System.Guid? @mass, System.Guid? @planView, IList<Profile> @profiles, Transform @transform = null, Material @material = null, Representation @representation = null, bool @isElementDefinition = false, System.Guid @id = default, string @name = null)
: base(transform, material, representation, isElementDefinition, id, name)
{
this.Profile = @profile;
Expand All @@ -37,6 +37,7 @@ public LevelVolume(Profile @profile, double @height, double @area, string @build
this.Level = @level;
this.Mass = @mass;
this.PlanView = @planView;
this.Profiles = @profiles;
}


Expand Down Expand Up @@ -74,6 +75,10 @@ public LevelVolume()
[JsonProperty("Plan View", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Guid? PlanView { get; set; }

/// <summary>Multiple profiles used for a collection of volumes</summary>
[JsonProperty("Profiles", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public IList<Profile> Profiles { get; set; }


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,22 @@ public class PrivateOfficeLayoutOutputs: SystemResults
/// The number of private offices.
/// </summary>
[JsonProperty("Private office count")]
public double PrivateOfficeCount {get; set;}


public double PrivateOfficeCount { get; set; }

/// <summary>
/// Construct a PrivateOfficeLayoutOutputs with default inputs.
/// This should be used for testing only.
/// </summary>
public PrivateOfficeLayoutOutputs() : base()
{

}


/// <summary>
/// Construct a PrivateOfficeLayoutOutputs specifying all inputs.
/// </summary>
/// <returns></returns>
[JsonConstructor]
public PrivateOfficeLayoutOutputs(double privateOfficeCount): base()
public PrivateOfficeLayoutOutputs(double privateOfficeCount) : base()
{
this.PrivateOfficeCount = privateOfficeCount;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Elements
public partial class SpaceBoundary : GeometricElement
{
[JsonConstructor]
public SpaceBoundary(Profile @boundary, IList<Polygon> @cells, double @area, double? @length, double? @depth, double @height, string @programGroup, string @programType, System.Guid? @programRequirement, System.Guid? @level, System.Guid? @levelLayout, string @hyparSpaceType, Transform @transform = null, Material @material = null, Representation @representation = null, bool @isElementDefinition = false, System.Guid @id = default, string @name = null)
public SpaceBoundary(Profile @boundary, IList<Polygon> @cells, double @area, double? @length, double? @depth, double @height, string @programGroup, string @programType, System.Guid? @programRequirement, System.Guid? @level, System.Guid? @levelLayout, string @hyparSpaceType, string @defaultWallType, Transform @transform = null, Material @material = null, Representation @representation = null, bool @isElementDefinition = false, System.Guid @id = default, string @name = null)
: base(transform, material, representation, isElementDefinition, id, name)
{
this.Boundary = @boundary;
Expand All @@ -42,6 +42,7 @@ public SpaceBoundary(Profile @boundary, IList<Polygon> @cells, double @area, dou
this.Level = @level;
this.LevelLayout = @levelLayout;
this.HyparSpaceType = @hyparSpaceType;
this.DefaultWallType = @defaultWallType;
}


Expand Down Expand Up @@ -97,6 +98,10 @@ public SpaceBoundary()
[JsonProperty("Hypar Space Type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string HyparSpaceType { get; set; }

/// <summary>What wall type should generally be created for this space type? This may get overridden later on for a specific wall.</summary>
[JsonProperty("Default Wall Type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string DefaultWallType { get; set; }


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public partial class SpaceSettingsOverride : IOverride
{
public static string Name = "Space Settings";
public static string Dependency = "Space Planning Zones";
public static string Context = "[*discriminator=Elements.SpaceBoundary&Name=Private Office]";
public static string Context = "[*discriminator=Elements.SpaceBoundary & Hypar Space Type = Private Office | Name=Private Office]";
public static string Paradigm = "Edit";

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion LayoutFunctions/PrivateOfficeLayout/hypar.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
},
"Space Settings": {
"dependency": "Space Planning Zones",
"context": "[*discriminator=Elements.SpaceBoundary&Name=Private Office]",
"context": "[*discriminator=Elements.SpaceBoundary & Hypar Space Type = Private Office | Name=Private Office]",
"identity": {
"ParentCentroid": {
"$ref": "https://schemas.hypar.io/Vector3.json"
Expand Down
16 changes: 4 additions & 12 deletions LayoutFunctions/PrivateOfficeLayout/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Edits to this code will be overwritten the next time you run 'hypar init'.
// DO NOT EDIT THIS FILE.

using Amazon;
using Amazon.Lambda.Core;
using Hypar.Functions.Execution;
using Hypar.Functions.Execution.AWS;
Expand All @@ -19,9 +18,9 @@ public class Function
{
// Cache the model store for use by subsequent
// executions of this lambda.
private IModelStore<PrivateOfficeLayoutInputs> store;
private UrlModelStore<PrivateOfficeLayoutInputs> store;

public async Task<PrivateOfficeLayoutOutputs> Handler(PrivateOfficeLayoutInputs args, ILambdaContext context)
public async Task<PrivateOfficeLayoutOutputs> Handler(PrivateOfficeLayoutInputs args)
{
// Preload dependencies (if they exist),
// so that they are available during model deserialization.
Expand Down Expand Up @@ -61,15 +60,8 @@ public async Task<PrivateOfficeLayoutOutputs> Handler(PrivateOfficeLayoutInputs
Console.WriteLine($"Time to load assemblies: {sw.Elapsed.TotalSeconds})");

if(this.store == null)
{
if (args.SignedResourceUrls == null)
{
this.store = new S3ModelStore<PrivateOfficeLayoutInputs>(RegionEndpoint.GetBySystemName("us-west-1"));
}
else
{
this.store = new UrlModelStore<PrivateOfficeLayoutInputs>();
}
{
this.store = new UrlModelStore<PrivateOfficeLayoutInputs>();
}


Expand Down
Loading