Commit 591dc493 authored by Claes Sjofors's avatar Claes Sjofors

Plc editor bugfix, coordinate wasn't not set correctly when floating node created with MB2

parent 12230825
!
! 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.
!
! pwrb_postoptionsmask.wb_load -- Defines the mask type PostOptionsMask
!
SObject pwrb:Type
!/**
! @Version 1.0
! @Group Types
! Bitmask for post options.
!*/
Object PostOptionsMask $TypeDef 65
Body SysBody
Attr Type = pwr_eType_Mask
Attr Size = 4
Attr TypeRef = "pwrs:Type-$Mask"
Attr Elements = 1
EndBody
!/**
! Single line SMS.
!*/
Object SingleLineSMS $Bit
Body SysBody
Attr PgmName = "SingleLineSMS"
Attr Text = "SingleLineSMS"
Attr Value = 1
EndBody
EndObject
!/**
! Print posted commands to console log.
!*/
Object Log $Bit
Body SysBody
Attr PgmName = "Log"
Attr Text = "Log"
Attr Value = 2
EndBody
EndObject
EndObject
EndSObject
...@@ -1521,8 +1521,32 @@ int WGre::flow_cb( FlowCtx *ctx, flow_tEvent event) ...@@ -1521,8 +1521,32 @@ int WGre::flow_cb( FlowCtx *ctx, flow_tEvent event)
return 1; return 1;
if ( flow_GetPasteActive( ctx)) { if ( flow_GetPasteActive( ctx)) {
flow_tObject *select_list;
int select_cnt;
double pos_x, pos_y;
int i;
vldh_t_node vnode;
flow_PasteStop( ctx); flow_PasteStop( ctx);
flow_MoveSelectedNodes( ctx, 0, 0, 1); flow_MoveSelectedNodes( ctx, 0, 0, 1);
flow_GetSelectList( ctx, &select_list, &select_cnt);
for ( i = 0; i < select_cnt; i++) {
flow_GetUserData( select_list[i], (void **) &vnode);
if ( gre->floating_node && vnode == gre->floating_node) {
flow_GetNodePosition( select_list[i], &pos_x, &pos_y);
vnode->ln.x = pos_x;
vnode->ln.y = pos_y;
vldh_nodemodified( vnode);
(gre->gre_node_moved) (gre);
if ( gre->gre_node_floating_created)
(gre->gre_node_floating_created) ( gre, vnode);
gre->floating_node = 0;
}
}
return 1; return 1;
} }
......
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