Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
8bb6cc02
Commit
8bb6cc02
authored
Mar 05, 2018
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wb syntax method for DsTrendCurve added
parent
5b5d88dd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
126 additions
and
1 deletion
+126
-1
wb/lib/wb/src/wb_c_dstrendcurve.cpp
wb/lib/wb/src/wb_c_dstrendcurve.cpp
+123
-0
wb/lib/wb/src/wb_i_base_methods.cpp
wb/lib/wb/src/wb_i_base_methods.cpp
+2
-1
wb/lib/wb/src/wb_wb.meth
wb/lib/wb/src/wb_wb.meth
+1
-0
No files found.
wb/lib/wb/src/wb_c_dstrendcurve.cpp
0 → 100644
View file @
8bb6cc02
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 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_dstrendcurve.c -- work bench methods of the DsTrendCurve class. */
#include <string.h>
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_pwrb_msg.h"
#include "pwr_baseclasses.h"
#include "wb_ldh.h"
#include "wb_session.h"
#include "wb_wsx.h"
#include "wb_pwrb_msg.h"
//
// Syntax check.
//
static
pwr_tStatus
SyntaxCheck
(
ldh_tSesContext
Session
,
pwr_tAttrRef
Object
,
/* current object */
int
*
ErrorCount
,
/* accumulated error count */
int
*
WarningCount
/* accumulated waring count */
)
{
// Check DataName
wb_session
*
sp
=
(
wb_session
*
)
Session
;
pwr_tAttrRef
attribute_vect
[
10
];
pwr_tAttrRef
buffers_vect
[
10
];
wb_attribute
a
=
sp
->
attribute
(
&
Object
);
if
(
!
a
)
return
a
.
sts
();
wb_attribute
attribute_a
(
a
,
0
,
"Attribute"
);
if
(
!
attribute_a
)
return
attribute_a
.
sts
();
attribute_a
.
value
(
&
attribute_vect
);
if
(
!
attribute_a
)
return
attribute_a
.
sts
();
wb_attribute
attribute_b
(
a
,
0
,
"Buffers"
);
if
(
!
attribute_b
)
return
attribute_b
.
sts
();
attribute_b
.
value
(
&
buffers_vect
);
if
(
!
attribute_a
)
return
attribute_a
.
sts
();
for
(
unsigned
int
i
=
0
;
i
<
sizeof
(
attribute_vect
)
/
sizeof
(
attribute_vect
[
0
]);
i
++
)
{
if
(
cdh_ObjidIsNotNull
(
attribute_vect
[
i
].
Objid
))
{
if
(
attribute_vect
[
i
].
Flags
.
b
.
Object
||
attribute_vect
[
i
].
Flags
.
b
.
ObjectAttr
)
{
wsx_error_msg_str
(
Session
,
"Bad Attribute reference, invalid type"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
return
PWRB__SUCCESS
;
}
if
(
cdh_ObjidIsNull
(
buffers_vect
[
i
].
Objid
))
wsx_error_msg_str
(
Session
,
"Buffer object not specified"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
wb_attribute
data_a
=
sp
->
attribute
(
&
attribute_vect
[
i
]);
if
(
!
data_a
)
{
wsx_error_msg_str
(
Session
,
"Bad Attribute reference"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
}
else
{
// Check DataName type
switch
(
data_a
.
tid
())
{
case
pwr_eType_Boolean
:
case
pwr_eType_Float32
:
case
pwr_eType_Float64
:
case
pwr_eType_Int8
:
case
pwr_eType_Int16
:
case
pwr_eType_Int32
:
case
pwr_eType_UInt8
:
case
pwr_eType_UInt16
:
case
pwr_eType_UInt32
:
break
;
default:
wsx_error_msg_str
(
Session
,
"Attribute type not supported"
,
Object
,
'E'
,
ErrorCount
,
WarningCount
);
}
}
}
}
return
PWRB__SUCCESS
;
}
// Every method to be exported to the workbench should be registred here.
pwr_dExport
pwr_BindMethods
(
DsTrendCurve
)
=
{
pwr_BindMethod
(
SyntaxCheck
),
pwr_NullMethod
};
wb/lib/wb/src/wb_i_base_methods.cpp
View file @
8bb6cc02
...
@@ -42,6 +42,7 @@ pwr_dImport pwr_BindMethods(ASup);
...
@@ -42,6 +42,7 @@ pwr_dImport pwr_BindMethods(ASup);
pwr_dImport
pwr_BindMethods
(
DsFast
);
pwr_dImport
pwr_BindMethods
(
DsFast
);
pwr_dImport
pwr_BindMethods
(
SevHist
);
pwr_dImport
pwr_BindMethods
(
SevHist
);
pwr_dImport
pwr_BindMethods
(
DsTrend
);
pwr_dImport
pwr_BindMethods
(
DsTrend
);
pwr_dImport
pwr_BindMethods
(
DsTrendCurve
);
pwr_dImport
pwr_BindMethods
(
DSup
);
pwr_dImport
pwr_BindMethods
(
DSup
);
pwr_dImport
pwr_BindMethods
(
PlcPgm
);
pwr_dImport
pwr_BindMethods
(
PlcPgm
);
pwr_dImport
pwr_BindMethods
(
PlcEmbed
);
pwr_dImport
pwr_BindMethods
(
PlcEmbed
);
...
@@ -121,4 +122,4 @@ pwr_dExport pwr_BindClasses(Base) = {
...
@@ -121,4 +122,4 @@ pwr_dExport pwr_BindClasses(Base) = {
pwr_BindClass
(
SevHistThread
),
pwr_BindClass
(
SevHistThread
),
pwr_BindClass
(
SevHistObject
),
pwr_BindClass
(
SevHistObject
),
pwr_NullClass
pwr_NullClass
};
};
\ No newline at end of file
wb/lib/wb/src/wb_wb.meth
View file @
8bb6cc02
...
@@ -2,6 +2,7 @@ ASup
...
@@ -2,6 +2,7 @@ ASup
DsFast
DsFast
SevHist
SevHist
DsTrend
DsTrend
DsTrendCurve
DSup
DSup
PlcPgm
PlcPgm
PlcEmbed
PlcEmbed
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment