|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
9 V0 D% _: C* f7 V3 p+ Y
4 Y( T j u4 B. j+ N& p8 m( V4 LNX二次开发源码分享:报告当前Teamcenter是两层还是四层: z$ ]: v: L) N& ~
- static void do_it(void)* z! r( l; H: `; Z$ d5 I0 u
- {, O4 j5 N$ j# N2 k* q) R6 ?
- logical IsManagedSession = FALSE;
1 u2 W$ v- i2 I% h' |, k+ m, @ - ! ^: b, s, o0 z$ V. u
- UF_is_UGmanager_active(&IsManagedSession);6 n6 C; i8 y, C! \) {
" Z& s* _3 V. B7 s+ \+ j- if(IsManagedSession == FALSE) return;0 Q& [' m2 T j* z% j" `8 G
$ g7 ?7 k' m) F& U5 T7 W- Session *theSession = Session::GetSession();0 S9 U; e$ F# K
- ListingWindow* lw;
: b0 }. H. X0 v/ _' e - lw = theSession->ListingWindow();+ R" ~3 @! \& i, I
- 1 E$ B' q& u1 Z T# [* W
- NXString connectString;8 ^: U4 x4 @( i H6 Y+ c; p
- NXString discriminator;
, F' _( b( X- W3 X - 6 L& d2 T2 K B; b/ K7 o/ p5 ?
- theSession->PdmSession()->GetTCserverSettings(&connectString,
+ D: Z2 d- M+ r& h, ], s F - &discriminator); { h: B- S- j$ P
-
, P: @8 h& M, Y( r! ^ - lw->Open();2 P0 d1 w0 F6 Q& w' C6 E
- & l! [# } V* Z/ J
- /********************* uncomment to see the string values
7 k* K- C" Z: r
2 m: T3 J1 J3 S; h' {6 L, P- lw->WriteLine("connectString: ");
3 N: W- p. D4 h$ t. n8 i - lw->WriteLine(connectString);
, m) j. V& l5 r# h! U0 ] -
+ e- _. i% c5 q N1 r3 }8 u - lw->WriteLine("discriminator: ");' }$ t. q/ v! c# Y2 G6 C' X# k+ o
- lw->WriteLine(discriminator);) }7 Z# k8 [+ r# i& s
( N; i! f1 i- `' V1 S- lw->WriteLine("Note: Empty string indicates 2-tier");
: e! O$ V8 |; T" x1 T - *************************************************************/, |$ O. O+ p; w9 ^1 c1 V: ?
- ) {9 g4 n9 Q ]# F. I9 D# ]
- const char * discriminatorString = discriminator.GetText();" v. I: M. B% W
5 L& Y4 G9 U6 c% H3 T8 S+ e- size_t sl = strlen(discriminatorString);
6 D2 M. @6 a2 e& w* T" X5 q2 W
* x v! w1 e- n; A; Y7 W- if((int)sl < 2)$ A( `) J' _+ b$ H
- {
5 h. d, q' p$ Q/ m0 L - lw->WriteLine("This is a 2-tier session.");- h3 c0 w8 H1 W q, v. S: w+ x9 ?- o. Y
- }6 a/ ^- V: s( Z/ ~# D' c
- else( T3 G- a% v; i& u, v* _9 |: g
- {
0 }5 M0 D8 [, _/ G; {6 e - lw->WriteLine("This is a 4-tier session.");
2 i, D+ K/ ]! P, d* F, Y! d - }! r- e* X f+ `8 y; n
-
- O' B/ u( I* o& X - }
9 G" k5 V* m! ^8 {" {
复制代码 , T# n* s9 y4 d: L! y" o
8 h* K) f: I) ^# R
& j) f3 L: i9 y" u- V7 R: | |
|