|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
N* i4 n4 q& P8 U8 ^0 P6 QNX二次开发源码分享: Ufun设置工作部件重量# Z- r* F: d. c; ]
) _* b' H. {! H" Z: x
+ G4 j& h3 z5 o! Y; L C- N$ A[mw_shl_code=c,true]void do_it(); d7 g2 }* w# n: H" w
{
1 g/ d p) H8 m4 S% I9 d4 y tag_t workPart = UF_ASSEM_ask_work_part();
. q& a4 u8 i+ L8 Q: K3 ^% @( K% D' l, M& w% x' C0 M* Z, I
if (workPart != NULL_TAG)
4 @2 p4 j$ H. n3 f8 w" c {
7 y) n- E- z8 ^# {0 H) n UF_WEIGHT_properties_t propsOld, propsNew;
: f! F$ T& Y$ \( N: ?- r4 c, `5 F' @0 b- o
UF_CALL(UF_WEIGHT_ask_props(workPart, UF_WEIGHT_units_km, &propsOld));
; n7 q" y4 n, F- s1 s ECHO("Old Weight: %f\n", propsOld.mass);( m3 Q5 u, }4 n% L% U" f
ECHO("Accuracy: %.2f\n", propsOld.accuracy);
. X8 P" }3 P, k0 Z
8 S% y+ Z0 e, h$ O3 b4 u propsNew.cache_state = propsNew.mass_state = UF_WEIGHT_asserted;; V, }( B) ^1 b- G; U4 j
propsNew.area_state = propsNew.cofm_state = propsNew.mofi_state = propsNew.density_state = propsNew.volume_state = UF_WEIGHT_unknown;0 o$ j: i- f: u. H& N5 N: G
propsNew.accuracy = 1.0;
5 ~% O: L3 k, M+ x propsNew.units = UF_WEIGHT_units_gm;4 x2 ^ J u5 E+ V) q
propsNew.mass = 1234.56;
! e P- t @8 e+ Z: C o UF_CALL(UF_WEIGHT_assert_part_props(workPart, &propsNew));7 T5 C8 _) d/ f" V T# [5 n
+ i" m; N3 L* j( A
UF_CALL(UF_WEIGHT_ask_props(workPart, UF_WEIGHT_units_km, &propsOld));% M8 [' K0 u8 O' Z- O0 [- _
ECHO("New Weight: %f\n", propsOld.mass);/ Z1 S, M9 z9 m5 N# M
}
. Z- M6 Y6 x" h+ X' m' E# ~2 U9 {5 V$ C
}[/mw_shl_code]
& `, ]8 _8 Q* V, f) U |
|