T O P I C R E V I E W |
peter.cook |
Posted - 01/07/2004 : 6:04:52 PM Hi,
I would like to load c files on opening an Origin project as specified in a command line. The OPJ file is the same always but the C file may be different. I have tried using def endopen as defined in different cnf files eg in testn.cnf
def EndOpen {
if(run.LoadOC(AZ\testn.C)!=0) type -b "Failed to load testn.C";
};
then opening via a command line such as
...\origin75.exe -a testn.cnf Test.opj
The problem is that testn fails to compile but running endopen from script window after project has loaded works fine..
Cheers,
Pete
|
6 L A T E S T R E P L I E S (Newest First) |
peter.cook |
Posted - 01/22/2004 : 05:28:29 AM Hi Mike,
Apologies for late eacknowledgement - I have used now as you described. Seems a bit daft now I think of it...why else have multiple system events?
Cheers,
Pete
|
Mike Buess |
Posted - 01/16/2004 : 11:41:37 AM Hi Pete,
If by event handlers you mean OEvents, you can use it on menu level 3 by adding the line 'ogs3=OEvents' to the Config section of Origin.ini.
Mike Buess Origin WebRing Member |
peter.cook |
Posted - 01/16/2004 : 10:03:54 AM Hi Mike,
Thanks. One problem I had was that the origin event handlers only work with menu level 1 - in the past our customised menus have always been set with level 3. Have found another problem (http://www.originlab.com/forum/topic.asp?TOPIC_ID=2828 with attached files.
Cheers,
pete
|
Mike Buess |
Posted - 01/15/2004 : 6:16:20 PM Hi Pete,
I ran a test with EndOpen and OEvents...
# Macros.cnf def EndOpen { ty -a EndOpen; };
# OEvents.ogs [BeforeUserCNF] // This event is triggered before any user CNF file is executed. // Execution of system CNF files takes place earlier // so system.cnf, option.cnf, and orgsys.cnf are executed // before this event is triggered. ty -a BeforeUserCNF;
[AfterUserCNF] // This event is triggered after all user CNF files are executed. ty -a AfterUserCNF;
[BeforeCompileSystem] // This event is triggered before Origin begins start up compilation of system folder. ty -a BeforeCompileSystem;
[AfterCompileSystem] // This event is triggered after Origin finishes startup compilation of system folder. // Use this event for additional customization of Origin that requires Origin C functions // that are compiled on startup. // %1 = 1 if compilation is successful otherwise %1 = 0. ty -a AfterCompileSystem;
[BeforeOpenDoc] // This event is triggered before Origin project is opened. // %1 = file path in quotes. ty -a BeforeOpenDoc;
[AfterOpenDoc] // This event is triggered after Origin project is opened. // %1 = file path in quotes. ty -a AfterOpenDoc;
After starting Origin by naming Origin.opj on the command line my script window looked like this after removing the line returns...
BeforeUserCNF AfterUserCNF BeforeOpenDoc AfterOpenDoc BeforeCompileSystem EndOpen AfterCompileSystem
The AfterOpenDoc, BeforeCompileSystem and EndOpen messages appear almost simultaneously, but always in that order and there is the significant lag you spoke of before AfterCompileSystem appears. In any case, it certainly looks like the project is opened before the system files start compiling.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 01/15/2004 6:19:19 PM |
peter.cook |
Posted - 01/15/2004 : 12:40:41 PM Hi Mike,
Thanks for pointer.
Worked fine. I was confused that endopen runs / project is opened before system files compiled. I would have expected this to be the other way ie project BUT I have noticed a significant lag before AfterCompileSystem section runs. Is the project really opened before system files start compiling? Anyone?
Cheers,
Pete
|
Mike Buess |
Posted - 01/08/2004 : 11:56:51 AM Hi Pete,
Generally the system files have to be ready before you can compile anything else and it appears that EndOpen runs before the system files are compiled. You might need to use OEvents.ogs to compile your file. Assuming that you run on menu level 1 (Full Menus) you can try this...
1> Close Origin and open Origin.ini in notepad. Find this line...
; ogs1 = OEvents
under the [Config] section, remove the semicolon and save.
2> Open OEvents.ogs in notepad and add this line to the [AfterCompileSystem] section...
if( %1 ) EndOpen;
That will run EndOpen again after the system files have been (successfully) compiled. It's easy enough to try at least.
Mike Buess Origin WebRing Member |