Changeset 2489 in Sophya for trunk/SophyaPI/PIext
- Timestamp:
- Dec 29, 2003, 1:41:57 AM (22 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/piacmd.cc
r2486 r2489 344 344 { 345 345 Commander::SetCurrentPrompt(pr); 346 if (mImgApp) mImgApp->GetConsole()->SetPrompt(pr); 346 if (mImgApp) { 347 ZSync(mImgApp->getMutex()); 348 mImgApp->GetConsole()->SetPrompt(pr); 349 } 347 350 } 348 351 … … 350 353 void PIACmd::ShowMessage(const char * msg, int att) 351 354 { 355 /* 356 Il faut faire quelque chose pour gerer correctement ca en multithread 352 357 char va = (att == 0) ? 0 : PIVA_Magenta; 353 if (mImgApp) mImgApp->GetConsole()->AddStr(msg, va); 354 } 358 if (mImgApp) { 359 ZSync(mImgApp->getMutex()); 360 mImgApp->GetConsole()->AddStr(msg, va); 361 } 362 */ 363 Commander::ShowMessage(msg, att); 364 } -
trunk/SophyaPI/PIext/piaversion.h
r2373 r2489 2 2 #define PIAPPVERSION_H_SEEN 3 3 4 #define PIAPP_VERSIONNUMBER 3.9 54 #define PIAPP_VERSIONNUMBER 3.96 5 5 6 6 #endif -
trunk/SophyaPI/PIext/pistdimgapp.cc
r2486 r2489 76 76 { 77 77 if (_app) { 78 _app->ExecuteExtCommand(); 78 // RZDEL: Normalement, il ne devrait plus y avoir besoin de cette 79 // methode avec le thread separe de l'interpreteur - Reza 27/12/2003 80 // _app->ExecuteExtCommand(); 79 81 _app->UpdateStatResourceInfo(); 80 82 } … … 380 382 } 381 383 384 class RunAlarm : public Periodic { 385 public: 386 RunAlarm(PIStdImgApp* app) : 387 Periodic(1) 388 { _app = app; SetIntervalms(1); } 389 ~RunAlarm() { } 390 virtual void DoPeriodic() 391 { _app->getMutex().broadcast(); } 392 PIStdImgApp* _app; 393 }; 394 382 395 /* --Methode-- */ 383 396 void PIStdImgApp::Run() … … 393 406 else mStop = true; // On rerentre apres un stop 394 407 395 mCmd->start(); 396 408 // Creation et demarrage de l'objet de reveil periodique 409 // de la boucle d'evts 410 RunAlarm * mru = new RunAlarm(this); 411 //mru->Start(); 412 // Demarrage du thread de l'interpreteur 413 CmdInterpreter()->start(); 414 415 // Soumission de la commande exterieur a executer 416 if (fg_exc_cmd) { 417 fg_exc_cmd = false; 418 } 419 420 bool fg_gls_lock = false; 397 421 while (mStop) { 398 422 thr_glsyn.lock(); // <ZThread> 399 if(XtAppPending(*appctx) != 0) {423 while (XtAppPending(*appctx) != 0) { 400 424 XtAppNextEvent(*appctx, &evt); 401 425 XtDispatchEvent(&evt); 402 426 } 403 thr_glsyn.unlock(); // <ZThread> 427 thr_glsyn.unlock(); // <ZThread> 428 // thr_glsyn.wait(); 404 429 usleep(1000); 405 430 } 431 432 delete mru; 406 433 return; 407 434 } … … 514 541 try { 515 542 // mCmd->Interpret(s); 516 mCmd->AddInputLine(s);543 CmdInterpreter()->AddInputLine(s); 517 544 } 518 545 catch ( PThrowable & exc ) { … … 596 623 597 624 // <ZThread> global PIApplication event loop synchronisation 598 ZSync zs(thr_glsyn );625 ZSync zs(thr_glsyn, 2); 599 626 600 627 // Choix de la taille de fenetre … … 666 693 667 694 // <ZThread> global PIApplication event loop synchronisation 668 ZSync zs(thr_glsyn );695 ZSync zs(thr_glsyn, 2); 669 696 670 697 // Trace en superpoistion … … 770 797 771 798 // <ZThread> global PIApplication event loop synchronisation 772 ZSync zs(thr_glsyn );799 ZSync zs(thr_glsyn, 2); 773 800 774 801 // Trace en superpoistion … … 856 883 } 857 884 885 // RZDEL: Normalement, il ne devrait plus y avoir besoin de cette 886 // methode avec le thread separe de l'interpreteur - Reza 27/12/2003 858 887 /* --Methode-- */ 859 888 int PIStdImgApp::ExecuteExtCommand() … … 869 898 void PIStdImgApp::AddText(string const & txt, double xp, double yp, string const& sop, bool fgcn) 870 899 { 900 // <ZThread> global PIApplication event loop synchronisation 901 ZSync zs(thr_glsyn, 2); 902 871 903 PIDrawer *eld=CurrentElDrawer(); 872 904 if (eld == NULL) return; … … 893 925 string const& optss, bool fgcn) 894 926 { 927 // <ZThread> global PIApplication event loop synchronisation 928 ZSync zs(thr_glsyn, 2); 929 895 930 PIDrawer *eld=CurrentElDrawer(); 896 931 if (eld == NULL) return; … … 918 953 string const& sop, bool fgarrow, bool fgcn) 919 954 { 955 // <ZThread> global PIApplication event loop synchronisation 956 ZSync zs(thr_glsyn, 2); 957 920 958 PIDrawer *eld=CurrentElDrawer(); 921 959 if (eld == NULL) return; … … 941 979 string const& sop, bool fgfill, bool fgcn) 942 980 { 981 // <ZThread> global PIApplication event loop synchronisation 982 ZSync zs(thr_glsyn, 2); 983 943 984 PIDrawer *eld=CurrentElDrawer(); 944 985 if (eld == NULL) return; … … 978 1019 bool fgfill, bool fgcn) 979 1020 { 1021 // <ZThread> global PIApplication event loop synchronisation 1022 ZSync zs(thr_glsyn, 2); 1023 980 1024 PIDrawer *eld=CurrentElDrawer(); 981 1025 if (eld == NULL) return; … … 1002 1046 string const& sop, bool fgfill, bool fgcn) 1003 1047 { 1048 // <ZThread> global PIApplication event loop synchronisation 1049 ZSync zs(thr_glsyn, 2); 1050 1004 1051 PIDrawer *eld=CurrentElDrawer(); 1005 1052 if (eld == NULL) return; … … 1023 1070 double x3, double y3, string const& sop, bool fgfill, bool fgcn) 1024 1071 { 1072 // <ZThread> global PIApplication event loop synchronisation 1073 ZSync zs(thr_glsyn, 2); 1074 1025 1075 PIDrawer *eld=CurrentElDrawer(); 1026 1076 if (eld == NULL) return; … … 1046 1096 string const& sop, bool fgfill, bool fgcn) 1047 1097 { 1098 // <ZThread> global PIApplication event loop synchronisation 1099 ZSync zs(thr_glsyn, 2); 1100 1048 1101 PIDrawer *eld=CurrentElDrawer(); 1049 1102 if (eld == NULL) return; … … 1070 1123 void PIStdImgApp::SetTitle(string const & titletop, string const & titlebottom, string const& sop) 1071 1124 { 1125 // <ZThread> global PIApplication event loop synchronisation 1126 ZSync zs(thr_glsyn, 2); 1127 1072 1128 PIDrawer *eld=CurrentElDrawer(); 1073 1129 if (eld == NULL) return; … … 1093 1149 void PIStdImgApp::SetAxeLabels(string const & xLabel, string const & yLabel, string const& sop) 1094 1150 { 1151 // <ZThread> global PIApplication event loop synchronisation 1152 ZSync zs(thr_glsyn, 2); 1153 1095 1154 PIDrawer *eld=CurrentElDrawer(); 1096 1155 if (eld == NULL) return; … … 1407 1466 int nlx = 0; 1408 1467 bool fgx = false; 1409 if ( mCmd) fgx = mCmd->isRunning(nlx);1468 if ( CmdInterpreter() ) fgx = CmdInterpreter()->isRunning(nlx); 1410 1469 if (!fgx) { 1411 1470 lab = "PIACmdThread Idle"; … … 1547 1606 1548 1607 case 10100 : 1549 mCmd->ShowHelpWindow();1608 CmdInterpreter()->ShowHelpWindow(); 1550 1609 break; 1551 1610 … … 1603 1662 cmd += nomobj; cmd += " "; cmd += afname; 1604 1663 try { 1605 mCmd->Interpret(cmd); 1664 CmdInterpreter()->AddInputLine(cmd); 1665 // mCmd->Interpret(cmd); 1606 1666 } 1607 1667 catch ( PThrowable & exc ) { … … 1705 1765 1706 1766 case 10304 : 1707 mCmd->ShowCxxExecWindow();1767 CmdInterpreter()->ShowCxxExecWindow(); 1708 1768 break; 1709 1769 … … 1981 2041 break; 1982 2042 case 10606: 1983 mCmd->ShowCxxOptionWindow();2043 CmdInterpreter()->ShowCxxOptionWindow(); 1984 2044 break; 1985 2045 default:
Note:
See TracChangeset
for help on using the changeset viewer.