How to add other properties ,such as frequency ?

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
JOE_FU
Posts: 79
Joined: Fri Jan 11, 2019 8:41 am

How to add other properties ,such as frequency ?

Post by JOE_FU »

I found that there are a lot of properties ,which we can use in FreeCAD,for exanple App ::PropertyFloat, App ::PropertyPrecision,App ::PropertyAngle, App ::PropertySpeed and so on. Now I want to add frequency in my FreeCAD. It's not clear for me about it.Maybe it is related to files such as Quantity.cpp, Unit.cpp or ExpressionParser.tab.c. Is it possible to implement this function?
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: How to add other properties ,such as frequency ?

Post by Jee-Bee »

I think frequency is added in the FEM WB. if a result have a set of frequencies...
So if you need it somewhere check there how they do it...
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: How to add other properties, such as frequency ?

Post by wmayer »

PropertyQuantity will be your friend for now. In your feature class you can define the unit to be 1/s, i.e. Unit(0,0,-1,0,0,0,0,0).

I looked quickly through the relevant classes and nowhere frequency is explicitly handled which is quite amazing as this is a relevant physical quantity. So, I think it's best to extend the quantity framework by this.
JOE_FU
Posts: 79
Joined: Fri Jan 11, 2019 8:41 am

Re: How to add other properties, such as frequency ?

Post by JOE_FU »

wmayer wrote: Fri Sep 20, 2019 12:52 pm PropertyQuantity will be your friend for now. In your feature class you can define the unit to be 1/s, i.e. Unit(0,0,-1,0,0,0,0,0).

I looked quickly through the relevant classes and nowhere frequency is explicitly handled which is quite amazing as this is a relevant physical quantity. So, I think it's best to extend the quantity framework by this.
Yes,i think so.
Now,i have already extended it by running BISON. But i have trouble in perfecting it. When I enter 1000000000000, why does the input box change to -0.000000000000? But I looked at the code, the maximum value is 1.7976931348623157e + 308.Can i increase display digits?
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: How to add other properties ,such as frequency ?

Post by wmayer »

Frequency is now supported: git commit 3500451a0 and git commit d7ca604c9
Post Reply