Project Functions

Proje fonksiyonları, script/expression ile proje bilgilerine erişmenizi sağlar. inSCADA Platformunda, proje bilgilerinin yanı sıra, uygulamamıza özel bir takım parametreleri proje altında statik olarak tutabiliyoruz. Bu statik parametreler ile uygulamalarımızın daha genel ve dinamik bir yapıda olmasını sağlayabiliriz. Bakınız Projeler

Get Project

object ins.getProject()

Proje bilgilerini okur.

Syntax

function getProjectProp(id,prop) {
var prj=ins.getProject();
var properties=JSON.parse(prj.properties);
var streams=JSON.parse(properties.STREAMS);
if (prop==="STREAM_NUMBER") {
    var counter=0;
    for (var i=0;i<streams.length;i++) {
         if (streams[i].id.substring(22,24)!=="00") {
         var prefix1=streams[i].id.substring(0,22);
         var prefix2=id.substring(0,22);
         if (prefix1==prefix2) counter=counter+1;
         }
    }
    return counter;
}
else 
{
    for (var z=0;z<streams.length;z++) {
         if (streams[z].id==id) return streams[z][prop];
    }
}
return "NOTOK";
}

getProjectProp("STN01_GRP01_PAY_STREAM01","STREAM_NUMBER");

veya

    var project=ins.getProject();
    return project;

sonuç

    {
    "lastModifiedDate":"2023-02-01T08:39:29.486+03:00",
    "lastModifiedBy":"yryskul",
    "creationDate":"2021-06-21T16:38:28.344+03:00",
    "createdBy":"inscada","latitude":37.0654293359997,
    "name":"DEMO_01",
    "properties":"{\"STREAMS\":\"{\\\"value\\\":[{\\\"id\\\":\\\"1\\\",\\\"name\\\":\\\"STREAMS\\\",\\\"usegc\\\":\\\"1\\\",\\\"qmin\\\":\\\"1\\\",\\\"qmax\\\":\\\"50\\\"}],\\\"type\\\":\\\"stream\\\"}\",\"PAGE01\":\"{\\\"value\\\":\\\"DEMO1\\\",\\\"type\\\":\\\"anime\\\"}\",\"Color Palette\":\"{\\\"value\\\":\\\"224 224 224 Display Background (no tabs)\\\\n224 224 224 Tab Panel Background\\\\n192 192 192 Display Background behind tabs (with tabs)\\\\n063 063 063 Title Foreground\\\\n063 063 063 Group Heading Foreground\\\\n063 063 063 Column Heading Foreground\\\\n216 216 216 Separator Line Color\\\\n160 160 164 Process and Connector lines\\\\n160 160 164 Equipment Border\\\\n232 232 232 Grouping Box\\\\n145 106 173 Low Priority Alarm\\\\n255 255 255 Low Priority Alarm Foreground\\\\n245 225 027 Medium Priority Alarm\\\\n063 063 063 Medium Priority Alarm Foreground\\\\n236 134 041 High Priority Alarm\\\\n255 255 255 High Priority Alarm Foreground\\\\n226 032 040 Urgent Priority Alarm\\\\n255 255 255 Urgent Priority Alarm Foreground\\\\n000 000 000 Program Error/Bad Configuration\\\\n255 255 255 Program Error/Bad Configuration Foreground\\\\n000 000 000 Fault Condition Background\\\\n255 255 255 Fault Condition Foreground\\\\n063 063 063 Warning Condition Background\\\\n255 255 255 Warning Condition Foreground\\\\n224 224 224 Prompts and Attention Background\\\\n000 000 000 Prompts and Attention Foreground\\\\n224 224 224 Testing or Simulation Background\\\\n000 000 000 Testing or Simulation Foreground\\\\n224 224 224 Other Abnormal State Background\\\\n000 000 000 Other Abnormal State Foreground\\\\n128 128 128 Off/De-energized/Idle/Stopped/Closed\\\\n240 240 240 On/Energized/Running/Closed\\\\n128 128 128 Disabled/Out of Service\\\\n147 164 228 Manual Operations (Jogging)\\\\n147 194 228 Transition (Starting, Stopping, Accelerating, Decelerating, Opening, Closing)\\\\n063 063 063 Label Foreground\\\\n145 145 145 Engineering Unit Foreground\\\\n063 063 063 Input Field Foreground (edits allowed)\\\\n063 063 063 Checkbox Foreground (edits allowed)\\\\n063 063 063 Radio Button Foreground (edits allowed)\\\\n192 192 192 Input Field Foreground (edits prohibited)\\\\n192 192 192 Checkbox Foreground (edits prohibited)\\\\n192 192 192 Radio Button Foreground (edits prohibited)\\\\n255 255 255 Input Field, Checkbox, Radio Button Background (edits allowed)\\\\n224 224 224 Input Field, Checkbox, Radio Button Background (edits prohibited)\\\\n063 063 063 Label Foreground\\\\n145 145 145 Engineering Unit Foreground\\\\n071 092 167 Data Foreground\\\\n192 192 192 Data Border (for diagrams only)\\\\n071 092 167 Primary State Indicator Foreground\\\\n212 212 212 Primary State Indicator Background\\\\n198 198 198 Foreground (Fill)\\\\n170 170 170 Border (Outline)\\\\n063 063 063 Label\\\\n128 128 128 Off/De-energized/Idle/Stopped\\\\n240 240 240 On/Energized/Running\\\\n128 128 128 Disabled/Out of Service\\\\n147 194 228 Manual Operations (Jogging)\\\\n147 194 228 Transition: Starting, Stopping, Accelerating, Decelerating\\\\n128 128 128 Closed\\\\n240 240 240 Open\\\\n147 194 228 Stopped\\\\n128 128 128 Closing/Opening\\\",\\\"type\\\":\\\"default\\\"}\"}","contractDay":null,"address":"37.06542933599965, 37.40082886624169","dsc":"","isActive":true,"longitude":37.4008288662417,"contractHour":"","icon":"\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n \n UNIT 1 ENERGY VALUES [PROTECTION RELAY]\n \n \n \n \n VALUE\n U12\n \n \n \n \n \n \n VALUE\n U23\n \n \n \n \n \n \n VALUE\n U13\n \n \n \n \n \n \n \n \n VALUE\n I1\n \n \n \n \n \n \n VALUE\n I2\n \n \n \n \n \n \n VALUE\n I3\n \n \n \n \n \n VALUE\n P\n \n \n \n \n VALUE\n Q\n \n \n \n \n \n \n VALUE\n S\n \n \n \n \n \n \n VALUE\n F\n \n \n \n \n \n \n VALUE\n PF\n \n \n \n \n \n \n -\n -\n \n \n \n DATE TIME\n \n \n \n \n GRID ENERGY VALUES [PROTECTION RELAY]\n \n \n \n \n VALUE\n U12\n \n \n \n \n \n \n VALUE\n U23\n \n \n \n \n \n \n VALUE\n U13\n \n \n \n \n \n \n \n \n VALUE\n I1\n \n \n \n \n \n \n VALUE\n I2\n \n \n \n \n \n \n VALUE\n I3\n \n \n \n \n \n VALUE\n P\n \n \n VALUE\n Q\n \n \n \n \n VALUE\n S\n \n \n \n \n \n \n \n VALUE\n F\n \n \n \n \n \n \n VALUE\n PF\n \n \n \n \n \n \n -\n -\n \n \n \n \n \n \n TRP\n \n \n \n ALM\n \n \n WATCH DOG \n DATE TIME\n \n \n \n \n \n \n Auto Start\n \n \n \n \n Stop\n \n \n \n \n Manuel\n \n \n \n \n \n Alarm Reset\n \n \n \n \n WATER LEVELS\n \n \n VALUE\n REGULATOR\n \n \n VALUE\n LOAD POOL\n \n \n \n \n \n \n \n \n CB 1\n DC 1\n DC 2\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n GEN\n TRF\n \n \n \n \n \n \n \n \n UNIT 1 ENERGY VALUES [PROTECTION RELAY]\n \n \n \n \n VALUE\n U12\n \n \n \n \n \n \n VALUE\n U23\n \n \n \n \n \n \n VALUE\n U13\n \n \n \n \n \n \n \n \n VALUE\n I1\n \n \n \n \n \n \n VALUE\n I2\n \n \n \n \n \n \n VALUE\n I3\n \n \n \n \n \n VALUE\n P\n \n \n \n \n VALUE\n Q\n \n \n \n \n \n \n VALUE\n S\n \n \n \n \n \n \n VALUE\n F\n \n \n \n \n \n \n VALUE\n PF\n \n \n \n \n \n \n -\n -\n \n \n \n DATE TIME\n \n \n \n \n \n \n Auto Start\n \n \n \n \n Stop\n \n \n \n \n Manuel\n \n \n \n \n \n Alarm Reset\n \n \n \n \n \n \n \n \n \n \n CB 1\n DC 1\n DC 2\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n GEN\n TRF\n \n \n \n \n \n \n \n \n UNIT 1 ENERGY VALUES [PROTECTION RELAY]\n \n \n \n \n VALUE\n U12\n \n \n \n \n \n \n VALUE\n U23\n \n \n \n \n \n \n VALUE\n U13\n \n \n \n \n \n \n \n \n VALUE\n I1\n \n \n \n \n \n \n VALUE\n I2\n \n \n \n \n \n \n VALUE\n I3\n \n \n \n \n \n VALUE\n P\n \n \n \n \n VALUE\n Q\n \n \n \n \n \n \n VALUE\n S\n \n \n \n \n \n \n VALUE\n F\n \n \n \n \n \n \n VALUE\n PF\n \n \n \n \n \n \n -\n -\n \n \n \n DATE TIME\n \n \n \n \n \n \n Auto Start\n \n \n \n \n Stop\n \n \n \n \n Manuel\n \n \n \n \n \n Alarm Reset\n \n \n \n \n \n \n \n \n \n \n CB 1\n DC 1\n DC 2\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n GEN\n TRF\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 3\n GATE\n 2\n GATE\n 1\n GATE\n \n\n",
    "id":2}

Last updated