yaptide / ui

Yet Another Particle Transport IDE - frontend
https://yaptide.github.io/web_dev/
GNU General Public License v3.0
9 stars 4 forks source link

1400 define particle filter #1408

Closed Bogdan2423 closed 8 months ago

Bogdan2423 commented 9 months ago

obraz

Bogdan2423 commented 8 months ago
Bogdan2423 commented 8 months ago

filter1 filter2

grzanka commented 8 months ago
  • In current production version of project there is a bug which makes it impossible to remove filters. I didnt manage to fix it yet. I would prefer to create a seperate issue for the bug and fix it there, unless you think that I should fix it in this PR

Thats not a problem, it can go into separate PR / issue.

  • Adding, duplicating, loading and saving to JSON and adding filters to detectors work normally for both types of filters

Good

  • This change is not backwards compatible, as SHIELDHIT-12A converter cannot parse the new JSON with particle filter. The new JSON format: "filters": [ { "uuid": "c0e0f38d-4f19-4d80-8f63-0e955059a96b", "name": "Filter", "type": "Filter", "rules": [ { "uuid": "af471dee-8dde-4eaa-8a1d-1c26097f7336", "keyword": "Z", "operator": "equal", "value": 1 }] }, { "uuid": "1c47cbc8-29f2-4eb0-b275-4876c331d9e2", "name": "Filter_1", "type": "Filter", "particle": { "id": 2, "name": "Proton" } }, ... For the new particle filter the rules field is replaced with "particle" field which has fields "id" and "name". The rest stays the same.

Then maybe you should bump JSON version ? What will happen if you define "Custom filter" (one based on Rules) and run now SHIELD-HIT12A simulation ? Will converter accept that ?

Bogdan2423 commented 8 months ago
  • This change is not backwards compatible, as SHIELDHIT-12A converter cannot parse the new JSON with particle filter. The new JSON format: "filters": [ { "uuid": "c0e0f38d-4f19-4d80-8f63-0e955059a96b", "name": "Filter", "type": "Filter", "rules": [ { "uuid": "af471dee-8dde-4eaa-8a1d-1c26097f7336", "keyword": "Z", "operator": "equal", "value": 1 }] }, { "uuid": "1c47cbc8-29f2-4eb0-b275-4876c331d9e2", "name": "Filter_1", "type": "Filter", "particle": { "id": 2, "name": "Proton" } }, ... For the new particle filter the rules field is replaced with "particle" field which has fields "id" and "name". The rest stays the same.

Then maybe you should bump JSON version ? What will happen if you define "Custom filter" (one based on Rules) and run now SHIELD-HIT12A simulation ? Will converter accept that ?

I bumped the version. If there is no new "particle filter" defined then converter will work normally and you can use "custom filter". It only will not work if you try to run simulation with the new type of filter.