Commit e0c5ad1c authored by claes's avatar claes

Build methods

parent e7b3539b
......@@ -7,3 +7,11 @@
not in edit mode.
060221 cs wnav Popupmenu for object with DevBody only could not be opened.
060223 cs wnav New wizard for configuration of directory volume.
060227 cs wnav Check before creating a toplevel object if class is a valid
in the current window.
060331 cs wtt Configuration wizard started when entering an empty directoryvolume.
060331 cs wtt Build methods added. 'Compile', 'create loadfile' and 'create bootfile'
replaced by 'build object', 'build volume' and 'build node'.
'build object', 'build volume' and 'build node' also available as wtt
commands.
060331 cs wtt Copy with keep references added to wtt menu.
......@@ -7,7 +7,7 @@ ifeq ($(export_type),exp)
$(pwr_eobj)/rt_io_user.o $(pwr_obj)/wb_provider.o \
-L/usr/X11R6/lib -L/usr/local/BerkeleyDB.4.0/lib \
-L/opt/gnome/lib \
-lpwr_wb -lpwr_pb -lpwr_rt -lpwr_ge -lpwr_flow -lpwr_glow -lpwr_co \
-lpwr_wb -lpwr_rt -lpwr_ge -lpwr_flow -lpwr_glow -lpwr_co \
-lpwr_msg_dummy -lantlr -lImlib -lMrm -lXm -lXpm -lXt -lX11 -lXext -lXp\
-lXmu -lSM -lICE\
-lrpcsvc -lpthread -lm -ldb_cxx -lz
......
/*
* Proview $Id: wb_c_plcpgm.c,v 1.4 2005-09-06 10:43:31 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
/* wb_c_plcpgm.c -- work bench methods of the PlcPgm class. */
#include <X11/Intrinsic.h>
#undef Status
#include "wb_pwrs.h"
#include "pwr_baseclasses.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "wb_foe_api.h"
#include "wb_pwrb_msg.h"
#include "wb_wsx.h"
#include "wb_wsx_msg.h"
/*----------------------------------------------------------------------------*\
To open a PLC program with the PLC editor.
\*----------------------------------------------------------------------------*/
static pwr_tStatus OpenProgram (
ldh_sMenuCall *ip
)
{
foe_Open (ip->EditorContext, ip->WindowContext, ip->PointedSession,
ip->Pointed.Objid);
return 1;
}
/*----------------------------------------------------------------------------*\
Syntax check.
\*----------------------------------------------------------------------------*/
static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session,
pwr_tObjid Object, /* current object */
int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */
) {
pwr_tStatus sts;
pwr_tObjid *ThreadObjectPtr;
int size;
pwr_tObjid child;
pwr_tClassId class;
/*
Check that ScanTime is set to something.
*/
sts = ldh_GetObjectPar( Session,
Object,
"RtBody",
"ThreadObject",
(char **)&ThreadObjectPtr, &size);
if ( EVEN(sts)) return sts;
sts = ldh_GetObjectClass ( Session, *ThreadObjectPtr, &class);
if ( EVEN(sts))
wsx_error_msg( Session, WSX__PLCTHREAD, Object, ErrorCount, WarningCount);
else if ( class != pwr_cClass_PlcThread)
wsx_error_msg( Session, WSX__PLCTHREAD, Object, ErrorCount, WarningCount);
free( (char *)ThreadObjectPtr);
/*
Check that the child is a plcwindow.
*/
sts = ldh_GetChild( Session, Object, &child);
if (EVEN(sts))
{
wsx_error_msg( Session, WSX__PLCWIND, Object, ErrorCount, WarningCount);
}
else
{
sts = ldh_GetObjectClass( Session, child, &class);
if (EVEN(sts)) return sts;
if ( class != pwr_cClass_windowplc)
wsx_error_msg( Session, WSX__PLCCHILD, Object, ErrorCount, WarningCount);
sts = ldh_GetNextSibling( Session, child, &child);
if ( ODD(sts))
wsx_error_msg( Session, WSX__PLCCHILD, Object, ErrorCount, WarningCount);
}
return PWRB__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods(PlcPgm) = {
pwr_BindMethod(OpenProgram),
pwr_BindMethod(SyntaxCheck),
pwr_NullMethod
};
/*
* Proview $Id: wb_c_rootvolume.c,v 1.3 2005-09-06 10:43:31 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
/* wb_c_rootvolume.c -- work bench methods of the RootVolume class. */
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_ldh.h"
#include "wb_wsx.h"
/*----------------------------------------------------------------------------*\
Syntax check.
\*----------------------------------------------------------------------------*/
static pwr_tStatus SyntaxCheck (
ldh_tSesContext Session,
pwr_tObjid Object, /* current object */
int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */
) {
pwr_tStatus sts;
sts = wsx_CheckVolume( Session, Object, ErrorCount, WarningCount);
if ( EVEN(sts)) return sts;
return PWRS__SUCCESS;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods($RootVolume) = {
pwr_BindMethod(SyntaxCheck),
pwr_NullMethod
};
/*
* Proview $Id: wb_c_webhandler.c,v 1.3 2005-09-06 10:43:31 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
/* wb_c_webhandler.c -- work bench methods of the WebHandler class. */
#include "wb_pwrs.h"
#include "wb_pwrs_msg.h"
#include "wb_ldh.h"
static pwr_tStatus PostCreate (
ldh_tSesContext Session,
pwr_tOid Object,
pwr_tOid Father,
pwr_tCid Class
) {
pwr_tOid oid;
pwr_tCid cid;
pwr_tStatus sts;
pwr_tInt32 *number;
pwr_tInt32 max_number = 0;
int size;
sts = ldh_ClassNameToId(Session, &cid, "OpPlace");
if ( EVEN(sts)) return sts;
// Get next OpNumber
sts = ldh_GetClassList(Session, cid, &oid);
while ( ODD(sts)) {
sts = ldh_GetObjectPar(Session, oid, "RtBody", "OpNumber", (char **)&number,
&size);
if ( EVEN(sts)) return sts;
if ( *number > max_number)
max_number = *number;
free( (char *) number);
sts = ldh_GetNextObject(Session, oid, &oid);
}
sts = ldh_ClassNameToId(Session, &cid, "User");
if ( EVEN(sts)) return sts;
sts = ldh_GetClassList(Session, cid, &oid);
while ( ODD(sts)) {
sts = ldh_GetObjectPar(Session, oid, "RtBody", "OpNumber", (char **)&number,
&size);
if ( EVEN(sts)) return sts;
if ( *number > max_number)
max_number = *number;
free( (char *) number);
sts = ldh_GetNextObject(Session, oid, &oid);
}
max_number++;
sts = ldh_CreateObject(Session, &oid, "User", cid, Object, ldh_eDest_IntoLast);
if ( EVEN(sts)) return sts;
sts = ldh_SetObjectPar(Session, oid, "RtBody", "OpNumber", (char *)&max_number,
sizeof(max_number));
if ( EVEN(sts)) return sts;
sts = ldh_SetObjectPar(Session, Object, "RtBody", "UserObject", (char *)&oid,
sizeof(oid));
if ( EVEN(sts)) return sts;
return PWRS__SUCCESS;
}
pwr_dExport pwr_BindMethods(WebHandler) = {
pwr_BindMethod(PostCreate),
pwr_NullMethod
};
/*
* Proview $Id: wb_c_xttgraph.c,v 1.5 2005-09-06 10:43:31 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
/* wb_c_xttgraph.c -- work bench methods of the XttGraph class. */
#include <X11/Intrinsic.h>
#undef Status
#include "wb_pwrs.h"
#include "pwr_baseclasses.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "ge.h"
#include "wb_pwrb_msg.h"
#include "wb_wsx.h"
#include "wb_wsx_msg.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",
"Action", &action, &size);
if ( EVEN(sts)) return sts;
cdh_ToLower( graph_name, action);
free( (char *)action);
if ( strstr( graph_name, ".pwg"))
{
ge_new( NULL, ip->WindowContext, ip->PointedSession, 0, graph_name);
return 1;
}
return PWRB__GRAPHACTION;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods(XttGraph) = {
pwr_BindMethod(OpenGraph),
pwr_NullMethod
};
/*
* Proview $Id: wb_foe_api.h,v 1.3 2005-09-06 10:43:31 claes Exp $
* Proview $Id: wb_foe_api.h,v 1.4 2006-03-31 14:29:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -23,6 +23,10 @@
/* wb_foe_api.h -- functional object editor
This module contains the api for the Functional Object Editor (PLC). */
#if defined __cplusplus
extern "C" {
#endif
#include "pwr_class.h"
#include "wb_ldh.h"
......@@ -41,4 +45,7 @@ foe_Close (
foe_tContext FoeContext
);
#if defined __cplusplus
}
#endif
#endif
/*
* Proview $Id: wb_gcg.c,v 1.29 2006-01-10 06:29:29 claes Exp $
* Proview $Id: wb_gcg.c,v 1.30 2006-03-31 14:29:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -2233,6 +2233,7 @@ int gcg_wind_comp_all(
int *loaded_list;
int loaded_windcount;
pwr_tObjid parent;
pwr_tStatus sumsts = GSX__SUCCESS;
sts = trv_get_window_windows( ldhses, window, &wind_count,
&windlist);
......@@ -2392,6 +2393,7 @@ int gcg_wind_comp_all(
&warningcount, 1, debug);
if ( sts == GSX__PLCWIND_ERRORS || sts == GSX__AMBIGOUS_EXECUTEORDER) {
/* continue */
sumsts = sts;
}
else if ( EVEN(sts)) return sts;
else
......@@ -2422,6 +2424,7 @@ int gcg_wind_comp_all(
debug);
if ( sts == GSX__PLCPGM_ERRORS) {
/* continue */
sumsts = sts;
}
else if ( EVEN(sts)) return sts;
}
......@@ -2451,7 +2454,9 @@ int gcg_wind_comp_all(
XtFree((char *) loaded_windlist);
XtFree((char *) loaded_list);
return GSX__SUCCESS;
if ( !wind_compiled)
return GSX__NOMODIF;
return sumsts;
}
......
/*
* Proview $Id: wb_i_system_methods.c,v 1.6 2005-09-06 10:43:31 claes Exp $
* Proview $Id: wb_i_system_methods.c,v 1.7 2006-03-31 14:29:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -33,6 +33,8 @@ pwr_dImport pwr_BindMethods($ClassHier);
pwr_dImport pwr_BindMethods($Attribute);
pwr_dImport pwr_BindMethods($ObjBodyDef);
pwr_dImport pwr_BindMethods($AttrRef);
pwr_dImport pwr_BindMethods($PlantHier);
pwr_dImport pwr_BindMethods($NodeHier);
pwr_dExport pwr_BindClasses(System) = {
pwr_BindClass($AttrXRef),
......@@ -47,5 +49,7 @@ pwr_dExport pwr_BindClasses(System) = {
pwr_BindClass($Attribute),
pwr_BindClass($ObjBodyDef),
pwr_BindClass($AttrRef),
pwr_BindClass($PlantHier),
pwr_BindClass($NodeHier),
pwr_NullClass
};
/*
* Proview $Id: wb_ldh.cpp,v 1.52 2006-02-23 14:39:36 claes Exp $
* Proview $Id: wb_ldh.cpp,v 1.53 2006-03-31 14:29:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -259,6 +259,19 @@ ldh_CallMenuMethod(ldh_sMenuCall *mcp, int index)
return sp->callMenuMethod( mcp, index);
}
pwr_tStatus
ldh_GetMethod( ldh_tSession Session, char *Name, wb_tMethod *method)
{
pwr_tStatus sts;
wb_session *sp = (wb_session *)Session;
wb_erep *erep = sp->env();
erep->method( &sts, Name, method);
return sts;
}
pwr_tStatus
ldh_ChangeObjectName(ldh_tSession session, pwr_tOid oid, char *name)
{
......@@ -1253,22 +1266,12 @@ pwr_tStatus
ldh_ArefANameToAref(ldh_tSession session, pwr_sAttrRef *arp, char *aname, pwr_sAttrRef *oarp)
{
wb_session *sp = (wb_session *)session;
pwr_tAName name;
wb_attribute a = sp->attribute(arp);
if (!a) return a.sts();
try {
strcpy( name, a.longName().name(cdh_mName_volumeStrict));
}
catch ( wb_error& e) {
return e.sts();
}
strcat( name, ".");
strcat( name, aname);
wb_attribute oa = sp->attribute(name);
if (!oa) return oa.sts();
wb_attribute oa( a, 0, aname);
oa.aref(oarp);
return oa.sts();
......
/*
* Proview $Id: wb_ldh.h,v 1.33 2005-12-20 11:57:29 claes Exp $
* Proview $Id: wb_ldh.h,v 1.34 2006-03-31 14:29:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -69,6 +69,7 @@ typedef void *ldh_tWorkbench;
typedef ldh_tWorkbench ldh_tWBContext;
typedef void *ldh_tVolume;
typedef ldh_tVolume ldh_tVolContext;
typedef pwr_tStatus (* wb_tMethod)();
typedef struct ldh_s_Event ldh_sEvent;
typedef struct ldh_s_MenuItem ldh_sMenuItem;
......@@ -328,10 +329,10 @@ struct ldh_s_MenuCall {
void *WindowContext;
ldh_eMenuSet PointedSet;
ldh_tSession PointedSession;
pwr_sAttrRef Pointed;
pwr_tAttrRef Pointed;
ldh_eMenuSet SelectedSet;
ldh_tSession SelectedSession;
pwr_sAttrRef *Selected;
pwr_tAttrRef *Selected;
pwr_tUInt32 SelectCount;
ldh_sMenuItem *ItemList;
pwr_tUInt32 ItemCount;
......@@ -431,6 +432,11 @@ pwr_tStatus ldh_CallMenuMethod (
int Index
);
pwr_tStatus ldh_GetMethod(
ldh_tSession Session,
char *Name,
wb_tMethod *method);
pwr_tStatus ldh_ChangeObjectName (
ldh_tSession Session,
pwr_tObjid object,
......
/*
* Proview $Id: wb_pwrs.h,v 1.5 2005-09-06 10:43:31 claes Exp $
* Proview $Id: wb_pwrs.h,v 1.6 2006-03-31 14:29:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -71,7 +71,6 @@ typedef struct {
Prototypes for DbCallbacks
\*----------------------------------------------------------------------------*/
typedef pwr_tStatus (* wb_tMethod)();
typedef pwr_tStatus (* wb_tMethodMenu)( ldh_sMenuCall *);
typedef pwr_tStatus (* wb_tMethodMenuFilter)( ldh_sMenuCall *, pwr_sMenuButton *);
typedef pwr_tStatus (* wb_tMethodAnteCreate) (ldh_tSesContext, pwr_tOid, pwr_tCid);
......
/*
* Proview $Id: wb_session.cpp,v 1.19 2005-10-07 05:57:29 claes Exp $
* Proview $Id: wb_session.cpp,v 1.20 2006-03-31 14:29:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -971,6 +971,27 @@ bool wb_session::disableAttribute( pwr_sAttrRef *arp, pwr_tDisableAttr disable)
return true;
}
bool wb_session::commit()
{
// Store time in volume object
pwr_tOid oid = pwr_cNOid;
pwr_tTime time;
clock_gettime(CLOCK_REALTIME, &time);
oid.vid = m_vrep->vid();
wb_orep *orep = m_vrep->object( &m_sts, oid);
if ( oddSts()) {
orep->ref();
wb_attribute modtime(m_sts, orep, "SysBody", "Modified");
if ( modtime.oddSts())
writeAttribute( modtime, &time);
orep->unref();
}
return m_srep->commit(&m_sts);
}
......
/*
* Proview $Id: wb_session.h,v 1.10 2005-10-07 05:57:29 claes Exp $
* Proview $Id: wb_session.h,v 1.11 2006-03-31 14:29:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -120,10 +120,10 @@ inline bool wb_session::isReadonly()
return m_srep->isReadonly(&m_sts);
}
inline bool wb_session::commit()
{
return m_srep->commit(&m_sts);
}
// inline bool wb_session::commit()
// {
// return m_srep->commit(&m_sts);
// }
inline bool wb_session::abort()
{
......
/*
* Proview $Id: wb_uted.h,v 1.3 2005-09-06 10:43:32 claes Exp $
* Proview $Id: wb_uted.h,v 1.4 2006-03-31 14:29:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -20,6 +20,10 @@
#ifndef wb_uted_h
#define wb_uted_h
#if defined __cplusplus
extern "C" {
#endif
#ifndef wb_ldh_h
#include "wb_ldh.h"
#endif
......@@ -124,4 +128,8 @@ void uted_set_editmode (
int edit,
ldh_tSesContext ldhses
);
#if defined __cplusplus
}
#endif
#endif
/*
* Proview $Id: wb_utl.c,v 1.21 2005-11-22 12:26:58 claes Exp $
* Proview $Id: wb_utl.c,v 1.22 2006-03-31 14:29:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -5430,7 +5430,7 @@ int utl_compile (
pwr_tClassId *class_ptr;
pwr_tClassId class_vect[2];
ldh_sSessInfo info;
int status;
int status = GSX__NOMODIF;
int other_volume_attached;
ldh_tVolContext volctx;
ldh_tSesContext l_ldhses;
......@@ -5442,6 +5442,7 @@ int utl_compile (
int thisvolume;
pwr_tVolumeId current_volid;
ldh_sVolumeInfo volinfo;
int access;
/* Check that the utilily session is saved */
sts = ldh_GetSessionInfo( ldhses, &info);
......@@ -5451,6 +5452,7 @@ int utl_compile (
/* To be able to compile the windows, the session has to
be set to ReadOnly */
access = info.Access;
sts = ldh_SetSession( ldhses, ldh_eAccess_ReadOnly);
if ( EVEN(sts)) return sts;
......@@ -5642,7 +5644,8 @@ int utl_compile (
status = sts;
goto error_return;
}
else if ( sts == GSX__NOMODIF)
status = sts;
list_ptr = list_ptr->next;
}
utl_objidlist_free( plcpgmlist);
......@@ -5686,6 +5689,8 @@ int utl_compile (
status = sts;
goto error_return;
}
else if ( sts != GSX__NOMODIF)
status = sts;
}
if ( windowname != NULL)
......@@ -5721,16 +5726,18 @@ int utl_compile (
status = sts;
goto error_return;
}
else if ( sts != GSX__NOMODIF)
status = sts;
}
/* Return to session access ReadWrite */
sts = ldh_SetSession( ldhses, ldh_eAccess_ReadWrite);
sts = ldh_SetSession( ldhses, access);
if ( EVEN(sts)) return sts;
return FOE__SUCCESS;
return status;
error_return:
sts = ldh_SetSession( ldhses, ldh_eAccess_ReadWrite);
sts = ldh_SetSession( ldhses, access);
if ( EVEN(sts)) return sts;
return status;
......
/*
* Proview $Id: wb_watt.cpp,v 1.9 2005-09-06 10:43:32 claes Exp $
* Proview $Id: wb_watt.cpp,v 1.10 2006-03-31 14:29:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -458,6 +458,8 @@ WAtt::WAtt(
Arg args[20];
pwr_tStatus sts;
char title[80];
char *title_p;
int size;
int i;
MrmHierarchy s_DRMh;
MrmType dclass;
......@@ -497,6 +499,11 @@ WAtt::WAtt(
dcli_translate_filename( uid_filename, uid_filename);
// Compose a title
sts = ldh_AttrRefToName( ldhses, &aref, cdh_mName_path | cdh_mName_object | cdh_mName_attribute,
&title_p, &size);
strncpy( title, title_p, sizeof(title));
// Create object context
// attrctx->close_cb = close_cb;
// attrctx->redraw_cb = redraw_cb;
......@@ -504,8 +511,6 @@ WAtt::WAtt(
// Motif
MrmInitialize();
strcpy( title, "PwR Object attributes");
reglist[0].value = (caddr_t) this;
// Save the context structure in the widget
......@@ -518,7 +523,7 @@ WAtt::WAtt(
MrmRegisterNames(reglist, reglist_num);
parent_wid = XtCreatePopupShell("objectEditor",
parent_wid = XtCreatePopupShell( title,
topLevelShellWidgetClass, parent_wid, args, i);
sts = MrmFetchWidgetOverride( s_DRMh, "watt_window", parent_wid,
......@@ -547,7 +552,10 @@ WAtt::WAtt(
XtUnmanageChild( cmd_scrolled_ok);
XtUnmanageChild( cmd_scrolled_ca);
if ( *(wb_eUtility *)parent_ctx == wb_eUtility_WNav)
parent_ctx = ((WNav *)parent_ctx)->parent_ctx;
utility = *(wb_eUtility *)parent_ctx;
wattnav = new WAttNav( (void *)this, wattnav_form, "Plant",
ldhses, aref, wa_editmode, wa_advanced_user,
wa_display_objectname, utility, &brow_widget, &sts);
......
/*
* Proview $Id: wb_wnav.cpp,v 1.30 2005-12-20 11:59:04 claes Exp $
* Proview $Id: wb_wnav.cpp,v 1.31 2006-03-31 14:29:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -35,6 +35,7 @@ extern "C" {
#include "co_time.h"
#include "pwr_baseclasses.h"
#include "wb_wnav_msg.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "wb_login.h"
#include "wb_wccm.h"
......@@ -644,7 +645,7 @@ WNav::WNav(
wnav_eWindowType xn_type,
pwr_tStatus *status) :
parent_ctx(xn_parent_ctx), parent_wid(xn_parent_wid),
ctx_type(wb_eUtility_WNav), parent_ctx(xn_parent_ctx), parent_wid(xn_parent_wid),
window_type(xn_type), ldhses(xn_ldhses), wbctx(0),
brow(0), brow_cnt(0), trace_started(0),
message_cb(NULL), close_cb(NULL), map_cb(NULL), change_value_cb(NULL),
......@@ -1932,53 +1933,65 @@ static int wnav_brow_cb( FlowCtx *ctx, flow_tEvent event)
else
break;
if ( !sel_cnt)
{
if ( !sel_cnt) {
// Create object
sts = (wnav->get_palette_select_cb)( wnav->parent_ctx, &classid);
if ( EVEN(sts))
{
if ( EVEN(sts)) {
wnav->message('E', "Select a class");
break;
}
switch ( event->object.object_type)
{
case flow_eObjectType_Node:
brow_GetUserData( event->object.object, (void **)&item);
switch( item->type)
{
case wnav_eItemType_Object:
brow_MeasureNode( event->object.object, &ll_x, &ll_y,
&ur_x, &ur_y);
if ( event->object.x < ll_x + 1.0)
destcode = ldh_eDest_IntoFirst;
else
destcode = ldh_eDest_After;
sts = ldh_CreateObject( wnav->ldhses,
&objid,
0, classid, ((WItemObject *)item)->objid,
destcode);
if (EVEN(sts))
wnav->message(' ', wnav_get_message(sts));
break;
default:
;
}
break;
default:
// Create toplevel object
sts = ldh_CreateObject( wnav->ldhses, &objid,
0, classid, pwr_cNObjid, ldh_eDest_IntoLast);
if (EVEN(sts))
wnav->message(' ', wnav_get_message(sts));
switch ( event->object.object_type) {
case flow_eObjectType_Node:
brow_GetUserData( event->object.object, (void **)&item);
switch( item->type) {
case wnav_eItemType_Object:
brow_MeasureNode( event->object.object, &ll_x, &ll_y,
&ur_x, &ur_y);
if ( event->object.x < ll_x + 1.0)
destcode = ldh_eDest_IntoFirst;
else
destcode = ldh_eDest_After;
if ( destcode == ldh_eDest_After) {
// Check if toplevel object
sts = ldh_GetParent( wnav->ldhses, ((WItemObject *)item)->objid, &objid);
if ( sts == LDH__NO_PARENT) {
if ( ! wnav->check_toplevel_class( classid)) {
wnav->message('E', "Class is not a toplevel class in this window");
break;
}
}
}
sts = ldh_CreateObject( wnav->ldhses, &objid, 0, classid,
((WItemObject *)item)->objid,
destcode);
if (EVEN(sts))
wnav->message(' ', wnav_get_message(sts));
break;
default:
;
}
break;
default:
// Create toplevel object
// Check that this is a valid top object in this window
if ( ! wnav->check_toplevel_class( classid)) {
wnav->message('E', "Class is not a toplevel class in this window");
break;
}
sts = ldh_CreateObject( wnav->ldhses, &objid, 0, classid,
pwr_cNObjid, ldh_eDest_IntoLast);
if (EVEN(sts))
wnav->message(' ', wnav_get_message(sts));
}
}
else
{
else {
// Move object
if ( event->object.object_type == flow_eObjectType_Node)
{
if ( event->object.object_type == flow_eObjectType_Node) {
brow_MeasureNode( event->object.object, &ll_x, &ll_y,
&ur_x, &ur_y);
if ( event->object.x < ll_x + 1.0)
......@@ -1987,8 +2000,7 @@ static int wnav_brow_cb( FlowCtx *ctx, flow_tEvent event)
destcode = ldh_eDest_After;
brow_GetUserData( event->object.object, (void **)&item);
if ( item->type == wnav_eItemType_Object)
{
if ( item->type == wnav_eItemType_Object) {
sts = ldh_MoveObject( wnav->ldhses, sel_list->Objid,
item->objid, destcode);
if ( EVEN(sts)) {
......@@ -2330,6 +2342,18 @@ int WNav::setup()
new WItemLocal( this, "ShowTrueDb", "setup_show_truedb",
pwr_eType_Int32, sizeof( gbl.show_truedb), 0, 1,
(void *) &gbl.show_truedb, NULL, flow_eDest_IntoLast);
new WItemLocal( this, "Build.Force", "setup_build_force",
pwr_eType_Int32, sizeof( gbl.build.force), 0, 1,
(void *) &gbl.build.force, NULL, flow_eDest_IntoLast);
new WItemLocal( this, "Build.Debug", "setup_build_debug",
pwr_eType_Int32, sizeof( gbl.build.debug), 0, 1,
(void *) &gbl.build.debug, NULL, flow_eDest_IntoLast);
new WItemLocal( this, "Build.CrossReferences", "setup_build_cross",
pwr_eType_Int32, sizeof( gbl.build.crossref), 0, 1,
(void *) &gbl.build.crossref, NULL, flow_eDest_IntoLast);
new WItemLocal( this, "Build.Manual", "setup_build_manual",
pwr_eType_Int32, sizeof( gbl.build.manual), 0, 1,
(void *) &gbl.build.manual, NULL, flow_eDest_IntoLast);
brow_ResetNodraw( brow->ctx);
brow_Redraw( brow->ctx, 0);
......@@ -2357,7 +2381,8 @@ int WNavGbl::symbolfile_exec( void *wnav)
}
void WNav::set_options( int sh_class, int sh_alias, int sh_descrip,
int sh_objref, int sh_objxref, int sh_attrref, int sh_attrxref)
int sh_objref, int sh_objxref, int sh_attrref, int sh_attrxref,
int bu_force, int bu_debug, int bu_crossref, int bu_manual)
{
gbl.show_class = sh_class;
gbl.show_alias = sh_alias;
......@@ -2366,11 +2391,16 @@ void WNav::set_options( int sh_class, int sh_alias, int sh_descrip,
gbl.show_objxref = sh_objxref;
gbl.show_attrref = sh_attrref;
gbl.show_attrxref = sh_attrxref;
gbl.build.force = bu_force;
gbl.build.debug = bu_debug;
gbl.build.crossref = bu_crossref;
gbl.build.manual = bu_manual;
ldh_refresh( pwr_cNObjid);
}
void WNav::get_options( int *sh_class, int *sh_alias, int *sh_descrip,
int *sh_objref, int *sh_objxref, int *sh_attrref, int *sh_attrxref)
int *sh_objref, int *sh_objxref, int *sh_attrref, int *sh_attrxref,
int *bu_force, int *bu_debug, int *bu_crossref, int *bu_manual)
{
*sh_class = gbl.show_class;
*sh_alias = gbl.show_alias;
......@@ -2379,6 +2409,10 @@ void WNav::get_options( int *sh_class, int *sh_alias, int *sh_descrip,
*sh_objxref = gbl.show_objxref;
*sh_attrref = gbl.show_attrref;
*sh_attrxref = gbl.show_attrxref;
*bu_force = gbl.build.force;
*bu_debug = gbl.build.debug;
*bu_crossref = gbl.build.crossref;
*bu_manual = gbl.build.manual;
}
int WNav::save_settnings( ofstream& fp)
......@@ -2436,6 +2470,16 @@ int WNav::save_settnings( ofstream& fp)
if ( strcmp( gbl.symbolfilename, "") != 0)
fp << " set symbolfile /local \"" << gbl.symbolfilename << "\"" << endl;
if ( gbl.build.crossref)
fp << " set buildcrossref /local" << endl;
else
fp << " set nobuildcrossref /local" << endl;
if ( gbl.build.manual)
fp << " set buildmanual /local" << endl;
else
fp << " set nobuildmanual /local" << endl;
if ( window_type == wnav_eWindowType_W1)
fp << "endif" << endl;
else if ( window_type == wnav_eWindowType_W2)
......
/*
* Proview $Id: wb_wnav.h,v 1.12 2005-10-25 12:04:25 claes Exp $
* Proview $Id: wb_wnav.h,v 1.13 2006-03-31 14:29:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -22,9 +22,9 @@
/* wtt_wnav.h -- Simple navigator */
#if defined __cplusplus
extern "C" {
#endif
//#if defined __cplusplus
//extern "C" {
//#endif
#ifndef pwr_h
# include "pwr.h"
......@@ -54,6 +54,10 @@ extern "C" {
#include "wb_pal.h"
#endif
#ifndef wb_build_opt_h
#include "wb_build_opt.h"
#endif
#ifndef co_wow_h
#include "co_wow.h"
#endif
......@@ -163,15 +167,15 @@ class ApplList {
class WNavGbl {
public:
WNavGbl() :
priv(0), verify(0), advanced_user(0), all_toplevel(0), bypass(0),
show_class(1), show_alias(0), show_descrip(1), show_attrref(0),
show_attrxref(0), show_objref(0), show_objxref(0), show_truedb(0)
{
strcpy( version, wnav_cVersion);
strcpy( platform, ""); strcpy( os, ""); strcpy( hw, "");
strcpy( node, ""); strcpy( sys, ""); strcpy( default_directory, "");
strcpy( symbolfilename, "");
};
priv(0), verify(0), advanced_user(0), all_toplevel(0), bypass(0),
show_class(1), show_alias(0), show_descrip(1), show_attrref(0),
show_attrxref(0), show_objref(0), show_objxref(0), show_truedb(0)
{
strcpy( version, wnav_cVersion);
strcpy( platform, ""); strcpy( os, ""); strcpy( hw, "");
strcpy( node, ""); strcpy( sys, ""); strcpy( default_directory, "");
strcpy( symbolfilename, "");
};
char version[10];
unsigned long priv;
char platform[20];
......@@ -193,6 +197,7 @@ class WNavGbl {
int show_objref;
int show_objxref;
int show_truedb;
wb_build_opt build;
int load_config( void *wnav);
int symbolfile_exec( void *wnav);
......@@ -212,6 +217,7 @@ class WNav {
pwr_tStatus *status);
~WNav();
wb_eUtility ctx_type;
WNavGbl gbl;
ApplList appl;
void *parent_ctx;
......@@ -342,9 +348,11 @@ class WNav {
void collapse();
void set_selection_owner();
void set_options( int sh_class, int sh_alias, int sh_descrip,
int sh_objref, int sh_objxref, int sh_attrref, int sh_attrxref);
int sh_objref, int sh_objxref, int sh_attrref, int sh_attrxref,
int bu_force, int bu_debug, int bu_crossref, int bu_manual);
void get_options( int *sh_class, int *sh_alias, int *sh_descrip,
int *sh_objref, int *sh_objxref, int *sh_attrref, int *sh_attrxref);
int *sh_objref, int *sh_objxref, int *sh_attrref, int *sh_attrxref,
int *bu_force, int *bu_debug, int *bu_crossref, int *bu_manual);
int save_settnings( ofstream& fp);
int node_to_objid( brow_tNode node, pwr_tObjid *objid);
int unselect_objid( pwr_tObjid objid);
......@@ -353,6 +361,7 @@ class WNav {
int show_database();
int show_volume( int pop);
int get_rootlist();
int check_toplevel_class( pwr_tCid cid);
int command( char* input_str);
int readcmdfile( char *incommand);
int get_current_object(
......@@ -397,7 +406,7 @@ void wnav_attrvalue_to_string( ldh_tSesContext ldhses, int type_id,
void *value_ptr, char **buff, int *len);
char *wnav_get_message( int sts);
#if defined __cplusplus
}
#endif
//#if defined __cplusplus
//}
//#endif
#endif
This diff is collapsed.
/*
* Proview $Id: wb_wnav_menu.cpp,v 1.8 2005-09-06 10:43:32 claes Exp $
* Proview $Id: wb_wnav_menu.cpp,v 1.9 2006-03-31 14:29:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -221,7 +221,8 @@ Widget wtt_create_popup_menu( Wtt *wtt, pwr_sAttrRef aref, pwr_tCid cid,
if ( cid != pwr_cNCid) {
// Popup in palette
mcp->EditorContext = (void *)wtt;
mcp->EditorContext = (void *)wtt->wnav;
mcp->WindowContext = (void *)wtt->palette_form;
mcp->PointedSet = ldh_eMenuSet_Class;
......@@ -236,7 +237,10 @@ Widget wtt_create_popup_menu( Wtt *wtt, pwr_sAttrRef aref, pwr_tCid cid,
}
else {
// Popup in wnav
mcp->EditorContext = (void *)wtt;
if ( !wtt->focused_wnav)
wtt->set_focus_default();
mcp->EditorContext = (void *)wtt->focused_wnav;
mcp->WindowContext = (void *)wtt->wnav_form;
mcp->Pointed = aref;
......
/*
* Proview $Id: wb_wsx.h,v 1.3 2005-09-06 10:43:32 claes Exp $
* Proview $Id: wb_wsx.h,v 1.4 2006-03-31 14:29:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -21,6 +21,13 @@
Wb syntax control.
This module control the syntax for objects. */
#ifndef wb_wsx_h
#define wb_wsx_h
#if defined __cplusplus
extern "C" {
#endif
typedef enum {
wsx_mCardOption_None = 0,
wsx_mCardOption_DevName = 1 << 0
......@@ -64,3 +71,8 @@ pwr_tStatus wsx_CheckVolume(
int *warningcount
);
#if defined __cplusplus
}
#endif
#endif
This diff is collapsed.
/*
* Proview $Id: wb_wtt.h,v 1.14 2005-10-25 12:04:25 claes Exp $
* Proview $Id: wb_wtt.h,v 1.15 2006-03-31 14:29:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -22,9 +22,9 @@
/* wb_wtt.h -- Simple navigator */
#if defined __cplusplus
extern "C" {
#endif
//#if defined __cplusplus
//extern "C" {
//#endif
#ifndef pwr_h
# include "pwr.h"
......@@ -127,6 +127,7 @@ class Wtt {
ldh_tVolume wt_volctx,
wnav_sStartMenu *root_menu,
pwr_tStatus *status);
Wtt() {};
wb_eUtility ctx_type;
void *parent_ctx;
......@@ -167,7 +168,6 @@ class Wtt {
void (*confirm_no_cb)( Wtt *);
struct {
Widget dia;
Widget deb;
Widget list;
void *volumelist;
int volumecount;
......@@ -194,6 +194,10 @@ class Wtt {
Widget show_objxref_w;
Widget show_attrref_w;
Widget show_attrxref_w;
Widget build_force_w;
Widget build_debug_w;
Widget build_crossref_w;
Widget build_manual_w;
int show_class;
int show_alias;
int show_descrip;
......@@ -201,25 +205,29 @@ class Wtt {
int show_objxref;
int show_attrref;
int show_attrxref;
int build_force;
int build_debug;
int build_crossref;
int build_manual;
int wnav_mapped;
int wnavnode_mapped;
Widget menu_save_w;
Widget menu_revert_w;
Widget menu_cut_w;
Widget menu_copy_w;
Widget menu_copykeep_w;
Widget menu_paste_w;
Widget menu_pasteinto_w;
Widget menu_rename_w;
Widget menu_utilities_w;
Widget menu_openplc_w;
Widget menu_compile_w;
Widget menu_createload_w;
Widget menu_createboot_w;
Widget menu_buildobject_w;
Widget menu_buildvolume_w;
Widget menu_buildnode_w;
Widget menu_distribute_w;
Widget menu_change_value_w;
Widget menu_edit_w;
Widget menu_classeditor_w;
Widget menu_createstruct_w;
uted_ctx utedctx;
WPkg *wpkg;
WNav *input_wnav;
......@@ -275,7 +283,7 @@ class Wtt {
Widget wtt_create_popup_menu( Wtt *wtt, pwr_sAttrRef aref, pwr_tCid cid,
void (*message_cb)(void *, char, char *));
#if defined __cplusplus
}
#endif
//#if defined __cplusplus
//}
//#endif
#endif
!
! Proview $Id: wb_foe.uil,v 1.5 2005-09-06 10:39:34 claes Exp $
! Proview $Id: wb_foe.uil,v 1.6 2006-03-31 14:29:39 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! This program is free software; you can redistribute it and/or
......@@ -388,8 +388,8 @@ object file_entry : XmCascadeButton {
};
XmPushButton {
arguments {
XmNlabelString = compound_string("Compile");
XmNmnemonic = keysym('C');
XmNlabelString = compound_string("Build");
XmNmnemonic = keysym('B');
XmNfontList = menu_font;
XmNuserData = 7;
};
......
This diff is collapsed.
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