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

Use-folder-content-update #87

Merged
merged 16 commits into from
Jan 9, 2024
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
67 changes: 43 additions & 24 deletions LayoutFunctions/ClassroomLayout/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,45 @@
{
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/test/bin/Debug/netcoreapp3.1/ClassroomLayout.Tests.dll",
"args": [],
"cwd": "${workspaceFolder}/test",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/test/bin/Debug/netcoreapp3.1/ClassroomLayout.Tests.dll",
"args": [],
"cwd": "${workspaceFolder}/test",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
},
{
"name": "Attach to Hypar Run",
"type": "coreclr",
"request": "attach",
"processName": "ClassroomLayout.Server"
},
{
"name": "Launch Hypar Run (Run once only)",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/server/bin/Debug/net6.0/ClassroomLayout.Server.dll",
"args": [
"--workflow-id",
"${input:workflowId}"
],
"preLaunchTask": "server-build"
}
],
"inputs": [
{
"id": "workflowId",
"type": "promptString",
"description": "Enter the workflow id to run."
}
]
}
90 changes: 50 additions & 40 deletions LayoutFunctions/ClassroomLayout/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,52 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/test/ClassroomLayout.Tests.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/test/ClassroomLayout.Tests.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/test/ClassroomLayout.Tests.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}
]
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/test/ClassroomLayout.Tests.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/test/ClassroomLayout.Tests.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/test/ClassroomLayout.Tests.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "server-build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/server/ClassroomLayout.Server.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
12 changes: 12 additions & 0 deletions LayoutFunctions/ClassroomLayout/dependencies/ProgramRequirement.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using Newtonsoft.Json;

namespace Elements
{
public partial class ProgramRequirement : IProgramRequirement
{
[JsonProperty("Qualified Program Name")]
public string QualifiedProgramName => String.IsNullOrWhiteSpace(this.ProgramGroup) ? this.ProgramName : $"{this.ProgramGroup} - {this.ProgramName}";
public int CountPlaced { get; set; }
}
}
116 changes: 116 additions & 0 deletions LayoutFunctions/ClassroomLayout/dependencies/ProgramRequirement.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
//----------------------
// <auto-generated>
// Generated using the NJsonSchema v10.1.21.0 (Newtonsoft.Json v13.0.0.0) (http://NJsonSchema.org)
// </auto-generated>
//----------------------
using Elements;
using Elements.GeoJSON;
using Elements.Geometry;
using Elements.Geometry.Solids;
using Elements.Spatial;
using Elements.Validators;
using Elements.Serialization.JSON;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using Line = Elements.Geometry.Line;
using Polygon = Elements.Geometry.Polygon;

namespace Elements
{
#pragma warning disable // Disable all warnings

/// <summary>Fill out your program requirements. Use "Hypar Space Type" to dictate which function should be used to lay out your space.</summary>
[JsonConverter(typeof(Elements.Serialization.JSON.JsonInheritanceConverter), "discriminator")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]
public partial class ProgramRequirement : Element
{
[JsonConstructor]
public ProgramRequirement(string @programGroup, string @programName, Color? @color, double @areaPerSpace, int @spaceCount, double? @width, double? @depth, string @hyparSpaceType, ProgramRequirementCountType @countType, double @totalArea, System.Guid? @spaceConfig, System.Guid? @layoutTypeId, System.Guid? @catalog, System.Guid @id = default, string @name = null)
: base(id, name)
{
this.ProgramGroup = @programGroup;
this.ProgramName = @programName;
this.Color = @color;
this.AreaPerSpace = @areaPerSpace;
this.SpaceCount = @spaceCount;
this.Width = @width;
this.Depth = @depth;
this.HyparSpaceType = @hyparSpaceType;
this.CountType = @countType;
this.TotalArea = @totalArea;
this.SpaceConfig = @spaceConfig;
this.LayoutTypeId = @layoutTypeId;
this.Catalog = @catalog;
}


// Empty constructor
public ProgramRequirement()
: base()
{
}

/// <summary>What group does this program belong to?</summary>
[JsonProperty("Program Group", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string ProgramGroup { get; set; }

/// <summary>What display name should be used for this program type?</summary>
[JsonProperty("Program Name", Required = Newtonsoft.Json.Required.Always)]
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
public string ProgramName { get; set; }

/// <summary>What color should be used to display this space type?</summary>
[JsonProperty("Color", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public Color? Color { get; set; }

/// <summary>How much area should be allocated for this space?</summary>
[JsonProperty("Area per Space", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public double AreaPerSpace { get; set; }

/// <summary>How many of this space type are required? Leave at 1 for spaces measured in aggregate, like circulation.</summary>
[JsonProperty("Space Count", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int SpaceCount { get; set; } = 1;

/// <summary>Optional. (Typically the longer dimension — along the side from which the space is accessed, like a corridor.)</summary>
[JsonProperty("Width", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public double? Width { get; set; }

/// <summary>Optional. (Typically the shorter dimension — perpendicular to the side from which the space is accessed, like a corridor.)</summary>
[JsonProperty("Depth", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public double? Depth { get; set; }

/// <summary>Which furniture layout function should be used to lay out this space?</summary>
[JsonProperty("Hypar Space Type", Required = Newtonsoft.Json.Required.Always)]
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
public string HyparSpaceType { get; set; } = "unspecified";

/// <summary>How should this requirement be counted?
///
/// Use "Item" for individual spaces (e.g. 3 conference rooms),
/// "Area Total" for spaces where you only care about the total (e.g. 1000 SF of circulation), and
/// "Unit" where you want total area divided by a "unit" size (e.g. this space supports 400 people at 120 SF / person)</summary>
[JsonProperty("Count Type", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
public ProgramRequirementCountType CountType { get; set; } = Elements.ProgramRequirementCountType.Item;

/// <summary>The Area per Space times the Space Count</summary>
[JsonProperty("Total Area", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public double TotalArea { get; set; }

/// <summary>The guid of the space configuration</summary>
[JsonProperty("SpaceConfig", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Guid? SpaceConfig { get; set; }

/// <summary>The guid of the layout type</summary>
[JsonProperty("Layout Type Id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Guid? LayoutTypeId { get; set; }

/// <summary>The guid of the catalog</summary>
[JsonProperty("Catalog", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Guid? Catalog { get; set; }


}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//----------------------
// <auto-generated>
// Generated using the NJsonSchema v10.1.21.0 (Newtonsoft.Json v13.0.0.0) (http://NJsonSchema.org)
// </auto-generated>
//----------------------
using Elements;
using Elements.GeoJSON;
using Elements.Geometry;
using Elements.Geometry.Solids;
using Elements.Spatial;
using Elements.Validators;
using Elements.Serialization.JSON;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using Line = Elements.Geometry.Line;
using Polygon = Elements.Geometry.Polygon;

namespace Elements
{
#pragma warning disable // Disable all warnings

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]
public enum ProgramRequirementCountType
{
[System.Runtime.Serialization.EnumMember(Value = @"Item")]
Item = 0,

[System.Runtime.Serialization.EnumMember(Value = @"Area Total")]
Area_Total = 1,

}
}
4 changes: 4 additions & 0 deletions LayoutFunctions/ClassroomLayout/dependencies/SpaceBoundary.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
using Elements.Geometry;
using Newtonsoft.Json;

namespace Elements
{
public partial class SpaceBoundary : GeometricElement, ISpaceBoundary
{
public Vector3? ParentCentroid { get; set; }

[JsonProperty("Config Id")]
public string ConfigId { get; set; }
}
}
8 changes: 7 additions & 1 deletion LayoutFunctions/ClassroomLayout/hypar.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
"name": "Space Planning Zones",
"optional": false
},
{
"autohide": false,
"name": "Program Requirements",
"optional": true
},
{
"autohide": false,
"name": "Circulation",
Expand Down Expand Up @@ -73,7 +78,8 @@
"https://schemas.hypar.io/SpaceBoundary.json",
"https://schemas.hypar.io/LevelElements.json",
"https://schemas.hypar.io/CirculationSegment.json",
"https://schemas.hypar.io/LevelVolume.json"
"https://schemas.hypar.io/LevelVolume.json",
"https://schemas.hypar.io/ProgramRequirement.json"
],
"repository_url": "https://github.com/hypar-io/function",
"source_file_key": null,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<ItemGroup>
<ProjectReference Include="..\src\ClassroomLayout.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Hypar.Server" Version="1.11.0-alpha.18" />
</ItemGroup>

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
Loading
Loading