Commit a53155ac authored by Claes Sjofors's avatar Claes Sjofors

Wb method for class AppGraph

parent 3943f047
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2012 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
/* wb_c_appgraph.c -- work bench methods of the AppGraph class. */
#undef Status
#include "wb_pwrs.h"
#include "pwr_baseclasses.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "wb_wtt.h"
#include "wb_pwrb_msg.h"
#include "wb_wsx.h"
#include "wb_wsx_msg.h"
#include "wb_build.h"
#include "co_cdh.h"
/*----------------------------------------------------------------------------*\
To open Ge.
\*----------------------------------------------------------------------------*/
static pwr_tStatus OpenGraph (
ldh_sMenuCall *ip
)
{
int sts;
char *action;
int size;
char graph_name[80];
sts = ldh_GetObjectPar( ip->PointedSession, ip->Pointed.Objid, "RtBody",
"Name", &action, &size);
if ( EVEN(sts)) return sts;
cdh_ToLower( graph_name, action);
free( (char *)action);
ip->wtt->ge_new( graph_name);
return 1;
}
static pwr_tStatus Build (
ldh_sMenuCall *ip
)
{
wb_build build( *(wb_session *)ip->PointedSession, ip->wnav);
build.opt = ip->wnav->gbl.build;
build.appgraph( ip->Pointed.Objid);
if ( build.sts() == PWRB__NOBUILT)
ip->wnav->message( 'I', "Nothing to build");
return build.sts();
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods(AppGraph) = {
pwr_BindMethod(OpenGraph),
pwr_BindMethod(Build),
pwr_NullMethod
};
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