Commit 38050c8b authored by claes's avatar claes

Work on merge of methods

parent ca23563e
/* /*
* Proview $Id: co_merge.c,v 1.2 2006-02-08 11:32:13 claes Exp $ * Proview $Id: co_merge.c,v 1.3 2006-02-08 13:53:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -122,6 +122,11 @@ int main( int argc, char *argv[]) ...@@ -122,6 +122,11 @@ int main( int argc, char *argv[])
break; break;
} }
case merge_eMtype_WbBase: { case merge_eMtype_WbBase: {
strcpy( cfile, "$pwre_broot/$pwre_target/bld/lib/wb/wb_i_base_methods.c");
strcpy( ofile, "$pwre_broot/$pwre_target/bld/lib/wb/wb_i_base_methods.o");
dcli_translate_filename( cfile, cfile);
dcli_translate_filename( ofile, ofile);
strcpy( cfile, "/tmp/wb_i_base_methods.c"); strcpy( cfile, "/tmp/wb_i_base_methods.c");
strcpy( ofile, "/tmp/wb_i_base_methods.o"); strcpy( ofile, "/tmp/wb_i_base_methods.o");
...@@ -148,12 +153,14 @@ int main( int argc, char *argv[]) ...@@ -148,12 +153,14 @@ int main( int argc, char *argv[])
dcli_translate_filename( incdir, "$pwr_einc"); dcli_translate_filename( incdir, "$pwr_einc");
sprintf( cmd, "gcc -c -I%s -DOS_LINUX -o %s %s", incdir, ofile, cfile); sprintf( cmd, "gcc -c -I%s -DOS_LINUX -o %s %s", incdir, ofile, cfile);
// printf( "co_merge: %s\n", cmd);
system( cmd); system( cmd);
sprintf( cmd, "ar r %s %s", outfile, cfile); sprintf( cmd, "ar r %s %s", outfile, ofile);
// printf( "co_merge: %s\n", cmd);
system(cmd); system(cmd);
// sprintf( cmd, "rm %s", ofile); // sprintf( cmd, "rm %s", ofile);
// system(cmd); // system(cmd);
// sprintf( cmd, "rm %s", cfile); sprintf( cmd, "rm %s", cfile);
// system(cmd); system(cmd);
return 1; return 1;
} }
/* /*
* Proview $Id: rt_io_comm.c,v 1.3 2005-09-01 14:57:48 claes Exp $ * Proview $Id: rt_io_comm.c,v 1.4 2006-02-08 13:53:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -55,7 +55,16 @@ ...@@ -55,7 +55,16 @@
static pwr_sClass_IOHandler* init(qcom_sQid*, lst_sEntry**); static pwr_sClass_IOHandler* init(qcom_sQid*, lst_sEntry**);
int main() static void usage()
{
printf( "\
rt_io_comm I/O Communication program\n\
\n\
-m Print loaded I/O methods\n\
\n");
}
int main (int argc, char **argv)
{ {
pwr_tStatus sts = 1; pwr_tStatus sts = 1;
io_tCtx io_ctx; io_tCtx io_ctx;
...@@ -74,6 +83,17 @@ int main() ...@@ -74,6 +83,17 @@ int main()
lst_sEntry *csup_lh; lst_sEntry *csup_lh;
int delay_action = 0; int delay_action = 0;
if ( argc > 1) {
if ( strcmp( argv[1], "-m") == 0) {
io_methods_print();
exit(0);
}
if ( strcmp( argv[1], "-h") == 0) {
usage();
exit(0);
}
}
ihp = init(&qid, &csup_lh); ihp = init(&qid, &csup_lh);
plc_UtlWaitForPlc(); plc_UtlWaitForPlc();
......
/* /*
* Proview $Id: rt_io_base.c,v 1.17 2005-12-30 15:36:36 claes Exp $ * Proview $Id: rt_io_base.c,v 1.18 2006-02-08 13:53:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -2704,3 +2704,35 @@ void io_ConvertAit ( ...@@ -2704,3 +2704,35 @@ void io_ConvertAit (
*actvalue_p = Intercept + sigvalue * Slope; *actvalue_p = Intercept + sigvalue * Slope;
} }
/*----------------------------------------------------------------------------*\
Print io methods
\*----------------------------------------------------------------------------*/
void io_methods_print()
{
int i, j;
printf( "Base Methods\n");
for ( i = 0;; i++) {
if (pwr_gBase_IoClassMethods[i].ClassName[0] == 0)
break;
printf( " %3d %-20s ", i, pwr_gBase_IoClassMethods[i].ClassName);
for ( j = 0;; j++) {
if ((*pwr_gBase_IoClassMethods[i].Methods)[j].MethodName[0] == '\0')
break;
printf( "%s ", (*pwr_gBase_IoClassMethods[i].Methods)[j].MethodName);
}
printf( "\n");
}
printf( "\nUser Methods\n");
for ( i = 0;; i++) {
if (pwr_gUser_IoUserClassMethods[i].ClassName[0] == 0)
break;
printf( " %3d %-20s ", i, pwr_gUser_IoUserClassMethods[i].ClassName);
for ( j = 0;; j++) {
if ((*pwr_gUser_IoUserClassMethods[i].Methods)[j].MethodName[0] == '\0')
break;
printf( "%s ", (*pwr_gUser_IoUserClassMethods[i].Methods)[j].MethodName);
}
printf( "\n");
}
}
/* /*
* Proview $Id: rt_io_base.h,v 1.6 2005-12-30 15:36:36 claes Exp $ * Proview $Id: rt_io_base.h,v 1.7 2006-02-08 13:53:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -248,4 +248,7 @@ int io_CheckClassIoType( ...@@ -248,4 +248,7 @@ int io_CheckClassIoType(
io_eType type, io_eType type,
pwr_tCid cid pwr_tCid cid
); );
void io_methods_print();
#endif #endif
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
"build_all", "build_all:usage_build_all", "build_all", "build_all:usage_build_all",
"build_kernel", "build_kernel:usage_build_kernel", "build_kernel", "build_kernel:usage_build_kernel",
"build_all_modules", "build_all_modules:usage_build_all_modules", "build_all_modules", "build_all_modules:usage_build_all_modules",
"method_build", "method_build:usage_method_build",
"copy", "copy:usage_copy", "copy", "copy:usage_copy",
"create", "create:usage_create", "create", "create:usage_create",
"create_all_modules", "create_all_modules:usage_create_all_modules", "create_all_modules", "create_all_modules:usage_create_all_modules",
...@@ -246,15 +247,21 @@ sub build_all_modules () ...@@ -246,15 +247,21 @@ sub build_all_modules ()
_module("telemecanique"); _module("telemecanique");
build_all(); build_all();
merge(); merge();
method_build();
}
sub method_build ()
{
printf("-- Relink method dependent programs"); printf("-- Relink method dependent programs");
_module("rt"); _module("rt");
$ENV{"export_type"} = "exp"; $ENV{"export_type"} = "exp";
my($exe_dir) = $ENV{"pwr_exe"}; my($exe_dir) = $ENV{"pwr_exe"};
system("rm $exe_dir/rt_io_comm"); system("rm $exe_dir/rt_io_comm");
_build("exe", "rt_io_comm", "all"); _build("exe", "rt_io_comm", "all");
system("rm $exe_dir/rt_ini"); # system("rm $exe_dir/rt_ini");
_build("exe", "rt_ini", "all"); # _build("exe", "rt_ini", "all");
merge(); merge();
_module("wb"); _module("wb");
...@@ -389,6 +396,7 @@ sub build_all () ...@@ -389,6 +396,7 @@ sub build_all ()
} }
if ( $exe == 1) { if ( $exe == 1) {
_build("exe", "rt*", "all"); _build("exe", "rt*", "all");
_build("exe", "pwr_user", "all");
_build("exp", "ge", "all"); _build("exp", "ge", "all");
_build("mmi", "*", "copy"); _build("mmi", "*", "copy");
_build("wbl", "pwrs", "lib"); _build("wbl", "pwrs", "lib");
...@@ -931,6 +939,12 @@ sub usage_build_all_modules () ...@@ -931,6 +939,12 @@ sub usage_build_all_modules ()
printf("++ build_all_modules : Builds all in all modules\n"); printf("++ build_all_modules : Builds all in all modules\n");
} }
sub usage_method_build ()
{
printf("++\n");
printf("++ method_build : Rebuild method dependent programs\n");
}
sub usage_create_all_modules () sub usage_create_all_modules ()
{ {
printf("++\n"); printf("++\n");
......
/* /*
* Proview $Id: wb_erep.cpp,v 1.43 2005-12-27 09:32:43 claes Exp $ * Proview $Id: wb_erep.cpp,v 1.44 2006-02-08 13:53:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -897,6 +897,35 @@ void wb_erep::bindMethods() ...@@ -897,6 +897,35 @@ void wb_erep::bindMethods()
#endif #endif
} }
void wb_erep::printMethods()
{
int i, j;
printf("System Methods\n");
for (i = 0;; i++) {
if (pwr_gSystem_ClassMethods[i].ClassName[0] == '\0')
break;
printf( "%3d %-20s\n", i, pwr_gSystem_ClassMethods[i].ClassName);
for (j = 0;; j++) {
if ((*pwr_gSystem_ClassMethods[i].Methods)[j].MethodName[0] == '\0')
break;
printf( " %s\n", (*pwr_gSystem_ClassMethods[i].Methods)[j].MethodName);
}
}
printf( "Base Methods\n");
for (i = 0;; i++) {
if (pwr_gBase_ClassMethods[i].ClassName[0] == '\0') break;
printf( "%3d %-20s\n", i, pwr_gBase_ClassMethods[i].ClassName);
for (j = 0;; j++) {
if ((*pwr_gBase_ClassMethods[i].Methods)[j].MethodName[0] == '\0')
break;
printf( " %s\n", (*pwr_gBase_ClassMethods[i].Methods)[j].MethodName);
}
}
}
int wb_erep::nextVolatileVid( pwr_tStatus *sts, char *name) int wb_erep::nextVolatileVid( pwr_tStatus *sts, char *name)
{ {
pwr_tVid vid = ldh_cVolatileVolMin + m_volatile_idx++; pwr_tVid vid = ldh_cVolatileVolMin + m_volatile_idx++;
......
/* /*
* Proview $Id: wb_erep.h,v 1.22 2005-12-15 07:41:17 claes Exp $ * Proview $Id: wb_erep.h,v 1.23 2006-02-08 13:53:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -95,6 +95,7 @@ public: ...@@ -95,6 +95,7 @@ public:
void setRefMerep( wb_merep *merep); void setRefMerep( wb_merep *merep);
void resetRefMerep(); void resetRefMerep();
bool refMerepOccupied() { return m_ref_merep_occupied;} bool refMerepOccupied() { return m_ref_merep_occupied;}
void printMethods();
static void volumeNameToFilename( pwr_tStatus *sts, char *name, char *filename); static void volumeNameToFilename( pwr_tStatus *sts, char *name, char *filename);
......
/* /*
* Proview $Id: wb_wnav_command.cpp,v 1.37 2005-12-30 15:36:36 claes Exp $ * Proview $Id: wb_wnav_command.cpp,v 1.38 2006-02-08 13:53:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -1902,6 +1902,12 @@ static int wnav_show_func( void *client_data, ...@@ -1902,6 +1902,12 @@ static int wnav_show_func( void *client_data,
} }
return sts; return sts;
} }
else if ( strncmp( arg1_str, "METHODS", strlen( arg1_str)) == 0)
{
// Command is "SHOW METHODS"
wb_erep *erep = *(wb_env *)wnav->wbctx;
erep->printMethods();
}
else else
{ {
wnav->message('E', "Unknown qualifier"); wnav->message('E', "Unknown qualifier");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment