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

Missing error message when pushing load type that is not implemented in Lusas. #385

Open
KalleEdstroem opened this issue Dec 14, 2023 · 1 comment
Assignees
Labels
type:documentation Wiki, help or in code attributes

Comments

@KalleEdstroem
Copy link
Contributor

KalleEdstroem commented Dec 14, 2023

Description:

  • When pushing a load type that is not implemented an error message regarding Null property is presented to the user.
  • It is (for the user) unclear why that error arises.
  • It would simplify if an error stating that the load type is not implemented for pushing to Lusas.

How to fix:

  • When the method determines the load type it could default to a message telling the user if it is not implemented.

Add this line in the end of the loadType case checks.
Engine.Base.Compute.RecordError("Load type is not supported in the Lusas_Toolkit.");

Question is if it should be worded as not supported or not implemented.

switch (loadType)
{
case "BH.oM.Structure.Loads.PointLoad":
success = CreateCollection(objects as IEnumerable<PointLoad>);
break;
case "BH.oM.Structure.Loads.GravityLoad":
success = CreateCollection(objects as IEnumerable<GravityLoad>);
break;
case "BH.oM.Structure.Loads.BarUniformlyDistributedLoad":
success = CreateCollection(objects as IEnumerable<BarUniformlyDistributedLoad>);
break;
case "BH.oM.Structure.Loads.AreaUniformlyDistributedLoad":
success = CreateCollection(objects as IEnumerable<AreaUniformlyDistributedLoad>);
break;
case "BH.oM.Structure.Loads.BarUniformTemperatureLoad":
success = CreateCollection(objects as IEnumerable<BarUniformTemperatureLoad>);
break;
case "BH.oM.Structure.Loads.AreaUniformTemperatureLoad":
success = CreateCollection(objects as IEnumerable<AreaUniformTemperatureLoad>);
break;
case "BH.oM.Structure.Loads.PointDisplacement":
success = CreateCollection(objects as IEnumerable<PointDisplacement>);
break;
case "BH.oM.Structure.Loads.BarPointLoad":
success = CreateCollection(objects as IEnumerable<BarPointLoad>);
break;
case "BH.oM.Structure.Loads.BarVaryingDistributedLoad":
success = CreateCollection(objects as IEnumerable<BarVaryingDistributedLoad>);
break;

Test script:

https://burohappold.sharepoint.com/:u:/r/sites/BHoM/02_Current/12_Scripts/01_Issue/BHoM/Lusas_Toolkit/%23385%20Error%20message%20for%20unsupported%20loadtypes%20.gh?csf=1&web=1&e=BUncCR

Additional info:

The load types (BHoM Type) not supported according to the wiki on Lusas_Toolkit: PointAcceleration, PointVelocity, BarPrestressLoad, ContourLoad and GeometricalLineLoad.

@KalleEdstroem KalleEdstroem added the type:documentation Wiki, help or in code attributes label Dec 14, 2023
@KalleEdstroem KalleEdstroem self-assigned this Dec 14, 2023
@KalleEdstroem
Copy link
Contributor Author

The error arises earlier in the GetCachedOrReadAsDictionary method within the BHoM adapter.

https://github.com/BHoM/BHoM_Adapter/blob/ee7a9882d1f3145484ef6b269bdeda750b2c1682/BHoM_Adapter/CRUD/Cache.cs#L120-L125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:documentation Wiki, help or in code attributes
Projects
None yet
Development

No branches or pull requests

1 participant