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.
JOE_FU
Posts: 79
Joined: Fri Jan 11, 2019 8:41 am

How to add other properties ,such as frequency ?

Postby JOE_FU » Fri Sep 20, 2019 11:21 am

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
Posts: 2011
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

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

Postby Jee-Bee » Fri Sep 20, 2019 12:43 pm

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
Site Admin
Posts: 15726
Joined: Thu Feb 19, 2009 10:32 am

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

Postby wmayer » 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.
JOE_FU
Posts: 79
Joined: Fri Jan 11, 2019 8:41 am

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

Postby JOE_FU » Sat Sep 21, 2019 9:36 am

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
Site Admin
Posts: 15726
Joined: Thu Feb 19, 2009 10:32 am

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

Postby wmayer » Mon Oct 21, 2019 9:52 am

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