void Cmd::save_cb( void *ctx, int quiet) { Cmd *cmd = (Cmd *) ctx; int sts; if ( !cmd->ldhses) { cmd->wnav->message( 'E', "Cmd is not attached to a volume"); return; } sts = ldh_SaveSession( cmd->ldhses); if ( EVEN(sts)) { cmd->wnav->message( 'E', wnav_get_message( sts)); return; } ldh_sVolumeInfo info; pwr_tCid volcid; ldh_GetVolumeInfo( ldh_SessionToVol( cmd->ldhses), &info); ldh_GetVolumeClass( cmd->wbctx, info.Volume, &volcid); if ( volcid == pwr_eClass_DirectoryVolume) { sts = lfu_SaveDirectoryVolume( cmd->ldhses, 0, quiet); if ( EVEN(sts)) { cmd->wnav->message( 'E', "Syntax error"); return; } } cmd->wnav->message( 'E', "Session saved"); }
int wnav_crr_get_volume_cb( void *ctx, pwr_tVid *vid, pwr_tVid prev_vid) { int sts; ldh_sVolumeInfo info; CrrCtx *cctx = (CrrCtx *)ctx; ldh_tVolContext volctx = ldh_SessionToVol( cctx->ldhses); sts = ldh_GetVolumeInfo( volctx, &info); if ( prev_vid) return WNAV__NOSUCHVOLUME; *vid = info.Volume; return WNAV__SUCCESS; }
// // Constructor // WFoeMotif::WFoeMotif( void *f_parent_ctx, Widget f_parent_wid, const char *f_name, pwr_tObjid plcprogram, ldh_tWBContext ldhwbctx, ldh_tSesContext ldhsesctx, int f_map_window, ldh_eAccess f_access, unsigned int f_options, pwr_tStatus *sts) : WFoe(f_parent_ctx,f_name,plcprogram,ldhwbctx,ldhsesctx,f_map_window, f_access,f_options,sts), parent_wid(f_parent_wid), set_focus_disabled(0), focus_timerid(0) { int size; pwr_tFullName new_name; ldh_tSesContext ldhses; memset( &widgets, 0, sizeof(widgets)); /* Check that it is possible to open a session */ *sts = ldh_OpenSession(&ldhses, ldh_SessionToVol( ldhsesctx), access, ldh_eUtility_PlcEditor); if ( EVEN(*sts)) return; *sts = ldh_CloseSession(ldhses); /* New title */ *sts = ldh_ObjidToName( ldhsesctx, plcprogram, ldh_eName_Hierarchy, new_name, sizeof( new_name), &size); error_msg(*sts); if( EVEN(*sts)) return; strcpy( name, new_name); *sts = new_local( plcprogram, ldhwbctx, ldhsesctx, 0, 0, 0, foe_eFuncAccess_Edit); wow = new CoWowMotif( parent_wid); }
Ge::Ge( void *x_parent_ctx, ldh_tSesContext x_ldhses, int x_exit_when_close, unsigned int x_options) : parent_ctx(x_parent_ctx), graph(0), subpalette(0), subgraphs(0), colorpalette_ctx(0), text_input_open(0), name_input_open(0), value_input_open(0), command_open(0), confirm_open(0), yesnodia_open(0), yesnodia_yes_cb(0), yesnodia_no_cb(0), india_ok_cb(0), current_text_object(0), current_value_object(0), current_confirm_object(0), ldhses(0), plantctx(0), exit_when_close(x_exit_when_close), prev_count(0), focused_component(0), recover_object(0), plant_mapped(0), subpalette_mapped(0), options(x_options) { strcpy( name, "PwR Ge"); #ifdef LDH if ( x_ldhses) { // Open a new session pwr_tStatus sts = ldh_OpenSession( &ldhses, ldh_SessionToVol( x_ldhses), ldh_eAccess_ReadOnly, ldh_eUtility_PlcEditor); if ( EVEN(sts)) return; } #endif }