Commit 877cd1a5 authored by Claes Sjofors's avatar Claes Sjofors

Merge branch 'master'

parents 73e01ac8 7af93228
......@@ -1066,3 +1066,356 @@ void CompCurvePolValueFo_exec(
co->ActVal = o->ActVal;
co->In = *o->InP;
}
/* MPC Model predictive contoller */
typedef struct {
float acc;
float value;
float output;
} t_vacc;
/* Interpolation for Curve relations. */
static float mpc_interpolate(float *curve, unsigned int c_len, float val)
{
unsigned int i;
float ret;
if (val < curve[0]) {
ret = curve[1] - (curve[0] - val) * (curve[3]- curve[1]) / (curve[2] - curve[0]);
return ret;
}
for (i = 1; i < c_len * 2; i++) {
if (val < curve[i*2]) {
ret = curve[i*2+1] + (val - curve[i*2]) * (curve[i*2+1] - curve[(i-1)*2+1]) / (curve[i*2] - curve[(i-1)*2]);
return ret;
}
}
ret = curve[(c_len-1)*2+1] + (val - curve[(c_len-1)*2]) * (curve[(c_len-1)*2+1] - curve[(c_len-2)*2+1]) / (curve[(c_len-1)*2] - curve[(c_len-2)*2]);
return ret;
}
/* Calculation of linear regression model */
static float mpc_model(pwr_sClass_CompMPC_Fo *o, pwr_sClass_CompMPC *co,
float out, float av0, float timestep)
{
float av;
switch (co->Algorithm) {
case pwr_eMpcAlgorithm_None:
av = 0;
break;
case pwr_eMpcAlgorithm_FixTimeStep:
case pwr_eMpcAlgorithm_FixTimeStepModelCorr:
case pwr_eMpcAlgorithm_ProgressiveTimeStep:
case pwr_eMpcAlgorithm_ProgressiveTimeStepMC:
case pwr_eMpcAlgorithm_FirstScanTimeStep:
case pwr_eMpcAlgorithm_FirstScanTimeStepMC: {
int i, j;
pwr_tFloat32 val;
for (i = 0; i < co->NoOfAttr; i++) {
if (i == 0) {
if (co->BaseAttrRelation[0] == pwr_eMpcAttrRelation_Integral)
av = av0;
else
av = 0;
val = out;
}
else
val = **(pwr_tFloat32 **)((char *)&o->Attr2P + pwr_cInputOffset * (i - 1));
switch (co->BaseAttrRelation[i]) {
case pwr_eMpcAttrRelation_Integral: {
switch (co->TightAttrRelation[i]) {
case pwr_eMpcAttrRelation_Curve: {
if ( i > 9)
break;
pwr_sClass_table *t = *(pwr_sClass_table **)
((char *)&o->Curve1P + pwr_cInputOffset * i);
val = mpc_interpolate(&t->TabVect[1], t->TabVect[0], val);
break;
}
}
for (j = i + 1; j < co->NoOfAttr; j++) {
if (co->BaseAttrRelation[j] == pwr_eMpcAttrRelation_No) {
pwr_tFloat32 tval = **(pwr_tFloat32 **)((char *)&o->Attr2P + pwr_cInputOffset * (j - 1));
switch (co->TightAttrRelation[j]) {
case pwr_eMpcAttrRelation_Sub:
val -= co->AttrCoeff[j] * tval;
break;
case pwr_eMpcAttrRelation_Add:
val += co->AttrCoeff[j] * tval;
break;
case pwr_eMpcAttrRelation_Multiply:
val *= co->AttrCoeff[j] * tval;
break;
case pwr_eMpcAttrRelation_Divide:
val /= co->AttrCoeff[j] * tval;
break;
}
}
else {
j--;
break;
}
}
av += val * co->AttrCoeff[i] * timestep;
i = j;
break;
}
case pwr_eMpcAttrRelation_Linear:
av += val * co->AttrCoeff[i];
break;
case pwr_eMpcAttrRelation_Curve: {
if ( i > 9)
break;
pwr_sClass_table *t = *(pwr_sClass_table **)
((char *)&o->Curve1P + pwr_cInputOffset * i);
float p = mpc_interpolate(&t->TabVect[1], t->TabVect[0], val);
av += p * co->AttrCoeff[i];
//printf("Curve %6.3f %6.2f\n", p, val);
break;
}
case pwr_eMpcAttrRelation_Multiply:
av = av * val * co->AttrCoeff[i];
break;
}
}
av += co->Coeff0;
break;
}
}
return av;
}
/* Executes one predictive time scan */
static void mpc_tscan(plc_sThread* tp, pwr_sClass_CompMPC_Fo* o,
pwr_sClass_CompMPC* co, int tix, int *vix,
int iter, float *iter_vout)
{
if (tix == co->TSize)
return;
t_vacc **vacc = (t_vacc **)co->Vacc;
int i;
float t;
float out;
float av;
float av0; // Previous procvalue
float omin, omax, omiddle;
float timestep;
switch (co->Algorithm) {
case pwr_eMpcAlgorithm_ProgressiveTimeStep:
case pwr_eMpcAlgorithm_ProgressiveTimeStepMC:
t = 0;
timestep = co->TStep;
for (i = 1; i < tix; i++) {
t += timestep;
timestep *= co->TStepFactor;
}
break;
case pwr_eMpcAlgorithm_FirstScanTimeStep:
case pwr_eMpcAlgorithm_FirstScanTimeStepMC:
if (tix == 0) {
t = 0;
timestep = co->TStepFirst;
}
else {
t = co->TStepFirst + co->TStep * (tix - 1);
timestep = co->TStep;
}
break;
default:
t = (float)(co->TStep * tix);
timestep = co->TStep;
}
for (i = 0; i < co->SSize; i++) {
if (iter == 0) {
if (tix == 0)
omiddle = o->OutValue;
else
omiddle = vacc[tix-1][vix[tix-1]-1].output;
omax = MIN(omiddle + co->OutRamp * timestep, co->OutMax);
omin = MAX(omiddle - co->OutRamp * timestep, co->OutMin);
}
else {
if (tix == 0)
omiddle = iter_vout[tix];
else
omiddle = vacc[tix-1][vix[tix-1]-1].output + iter_vout[tix] - iter_vout[tix-1];
omax = MIN(omiddle + co->OutRamp * timestep/(iter*2), co->OutMax);
omin = MAX(omiddle - co->OutRamp * timestep/(iter*2), co->OutMin);
}
out = omin + (omax - omin)/(co->SSize - 1) * i;
if (tix == 0)
av0 = *o->ProcValueP;
else
av0 = vacc[tix-1][vix[tix]/co->SSize].value;
av = mpc_model(o, co, out, av0, timestep);
vacc[tix][vix[tix]].output = out;
vacc[tix][vix[tix]].value = av;
if (tix > 0)
vacc[tix][vix[tix]].acc = vacc[tix-1][vix[tix-1]-1].acc;
switch (co->Algorithm) {
case pwr_eMpcAlgorithm_FixTimeStepModelCorr:
case pwr_eMpcAlgorithm_ProgressiveTimeStepMC:
case pwr_eMpcAlgorithm_FirstScanTimeStepMC:
vacc[tix][vix[tix]].acc += fabs(av - (co->SetValue + co->ModelCorr));
break;
default:
vacc[tix][vix[tix]].acc += fabs(av - co->SetValue);
}
// printf("acc[%2d][%2d] %7.2f sp %7.2f out %7.2f\n", tix, vix[tix], vacc[tix][vix[tix]].acc, co->SetValue, out);
vix[tix]++;
mpc_tscan(tp, o, co, tix+1, vix, iter, iter_vout);
}
}
/*_*
CompMPC_Fo
@aref compmpc_fo CompMPC_Fo
*/
void CompMPC_Fo_init(pwr_sClass_CompMPC_Fo* o)
{
t_vacc **vacc;
int size;
int i;
pwr_sClass_CompMPC *co;
pwr_tDlid dlid;
pwr_tStatus sts;
sts = gdh_DLRefObjectInfoAttrref(
&o->PlcConnect, (void**)&o->PlcConnectP, &dlid);
if (EVEN(sts))
o->PlcConnectP = 0;
co = (pwr_sClass_CompMPC *)o->PlcConnectP;
if (!co)
return;
co->NoOfPaths = 0;
co->Vacc = malloc(co->TSize * sizeof(float*));
vacc = (t_vacc **)co->Vacc;
for (i = 0; i < co->TSize; i++) {
size = pow(co->SSize, i+1);
vacc[i] = (t_vacc *)malloc(size * sizeof(t_vacc));
memset(vacc[i], 0, size * sizeof(t_vacc));
co->NoOfPaths += size;
}
}
void CompMPC_Fo_exec(plc_sThread* tp, pwr_sClass_CompMPC_Fo* o)
{
t_vacc **vacc;
int i, j;
int min_acc;
int *vix;
float *vout;
int idx;
int size;
pwr_sClass_CompMPC *co = (pwr_sClass_CompMPC *)o->PlcConnectP;
if (!co)
return;
co->ProcValue = o->ProcValue = *o->ProcValueP;
co->SetValue = o->SetValue = *o->SetValueP;
co->ForceValue = o->ForceValue = *o->ForceValueP;
co->Force = o->Force = *o->ForceP;
if (*o->ForceP) {
o->OutValue = *o->ForceValueP;
return;
}
/* SetValue correction */
switch (co->Algorithm) {
case pwr_eMpcAlgorithm_FixTimeStepModelCorr:
case pwr_eMpcAlgorithm_ProgressiveTimeStepMC:
case pwr_eMpcAlgorithm_FirstScanTimeStepMC:
if ( fabs(*o->SetValueP - *o->ProcValueP) < co->ModelCorrInterval)
co->ModelCorr += (*o->SetValueP - *o->ProcValueP) * (*o->ScanTime) / co->ModelCorrIntTime;
else
co->ModelCorr = 0;
break;
default:
co->ModelCorr = 0;
}
vacc = (t_vacc **)co->Vacc;
vix = (int *)calloc(1, co->TSize * sizeof(unsigned int));
mpc_tscan(tp, o, co, 0, vix, 0, 0);
min_acc = 0;
for (i = 0; i < pow(co->SSize, co->TSize); i++) {
if (vacc[co->TSize-1][i].acc < vacc[co->TSize-1][min_acc].acc)
min_acc = i;
//printf( "%d acc %7.2f\n", i, vacc[co->TSize-1][i].acc);
}
// printf("min_acc %d\n", min_acc);
idx = min_acc;
for (i = co->TSize - 1; i >= 0; i--) {
#if 0
printf("vacc[%d][%d] %7.2f %7.2f %7.2f\n", i, idx, vacc[i][idx].acc,
vacc[i][idx].value, vacc[i][idx].output);
#endif
idx = idx / co->SSize;
}
vout = (float *)malloc(co->TSize * sizeof(float));
for ( j = 0; j < 3; j++) {
idx = min_acc;
for (i = co->TSize - 1; i >= 0; i--) {
vout[i] = vacc[i][idx].output;
idx = idx / co->SSize;
}
for (i = 0; i < co->TSize; i++) {
size = pow(co->SSize, i+1);
memset(vacc[i], 0, size * sizeof(t_vacc));
}
memset(vix, 0, co->TSize * sizeof(unsigned int));
mpc_tscan(tp, o, co, 0, vix, j+1, vout);
min_acc = 0;
for (i = 0; i < pow(co->SSize,co->TSize); i++) {
if (vacc[co->TSize-1][i].acc < vacc[co->TSize-1][min_acc].acc)
min_acc = i;
// printf( "%d acc %7.2f\n", i, vacc[co->TSize-1][i].acc);
}
idx = min_acc;
for (i = co->TSize - 1; i >= 0; i--) {
#if 0
printf("vacc[%d][%d] %7.2f %7.2f %7.2f\n", i, idx, vacc[i][idx].acc,
vacc[i][idx].value, vacc[i][idx].output);
#endif
if (i == 0)
break;
idx = idx / co->SSize;
}
}
free(vix);
free(vout);
co->CurrentPath = min_acc;
co->Error = *o->SetValueP - *o->ProcValueP;
switch (co->Algorithm) {
case pwr_eMpcAlgorithm_FirstScanTimeStep:
o->OutValue = vacc[0][idx].output;
break;
default:
o->OutValue += (vacc[0][idx].output - o->OutValue) * tp->f_scan_time / co->TStep * co->Gain;
}
co->OutValue = o->OutValue;
}
......@@ -62,5 +62,7 @@ void CompCurveTabValueFo_exec(
void CompCurvePolValueFo_init(pwr_sClass_CompCurvePolValueFo* o);
void CompCurvePolValueFo_exec(
plc_sThread* tp, pwr_sClass_CompCurvePolValueFo* o);
void CompMPC_Fo_init(pwr_sClass_CompMPC_Fo* o);
void CompMPC_Fo_exec(plc_sThread* tp, pwr_sClass_CompMPC_Fo* o);
#endif
This diff is collapsed.
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
exe : $(doc_dir)/sv_se/orm/pwr_basecomponentclasses_h.html \
$(doc_dir)/en_us/orm/pwr_basecomponentclasses_h.html \
$(doc_dir)/sv_se/orm/pwr_basecomponentclasses_hpp.html \
$(doc_dir)/en_us/orm/pwr_basecomponentclasses_hpp.html
$(doc_dir)/sv_se/orm/pwr_basecomponentclasses_h.html : $(inc_dir)/pwr_basecomponentclasses.h
@ echo "Generating html files for struct sv_se..."
@ $(co_convert) -c -d $(doc_dir)/sv_se/orm "$(source)"
$(doc_dir)/en_us/orm/pwr_basecomponentclasses_h.html : $(inc_dir)/pwr_basecomponentclasses.h
@ echo "Generating html files for struct en_us..."
@ $(co_convert) -c -d $(doc_dir)/en_us/orm "$(source)"
$(doc_dir)/sv_se/orm/pwr_basecomponentclasses_hpp.html : $(inc_dir)/pwr_basecomponentclasses.hpp
@ echo "Generating html files for struct sv_se..."
@ $(co_convert) -c -d $(doc_dir)/sv_se/orm "$(source)"
$(doc_dir)/en_us/orm/pwr_basecomponentclasses_hpp.html : $(inc_dir)/pwr_basecomponentclasses.hpp
@ echo "Generating html files for struct en_us..."
@ $(co_convert) -c -d $(doc_dir)/en_us/orm "$(source)"
"use strict";
class CliTable {
command: string;
qualifier: Array<string>;
constructor(command, qualifier) {
this.command = command;
this.qualifier = qualifier;
}
}
enum CliC {
SUCCESS = 1,
SYNTAX_ERROR = 2,
UNKNOWN_COMMAND = 4,
VERB_VECT_SIZE = 5,
QUALNOTFOUND = 6
}
enum State {
INIT,
VERB,
QUAL,
QUALVALUE,
SPACE,
EQUAL,
ERROR,
QUOTE_VERB,
QUOTE_QUALVALUE,
QUALVALUE_EXACT,
VERB_EXACT
}
class Cli {
verb: Array = new Array(CliC.VERB_VECT_SIZE);
qualifier: Array = new Array(30);
qualValue: Array = new Array(30);
status: number;
cliTableIndex: number;
cliQualifierIndex: Array = new Array(30);
configuredVerbs: number;
cliTable: Array<CliTable>;
constructor(cliTable) {
this.cliTable = cliTable;
}
/**
* Return the status of the last operation as a string.
* @return The status of the last operation.
*/
getStsString() {
switch (this.status) {
case CliC.SUCCESS:
return "Success";
case CliC.SYNTAX_ERROR:
return "Syntax error";
case CliC.UNKNOWN_COMMAND:
return "Unknown command verb";
case CliC.QUALNOTFOUND:
return "Unknown qualifier";
default:
return "Unknown command interpreter error";
}
}
/**
* Parse a command line and detect verbs and qualifiers.
* @param cmd Command line.
*/
parse(cmd) {
let state = State.INIT;
let start_pos = 0;
this.status = CliC.SUCCESS;
let i;
for (i = 0; i < cmd.length; i++) {
let c = cmd.charAt(i);
switch (state) {
case State.INIT:
if (c === ' ' || c === '\t') {
break;
} else {
state = State.VERB;
start_pos = i;
}
break;
case State.SPACE:
if (c === ' ' || c === '\t') {
break;
}
if (c === '/') {
state = State.QUAL;
start_pos = i;
} else if (c === '=') {
if (this.qualifier.length === 0) {
state = State.ERROR;
this.status = CliC.SYNTAX_ERROR;
break;
}
state = State.EQUAL;
} else if (c === '"') {
state = State.QUOTE_VERB;
break;
} else {
state = State.VERB;
start_pos = i;
}
break;
case State.VERB:
if (c === ' ' || c === '\t') {
if (this.verb.length === CliC.VERB_VECT_SIZE) {
state = State.ERROR;
break;
}
if (this.verb.length === 0) {
this.verb.push(cmd.substring(start_pos, i).toUpperCase());
} else {
this.verb.push(cmd.substring(start_pos, i));
}
state = State.SPACE;
} else if (c === '/') {
if (this.verb.length === CliC.VERB_VECT_SIZE) {
state = State.ERROR;
break;
}
this.verb.push(cmd.substring(start_pos, i).toUpperCase());
state = State.QUAL;
start_pos = i;
}
break;
case State.VERB_EXACT:
if (c === '"') {
if (this.verb.length === CliC.VERB_VECT_SIZE) {
state = State.ERROR;
break;
}
this.verb.push(cmd.substring(start_pos, i));
state = State.SPACE;
}
break;
case State.QUAL:
if (c === ' ' || c === '\t') {
this.qualifier.push(cmd.substring(start_pos, i).toUpperCase());
state = State.SPACE;
} else if (c === '=') {
this.qualifier.push(cmd.substring(start_pos, i).toUpperCase());
state = State.EQUAL;
} else if (c === '/') {
this.qualifier.push(cmd.substring(start_pos, i).toUpperCase());
state = State.QUAL;
start_pos = i;
}
break;
case State.QUALVALUE:
if (c === ' ' || c === '\t') {
this.qualValue[this.qualifier.length - 1] =
cmd.substring(start_pos, i);
state = State.SPACE;
} else if (c === '/') {
this.qualValue[this.qualifier.length - 1] =
cmd.substring(start_pos, i);
state = State.QUAL;
start_pos = i;
}
break;
case State.QUALVALUE_EXACT:
if (c === '"') {
this.qualValue[this.qualifier.length - 1] =
cmd.substring(start_pos, i);
state = State.SPACE;
}
break;
case State.QUOTE_VERB:
state = State.VERB_EXACT;
start_pos = i;
break;
case State.QUOTE_QUALVALUE:
state = State.QUALVALUE_EXACT;
start_pos = i;
break;
case State.EQUAL:
if (c === ' ' || c === '\t') {
break;
}
if (c === '"') {
state = State.QUOTE_QUALVALUE;
} else {
state = State.QUALVALUE;
start_pos = i;
}
break;
}
if (state === State.ERROR) {
break;
}
}
switch (state) {
case State.INIT:
case State.ERROR:
return "";
case State.VERB:
if (this.verb.length === CliC.VERB_VECT_SIZE) {
state = State.ERROR;
break;
}
if (this.verb.length === 0) {
this.verb.push(cmd.substring(start_pos, i).toUpperCase());
} else {
this.verb.push(cmd.substring(start_pos, i));
}
break;
case State.VERB_EXACT:
if (this.verb.length === CliC.VERB_VECT_SIZE) {
state = State.ERROR;
break;
}
this.verb.push(cmd.substring(start_pos, i));
break;
case State.QUAL:
this.qualifier.push(cmd.substring(start_pos, i).toUpperCase());
break;
case State.QUALVALUE:
this.qualValue[this.qualifier.length - 1] = cmd.substring(start_pos, i);
break;
case State.QUALVALUE_EXACT:
this.qualValue[this.qualifier.length - 1] = cmd.substring(start_pos, i);
break;
case State.QUOTE_VERB:
case State.QUOTE_QUALVALUE:
case State.EQUAL:
this.status = CliC.SYNTAX_ERROR;
return "";
}
if (this.verb.length === 0) {
this.status = CliC.SYNTAX_ERROR;
return "";
}
// Identify verbs and qualifiers
let found = false;
for (i = 0; i < this.cliTable.length; i++) {
if (this.verb[0].length > this.cliTable[i].command.length) {
continue;
}
if (this.verb[0] ===
(this.cliTable[i].command.substring(0, this.verb[0].length))) {
this.verb[0] = this.cliTable[i].command;
found = true;
break;
}
}
if (!found) {
this.status = CliC.UNKNOWN_COMMAND;
return "";
}
this.cliTableIndex = i;
this.configuredVerbs = 0;
if (this.cliTable[this.cliTableIndex].qualifier !== null) {
for (i = 0; i < this.cliTable[this.cliTableIndex].qualifier.length; i++) {
if (this.cliTable[this.cliTableIndex].qualifier[i] === null) {
break;
}
for (let i = 1; i <= 5; i++) {
if (this.cliTable[this.cliTableIndex].qualifier[i] === ("cli_arg" + String(i))) {
this.configuredVerbs++;
}
}
}
for (let j = 0; j < this.qualifier.length; j++) {
found = false;
for (i = 0; i < this.cliTable[this.cliTableIndex].qualifier.length;
i++) {
if (this.cliTable[this.cliTableIndex].qualifier[i] === null) {
break;
}
if (this.qualifier[j].length >
this.cliTable[this.cliTableIndex].qualifier[i].length) {
continue;
}
if (this.qualifier[j] ===
(this.cliTable[this.cliTableIndex].qualifier[i].substring(0,
this.qualifier[j].length))) {
this.cliQualifierIndex[j] = i;
found = true;
this.qualifier[j] = this.cliTable[this.cliTableIndex].qualifier[i];
}
}
if (!found) {
this.status = CliC.QUALNOTFOUND;
return "";
}
}
} else if (this.qualifier.length > 0) {
this.status = CliC.QUALNOTFOUND;
return "";
}
return this.verb[0];
}
/**
* Check if a qualifier was present in the last parse operation.
* @param qual Qualifier to check.
* @return Returns true if the qualifier is present.
*/
qualifierFound(qual) {
for (let i = 1; i < 6; i++) {
if (qual == ("cli_arg" + String(i))) {
return !(this.verb.length < (i+1) || this.configuredVerbs < i);
}
}
for (let i = 0; i < this.qualifier.length; i++) {
if (qual === (this.qualifier[i])) {
return true;
}
}
return false;
}
/**
* Get the value of a qualifier in the last parse operation.
* @param qual Qualifier to check.
* @return Returns the value of the qualifier.
*/
getQualValue(qual) {
for (let i = 1; i < 6; i++) {
if (qual == ("cli_arg" + String(i))) {
if (this.verb.length < (i+1) || this.configuredVerbs < i) {
return ""
}
return this.verb[i];
}
}
for (let i = 0; i < this.qualifier.length; i++) {
if (qual === (this.qualifier[i])) {
if (this.qualValue[i] === null) {
return "";
} else {
return this.qualValue[i];
}
}
}
return "";
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
"use strict";
function even(sts) {
return sts % 2 === 0;
}
function odd(sts) {
return sts % 2 === 1;
}
function clamp(val, min, max) {
return val > max ? max : (val < min ? min : val);
}
enum Type {
Bit = (1 << 15) + 1,
Boolean = 98305,
Float32,
Float64,
Char,
Int8,
Int16,
Int32,
UInt8,
UInt16,
UInt32,
Objid,
Buffer,
String,
Enum,
Struct,
Mask,
Array,
Time,
Text,
AttrRef,
UInt64,
Int64,
ClassId,
TypeId,
VolumeId,
ObjectIx,
RefId,
DeltaTime,
Status,
NetStatus,
CastId,
ProString,
DisableAttr,
DataRef
}
enum Prv {
RtRead = 1 << 0,
RtWrite = 1 << 1,
System = 1 << 2,
Maintenance = 1 << 3,
Process = 1 << 4,
Instrument = 1 << 5,
Operator1 = 1 << 6,
Operator2 = 1 << 7,
Operator3 = 1 << 8,
Operator4 = 1 << 9,
Operator5 = 1 << 10,
Operator6 = 1 << 11,
Operator7 = 1 << 12,
Operator8 = 1 << 13,
Operator9 = 1 << 14,
Operator10 = 1 << 15,
RtEventsAck = 1 << 18,
RtPlc = 1 << 19,
RtNavigator = 1 << 20,
DevRead = 1 << 21,
DevPlc = 1 << 22,
DevConfig = 1 << 23,
DevClass = 1 << 24,
RtEventsBlock = 1 << 25,
Administrator = 1 << 26,
SevRead = 1 << 27,
SevAdmin = 1 << 28
}
enum Access {
RtRead = 1 << 0,
RtWrite = 1 << 1,
System = 1 << 2,
Maintenance = 1 << 3,
Process = 1 << 4,
Instrument = 1 << 5,
RtEventsBlock = 1 << 25,
RtEventsAck = 1 << 18,
RtPlc = 1 << 19,
RtNavigator = 1 << 20,
AllRt = 1 << 2 | 1 << 3 | 1 << 4 | 1 << 5 | 1 << 0 | 1 << 1 | 1 << 25 |
1 << 18 | 1 << 19 | 1 << 20 | 1 << 6 | 1 << 7 | 1 << 8 | 1 << 9 | 1 << 10 |
1 << 11 | 1 << 12 | 1 << 13 | 1 << 14 | 1 << 15,
AllOperators = 1 << 6 | 1 << 7 | 1 << 8 | 1 << 9 | 1 << 10 | 1 << 11 |
1 << 12 | 1 << 13 | 1 << 14 | 1 << 15,
AllPwr = ~0
}
enum Adef {
Pointer = 1,
Array = 2,
Backup = 4,
Changelog = 8,
State = 16,
Const = 32,
Rtvirtual = 64,
Devbodyref = 128,
Dynamic = 256,
Publicwrite = 512,
Noedit = 1024,
Invisible = 2048,
Refdirect = 4096,
Noinvert = 8192,
Noremove = 16384,
Rtdbref = 32768,
Private = 65536,
Class = 131072,
Superclass = 262144,
Buffer = 524288,
Nowbl = 1048576,
Alwayswbl = 2097152,
Disableattr = 4194304,
Rthide = 8388608
}
enum XttMethodsFlagsMask {
IsConfigured = 1
}
enum XttOpMethodsMask {
OpenGraph = 1,
OpenObjectGraph = 2,
OpenTrend = 4,
OpenHistory = 8,
OpenFast = 16,
Camera = 32,
HistEvent = 64,
BlockEvents = 128,
Help = 256,
Photo = 512,
Note = 1024,
ParentObjectGraph = 2048
}
enum XttMntMethodsMask {
OpenObject = 1,
OpenTrace = 2,
RtNavigator = 4,
OpenCrossref = 8,
HelpClass = 16,
DataSheet = 32,
CircuitDiagram = 64,
Simulate = 1 << 31
}
class PwrtObjid {
vid: number;
oix: number;
constructor(vid, oix) {
this.oix = oix;
this.vid = vid;
}
}
class PwrtAttrRef {
objid;
offset;
body;
size;
flags;
}
class CdhrNumber {
value: number;
sts: number;
constructor(value, sts) {
this.value = value;
this.sts = sts;
}
}
enum UserVol {
Min = ((0 << 24) + (1 << 16) + (1 << 8) + 1),
Max = ((0 << 24) + (254 << 16) + (254 << 8) + 254)
}
class UserdataCbReturn {
userdata;
row;
}
class Point {
x = 0;
y = 0;
constructor() {
}
constructor(x: number, y: number) {
this.x = x;
this.y = y;
}
}
class Rect {
ll_x = 0;
ll_y = 0;
ur_x = 0;
ur_y = 0;
constructor() {
}
constructor(x: number, y: number, x2: number, y2: number) {
this.ll_x = x;
this.ll_y = y;
this.ur_x = x2;
this.ur_y = y2;
}
set(r: Rect) {
this.ll_x = r.ll_x;
this.ll_y = r.ll_y;
this.ur_x = r.ur_x;
this.ur_y = r.ur_y;
}
width() {
return this.ur_x - this.ll_x;
}
height() {
return this.ur_y - this.ll_y;
}
hit(p: Point) {
return (p.x >= this.ll_x && p.x <= this.ur_x && p.y >= this.ll_y && p.y <= this.ur_y);
}
static union(r1: Rect, r2: Rect) {
return new Rect(
Math.min(r1.ll_x, r2.ll_x),
Math.min(r1.ll_y, r2.ll_y),
Math.max(r1.ur_x, r2.ur_x),
Math.max(r1.ur_y, r2.ur_y),
);
}
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Alarm List</title>
<link rel="stylesheet" type="text/css" href="toolbar.css">
</head>
<head>
<title>Alarm List</title>
<link rel="stylesheet" type="text/css" href="toolbar.css">
</head>
<body>
<div class="toolbar" role="toolbar">
<div id="toolitem1" tabindex="0" class="toolbar-item" role="button"><img src="toolbar_ack.png"><img>....</div>
<div id="toolitem2" tabindex="-1" class="toolbar-item" role="button"><img src="toolbar_navigator.png"><img></div>
<div id="toolitem3" tabindex="-1" class="toolbar-item" role="button"><img src="toolbar_plc.png"><img>....</div>
<div id="toolitem4" tabindex="-1" class="toolbar-item" role="button"><img src="toolbar_graph.png"><img></div>
<div id="toolitem5" tabindex="-1" class="toolbar-item" role="button"><img src="toolbar_objectgraph.png"><img></div>
<div id="toolitem6" tabindex="-1" class="toolbar-item" role="button"><img src="toolbar_navigator.png"><img></div>
<div id="toolitem7" tabindex="-1" class="toolbar-item" role="button"><img src="toolbar_plc.png"><img></div>
<div id="toolitem8" tabindex="-1" class="toolbar-item" role="button"><img src="toolbar_history.png"><img></div>
<div id="toolitem9" tabindex="-1" class="toolbar-item" role="button"><img src="toolbar_object.png"><img></div>
<div id="toolitem10" tabindex="-1" class="toolbar-item" role="button"><img src="toolbar_crossref.png"><img></div>
<div id="toolitem11" tabindex="-1" class="toolbar-item" role="button"><img src="toolbar_help.png"><img></div>
<div id="toolitem12" tabindex="-1" class="toolbar-item" role="button"><img src="toolbar_classhelp.png"><img></div>
</div>
<!-- <div style="height:300px;overflow:auto;"> -->
<canvas id="flowcanvas" width="1200" height="800"></canvas>
<script src=ev.js></script>
<!-- </div> -->
<hr>
<address><a href="mailto:claes@debian86.ssab.com"></a></address>
</body>
<body>
<div class="toolbar" role="toolbar">
<div id="toolitem1" tabindex="0" class="toolbar-item" role="button">
<img src="toolbar_ack.png"/>....
</div>
<div id="toolitem2" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_navigator.png"/>
</div>
<div id="toolitem3" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_plc.png"/>....
</div>
<div id="toolitem4" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_graph.png"/>
</div>
<div id="toolitem5" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_objectgraph.png"/>
</div>
<div id="toolitem6" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_navigator.png"/>
</div>
<div id="toolitem7" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_plc.png"/>
</div>
<div id="toolitem8" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_history.png"/>
</div>
<div id="toolitem9" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_object.png"/>
</div>
<div id="toolitem10" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_crossref.png"/>
</div>
<div id="toolitem11" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_help.png"/>
</div>
<div id="toolitem12" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_classhelp.png"/>
</div>
</div>
<canvas id="flowcanvas" width="1200" height="800"></canvas>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script type="text/babel" src="pwr.js"></script>
<script type="text/babel" src="cli.js"></script>
<script type="text/babel" src="gdh.js"></script>
<script type="text/babel" src="plow.js"></script>
<script type="text/babel" src="ev.ts"></script>
<hr>
<address><a href="mailto:claes@debian86.ssab.com"></a></address>
</body>
</html>
This diff is collapsed.
This diff is collapsed.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Trace</title>
<link rel="stylesheet" type="text/css" href="toolbar.css">
</head>
<head>
<title>Trace</title>
<link rel="stylesheet" type="text/css" href="toolbar.css">
</head>
<body>
<div class="toolbar" role="toolbar">
<div id="toolitem1" tabindex="0" class="toolbar-item" role="button"><img src="toolbar_graph.png"><img></div>
<div id="toolitem2" tabindex="-1" class="toolbar-item" role="button"><img src="toolbar_navigator.png"><img></div>
<div id="toolitem3" tabindex="-1" class="toolbar-item" role="button"><img src="toolbar_history.png"><img></div>
<div id="toolitem4" tabindex="-1" class="toolbar-item" role="button"><img src="toolbar_object.png"><img></div>
<body>
<div class="toolbar" role="toolbar">
<div id="toolitem1" tabindex="0" class="toolbar-item" role="button">
<img src="toolbar_graph.png"/>
</div>
<!-- <div style="height:300px;overflow:auto;"> --!>
<canvas id="flowcanvas" width="1200" height="800"></canvas>
<script src=flow.js></script>
<!-- </div> --!>
<hr>
<address><a href="mailto:claes@debian86.ssab.com"></a></address>
<!-- Created: Tue Mar 13 16:22:00 CET 2018 -->
<!-- hhmts start -->
Last modified: Tue May 15 08:59:01 CEST 2018
<!-- hhmts end -->
</body>
<div id="toolitem2" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_navigator.png"/>
</div>
<div id="toolitem3" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_history.png"/>
</div>
<div id="toolitem4" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_object.png"/>
</div>
</div>
<canvas id="flowcanvas" width="1200" height="800"></canvas>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script type="text/babel" src="pwr.js"></script>
<script type="text/babel" src="gdh.js"></script>
<script type="text/babel" src="flow.ts"></script>
<hr>
<address><a href="mailto:claes@debian86.ssab.com"></a></address>
</body>
</html>
This diff is collapsed.
This diff is collapsed.
<!DOCTYPE html>
<html>
<head>
<title>Ge graph</title>
<link rel="stylesheet" type="text/css" href="toolbar.css">
</head>
<body>
<!-- <div style="height:300px;overflow:auto;"> -->
<canvas id="flowcanvas" width="1200" height="800"></canvas>
<script src=ge.js></script>
<!-- </div> -->
<hr>
<address><a href="mailto:claes@debian86.ssab.com"></a></address>
</body>
<head>
<title>Ge graph</title>
<link rel="stylesheet" type="text/css" href="toolbar.css">
</head>
<body>
<canvas id="flowcanvas" width="1200" height="800"></canvas>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script type="text/babel" src="pwr.js"></script>
<script type="text/babel" src="cli.js"></script>
<script type="text/babel" src="gdh.js"></script>
<script type="text/babel" src="glow.ts"></script>
<script type="text/babel" src="glow_color.ts"></script>
<script type="text/babel" src="glow_point.ts"></script>
<script type="text/babel" src="glow_transform.ts"></script>
<script type="text/babel" src="glow_annot.ts"></script>
<script type="text/babel" src="glow_arc.ts"></script>
<script type="text/babel" src="glow_array.ts"></script>
<script type="text/babel" src="glow_arrow.ts"></script>
<script type="text/babel" src="glow_cformat.ts"></script>
<script type="text/babel" src="glow_con.ts"></script>
<script type="text/babel" src="glow_conclass.ts"></script>
<script type="text/babel" src="glow_conpoint.ts"></script>
<script type="text/babel" src="glow_draw.ts"></script>
<script type="text/babel" src="glow_line.ts"></script>
<script type="text/babel" src="glow_node.ts"></script>
<script type="text/babel" src="glow_nodeclass.ts"></script>
<script type="text/babel" src="glow_nodegroup.ts"></script>
<script type="text/babel" src="glow_polyline.ts"></script>
<script type="text/babel" src="glow_rect.ts"></script>
<script type="text/babel" src="glow_text.ts"></script>
<script type="text/babel" src="grow_node.ts"></script>
<script type="text/babel" src="grow_rect.ts"></script>
<script type="text/babel" src="grow_annot.ts"></script>
<script type="text/babel" src="grow_arc.ts"></script>
<script type="text/babel" src="grow_axis.ts"></script>
<script type="text/babel" src="grow_axisarc.ts"></script>
<script type="text/babel" src="grow_bar.ts"></script>
<script type="text/babel" src="grow_bararc.ts"></script>
<script type="text/babel" src="grow_barchart.ts"></script>
<script type="text/babel" src="grow_conglue.ts"></script>
<script type="text/babel" src="grow_conpoint.ts"></script>
<script type="text/babel" src="grow_group.ts"></script>
<script type="text/babel" src="grow_image.ts"></script>
<script type="text/babel" src="grow_line.ts"></script>
<script type="text/babel" src="grow_menu.ts"></script>
<script type="text/babel" src="grow_pie.ts"></script>
<script type="text/babel" src="grow_polyline.ts"></script>
<script type="text/babel" src="grow_rectrounded.ts"></script>
<script type="text/babel" src="grow_scrollbar.ts"></script>
<script type="text/babel" src="grow_slider.ts"></script>
<script type="text/babel" src="grow_table.ts"></script>
<script type="text/babel" src="grow_text.ts"></script>
<script type="text/babel" src="grow_toolbar.ts"></script>
<script type="text/babel" src="grow_trend.ts"></script>
<script type="text/babel" src="grow_window.ts"></script>
<script type="text/babel" src="grow_xycurve.ts"></script>
<script type="text/babel" src="grow_folder.ts"></script>
<script type="text/babel" src="grow_ctx.ts"></script>
<script type="text/babel" src="grow_frame.ts"></script>
<script type="text/babel" src="ge.ts"></script>
<script type="text/babel" src="ge_dyn.ts"></script>
<script type="text/babel" src="ge_graph.ts"></script>
<script type="text/babel" src="ge_appl.ts"></script>
<hr>
<address><a href="mailto:claes@debian86.ssab.com"></a></address>
</body>
</html>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2338,12 +2338,12 @@ int pn_gsdml::string_to_datavalue(gsdml_eValueDataType datatype, void* value,
case gsdml_eValueDataType_Integer8:
if (sscanf(str, "%hhd", (char*)value) != 1)
return PB__SYNTAX;
value_reversed_endianess = value;
*(char*)value_reversed_endianess = *(char*)value;
break;
case gsdml_eValueDataType_Unsigned8:
if (sscanf(str, "%hhu", (unsigned char*)value) != 1)
return PB__SYNTAX;
value_reversed_endianess = value;
*(unsigned char*)value_reversed_endianess = *(unsigned char*)value;
break;
case gsdml_eValueDataType_Integer16: {
short v;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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