Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| adc8558edf | |||
| 83c72a7131 | |||
| 658c40eecd | |||
| 345b23f801 | |||
| d563e5cfe5 | |||
| 2dc2d452e6 | |||
| 2ea6fdd32e | |||
| 8c770e1fbc | |||
| 30ae1b7420 | |||
| 66a1ccb8ba | |||
| 4bb2759be9 | |||
| 0a1a3e1627 | |||
| 57c7dd0bd0 | |||
| 330a55b058 | |||
| 1b92138ce9 | |||
| 2f2be53bff | |||
| af6b381578 | |||
| a53cef31a8 | |||
| 8dc8c9a0fb | |||
| 65fab58006 | |||
| b93aa1a76a | |||
| bdc105fa95 | |||
| 59f87b2a7d | |||
| c314fc5834 | |||
| b7e57b1ec8 | |||
| 0f649d6d2d | |||
| 92f814dab4 |
+28
-12
@@ -1,36 +1,52 @@
|
||||
version: 2.1
|
||||
|
||||
orbs:
|
||||
win: circleci/windows@2.2.0
|
||||
win: circleci/windows@5.0.0
|
||||
|
||||
jobs:
|
||||
build:
|
||||
executor: win/default
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Restore packages
|
||||
command: dotnet restore GrasshopperAsyncComponent.sln
|
||||
- run:
|
||||
name: Build solution
|
||||
command: |
|
||||
$TAG = if([string]::IsNullOrEmpty($env:CIRCLE_TAG)) { "0.999.$($env:WORKFLOW_NUM)-ci" } else { $env:CIRCLE_TAG }
|
||||
dotnet build GrasshopperAsyncComponent.sln --no-restore -c Release /p:Version=$TAG /p:AssemblyVersionNumber=$TAG /p:AssemblyInformationalVersion=$TAG
|
||||
environment:
|
||||
WORKFLOW_NUM: << pipeline.number >>
|
||||
publish_nuget:
|
||||
executor: win/default
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Restore packages
|
||||
command: nuget restore GrasshopperAsyncComponent.sln
|
||||
command: dotnet restore GrasshopperAsyncComponent.sln
|
||||
- run:
|
||||
name: Build solution
|
||||
command: msbuild GrasshopperAsyncComponent.sln /p:Configuration=Release
|
||||
- run:
|
||||
name: Pack NuGet
|
||||
command: cd GrasshopperAsyncComponent; nuget pack GrasshopperAsyncComponent.csproj -Prop Configuration=Release
|
||||
command: |
|
||||
$TAG = if([string]::IsNullOrEmpty($env:CIRCLE_TAG)) { "0.999.$($env:WORKFLOW_NUM)-ci" } else { $env:CIRCLE_TAG }
|
||||
dotnet build GrasshopperAsyncComponent.sln --no-restore -c Release /p:Version=$TAG /p:AssemblyVersionNumber=$TAG /p:AssemblyInformationalVersion=$TAG
|
||||
environment:
|
||||
WORKFLOW_NUM: << pipeline.number >>
|
||||
- run:
|
||||
name: Push NuGet
|
||||
command: cd GrasshopperAsyncComponent; nuget push *.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey $env:NUGET_AUTH_TOKEN -SkipDuplicate
|
||||
|
||||
command: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey $env:NUGET_APIKEY -SkipDuplicate
|
||||
|
||||
workflows:
|
||||
build:
|
||||
jobs:
|
||||
- build:
|
||||
context: github-dev-bot
|
||||
publish:
|
||||
jobs:
|
||||
- publish_nuget:
|
||||
filters:
|
||||
tags:
|
||||
only: /^v.*/
|
||||
only: /.*/
|
||||
branches:
|
||||
ignore: /.*/
|
||||
|
||||
|
||||
|
||||
context: nuget
|
||||
|
||||
@@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
- Using welcoming and inclusive language
|
||||
- Being respectful of differing viewpoints and experiences
|
||||
- Gracefully accepting constructive criticism
|
||||
- Focusing on what is best for the community
|
||||
- Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
- The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Speckle Contribution Guidelines
|
||||
|
||||
## Introduction
|
||||
|
||||
Thank you for reading this! Speckle's a rather wide network of parts that depend on each other, either directly, indirectly or even just cosmetically.
|
||||
@@ -9,41 +10,41 @@ This means that what might look like a simple quick change in one repo may have
|
||||
|
||||
## Bugs & Issues 🐞
|
||||
|
||||
### Found a new bug?
|
||||
### Found a new bug?
|
||||
|
||||
- First step is to check whether this is a new bug! We encourage you to search through the issues of the project in question **and** associated repos!
|
||||
|
||||
- If you come up with nothing, **open a new issue with a clear title and description**, as much relevant information as possible: system configuration, code samples & steps to reproduce the problem.
|
||||
- If you come up with nothing, **open a new issue with a clear title and description**, as much relevant information as possible: system configuration, code samples & steps to reproduce the problem.
|
||||
|
||||
- Can't mention this often enough: tells us how to reproduce the problem! We will ignore or flag as such issues without reproduction steps.
|
||||
- Can't mention this often enough: tells us how to reproduce the problem! We will ignore or flag as such issues without reproduction steps.
|
||||
|
||||
- Try to reference & note all potentially affected projects.
|
||||
|
||||
### Sending a PR for Bug Fixes
|
||||
|
||||
You fixed something! Great! We hope you logged it first :) Make sure though that you've covered the lateral thinking needed for a bug report, as described above, also in your implementation! If there any tests, make sure they all pass. If there are none, it means they're missing - so add them!
|
||||
You fixed something! Great! We hope you logged it first :) Make sure though that you've covered the lateral thinking needed for a bug report, as described above, also in your implementation! If there any tests, make sure they all pass. If there are none, it means they're missing - so add them!
|
||||
|
||||
## New Features 🎉
|
||||
|
||||
The golden rule is to Discuss First!
|
||||
|
||||
- Before embarking on adding a new feature, suggest it first as an issue with the `enhancement` label and/or title - this will allow relevant people to pitch in
|
||||
- We'll now discuss your requirements and see how and if they fit within the Speckle ecosystem.
|
||||
- The last step is to actually start writing code & submit a PR so we can follow along!
|
||||
- All new features should, if and where possible, come with tests. We won't merge without!
|
||||
- We'll now discuss your requirements and see how and if they fit within the Speckle ecosystem.
|
||||
- The last step is to actually start writing code & submit a PR so we can follow along!
|
||||
- All new features should, if and where possible, come with tests. We won't merge without!
|
||||
|
||||
> Many clients may potentially have overlapping scopes, some features might already be in dev somewhere else, or might have been postponed to the next major release due to api instability in that area. For example, adding a delete stream button in the accounts panel in rhino: this feature was planned for speckle admin, and the whole functionality of the accounts panel in rhino is to be greatly reduced!
|
||||
|
||||
## Cosmetic Patches ✨
|
||||
|
||||
Changes that are cosmetic in nature and do not add anything substantial to the stability or functionality of Speckle **will generally not be accepted**.
|
||||
Changes that are cosmetic in nature and do not add anything substantial to the stability or functionality of Speckle **will generally not be accepted**.
|
||||
|
||||
Why? However trivial the changes might seem, there might be subtle reasons for the original code to be as it is. Furthermore, there are a lot of potential hidden costs (that even maintainers themselves are not aware of fully!) and they eat up review time unncessarily.
|
||||
|
||||
> **Examples**: modifying the colour of an UI element in one client may have a big hidden cost and need propagation in several other clients that implement a similar ui element. Changing the default port or specifiying `localhost` instead of `0.0.0.0` breaks cross-vm debugging and developing.
|
||||
|
||||
> **Examples**: modifying the colour of an UI element in one client may have a big hidden cost and need propagation in several other clients that implement a similar ui element. Changing the default port or specifiying `localhost` instead of `0.0.0.0` breaks cross-vm debugging and developing.
|
||||
|
||||
## Wrap up
|
||||
Don't worry if you get things wrong. We all do, including project owners: this document should've been here a long time ago. There's plenty of room for discussion either on our community [forum](https://discourse.speckle.works) or [chat](https://speckle-works.slack.com/join/shared_invite/enQtNjY5Mzk2NTYxNTA4LTU4MWI5ZjdhMjFmMTIxZDIzOTAzMzRmMTZhY2QxMmM1ZjVmNzJmZGMzMDVlZmJjYWQxYWU0MWJkYmY3N2JjNGI).
|
||||
|
||||
Don't worry if you get things wrong. We all do, including project owners: this document should've been here a long time ago. There's plenty of room for discussion on our community [forum](https://discourse.speckle.works).
|
||||
|
||||
🙌❤️💙💚💜🙌
|
||||
@@ -0,0 +1,113 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Help improve Speckle!
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
<!---
|
||||
|
||||
Provide a short summary in the Title above. Examples of good Issue titles:
|
||||
|
||||
* "Bug: Error from server when reticulating splines"
|
||||
* "Bug: Revit crashes when installing connector"
|
||||
|
||||
-->
|
||||
|
||||
## Prerequisites
|
||||
|
||||
<!---
|
||||
|
||||
Please answer the following questions before submitting an issue.
|
||||
|
||||
-->
|
||||
|
||||
- [ ] I read the [contribution guidelines](https://github.com/specklesystems/speckle-server/blob/main/CONTRIBUTING.md)
|
||||
- [ ] I checked the [documentation](https://speckle.guide/) and found no answer.
|
||||
- [ ] I checked [existing issues](../issues?q=is%3Aissue) and found no similar issue. <!-- If you do find an existing issue, please show your support by liking it :+1: instead of creating a new issue -->
|
||||
- [ ] I checked the [community forum](https://speckle.community/) for related discussions and found no answer.
|
||||
- [ ] I'm reporting the issue to the correct repository (see also [speckle-server](https://github.com/specklesystems/speckle-server), [speckle-sharp](https://github.com/specklesystems/speckle-sharp), [specklepy](https://github.com/specklesystems/specklepy), [speckle-docs](https://github.com/specklesystems/speckle-docs), and [others](https://github.com/orgs/specklesystems/repositories))
|
||||
|
||||
## What package are you referring to?
|
||||
|
||||
<!---
|
||||
Is it related to the server (backend) only, or does this bug relate to the frontend, viewer, objectloader or any other package?
|
||||
-->
|
||||
|
||||
## Describe the bug
|
||||
|
||||
<!---
|
||||
A clear and concise description of what the bug is.
|
||||
-->
|
||||
|
||||
## To Reproduce
|
||||
|
||||
<!---
|
||||
Steps to reproduce the behavior:
|
||||
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
-->
|
||||
|
||||
## Expected behavior
|
||||
|
||||
<!---
|
||||
A clear and concise description of what you expected to happen.
|
||||
-->
|
||||
|
||||
## Screenshots
|
||||
|
||||
<!---
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
-->
|
||||
|
||||
## System Info
|
||||
|
||||
If applicable, please fill in the below details - they help a lot!
|
||||
|
||||
### Desktop (please complete the following information):
|
||||
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
### Smartphone (please complete the following information):
|
||||
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
## Failure Logs
|
||||
|
||||
<!---
|
||||
Please include any relevant log snippets or files here, or upload as a file.
|
||||
|
||||
If including inline, please use markdown code block syntax. https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks
|
||||
For example:
|
||||
|
||||
```
|
||||
your log output here
|
||||
```
|
||||
-->
|
||||
|
||||
## Additional context
|
||||
|
||||
<!---
|
||||
Add any other context about the problem here.
|
||||
-->
|
||||
|
||||
## Proposed Solution (if any)
|
||||
|
||||
<!---
|
||||
Let us know what how you would solve this.
|
||||
-->
|
||||
|
||||
#### Optional: Affected Projects
|
||||
|
||||
<!---
|
||||
Does this issue propagate to other dependencies or dependents? If so, list them here with links!
|
||||
-->
|
||||
@@ -0,0 +1,71 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for Speckle!
|
||||
title: ''
|
||||
labels: enhancement, question
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
<!---
|
||||
|
||||
Provide a short summary in the Title above. Examples of good Issue titles:
|
||||
|
||||
* "Enhancement: Connector for Minecraft"
|
||||
* "Enhancement: Web viewer should support tesseracts"
|
||||
|
||||
-->
|
||||
|
||||
## Prerequisites
|
||||
|
||||
<!---
|
||||
|
||||
Please answer the following questions before submitting an issue.
|
||||
|
||||
-->
|
||||
|
||||
- [ ] I read the [contribution guidelines](https://github.com/specklesystems/speckle-server/blob/main/CONTRIBUTING.md)
|
||||
- [ ] I checked the [documentation](https://speckle.guide/) and found no answer.
|
||||
- [ ] I checked [existing issues](../issues?q=is%3Aissue) and found no similar issue. <!-- If you do find an existing issue, please show your support by liking it :+1: instead of creating a new issue -->
|
||||
- [ ] I checked the [community forum](https://speckle.community/) for related discussions and found no answer.
|
||||
- [ ] I'm requesting the feature to the correct repository (see also [speckle-server](https://github.com/specklesystems/speckle-server), [speckle-sharp](https://github.com/specklesystems/speckle-sharp), [specklepy](https://github.com/specklesystems/specklepy), [speckle-docs](https://github.com/specklesystems/speckle-docs), and [others](https://github.com/orgs/specklesystems/repositories))
|
||||
|
||||
## What package are you referring to?
|
||||
|
||||
<!---
|
||||
Is it related to the server (backend) only, or does this feature request relate to the frontend, viewer, objectloader or any other package?
|
||||
-->
|
||||
|
||||
## Is your feature request related to a problem? Please describe.
|
||||
|
||||
<!---
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
-->
|
||||
|
||||
## Describe the solution you'd like
|
||||
|
||||
<!---
|
||||
A clear and concise description of what you want to happen.
|
||||
-->
|
||||
|
||||
## Describe alternatives you've considered
|
||||
|
||||
<!---
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
-->
|
||||
|
||||
## Additional context
|
||||
|
||||
<!---
|
||||
Add any other context or screenshots about the feature request here.
|
||||
|
||||
Have you seen this feature implemented in any other software? Can you provide screenshots or links to video or documentation?
|
||||
What works well about these existing features in other software? What doesn't work well?
|
||||
-->
|
||||
|
||||
## Related issues or community discussions
|
||||
|
||||
<!---
|
||||
Is this feature request related to (but sufficiently distinct from) any existing issues?
|
||||
Does this feature request require other features to be available beforehand?
|
||||
Has this feature been discussed in the community forum, please link here? https://speckle.community/
|
||||
-->
|
||||
@@ -0,0 +1,86 @@
|
||||
<!---
|
||||
|
||||
Provide a short summary in the Title above. Examples of good PR titles:
|
||||
|
||||
* "Feature: adds metrics to component"
|
||||
|
||||
* "Fix: resolves duplication in comment thread"
|
||||
|
||||
* "Update: apollo v2.34.0"
|
||||
|
||||
-->
|
||||
|
||||
## Description & motivation
|
||||
|
||||
<!---
|
||||
|
||||
Describe your changes, and why you're making them. What benefit will this have to others?
|
||||
|
||||
Is this linked to an open Github issue, a thread in Speckle community,
|
||||
or another pull request? Link it here.
|
||||
|
||||
If it is related to a Github issue, and resolves it, please link to the issue number, e.g.:
|
||||
Fixes #85, Fixes #22, Fixes username/repo#123
|
||||
Connects #123
|
||||
|
||||
-->
|
||||
|
||||
## Changes:
|
||||
|
||||
<!---
|
||||
|
||||
- Item 1
|
||||
- Item 2
|
||||
|
||||
-->
|
||||
|
||||
## To-do before merge
|
||||
|
||||
<!---
|
||||
|
||||
(Optional -- remove this section if not needed)
|
||||
|
||||
Include any notes about things that need to happen before this PR is merged, e.g.:
|
||||
|
||||
- [ ] Change the base branch
|
||||
|
||||
- [ ] Ensure PR #56 is merged
|
||||
|
||||
-->
|
||||
|
||||
## Screenshots:
|
||||
|
||||
<!---
|
||||
|
||||
Include a screenshot the before and after. This can be a screenshot of a plugin, web frontend, or output in a terminal.
|
||||
|
||||
-->
|
||||
|
||||
## Validation of changes:
|
||||
|
||||
<!---
|
||||
|
||||
Describe what tests have been added or amended, and why these demonstrate it works and will prevent this feature being accidentally broken by future changes.
|
||||
|
||||
-->
|
||||
|
||||
## Checklist:
|
||||
|
||||
<!---
|
||||
|
||||
This checklist is mostly useful as a reminder of small things that can easily be
|
||||
|
||||
forgotten – it is meant as a helpful tool rather than hoops to jump through.
|
||||
|
||||
Put an `x` in all the items that apply, make notes next to any that haven't been
|
||||
|
||||
addressed, and remove any items that are not relevant to this PR.
|
||||
|
||||
-->
|
||||
|
||||
- [ ] My pull request follows the guidelines in the [Contributing guide](https://github.com/specklesystems/speckle-server/blob/main/CONTRIBUTING.md)?
|
||||
- [ ] My pull request does not duplicate any other open [Pull Requests](../../pulls) for the same update/change?
|
||||
- [ ] My commits are related to the pull request and do not amend unrelated code or documentation.
|
||||
- [ ] My code follows a similar style to existing code.
|
||||
- [ ] I have added appropriate tests.
|
||||
- [ ] I have updated or added relevant documentation.
|
||||
@@ -0,0 +1,77 @@
|
||||
name: Update issue Status
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [closed]
|
||||
|
||||
jobs:
|
||||
update_issue:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get project data
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GHPROJECT_TOKEN}}
|
||||
ORGANIZATION: specklesystems
|
||||
PROJECT_NUMBER: 9
|
||||
run: |
|
||||
gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query='
|
||||
query($org: String!, $number: Int!) {
|
||||
organization(login: $org){
|
||||
projectNext(number: $number) {
|
||||
id
|
||||
fields(first:20) {
|
||||
nodes {
|
||||
id
|
||||
name
|
||||
settings
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
|
||||
|
||||
echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
|
||||
|
||||
echo "$PROJECT_ID"
|
||||
echo "$STATUS_FIELD_ID"
|
||||
|
||||
echo 'DONE_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") | .settings | fromjson | .options[] | select(.name== "Done") | .id' project_data.json) >> $GITHUB_ENV
|
||||
echo "$DONE_ID"
|
||||
|
||||
- name: Add Issue to project #it's already in the project, but we do this to get its node id!
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GHPROJECT_TOKEN}}
|
||||
ISSUE_ID: ${{ github.event.issue.node_id }}
|
||||
run: |
|
||||
item_id="$( gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query='
|
||||
mutation($project:ID!, $id:ID!) {
|
||||
addProjectNextItem(input: {projectId: $project, contentId: $id}) {
|
||||
projectNextItem {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project=$PROJECT_ID -f id=$ISSUE_ID --jq '.data.addProjectNextItem.projectNextItem.id')"
|
||||
|
||||
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
|
||||
|
||||
- name: Update Status
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GHPROJECT_TOKEN}}
|
||||
ISSUE_ID: ${{ github.event.issue.node_id }}
|
||||
run: |
|
||||
gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query='
|
||||
mutation($project:ID!, $status:ID!, $id:ID!, $value:String!) {
|
||||
set_status: updateProjectNextItemField(
|
||||
input: {
|
||||
projectId: $project
|
||||
itemId: $id
|
||||
fieldId: $status
|
||||
value: $value
|
||||
}
|
||||
) {
|
||||
projectNextItem {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project=$PROJECT_ID -f status=$STATUS_FIELD_ID -f id=$ITEM_ID -f value=${{ env.DONE_ID }}
|
||||
@@ -0,0 +1,50 @@
|
||||
name: Move new issues into Project
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
track_issue:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get project data
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GHPROJECT_TOKEN}}
|
||||
ORGANIZATION: specklesystems
|
||||
PROJECT_NUMBER: 9
|
||||
run: |
|
||||
gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query='
|
||||
query($org: String!, $number: Int!) {
|
||||
organization(login: $org){
|
||||
projectNext(number: $number) {
|
||||
id
|
||||
fields(first:20) {
|
||||
nodes {
|
||||
id
|
||||
name
|
||||
settings
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
|
||||
|
||||
echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
|
||||
|
||||
- name: Add Issue to project
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GHPROJECT_TOKEN}}
|
||||
ISSUE_ID: ${{ github.event.issue.node_id }}
|
||||
run: |
|
||||
item_id="$( gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query='
|
||||
mutation($project:ID!, $id:ID!) {
|
||||
addProjectNextItem(input: {projectId: $project, contentId: $id}) {
|
||||
projectNextItem {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project=$PROJECT_ID -f id=$ISSUE_ID --jq '.data.addProjectNextItem.projectNextItem.id')"
|
||||
|
||||
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
|
||||
@@ -0,0 +1,50 @@
|
||||
name: Move new issues into Project
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
track_issue:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get project data
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GHPROJECT_TOKEN}}
|
||||
ORGANIZATION: specklesystems
|
||||
PROJECT_NUMBER: 9
|
||||
run: |
|
||||
gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query='
|
||||
query($org: String!, $number: Int!) {
|
||||
organization(login: $org){
|
||||
projectNext(number: $number) {
|
||||
id
|
||||
fields(first:20) {
|
||||
nodes {
|
||||
id
|
||||
name
|
||||
settings
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
|
||||
|
||||
echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
|
||||
|
||||
- name: Add Issue to project
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GHPROJECT_TOKEN}}
|
||||
ISSUE_ID: ${{ github.event.issue.node_id }}
|
||||
run: |
|
||||
item_id="$( gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query='
|
||||
mutation($project:ID!, $id:ID!) {
|
||||
addProjectNextItem(input: {projectId: $project, contentId: $id}) {
|
||||
projectNextItem {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project=$PROJECT_ID -f id=$ISSUE_ID --jq '.data.addProjectNextItem.projectNextItem.id')"
|
||||
|
||||
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using Grasshopper.Kernel;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Grasshopper.Kernel;
|
||||
using Timer = System.Timers.Timer;
|
||||
|
||||
namespace GrasshopperAsyncComponent
|
||||
@@ -21,14 +22,14 @@ namespace GrasshopperAsyncComponent
|
||||
Action<string, double> ReportProgress;
|
||||
|
||||
public ConcurrentDictionary<string, double> ProgressReports;
|
||||
|
||||
|
||||
Action Done;
|
||||
|
||||
Timer DisplayProgressTimer;
|
||||
|
||||
int State = 0;
|
||||
|
||||
bool SetData = false;
|
||||
int SetData = 0;
|
||||
|
||||
public List<WorkerInstance> Workers;
|
||||
|
||||
@@ -55,16 +56,19 @@ namespace GrasshopperAsyncComponent
|
||||
ReportProgress = (id, value) =>
|
||||
{
|
||||
ProgressReports[id] = value;
|
||||
if (!DisplayProgressTimer.Enabled) DisplayProgressTimer.Start();
|
||||
if (!DisplayProgressTimer.Enabled)
|
||||
{
|
||||
DisplayProgressTimer.Start();
|
||||
}
|
||||
};
|
||||
|
||||
Done = () =>
|
||||
{
|
||||
State++;
|
||||
|
||||
if (State == Workers.Count)
|
||||
Interlocked.Increment(ref State);
|
||||
if (State == Workers.Count && SetData == 0)
|
||||
{
|
||||
SetData = true;
|
||||
Interlocked.Exchange(ref SetData, 1);
|
||||
|
||||
// We need to reverse the workers list to set the outputs in the same order as the inputs.
|
||||
Workers.Reverse();
|
||||
|
||||
@@ -84,7 +88,11 @@ namespace GrasshopperAsyncComponent
|
||||
|
||||
public virtual void DisplayProgress(object sender, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
if (Workers.Count == 0) return;
|
||||
if (Workers.Count == 0 || ProgressReports.Values.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Workers.Count == 1)
|
||||
{
|
||||
Message = ProgressReports.Values.Last().ToString("0.00%");
|
||||
@@ -108,39 +116,52 @@ namespace GrasshopperAsyncComponent
|
||||
|
||||
protected override void BeforeSolveInstance()
|
||||
{
|
||||
if (State != 0 && SetData) return;
|
||||
if (State != 0 && SetData == 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var source in CancellationSources) source.Cancel();
|
||||
Debug.WriteLine("Killing");
|
||||
|
||||
foreach (var source in CancellationSources)
|
||||
{
|
||||
source.Cancel();
|
||||
}
|
||||
|
||||
CancellationSources.Clear();
|
||||
Workers.Clear();
|
||||
ProgressReports.Clear();
|
||||
Tasks.Clear();
|
||||
|
||||
State = 0;
|
||||
|
||||
//var test = Params.Output[0].VolatileData;
|
||||
Interlocked.Exchange(ref State, 0);
|
||||
}
|
||||
|
||||
protected override void AfterSolveInstance()
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("After solve instance was called " + State + " ? " + Workers.Count);
|
||||
// We need to start all the tasks as close as possible to each other.
|
||||
if (State == 0 && Tasks.Count > 0)
|
||||
if (State == 0 && Tasks.Count > 0 && SetData == 0)
|
||||
{
|
||||
foreach (var task in Tasks) task.Start();
|
||||
//var test = Params.Output[0].VolatileData;
|
||||
System.Diagnostics.Debug.WriteLine("After solve INVOKATIONM");
|
||||
foreach (var task in Tasks)
|
||||
{
|
||||
task.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void ExpireDownStreamObjects()
|
||||
{
|
||||
// Prevents the flash of null data until the new solution is ready
|
||||
if (SetData)
|
||||
if (SetData == 1)
|
||||
{
|
||||
base.ExpireDownStreamObjects();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void SolveInstance(IGH_DataAccess DA)
|
||||
{
|
||||
//return;
|
||||
if (State == 0)
|
||||
{
|
||||
if (BaseWorker == null)
|
||||
@@ -164,13 +185,13 @@ namespace GrasshopperAsyncComponent
|
||||
currentWorker.CancellationToken = tokenSource.Token;
|
||||
currentWorker.Id = $"Worker-{DA.Iteration}";
|
||||
|
||||
var currentRun = TaskCreationOptions != null
|
||||
? new Task(() => currentWorker.DoWork(ReportProgress, Done), tokenSource.Token, (TaskCreationOptions)TaskCreationOptions)
|
||||
var currentRun = TaskCreationOptions != null
|
||||
? new Task(() => currentWorker.DoWork(ReportProgress, Done), tokenSource.Token, (TaskCreationOptions)TaskCreationOptions)
|
||||
: new Task(() => currentWorker.DoWork(ReportProgress, Done), tokenSource.Token);
|
||||
|
||||
|
||||
// Add cancellation source to our bag
|
||||
CancellationSources.Add(tokenSource);
|
||||
|
||||
|
||||
// Add the worker to our list
|
||||
Workers.Add(currentWorker);
|
||||
|
||||
@@ -179,22 +200,50 @@ namespace GrasshopperAsyncComponent
|
||||
return;
|
||||
}
|
||||
|
||||
if (!SetData) return;
|
||||
|
||||
if (Workers.Count > 0)
|
||||
Workers[--State].SetData(DA);
|
||||
if (SetData == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Workers.Count > 0)
|
||||
{
|
||||
Interlocked.Decrement(ref State);
|
||||
Workers[State].SetData(DA);
|
||||
}
|
||||
|
||||
if (State != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (State != 0) return;
|
||||
|
||||
CancellationSources.Clear();
|
||||
Workers.Clear();
|
||||
ProgressReports.Clear();
|
||||
Tasks.Clear();
|
||||
|
||||
SetData = false;
|
||||
Interlocked.Exchange(ref SetData, 0);
|
||||
|
||||
Message = "Done";
|
||||
OnDisplayExpired(true);
|
||||
}
|
||||
|
||||
public void RequestCancellation()
|
||||
{
|
||||
foreach (var source in CancellationSources)
|
||||
{
|
||||
source.Cancel();
|
||||
}
|
||||
|
||||
CancellationSources.Clear();
|
||||
Workers.Clear();
|
||||
ProgressReports.Clear();
|
||||
Tasks.Clear();
|
||||
|
||||
Interlocked.Exchange(ref State, 0);
|
||||
Interlocked.Exchange(ref SetData, 0);
|
||||
Message = "Cancelled";
|
||||
OnDisplayExpired(true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,62 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{114D5E49-AC13-47F7-A70E-B4289579F4E3}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
<RootNamespace>GrasshopperAsyncComponent</RootNamespace>
|
||||
<AssemblyName>GrasshopperAsyncComponent</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
|
||||
<PropertyGroup>
|
||||
<Title>Grasshopper Async Component</Title>
|
||||
<Description>Jankless Grasshopper Components</Description>
|
||||
<Authors>Speckle Systems</Authors>
|
||||
<Company>Speckle Systems</Company>
|
||||
<Copyright>Copyright AEC Systems © 2020, 2021</Copyright>
|
||||
<ProjectGuid>{114D5E49-AC13-47F7-A70E-B4289579F4E3}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
|
||||
<PropertyGroup>
|
||||
<PackageId>GrasshopperAsyncComponent</PackageId>
|
||||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
||||
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
|
||||
<PackageProjectUrl>https://github.com/specklesystems/GrasshopperAsyncComponent</PackageProjectUrl>
|
||||
<PackageTags>grasshopper rhino mcneel gh_component</PackageTags>
|
||||
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<PackageReference Include="Grasshopper" Version="7.4.21078.1001" IncludeAssets="compile;build" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="GH_AsyncComponent.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="WorkerInstance.cs" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Grasshopper">
|
||||
<Version>6.29.20238.11501</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="RhinoCommon">
|
||||
<Version>6.29.20238.11501</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
|
||||
<PropertyGroup Condition="$(Configuration) == 'Debug' AND $([MSBuild]::IsOSPlatform(Windows))">
|
||||
<StartProgram>C:\Program Files\Rhino 7\System\Rhino.exe</StartProgram>
|
||||
<StartAction>Program</StartAction>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package >
|
||||
<metadata>
|
||||
<id>GrasshopperAsyncComponent</id>
|
||||
<version>0.2.0.0</version>
|
||||
<title>GrasshopperAsyncComponent</title>
|
||||
<authors>Speckle Systems</authors>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<license type="expression">Apache-2.0</license>
|
||||
<projectUrl>https://github.com/specklesystems/GrasshopperAsyncComponent</projectUrl>
|
||||
<iconUrl>http://icon_url_here_or_delete_this_line/</iconUrl>
|
||||
<description>Jankless Grasshopper Component</description>
|
||||
<releaseNotes>Initial release.</releaseNotes>
|
||||
<copyright>Speckle Systems</copyright>
|
||||
<tags>grasshopper rhino mcneel gh_component</tags>
|
||||
</metadata>
|
||||
</package>
|
||||
@@ -1,35 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("GrasshopperAsyncComponent")]
|
||||
[assembly: AssemblyDescription("Asyncronous Implementation of GH_Component for Grassshopper")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Speckle Systems")]
|
||||
[assembly: AssemblyProduct("GrasshopperAsyncComponent")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("114D5E49-AC13-47F7-A70E-B4289579F4E3")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -1,99 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{695D2B91-DDB6-416E-8A99-DDE6253DA7AA}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
<Version>1.0</Version>
|
||||
<Title>GrasshopperAsyncComponentDemo</Title>
|
||||
<Description>Jankless Grasshopper Components Demo</Description>
|
||||
<TargetExt>.gha</TargetExt>
|
||||
<RootNamespace>GrasshopperAsyncComponentDemo</RootNamespace>
|
||||
<AssemblyName>GrasshopperAsyncComponentDemo</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Grasshopper" Version="7.4.21078.1001" IncludeAssets="compile;build" />
|
||||
<PackageReference Include="System.Resources.Extensions" Version="7.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\GrasshopperAsyncComponent\GrasshopperAsyncComponent.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Info\GrasshopperAsyncComponentInfo.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SampleImplementations\Sample_PrimeCalculatorAsyncComponent.cs" />
|
||||
<Compile Include="SampleImplementations\Sample_UslessCyclesComponent.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Grasshopper" Version="6.29.20238.11501" />
|
||||
<PackageReference Include="RhinoCommon" Version="6.29.20238.11501" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\GrasshopperAsyncComponent\GrasshopperAsyncComponent.csproj">
|
||||
<Project>{114d5e49-ac13-47f7-a70e-b4289579f4e3}</Project>
|
||||
<Name>GrasshopperAsyncComponent</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\logo32.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<PropertyGroup Condition="$([MSBuild]::IsOsPlatform('Windows'))">
|
||||
<PostBuildEvent>Copy "$(TargetPath)" "$(TargetDir)$(ProjectName).gha"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="$([MSBuild]::IsOsPlatform('OSX'))">
|
||||
<PostBuildEvent>cp "$(TargetPath)" "$(TargetDir)$(ProjectName).gha"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<FallbackCulture>en-US</FallbackCulture>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<StartProgram>C:\Program Files\Rhino 6\System\Rhino.exe</StartProgram>
|
||||
<StartArguments>
|
||||
</StartArguments>
|
||||
|
||||
<PropertyGroup Condition="$(Configuration) == 'Debug' AND $([MSBuild]::IsOSPlatform(Windows))">
|
||||
<StartProgram>C:\Program Files\Rhino 7\System\Rhino.exe</StartProgram>
|
||||
<StartAction>Program</StartAction>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,36 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("GrasshopperAsyncComponentDemo")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Aec systems")]
|
||||
[assembly: AssemblyProduct("GrasshopperAsyncComponentDemo")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("695d2b91-ddb6-416e-8a99-dde6253da7aa")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
+92
-89
@@ -1,107 +1,110 @@
|
||||
using Grasshopper.Kernel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using GrasshopperAsyncComponent;
|
||||
|
||||
namespace GrasshopperAsyncComponentDemo.SampleImplementations
|
||||
{
|
||||
public class Sample_PrimeCalculatorAsyncComponent : GH_AsyncComponent
|
||||
{
|
||||
public override Guid ComponentGuid { get => new Guid("22C612B0-2C57-47CE-B9FE-E10621F18933"); }
|
||||
|
||||
protected override System.Drawing.Bitmap Icon { get => Properties.Resources.logo32; }
|
||||
|
||||
public override GH_Exposure Exposure => GH_Exposure.primary;
|
||||
|
||||
public Sample_PrimeCalculatorAsyncComponent() : base("The N-th Prime Calculator", "PRIME", "Calculates the nth prime number.", "Samples", "Async")
|
||||
public class Sample_PrimeCalculatorAsyncComponent : GH_AsyncComponent
|
||||
{
|
||||
BaseWorker = new PrimeCalculatorWorker();
|
||||
}
|
||||
public override Guid ComponentGuid { get => new Guid("22C612B0-2C57-47CE-B9FE-E10621F18933"); }
|
||||
|
||||
protected override void RegisterInputParams(GH_InputParamManager pManager)
|
||||
{
|
||||
pManager.AddIntegerParameter("N", "N", "Which n-th prime number. Minimum 1, maximum one million. Take care, it can burn your CPU.", GH_ParamAccess.item);
|
||||
}
|
||||
protected override System.Drawing.Bitmap Icon { get => Properties.Resources.logo32; }
|
||||
|
||||
protected override void RegisterOutputParams(GH_OutputParamManager pManager)
|
||||
{
|
||||
pManager.AddNumberParameter("Output", "O", "The n-th prime number.", GH_ParamAccess.item);
|
||||
public override GH_Exposure Exposure => GH_Exposure.primary;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class PrimeCalculatorWorker : WorkerInstance
|
||||
{
|
||||
int TheNthPrime { get; set; } = 100;
|
||||
long ThePrime { get; set; } = -1;
|
||||
|
||||
public PrimeCalculatorWorker() : base(null) { }
|
||||
|
||||
public override void DoWork(Action<string, double> ReportProgress, Action Done)
|
||||
{
|
||||
// 👉 Checking for cancellation!
|
||||
if (CancellationToken.IsCancellationRequested) return;
|
||||
|
||||
int count = 0;
|
||||
long a = 2;
|
||||
|
||||
// Thanks Steak Overflow (TM) https://stackoverflow.com/a/13001749/
|
||||
while (count < TheNthPrime)
|
||||
{
|
||||
// 👉 Checking for cancellation!
|
||||
if (CancellationToken.IsCancellationRequested) return;
|
||||
|
||||
long b = 2;
|
||||
int prime = 1;// to check if found a prime
|
||||
while (b * b <= a)
|
||||
public Sample_PrimeCalculatorAsyncComponent() : base("The N-th Prime Calculator", "PRIME", "Calculates the nth prime number.", "Samples", "Async")
|
||||
{
|
||||
// 👉 Checking for cancellation!
|
||||
if (CancellationToken.IsCancellationRequested) return;
|
||||
|
||||
if (a % b == 0)
|
||||
{
|
||||
prime = 0;
|
||||
break;
|
||||
}
|
||||
b++;
|
||||
BaseWorker = new PrimeCalculatorWorker();
|
||||
}
|
||||
|
||||
ReportProgress(Id, ((double)count) / TheNthPrime);
|
||||
|
||||
if (prime > 0)
|
||||
protected override void RegisterInputParams(GH_InputParamManager pManager)
|
||||
{
|
||||
count++;
|
||||
pManager.AddIntegerParameter("N", "N", "Which n-th prime number. Minimum 1, maximum one million. Take care, it can burn your CPU.", GH_ParamAccess.item);
|
||||
}
|
||||
a++;
|
||||
}
|
||||
|
||||
ThePrime = --a;
|
||||
Done();
|
||||
protected override void RegisterOutputParams(GH_OutputParamManager pManager)
|
||||
{
|
||||
pManager.AddNumberParameter("Output", "O", "The n-th prime number.", GH_ParamAccess.item);
|
||||
}
|
||||
|
||||
public override void AppendAdditionalMenuItems(ToolStripDropDown menu)
|
||||
{
|
||||
base.AppendAdditionalMenuItems(menu);
|
||||
Menu_AppendItem(menu, "Cancel", (s, e) =>
|
||||
{
|
||||
RequestCancellation();
|
||||
});
|
||||
}
|
||||
|
||||
private class PrimeCalculatorWorker : WorkerInstance
|
||||
{
|
||||
int TheNthPrime { get; set; } = 100;
|
||||
long ThePrime { get; set; } = -1;
|
||||
|
||||
public PrimeCalculatorWorker() : base(null) { }
|
||||
|
||||
public override void DoWork(Action<string, double> ReportProgress, Action Done)
|
||||
{
|
||||
// 👉 Checking for cancellation!
|
||||
if (CancellationToken.IsCancellationRequested) { return; }
|
||||
|
||||
int count = 0;
|
||||
long a = 2;
|
||||
|
||||
// Thanks Steak Overflow (TM) https://stackoverflow.com/a/13001749/
|
||||
while (count < TheNthPrime)
|
||||
{
|
||||
// 👉 Checking for cancellation!
|
||||
if (CancellationToken.IsCancellationRequested) { return; }
|
||||
|
||||
long b = 2;
|
||||
int prime = 1;// to check if found a prime
|
||||
while (b * b <= a)
|
||||
{
|
||||
// 👉 Checking for cancellation!
|
||||
if (CancellationToken.IsCancellationRequested) { return; }
|
||||
|
||||
if (a % b == 0)
|
||||
{
|
||||
prime = 0;
|
||||
break;
|
||||
}
|
||||
b++;
|
||||
}
|
||||
|
||||
ReportProgress(Id, ((double)count) / TheNthPrime);
|
||||
|
||||
if (prime > 0)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
a++;
|
||||
}
|
||||
|
||||
ThePrime = --a;
|
||||
Done();
|
||||
}
|
||||
|
||||
public override WorkerInstance Duplicate() => new PrimeCalculatorWorker();
|
||||
|
||||
public override void GetData(IGH_DataAccess DA, GH_ComponentParamServer Params)
|
||||
{
|
||||
int _nthPrime = 100;
|
||||
DA.GetData(0, ref _nthPrime);
|
||||
if (_nthPrime > 1000000) _nthPrime = 1000000;
|
||||
if (_nthPrime < 1) _nthPrime = 1;
|
||||
|
||||
TheNthPrime = _nthPrime;
|
||||
}
|
||||
|
||||
public override void SetData(IGH_DataAccess DA)
|
||||
{
|
||||
// 👉 Checking for cancellation!
|
||||
if (CancellationToken.IsCancellationRequested) { return; }
|
||||
|
||||
DA.SetData(0, ThePrime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override WorkerInstance Duplicate() => new PrimeCalculatorWorker();
|
||||
|
||||
public override void GetData(IGH_DataAccess DA, GH_ComponentParamServer Params)
|
||||
{
|
||||
int _nthPrime = 100;
|
||||
DA.GetData(0, ref _nthPrime);
|
||||
if (_nthPrime > 1000000) _nthPrime = 1000000;
|
||||
if (_nthPrime < 1) _nthPrime = 1;
|
||||
|
||||
TheNthPrime = _nthPrime;
|
||||
}
|
||||
|
||||
public override void SetData(IGH_DataAccess DA)
|
||||
{
|
||||
// 👉 Checking for cancellation!
|
||||
if (CancellationToken.IsCancellationRequested) return;
|
||||
|
||||
DA.SetData(0, ThePrime);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+79
-73
@@ -1,83 +1,89 @@
|
||||
using Grasshopper.Kernel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using GrasshopperAsyncComponent;
|
||||
|
||||
|
||||
namespace GrasshopperAsyncComponentDemo.SampleImplementations
|
||||
{
|
||||
public class Sample_UselessCyclesAsyncComponent : GH_AsyncComponent
|
||||
{
|
||||
public override Guid ComponentGuid { get => new Guid("DF2B93E2-052D-4BE4-BC62-90DC1F169BF6"); }
|
||||
|
||||
protected override System.Drawing.Bitmap Icon { get => Properties.Resources.logo32; }
|
||||
|
||||
public override GH_Exposure Exposure => GH_Exposure.primary;
|
||||
|
||||
public Sample_UselessCyclesAsyncComponent() : base("Sample Async Component", "CYCLOMATRON-X", "Spins uselessly.", "Samples", "Async")
|
||||
public class Sample_UselessCyclesAsyncComponent : GH_AsyncComponent
|
||||
{
|
||||
BaseWorker = new UselessCyclesWorker();
|
||||
public override Guid ComponentGuid { get => new Guid("DF2B93E2-052D-4BE4-BC62-90DC1F169BF6"); }
|
||||
|
||||
protected override System.Drawing.Bitmap Icon { get => Properties.Resources.logo32; }
|
||||
|
||||
public override GH_Exposure Exposure => GH_Exposure.primary;
|
||||
|
||||
public Sample_UselessCyclesAsyncComponent() : base("Sample Async Component", "CYCLOMATRON-X", "Spins uselessly.", "Samples", "Async")
|
||||
{
|
||||
BaseWorker = new UselessCyclesWorker();
|
||||
}
|
||||
|
||||
private class UselessCyclesWorker : WorkerInstance
|
||||
{
|
||||
int MaxIterations { get; set; } = 100;
|
||||
|
||||
public UselessCyclesWorker() : base(null) { }
|
||||
|
||||
public override void DoWork(Action<string, double> ReportProgress, Action Done)
|
||||
{
|
||||
// Checking for cancellation
|
||||
if (CancellationToken.IsCancellationRequested) { return; }
|
||||
|
||||
for (int i = 0; i <= MaxIterations; i++)
|
||||
{
|
||||
var sw = new SpinWait();
|
||||
for (int j = 0; j <= 100; j++)
|
||||
sw.SpinOnce();
|
||||
|
||||
ReportProgress(Id, ((double)(i + 1) / (double)MaxIterations));
|
||||
|
||||
// Checking for cancellation
|
||||
if (CancellationToken.IsCancellationRequested) { return; }
|
||||
}
|
||||
|
||||
Done();
|
||||
}
|
||||
|
||||
public override WorkerInstance Duplicate() => new UselessCyclesWorker();
|
||||
|
||||
public override void GetData(IGH_DataAccess DA, GH_ComponentParamServer Params)
|
||||
{
|
||||
if (CancellationToken.IsCancellationRequested) return;
|
||||
|
||||
int _maxIterations = 100;
|
||||
DA.GetData(0, ref _maxIterations);
|
||||
if (_maxIterations > 1000) _maxIterations = 1000;
|
||||
if (_maxIterations < 10) _maxIterations = 10;
|
||||
|
||||
MaxIterations = _maxIterations;
|
||||
}
|
||||
|
||||
public override void SetData(IGH_DataAccess DA)
|
||||
{
|
||||
if (CancellationToken.IsCancellationRequested) return;
|
||||
DA.SetData(0, $"Hello world. Worker {Id} has spun for {MaxIterations} iterations.");
|
||||
}
|
||||
}
|
||||
|
||||
protected override void RegisterInputParams(GH_InputParamManager pManager)
|
||||
{
|
||||
pManager.AddIntegerParameter("N", "N", "Number of spins.", GH_ParamAccess.item);
|
||||
}
|
||||
|
||||
protected override void RegisterOutputParams(GH_OutputParamManager pManager)
|
||||
{
|
||||
pManager.AddTextParameter("Output", "O", "Nothing really interesting.", GH_ParamAccess.item);
|
||||
}
|
||||
|
||||
public override void AppendAdditionalMenuItems(ToolStripDropDown menu)
|
||||
{
|
||||
base.AppendAdditionalMenuItems(menu);
|
||||
Menu_AppendItem(menu, "Cancel", (s, e) =>
|
||||
{
|
||||
RequestCancellation();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected override void RegisterInputParams(GH_InputParamManager pManager)
|
||||
{
|
||||
pManager.AddIntegerParameter("N", "N", "Number of spins.", GH_ParamAccess.item);
|
||||
}
|
||||
|
||||
protected override void RegisterOutputParams(GH_OutputParamManager pManager)
|
||||
{
|
||||
pManager.AddTextParameter("Output", "O", "Nothing really interesting.", GH_ParamAccess.item);
|
||||
}
|
||||
}
|
||||
|
||||
public class UselessCyclesWorker : WorkerInstance
|
||||
{
|
||||
int MaxIterations { get; set; } = 100;
|
||||
|
||||
public UselessCyclesWorker() : base(null) { }
|
||||
|
||||
public override void DoWork(Action<string, double> ReportProgress, Action Done)
|
||||
{
|
||||
// Checking for cancellation
|
||||
if (CancellationToken.IsCancellationRequested) return;
|
||||
|
||||
for (int i = 0; i <= MaxIterations; i++)
|
||||
{
|
||||
var sw = new SpinWait();
|
||||
for (int j = 0; j <= 100; j++)
|
||||
sw.SpinOnce();
|
||||
|
||||
ReportProgress(Id, ((double)(i + 1) / (double)MaxIterations));
|
||||
|
||||
// Checking for cancellation
|
||||
if (CancellationToken.IsCancellationRequested) return;
|
||||
}
|
||||
|
||||
Done();
|
||||
}
|
||||
|
||||
public override WorkerInstance Duplicate() => new UselessCyclesWorker();
|
||||
|
||||
public override void GetData(IGH_DataAccess DA, GH_ComponentParamServer Params)
|
||||
{
|
||||
if (CancellationToken.IsCancellationRequested) return;
|
||||
|
||||
int _maxIterations = 100;
|
||||
DA.GetData(0, ref _maxIterations);
|
||||
if (_maxIterations > 1000) _maxIterations = 1000;
|
||||
if (_maxIterations < 10) _maxIterations = 10;
|
||||
|
||||
MaxIterations = _maxIterations;
|
||||
}
|
||||
|
||||
public override void SetData(IGH_DataAccess DA)
|
||||
{
|
||||
if (CancellationToken.IsCancellationRequested) return;
|
||||
DA.SetData(0, $"Hello world. Worker {Id} has spun for {MaxIterations} iterations.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
Copyright 2020 AEC Systems
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -15,14 +15,15 @@ Looks nice, doesn't it? Notice that the solution runs "eagerly" - every time the
|
||||
|
||||
- **Grasshopper and Rhino are still responsive!**
|
||||
- **There's progress reporting!** (personally I hate waiting for Gh to unfreeze...).
|
||||
- **Thread safe**: 99% of the times this won't explode in your face. It still might though!
|
||||
|
||||
### Approach
|
||||
|
||||
Provides an abstract `GH_AsyncComponent` which you can inherit from to scaffold your own async component. There's more info in the [blogpost](https://speckle.systems/blog/async-gh/) on how to go about it.
|
||||
|
||||
Even better, there's a [sample component that shows how an implementation could look like](https://github.com/specklesystems/GrasshopperAsyncComponent/tree/main/GrasshopperAsyncComponent/SampleImplementations)! There's two components in that folder:
|
||||
- The Useless Spinner: does no meaningfull CPU work, just keeps a thread busy with SpinWait()
|
||||
- The N-th Prime Calculator: can actually spin your computer's fans quite a bit (for numbers > 100.000)
|
||||
> #### Checkout the sample implementation!
|
||||
> - [Prime number calculator](https://github.com/specklesystems/GrasshopperAsyncComponent/blob/a53cef31a8750a18d06fad0f41b2dc452fdc253b/GrasshopperAsyncComponentDemo/SampleImplementations/Sample_PrimeCalculatorAsyncComponent.cs#L11-L53) Calculates the n'th prime. Can actually spin your computer's fans quite a bit for numbers > 100.000!
|
||||
> - [Usless spinner](https://github.com/specklesystems/GrasshopperAsyncComponent/blob/2f2be53bffd2402337ba40d65bb5b619d1161b3e/GrasshopperAsyncComponentDemo/SampleImplementations/Sample_UslessCyclesComponent.cs#L13-L91) does no meaningfull CPU work, just keeps a thread busy with SpinWait().
|
||||
|
||||
### Current limitations
|
||||
|
||||
@@ -46,6 +47,25 @@ Q: Does this component use all my cores? A: OH YES. It goes WROOOM.
|
||||
|
||||

|
||||
|
||||
Q: Can I enable cancellation of a longer running task?
|
||||
|
||||
A: Yes, now you can! In your component, just add a right click menu action like so:
|
||||
|
||||
```cs
|
||||
|
||||
public override void AppendAdditionalMenuItems(ToolStripDropDown menu)
|
||||
{
|
||||
base.AppendAdditionalMenuItems(menu);
|
||||
Menu_AppendItem(menu, "Cancel", (s, e) =>
|
||||
{
|
||||
RequestCancellation();
|
||||
});
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Debugging
|
||||
|
||||
Quite easy:
|
||||
@@ -56,11 +76,16 @@ Quite easy:
|
||||
|
||||
## Contributing
|
||||
|
||||
Before embarking on submitting a patch, please make sure you read:
|
||||
Please make sure you read the [contribution guidelines](.github/CONTRIBUTING.md) and [Code of Conduct](.github/CODE_OF_CONDUCT.md) for an overview of the best practices we try to follow.
|
||||
|
||||
- [Contribution Guidelines](CONTRIBUTING.md),
|
||||
- [Code of Conduct](CODE_OF_CONDUCT.md)
|
||||
## Community
|
||||
|
||||
The Speckle Community hangs out on [the forum](https://discourse.speckle.works), do join and introduce yourself & feel free to ask us questions!
|
||||
|
||||
## Security
|
||||
|
||||
For any security vulnerabilities or concerns, please contact us directly at security[at]speckle.systems.
|
||||
|
||||
## License
|
||||
|
||||
Unless otherwise described, the code in this repository is licensed under the Apache-2.0 license.
|
||||
Unless otherwise described, the code in this repository is licensed under the Apache-2.0 License. Please note that some modules, extensions or code herein might be otherwise licensed. This is indicated either in the root of the containing folder under a different license file, or in the respective file's header. If you have any questions, don't hesitate to get in touch with us via [email](mailto:hello@speckle.systems).
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 2.2.+ | :white_check_mark: |
|
||||
| < 2.2 | :x: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Hi! If you've found something off, we'd be more than happy if you would report it via security@speckle.systems. We will work together with you to correctly identify the cause and implement a fix. Thanks for helping make Speckle safer!
|
||||
Reference in New Issue
Block a user