553 lines
26 KiB
SQL
553 lines
26 KiB
SQL
<% /*
|
|
$Revision: 1 $
|
|
$Modtime: 15-09-09 9:26 $
|
|
|
|
File: symbols.inc
|
|
Description: Functies om symbolen (ins_deel) te tekenen
|
|
Parameters:
|
|
Context:
|
|
Note:
|
|
*/
|
|
|
|
// Result: false: ik mag niet schrijven
|
|
// true: ik mag wel schrijven
|
|
// Veronderstel dat autorisatie minimaal verdieping is, ruimte wordt niet ondersteund
|
|
function canWriteInsDeel(deel_key, vKey)
|
|
{
|
|
// Hebben we wel schrijfrechten op dit symbool op deze verdieping?
|
|
var sql = "SELECT MIN(fac_gebruiker_alg_level_write) lvl"
|
|
+ " FROM fac_v_webgebruiker w, fac_functie f, ins_deel idd "
|
|
+ " WHERE w.ins_discipline_key = idd.ins_discipline_key "
|
|
+ " AND w.fac_functie_key = f.fac_functie_key "
|
|
+ " AND w.prs_perslid_key = " + user_key
|
|
+ " AND fac_functie_code = 'WEB_INSMAN'"
|
|
+ " AND ins_deel_key = " + deel_key;
|
|
var oRs = Oracle.Execute(sql);
|
|
if (oRs.eof)
|
|
return false; // Geen rechten
|
|
|
|
var ALGWriteLevel = oRs("lvl").value;
|
|
if (ALGWriteLevel == 9)
|
|
return false; // Geen rechten
|
|
|
|
if (ALGWriteLevel < 0)
|
|
return true; // Alle rechten
|
|
|
|
var fac_v_my_disc_onrgoed_write = ""
|
|
+ "SELECT a.alg_ruimte_key"
|
|
+ " FROM alg_v_onrgoed_familie a,"
|
|
+ " alg_v_onrgoed_familie aa,"
|
|
+ " alg_v_my_room mr"
|
|
+ " WHERE mr.alg_ruimte_key = aa.alg_ruimte_key"
|
|
+ " AND mr.prs_perslid_key = " + user_key
|
|
+ " AND a.alg_onrgoed_elder_key = aa.alg_onrgoed_elder_key"
|
|
+ " AND aa.niveau = a.niveau" // Noodzakelijk want ALG_LOCATIE heeft eigen sequence
|
|
+ " AND aa.niveau >= " + ALGWriteLevel
|
|
|
|
var rsql = " SELECT 1" // plaatsgebonden en gebruiker heeft een plaats (werkplek)
|
|
+ " FROM ("+fac_v_my_disc_onrgoed_write+") oga, alg_ruimte ar"
|
|
+ " WHERE oga.alg_ruimte_key = ar.alg_ruimte_key"
|
|
+ " AND ar.alg_verdieping_key = " + vKey
|
|
|
|
return !(Oracle.Execute(rsql).eof);
|
|
}
|
|
|
|
/************************************************************\
|
|
* Voeg alle symbolen van de huidige discipline(s) toe aan
|
|
* de tekening
|
|
* Een en ander altijd binnen te tonen disciplines waarbij
|
|
* een ins_srtdeel_acadsymbol is ingevuld
|
|
*
|
|
* Merk op dat een dobbelsteen verschillende symbolen kan bevatten
|
|
*
|
|
* LOOP: Per ruimte/aantal binnen verdieping met objecten zonder XY
|
|
* - Bepaal linksboven van de dobbelsteen
|
|
* LOOP: Per srtdeel binnen te tonen disciplines
|
|
* - Maak een symbool aan
|
|
* - LOOP: per object van deze soort in deze ruimte
|
|
* Teken een symbool van dit object volgens
|
|
* volgende positie dobbelpatroon
|
|
|
|
* LOOP: Per srtdeel
|
|
* - Maak een symbool aan
|
|
* - LOOP: per object met ingevulde XY
|
|
* - Teken het symbool op XY
|
|
*
|
|
\************************************************************/
|
|
var _symbolDefs = []; // Welke hebben we al gedefinieerd.
|
|
function DefineSymbol(cHandle, acadSymbol)
|
|
{
|
|
var symbolname = acadSymbol;
|
|
if (typeof _symbolDefs[symbolname] != 'undefined')
|
|
return symbolname; // Direct klaar
|
|
|
|
//Maak symbool definitie
|
|
var symbolFile = fg_symbols_path + acadSymbol + ".dwf"
|
|
fso = new ActiveXObject("Scripting.FileSystemObject");
|
|
if (fso.FileExists(symbolFile))
|
|
{
|
|
var xs = new ActiveXObject("SLNKDWF.DWFFile")
|
|
xs.Open(symbolFile);
|
|
cHandle.DefineSymbol(symbolname, xs.EplotSections.Item(0));
|
|
}
|
|
else
|
|
{
|
|
// Symbool bestand niet gevonden. Later wordt dit vanzelf een *STAR symbool
|
|
}
|
|
_symbolDefs[symbolname] = true;
|
|
return symbolname;
|
|
}
|
|
|
|
// Voeg alle symbolen (INS_DEEL) toe aan de tekening
|
|
// Gelukkig bevat pDiscs alleen disciplines waar we leesrechten op hebben dus
|
|
// dat hoeven we niet meer te controleren.
|
|
// Globalen als colKey etc. zijn al gezet
|
|
function addObjecten(cHandle)
|
|
{
|
|
if ( pDiscs == "" || pDiscs == "-1")
|
|
return;
|
|
|
|
var symbolArray = []; // Hierin onthouden we even onze symbolen om later labels te kunnen zetten
|
|
|
|
//
|
|
// Bepaal afmeting dobbelsteen
|
|
// Tel per ruimte over alle disciplines heen waar symboolnaam in ingevuld
|
|
// Dat aantal moeten we van te voren weten om linksboven de dobbel te
|
|
// kunnen beginnen
|
|
sql = "SELECT ins_alg_ruimte_key alg_ruimte_key, cadlabel, count(*) aantal"
|
|
+ " FROM ins_deel id, ins_srtdeel isd, ins_srtgroep isg, "+syncView+" SYNC"
|
|
+ " WHERE id.ins_alg_ruimte_key = SYNC."+colKey
|
|
// + " AND id.ins_alg_ruimte_type = 'R'"
|
|
+ " AND id.ins_srtdeel_key = isd.ins_srtdeel_key"
|
|
+ " AND ins_deel_dwgx IS NULL AND ins_deel_dwgy IS NULL"
|
|
+ " AND "+syncParent+" = " + pvKey
|
|
+ " AND ins_deel_verwijder IS NULL"
|
|
+ " AND ins_deel_parent_key IS NULL"
|
|
+ " AND isd.ins_srtgroep_key = isg.ins_srtgroep_key"
|
|
+ " AND ins_srtdeel_acadsymbol IS NOT NULL"
|
|
+ " AND id.ins_discipline_key in (" + pDiscs +")"
|
|
+ " AND isg.ins_discipline_key in (" + pDiscs +")"
|
|
+ " GROUP BY ins_alg_ruimte_key, cadlabel"
|
|
oRsRuimte = Oracle.Execute(sql);
|
|
while (!oRsRuimte.EOF)
|
|
{
|
|
var symbols =
|
|
buildDobbel(cHandle,
|
|
{ aantal: oRsRuimte("aantal").value, // Zoveel symbolen voor onze dobbelsteen
|
|
ruimte: oRsRuimte("cadlabel"),
|
|
fnLabel: function (rs)
|
|
{ return "[c][S"+fg_dobbelScale*fg_inINSLabelSize+"][c808080]" + rs("oms");
|
|
},
|
|
sql : "SELECT 'I:'||ins_deel_key key, ins_deel_omschrijving oms,"
|
|
+ " ins_srtdeel_acadsymbol symbolname"
|
|
+ " FROM ins_deel id, ins_srtdeel isd, ins_srtgroep isg"
|
|
+ " WHERE id.ins_alg_ruimte_key = " + oRsRuimte("alg_ruimte_key")
|
|
+ " AND id.ins_srtdeel_key = isd.ins_srtdeel_key"
|
|
+ " AND ins_deel_dwgx IS NULL AND ins_deel_dwgy IS NULL"
|
|
+ " AND isd.ins_srtgroep_key = isg.ins_srtgroep_key"
|
|
+ " AND ins_srtdeel_acadsymbol IS NOT NULL"
|
|
+ " AND isg.ins_discipline_key in (" + pDiscs + ")"
|
|
+ " AND id.ins_discipline_key in (" + pDiscs + ")"
|
|
+ " AND ins_deel_verwijder IS NULL"
|
|
+ " AND ins_deel_parent_key IS NULL"
|
|
+ " ORDER BY isg.ins_discipline_key, isg.ins_srtgroep_key, "
|
|
+ " isd.ins_srtdeel_key, ins_deel_omschrijving"
|
|
}
|
|
)
|
|
|
|
for (var xx in symbols)
|
|
symbolArray[xx] = symbols[xx];
|
|
oRsRuimte.MoveNext();
|
|
}
|
|
oRsRuimte.Close();
|
|
|
|
//
|
|
// Nu nog de ins_deel met ingevulde XY
|
|
//
|
|
sql = "SELECT 'I:'||ins_deel_key key, ins_deel_omschrijving oms, ins_srtdeel_omschrijving,"
|
|
+ " ins_deel_dwgx dwgx, ins_deel_dwgy dwgy,"
|
|
+ " ins_deel_dwgrotatie rot, ins_deel_dwgschaal scl,"
|
|
+ " ins_srtdeel_acadsymbol symbolname, cadlabel"
|
|
+ " FROM ins_deel id, ins_srtdeel isd, ins_srtgroep isg, "+syncView+" SYNC"
|
|
+ " WHERE id.ins_alg_ruimte_key = SYNC."+colKey
|
|
+ " AND id.ins_srtdeel_key = isd.ins_srtdeel_key"
|
|
// + " AND id.ins_alg_ruimte_type = 'R'"
|
|
+ " AND ins_deel_dwgx IS NOT NULL"
|
|
+ " AND "+syncParent+" = " + pvKey
|
|
+ " AND ins_deel_verwijder IS NULL"
|
|
+ " AND ins_deel_parent_key IS NULL"
|
|
+ " AND isd.ins_srtgroep_key = isg.ins_srtgroep_key"
|
|
+ " AND INS_SRTDEEL_ACADSYMBOL IS NOT NULL"
|
|
+ " AND isg.ins_discipline_key in (" + pDiscs +")"
|
|
+ " AND id.ins_discipline_key in (" + pDiscs +")"
|
|
+ " ORDER BY isd.ins_srtdeel_key"
|
|
symbols = buildSymbols(cHandle, { sql : sql,
|
|
fnLabel: function (rs)
|
|
{ return "[c][S"+fg_inINSLabelSize+"][c000000]" + rs("oms");
|
|
},
|
|
fnProcess: function (symbol, rs)
|
|
{
|
|
//symbol.Contour.SetColor(0x00FF00, 32); // groene achtergrond
|
|
//symbol.Contour.Hatch=3; // groene achtergrond
|
|
//symbol.SetColor(0x00FF00, 255); // groen maken
|
|
}
|
|
}
|
|
);
|
|
for (var xx in symbols)
|
|
symbolArray[xx] = symbols[xx];
|
|
|
|
themaProps={ symbols: symbolArray,
|
|
labelThema:pLabel,
|
|
kleurThema: pThema,
|
|
colorSymbol : true, // in plaats van de bounding contour
|
|
fnSql: function (viewName)
|
|
{
|
|
return "SELECT 'I:'||id.ins_deel_key key, waarde"
|
|
+ " FROM ins_deel id, ins_srtdeel isd, ins_srtgroep isg, "+dbTable+" SYNC, " + viewName + " THEMA"
|
|
+ " WHERE id.ins_alg_ruimte_key = SYNC."+colKey
|
|
+ " AND id.ins_srtdeel_key = isd.ins_srtdeel_key"
|
|
+ " AND "+syncParent+" = " + pvKey
|
|
+ " AND ins_deel_verwijder IS NULL"
|
|
+ " AND ins_deel_parent_key IS NULL"
|
|
+ " AND isd.ins_srtgroep_key = isg.ins_srtgroep_key"
|
|
+ " AND ins_srtdeel_acadsymbol IS NOT NULL"
|
|
+ " AND isg.ins_discipline_key in (" + pDiscs +")"
|
|
+ " AND THEMA.ins_deel_key = id.ins_deel_key"
|
|
+ " ORDER BY isd.ins_srtdeel_key"
|
|
}
|
|
}
|
|
// Symbool label thema's
|
|
if ((labelType & 0x18) == 0x10) // Bit 4/5 moet 10 zijn voor objecten
|
|
labelThema(cHandle, themaProps)
|
|
|
|
// Symbool kleur thema's
|
|
if ((themaType & 0x18) == 0x10) // Bit 4/5 moet 10 zijn voor objecten
|
|
kleurThema(cHandle, themaProps)
|
|
}
|
|
|
|
// INS_DEELen die gekoppeld zijn aan werkplekken ('inventaris');
|
|
// We tonen ze alleen als ze XY hebben
|
|
function addWerkplekObjecten(cHandle)
|
|
{
|
|
if ( pDiscs == "" || pDiscs == "-1")
|
|
return;
|
|
//
|
|
// Nu nog de gewone objecten met XY
|
|
//
|
|
sql = "SELECT ins_deel_key, ins_deel_omschrijving oms, ins_srtdeel_omschrijving,"
|
|
+ " coalesce(ins_deel_dwgx,0) dwgx, coalesce(ins_deel_dwgy,0) dwgy, "
|
|
+ " coalesce(ins_deel_dwgrotatie,0)ins_deel_dwgrotatie, coalesce(ins_deel_dwgschaal,1.0)ins_deel_dwgschaal,"
|
|
+ " prs_werkplek_dwgx wdwgx, prs_werkplek_dwgy wdwgy,"
|
|
+ " prs_werkplek_dwgrotatie, prs_werkplek_dwgschaal,"
|
|
+ " isd.ins_srtdeel_key, ins_srtdeel_acadsymbol, cadlabel"
|
|
+ " FROM ins_deel id, ins_srtdeel isd, ins_srtgroep isg, "+fg_syncruimteview+" SYNC,"
|
|
+ " prs_werkplek pw"
|
|
+ " WHERE pw.prs_alg_ruimte_key = SYNC.alg_ruimte_key"
|
|
+ " AND id.ins_alg_ruimte_key = pw.prs_werkplek_key"
|
|
+ " AND id.ins_alg_ruimte_type = 'W'"
|
|
+ " AND id.ins_srtdeel_key = isd.ins_srtdeel_key"
|
|
+ " AND prs_werkplek_dwgx IS NOT NULL" // werkplek moet wel geplaatst zijn
|
|
+ " AND alg_verdieping_key = " + pvKey
|
|
+ " AND isg.ins_discipline_key in (" + pDiscs +")"
|
|
+ " AND ins_deel_verwijder IS NULL"
|
|
+ " AND ins_deel_parent_key IS NULL"
|
|
+ " AND isd.ins_srtgroep_key = isg.ins_srtgroep_key"
|
|
+ " AND ins_srtdeel_acadsymbol IS NOT NULL"
|
|
+ " ORDER BY isd.ins_srtdeel_key"
|
|
var oRs = Oracle.Execute(sql);
|
|
|
|
var symbolArray = [];
|
|
while (!oRs.EOF)
|
|
{
|
|
var symbolName = DefineSymbol(cHandle, oRs("ins_srtdeel_acadsymbol"));
|
|
|
|
var wRot = oRs("prs_werkplek_dwgrotatie").value;
|
|
if (wRot==null) wRot=0;
|
|
|
|
dwRot = wRot*3.1415926/180;
|
|
var scl = 1.0;
|
|
if (oRs("prs_werkplek_dwgschaal").value != null)
|
|
scl=oRs("prs_werkplek_dwgschaal").value;
|
|
|
|
var insX=oRs("wdwgX")+scl*(Math.cos(dwRot)*oRs("dwgX")-Math.sin(dwRot)*oRs("dwgY"));
|
|
var insY=oRs("wdwgY")+scl*(Math.cos(dwRot)*oRs("dwgY")+Math.sin(dwRot)*oRs("dwgX"));
|
|
|
|
var symbol = cHandle.AddSymbol(insX, insY, oRs("ins_srtdeel_acadsymbol"));
|
|
if (oRs("ins_deel_dwgrotatie").value != null)
|
|
symbol.rotation = (wRot+oRs("ins_deel_dwgrotatie")+360)%360;
|
|
var scl = 1.0;
|
|
if (oRs("ins_deel_dwgschaal").value != null)
|
|
scl = oRs("ins_deel_dwgschaal").value;
|
|
symbol.scale = scl;
|
|
symbol.Contour.Key = "IW:"+oRs("ins_deel_key");
|
|
symbolArray[symbol.Contour.Key] = symbol; // Onthouden voor later
|
|
symbol.Contour.Label = "[c][S"+fg_inINSLabelSize+"][c000000]"+oRs("oms");
|
|
symbol.Contour.SetUrl("", oRs("oms"));
|
|
//symbol.Contour.SetColor(0x0000FF, 64);
|
|
//symbol.SetColor(0xFF0000,255); // Maak onzichtbaar
|
|
|
|
oRs.MoveNext();
|
|
}
|
|
oRs.Close();
|
|
|
|
// thema's
|
|
themaProps={ symbols: symbolArray,
|
|
labelThema:pLabel,
|
|
kleurThema: pThema,
|
|
colorSymbol : true, // in plaats van de bounding contour
|
|
fnSql: function (viewName)
|
|
{
|
|
return "SELECT 'IW:'||id.ins_deel_key key, waarde"
|
|
+ " FROM ins_deel id, ins_srtdeel isd, ins_srtgroep isg, "
|
|
+ " ALG_RUIMTE SYNC, " + viewName + " THEMA,"
|
|
+ " prs_werkplek pw"
|
|
+ " WHERE pw.prs_alg_ruimte_key = SYNC.alg_ruimte_key"
|
|
+ " AND id.ins_alg_ruimte_key = pw.prs_werkplek_key"
|
|
+ " AND id.ins_alg_ruimte_type = 'W'"
|
|
+ " AND id.ins_srtdeel_key = isd.ins_srtdeel_key"
|
|
+ " AND alg_verdieping_key = " + pvKey
|
|
+ " AND ins_deel_verwijder IS NULL"
|
|
+ " AND ins_deel_parent_key IS NULL"
|
|
+ " AND isd.ins_srtgroep_key = isg.ins_srtgroep_key"
|
|
+ " AND ins_srtdeel_acadsymbol IS NOT NULL"
|
|
+ " AND isg.ins_discipline_key in (" + pDiscs +")"
|
|
+ " AND THEMA.ins_deel_key = id.ins_deel_key"
|
|
+ " ORDER BY isd.ins_srtdeel_key"
|
|
}
|
|
}
|
|
// Symbool label thema's
|
|
if ((labelType & 0x18) == 0x10) // Bit 4/5 moet 10 zijn voor objecten
|
|
labelThema(cHandle, themaProps)
|
|
|
|
// Symbool kleur thema's
|
|
if ((themaType & 0x18) == 0x10) // Bit 4/5 moet 10 zijn voor objecten
|
|
kleurThema(cHandle, themaProps)
|
|
}
|
|
|
|
// Plaats de ruimtegebonden objecten (werkplekgebonden gebeurt in addPRJWerkplekObjecten)
|
|
function addPRJObjecten(cHandle)
|
|
{
|
|
if ( pDiscs == "" || pDiscs == "-1")
|
|
return;
|
|
|
|
var symbolArray = []; // Hierin onthouden we even onze symbolen om later labels te kunnen zetten
|
|
|
|
//
|
|
// Bepaal afmeting dobbelsteen
|
|
// Tel per ruimte over alle disciplines heen waar symboolnaam in ingevuld
|
|
// Dat aantal moeten we van te voren weten om linksboven de dobbel te
|
|
// kunnen beginnen
|
|
sql = "SELECT id.prj_ruimte_key, cadlabel, count(*) aantal"
|
|
+ " FROM prj_deel id, ins_srtdeel isd, ins_srtgroep isg, "+syncView+" SYNC"
|
|
+ " WHERE id.prj_ruimte_key = SYNC."+colKey
|
|
+ " AND id.prj_werkplek_key is null"
|
|
+ " AND id.ins_srtdeel_key = isd.ins_srtdeel_key"
|
|
+ " AND prj_deel_dwgx IS NULL AND prj_deel_dwgy IS NULL"
|
|
+ " AND "+syncParent+" = " + pvKey
|
|
+ " AND prj_deel_verwijder IS NULL"
|
|
+ " AND isd.ins_srtgroep_key = isg.ins_srtgroep_key"
|
|
+ " AND ins_srtdeel_acadsymbol IS NOT NULL"
|
|
+ " AND isg.ins_discipline_key in (" + pDiscs +")"
|
|
+ " AND prj_scenario_key = " + scenario_key
|
|
+ " GROUP BY id.prj_ruimte_key, cadlabel"
|
|
oRsRuimte = Oracle.Execute(sql);
|
|
while (!oRsRuimte.EOF)
|
|
{
|
|
var symbols =
|
|
buildDobbel(cHandle,
|
|
{ aantal: oRsRuimte("aantal").value, // Zoveel symbolen voor onze dobbelsteen
|
|
ruimte: oRsRuimte("cadlabel"),
|
|
fnLabel: function (rs)
|
|
{ return "[c][S"+fg_dobbelScale*fg_inINSLabelSize+"][c808080]" + rs("oms");
|
|
},
|
|
sql : "SELECT 'I:'||prj_deel_key key, prj_deel_omschrijving oms,"
|
|
+ " ins_srtdeel_acadsymbol symbolname"
|
|
+ " FROM prj_deel id, ins_srtdeel isd, ins_srtgroep isg"
|
|
+ " WHERE id.prj_ruimte_key = " + oRsRuimte("prj_ruimte_key")
|
|
+ " AND id.prj_werkplek_key is null"
|
|
+ " AND id.ins_srtdeel_key = isd.ins_srtdeel_key"
|
|
+ " AND prj_deel_dwgx IS NULL AND prj_deel_dwgy IS NULL"
|
|
+ " AND isd.ins_srtgroep_key = isg.ins_srtgroep_key"
|
|
+ " AND ins_srtdeel_acadsymbol IS NOT NULL"
|
|
+ " AND isg.ins_discipline_key in (" + pDiscs + ")"
|
|
+ " AND prj_deel_verwijder IS NULL"
|
|
+ " ORDER BY isg.ins_discipline_key, isg.ins_srtgroep_key, "
|
|
+ " isd.ins_srtdeel_key, prj_deel_omschrijving"
|
|
}
|
|
)
|
|
|
|
for (var xx in symbols)
|
|
symbolArray[xx] = symbols[xx];
|
|
oRsRuimte.MoveNext();
|
|
}
|
|
oRsRuimte.Close();
|
|
|
|
//
|
|
// Nu nog de prj_deel met ingevulde XY
|
|
//
|
|
sql = "SELECT 'I:'||prj_deel_key key, prj_deel_omschrijving oms, ins_srtdeel_omschrijving,"
|
|
+ " prj_deel_dwgx dwgx, prj_deel_dwgy dwgy,"
|
|
+ " prj_deel_dwgrotatie rot, prj_deel_dwgschaal scl,"
|
|
+ " ins_srtdeel_acadsymbol symbolname, cadlabel,"
|
|
+ " prj_deel_verwijder"
|
|
+ " FROM prj_deel id, ins_srtdeel isd, ins_srtgroep isg, "+syncView+" SYNC"
|
|
+ " WHERE id.prj_ruimte_key = SYNC."+colKey
|
|
+ " AND id.ins_srtdeel_key = isd.ins_srtdeel_key"
|
|
+ " AND prj_deel_dwgx IS NOT NULL"
|
|
+ " AND "+syncParent+" = " + pvKey
|
|
// + " AND prj_deel_verwijder IS NULL"
|
|
+ " AND isd.ins_srtgroep_key = isg.ins_srtgroep_key"
|
|
+ " AND INS_SRTDEEL_ACADSYMBOL IS NOT NULL"
|
|
+ " AND isg.ins_discipline_key in (" + pDiscs +")"
|
|
+ " AND prj_scenario_key = " + scenario_key
|
|
+ " ORDER BY isd.ins_srtdeel_key"
|
|
symbols = buildSymbols(cHandle, { sql : sql,
|
|
fnLabel: function (rs)
|
|
{ if (rs("prj_deel_verwijder").Value == null)
|
|
return "[c][s30][c000000]" + rs("oms");
|
|
else
|
|
return "[c][s30][c404040]"
|
|
+ lcl_fg_obj_deleted
|
|
+ "\n[c][s30][c404040]" + rs("oms");
|
|
},
|
|
fnProcess: function (symbol, rs)
|
|
{
|
|
//symbol.Contour.Hatch = 3;
|
|
//symbol.Contour.SetColor(0xFF00FF, 64); // Blauwe achtergrond
|
|
if (rs("prj_deel_verwijder").Value != null)
|
|
symbol.SetColor(0x404040, 255); // grijs maken
|
|
}
|
|
}
|
|
);
|
|
for (var xx in symbols)
|
|
symbolArray[xx] = symbols[xx];
|
|
|
|
themaProps= { symbols: symbolArray,
|
|
labelThema: pLabel,
|
|
kleurThema: pThema,
|
|
colorSymbol : true, // in plaats van de bounding contour
|
|
fnSql:function (viewName)
|
|
{
|
|
return "SELECT 'I:'||id.prj_deel_key key, waarde"
|
|
+ " FROM prj_deel id, ins_srtdeel isd, ins_srtgroep isg, "
|
|
+ " PRJ_RUIMTE SYNC, " + viewName + " THEMA"
|
|
+ " WHERE id.prj_ruimte_key = SYNC.prj_ruimte_key"
|
|
+ " AND id.prj_werkplek_key is null"
|
|
+ " AND id.ins_srtdeel_key = isd.ins_srtdeel_key"
|
|
+ " AND alg_verdieping_key = " + pvKey
|
|
+ " AND prj_deel_verwijder IS NULL"
|
|
+ " AND isd.ins_srtgroep_key = isg.ins_srtgroep_key"
|
|
+ " AND ins_srtdeel_acadsymbol IS NOT NULL"
|
|
+ " AND isg.ins_discipline_key in (" + pDiscs +")"
|
|
+ " AND THEMA.prj_deel_key = id.prj_deel_key"
|
|
+ " AND prj_scenario_key = " + scenario_key
|
|
+ " ORDER BY isd.ins_srtdeel_key"
|
|
}
|
|
}
|
|
// Symbool label thema's
|
|
if ((labelType & 0x18) == 0x10) // Bit 4/5 moet 10 zijn voor objecten
|
|
labelThema(cHandle, themaProps);
|
|
|
|
// Symbool kleur thema's
|
|
if ((themaType & 0x18) == 0x10) // Bit 4/5 moet 10 zijn voor objecten
|
|
kleurThema(cHandle, themaProps)
|
|
|
|
}
|
|
|
|
// INS_DEELen die gekoppeld zijn aan werkplekken ('inventaris')
|
|
// voor werkplek gebonden objecten doen we (nog) geen dobbelsteen
|
|
function addPRJWerkplekObjecten(cHandle)
|
|
{
|
|
if ( pDiscs == "" || pDiscs == "-1")
|
|
return;
|
|
//
|
|
// Nu nog de gewone objecten met XY
|
|
//
|
|
sql = "SELECT prj_deel_key, prj_deel_omschrijving oms, ins_srtdeel_omschrijving,"
|
|
+ " coalesce(prj_deel_dwgx,0) dwgx, coalesce(prj_deel_dwgy,0) dwgy, "
|
|
+ " coalesce(prj_deel_dwgrotatie,0) rot, coalesce(prj_deel_dwgschaal,1.0) scl,"
|
|
+ " prj_werkplek_dwgx wdwgx, prj_werkplek_dwgy wdwgy,"
|
|
+ " prj_werkplek_dwgrotatie wrot, prj_werkplek_dwgschaal wscl,"
|
|
+ " isd.ins_srtdeel_key, ins_srtdeel_acadsymbol, cadlabel"
|
|
+ " FROM prj_deel id, ins_srtdeel isd, ins_srtgroep isg, "+fg_prj_syncruimteview+" SYNC,"
|
|
+ " prj_werkplek pw"
|
|
+ " WHERE pw.prj_ruimte_key = SYNC.prj_ruimte_key"
|
|
+ " AND id.prj_werkplek_key = pw.prj_werkplek_key"
|
|
+ " AND id.ins_srtdeel_key = isd.ins_srtdeel_key"
|
|
+ " AND prj_werkplek_dwgx IS NOT NULL" // werkplek moet wel geplaatst zijn
|
|
+ " AND alg_verdieping_key = " + pvKey
|
|
+ " AND isg.ins_discipline_key in (" + pDiscs +")"
|
|
+ " AND prj_deel_verwijder IS NULL"
|
|
+ " AND isd.ins_srtgroep_key = isg.ins_srtgroep_key"
|
|
+ " AND ins_srtdeel_acadsymbol IS NOT NULL"
|
|
+ " AND prj_scenario_key = " + scenario_key
|
|
+ " ORDER BY isd.ins_srtdeel_key"
|
|
var oRs = Oracle.Execute(sql);
|
|
|
|
var symbolArray = [];
|
|
while (!oRs.EOF)
|
|
{
|
|
var symbolName = DefineSymbol(cHandle, oRs("ins_srtdeel_acadsymbol"));
|
|
|
|
var wRot = oRs("wrot").value;
|
|
if (wRot==null) wRot=0;
|
|
|
|
var dwRot = wRot*3.1415926/180;
|
|
var scl = 1.0;
|
|
if (oRs("wscl").value != null)
|
|
scl=oRs("wscl").value;
|
|
|
|
var insX=oRs("wdwgX")+scl*(Math.cos(dwRot)*oRs("dwgX")-Math.sin(dwRot)*oRs("dwgY"));
|
|
var insY=oRs("wdwgY")+scl*(Math.cos(dwRot)*oRs("dwgY")+Math.sin(dwRot)*oRs("dwgX"));
|
|
|
|
var symbol = cHandle.AddSymbol(insX, insY, oRs("ins_srtdeel_acadsymbol"));
|
|
if (oRs("rot").value != null)
|
|
symbol.rotation = (wRot+oRs("rot")+360)%360;
|
|
var scl = 1.0;
|
|
if (oRs("scl").value != null)
|
|
scl = oRs("scl").value;
|
|
symbol.scale = scl;
|
|
symbol.Contour.Key = "IW:"+oRs("prj_deel_key");
|
|
symbolArray[symbol.Contour.Key] = symbol; // Onthouden voor later
|
|
symbol.Contour.Label = "[c][s20][c000000]"+oRs("oms");
|
|
symbol.Contour.SetUrl("", oRs("oms"));
|
|
//symbol.Contour.SetColor(0x0000FF, 64);
|
|
//symbol.SetColor(0xFF0000,255); // Maak onzichtbaar
|
|
|
|
oRs.MoveNext();
|
|
}
|
|
oRs.Close();
|
|
|
|
// thema's
|
|
themaProps={ symbols: symbolArray,
|
|
labelThema:pLabel,
|
|
kleurThema: pThema,
|
|
colorSymbol : true, // in plaats van de bounding contour
|
|
fnSql: function (viewName)
|
|
{
|
|
return "SELECT 'IW:'||id.prj_deel_key key, waarde"
|
|
+ " FROM prj_deel id, ins_srtdeel isd, ins_srtgroep isg, "
|
|
+ " prj_RUIMTE SYNC, " + viewName + " THEMA,"
|
|
+ " prj_werkplek pw"
|
|
+ " WHERE pw.prj_ruimte_key = SYNC.prj_ruimte_key"
|
|
+ " AND id.prj_werkplek_key = pw.prj_werkplek_key"
|
|
+ " AND id.ins_srtdeel_key = isd.ins_srtdeel_key"
|
|
+ " AND alg_verdieping_key = " + pvKey
|
|
+ " AND prj_deel_verwijder IS NULL" // leuke thema's
|
|
+ " AND isd.ins_srtgroep_key = isg.ins_srtgroep_key"
|
|
+ " AND ins_srtdeel_acadsymbol IS NOT NULL"
|
|
+ " AND isg.ins_discipline_key in (" + pDiscs +")"
|
|
+ " AND THEMA.prj_deel_key = id.prj_deel_key"
|
|
+ " ORDER BY isd.ins_srtdeel_key"
|
|
}
|
|
}
|
|
// Symbool label thema's
|
|
if ((labelType & 0x18) == 0x10) // Bit 4/5 moet 10 zijn voor objecten
|
|
labelThema(cHandle, themaProps)
|
|
|
|
// Symbool kleur thema's
|
|
if ((themaType & 0x18) == 0x10) // Bit 4/5 moet 10 zijn voor objecten
|
|
kleurThema(cHandle, themaProps)
|
|
}
|
|
|
|
%> |