Functie cad_MaakCadTekening toegevoegd. Deze functie maakt een record aan in de tabel cad_tekening en geeft de naam van de toegevoegde tekening terug <cad_tekening_key>.DWG
svn path=/Database/trunk/; revision=6681
This commit is contained in:
131
CAD/CAD_PAC.SRC
131
CAD/CAD_PAC.SRC
@@ -3,6 +3,8 @@
|
||||
/* REVISIONS:
|
||||
*
|
||||
* --- 01.43 ---
|
||||
* 14-04-1999 BIV Functie cad_MaakCadTekening toegevoegd. Deze functie maakt een tekening aan in cad_tekening en
|
||||
* en geeft de naam van die tekening terug.
|
||||
* 12-04-1999 BIV Procedure cad_SLNKgetBinnenBuiten toegevoegd. Deze bepaalt a.h.v. LoadDwg of binnen of buiten.
|
||||
* 30-03-1999 BIV Procedure cad_SLNKDelenbijWerkplek.
|
||||
* 18-03-1999 BIV #2278 - cad_SLNKPostDraw aangepast i.v.m. ins_deelkoppeling.
|
||||
@@ -293,7 +295,6 @@ CREATE OR REPLACE PACKAGE BODY cad AS
|
||||
END cad_getLocatieCode_Tekening;
|
||||
|
||||
FUNCTION cad_getTekeningNaam_LoadDwg(LoadDwg IN VARCHAR2) RETURN VARCHAR2 IS
|
||||
/* LoadDwg moet volgende formaat hebben <Locatiecode>\<Tekeningnaam> - (Tekeningnaam zonder extensie DWG) */
|
||||
Teller NUMBER;
|
||||
OneChar VARCHAR2(1);
|
||||
Tekening VARCHAR2(256);
|
||||
@@ -1181,6 +1182,81 @@ FUNCTION Bepaal_VolgnummerTxt(Omschrijving IN VARCHAR2) RETURN VARCHAR2 IS
|
||||
END AddDeel;
|
||||
|
||||
|
||||
FUNCTION cad_MaakCadTekening(LPNALIAS IN VARCHAR2, LPNKEY IN VARCHAR2, SrtTekening IN CHAR) RETURN VARCHAR2 IS
|
||||
LocatieKey alg_locatie.alg_locatie_key%TYPE;
|
||||
LocatieCode alg_locatie.alg_locatie_code%TYPE;
|
||||
VerdiepingKey alg_ruimte.alg_verdieping_key%TYPE;
|
||||
DisciplineKey ins_discipline.ins_discipline_key%TYPE;
|
||||
TekeningNaam cad_tekening.cad_tekening_filenaam%TYPE;
|
||||
TekeningKey cad_tekening.cad_tekening_key%TYPE;
|
||||
PlaatsDeel ins_deel.ins_alg_ruimte_type%TYPE;
|
||||
|
||||
|
||||
BEGIN
|
||||
IF LPNALIAS = 'LPN_ALG_TERREINSECTOR' THEN
|
||||
SELECT alg_locatie_key,alg_locatie_code INTO LocatieKey, LocatieCode
|
||||
FROM alg_locatie
|
||||
WHERE alg_locatie_key =
|
||||
(SELECT alg_locatie_key FROM alg_terreinsector
|
||||
WHERE alg_terreinsector_key = LPNKey);
|
||||
/* Tekening bestaat nog NIET, dus aanmaken ...
|
||||
* Naam v.d. tekening is waarde v.d. toe te voegen key v.d. tabel cad_tekening + '.DWG'
|
||||
*/
|
||||
SELECT cad_s_cad_tekening_key.NEXTVAL INTO TekeningKey FROM DUAL;
|
||||
TekeningNaam := TO_CHAR(TekeningKey)||'.DWG';
|
||||
VerdiepingKey := NULL;
|
||||
DisciplineKey := NULL;
|
||||
ELSIF LPNALIAS = 'LPN_ALG_GEBOUW' THEN
|
||||
SELECT alg_locatie_key,alg_locatie_code INTO LocatieKey, LocatieCode
|
||||
FROM alg_locatie
|
||||
WHERE alg_locatie_key =
|
||||
(SELECT alg_locatie_key FROM alg_gebouw
|
||||
WHERE alg_gebouw_key = LPNKey);
|
||||
SELECT cad_s_cad_tekening_key.NEXTVAL INTO TekeningKey FROM DUAL;
|
||||
TekeningNaam := TO_CHAR(TekeningKey)||'.DWG';
|
||||
VerdiepingKey := NULL;
|
||||
DisciplineKey := NULL;
|
||||
ELSIF LPNALIAS = 'LPN_ALG_RUIMTE' THEN
|
||||
SELECT alg_locatie_key,alg_locatie_code, alg_verdieping_key INTO LocatieKey, LocatieCode, VerdiepingKey
|
||||
FROM alg_v_ruimte_gegevens
|
||||
WHERE alg_ruimte_key = LPNKey;
|
||||
SELECT cad_s_cad_tekening_key.NEXTVAL INTO TekeningKey FROM DUAL;
|
||||
TekeningNaam := TO_CHAR(TekeningKey)||'.DWG';
|
||||
DisciplineKey := NULL;
|
||||
ELSIF LPNALIAS = 'LPN_INS_DEEL' THEN
|
||||
SELECT ins_alg_locatie_key, ins_alg_ruimte_type INTO LocatieKey, PlaatsDeel
|
||||
FROM ins_deel
|
||||
WHERE ins_deel_key = LPNKey;
|
||||
LocatieCode := Bepaal_LocatieCode(LocatieKey);
|
||||
IF SrtTekening = 'D' THEN
|
||||
DisciplineKey := cad_f_deel_get_discipline(LPNKey);
|
||||
ELSE
|
||||
DisciplineKey := NULL;
|
||||
END IF;
|
||||
IF PlaatsDeel = 'T' THEN /* Deel bevindt zich buiten */
|
||||
VerdiepingKey := NULL;
|
||||
ELSE
|
||||
VerdiepingKey := cad_f_deel_get_verdieping(LPNKey);
|
||||
END IF;
|
||||
SELECT cad_s_cad_tekening_key.NEXTVAL INTO TekeningKey FROM DUAL;
|
||||
TekeningNaam := TO_CHAR(TekeningKey)||'.DWG';
|
||||
ELSIF LPNALIAS = 'LPN_PRS_WERKPLEK' THEN
|
||||
SELECT alg_locatie_key, alg_verdieping_key INTO LocatieKey, VerdiepingKey
|
||||
FROM prs_v_werkplek_gegevens
|
||||
WHERE prs_werkplek_key = LPNKey;
|
||||
LocatieCode := Bepaal_LocatieCode(LocatieKey);
|
||||
SELECT cad_s_cad_tekening_key.NEXTVAL INTO TekeningKey FROM DUAL;
|
||||
TekeningNaam := TO_CHAR(TekeningKey)||'.DWG';
|
||||
DisciplineKey := NULL;
|
||||
END IF;
|
||||
INSERT INTO cad_tekening(cad_tekening_key, alg_locatie_key, alg_verdieping_key, ins_discipline_key,
|
||||
cad_tekening_filenaam, cad_tekening_type)
|
||||
VALUES(TekeningKey, LocatieKey, VerdiepingKey, DisciplineKey, TekeningNaam, SrtTekening);
|
||||
COMMIT;
|
||||
Tekeningnaam := LocatieCode||'\'||TekeningNaam;
|
||||
RETURN TekeningNaam;
|
||||
END cad_MaakCadTekening;
|
||||
|
||||
PROCEDURE cad_SLNKPreDraw(Session_Id NUMBER) IS
|
||||
LPNName VARCHAR2(128);
|
||||
LPNKey NUMBER(10);
|
||||
@@ -1218,6 +1294,7 @@ FUNCTION Bepaal_VolgnummerTxt(Omschrijving IN VARCHAR2) RETURN VARCHAR2 IS
|
||||
Dimensie NUMBER;
|
||||
PlaatsDeel VARCHAR2(1);
|
||||
Omschrijving VARCHAR2(30);
|
||||
SrtTekening VARCHAR2(20);
|
||||
|
||||
BEGIN
|
||||
LPNName := cad_SLNKSTRUCTreadVALSTR(Session_id, 'LPNALIASPREDRAW');
|
||||
@@ -1261,7 +1338,7 @@ FUNCTION Bepaal_VolgnummerTxt(Omschrijving IN VARCHAR2) RETURN VARCHAR2 IS
|
||||
END IF;
|
||||
IF PlaatsDeel = 'W' THEN /* Bepaal ruimte waarin werkplek zich bevindt en geef ruimtekey ervan door */
|
||||
SELECT prs_alg_ruimte_key INTO LPNKeyCond
|
||||
FROM PRS_WERKPLEK
|
||||
FROM prs_werkplek
|
||||
WHERE prs_werkplek_key =
|
||||
(SELECT ins_alg_ruimte_key FROM ins_deel
|
||||
WHERE ins_deel_key = LPNKey);
|
||||
@@ -1273,12 +1350,14 @@ FUNCTION Bepaal_VolgnummerTxt(Omschrijving IN VARCHAR2) RETURN VARCHAR2 IS
|
||||
cad.cad_SLNKstructinsertVALINT(Session_Id,'LPNKEYCONDA', SeqNr, LPNKeyCond, 1);
|
||||
/* Bepaal Disciplinetekening */
|
||||
SrcDwg := cad_f_deel_get_tekeningnaam(LPNKey);
|
||||
SELECT ins_alg_locatie_key INTO LocatieKey
|
||||
FROM ins_deel
|
||||
WHERE ins_deel_key = LPNKey;
|
||||
IF SrcDwg IS NOT NULL THEN
|
||||
SELECT ins_alg_locatie_key INTO LocatieKey
|
||||
FROM ins_deel
|
||||
WHERE ins_deel_key = LPNKey;
|
||||
Locatiecode := Bepaal_locatiecode(LocatieKey);
|
||||
SrcDwg := Locatiecode||'\'||SrcDwg;
|
||||
ELSE
|
||||
SrcDwg := cad_MaakCadTekening('LPN_INS_DEEL', LPNKey, 'D');
|
||||
END IF;
|
||||
/* Bepaal LoadDwg */
|
||||
IF PlaatsDeel = 'T' THEN /* Terreinsector */
|
||||
@@ -1289,12 +1368,18 @@ FUNCTION Bepaal_VolgnummerTxt(Omschrijving IN VARCHAR2) RETURN VARCHAR2 IS
|
||||
WHERE alg_ruimte_key = LPNKeyCond;
|
||||
LoadDwg := cad_getVerdiepPlgrnd_tekening(LocatieKey, Verdiepingkey);
|
||||
END IF;
|
||||
IF LoadDwg IS NULL THEN
|
||||
LoadDwg := cad_MaakCadTekening('LPN_INS_DEEL', LPNKey, 'P');
|
||||
END IF;
|
||||
/* Bepaal Attachdwg's */
|
||||
IF PlaatsDeel = 'T' THEN /* Terreinsector */
|
||||
AttachDwg1 := cad_getContourtekening(LocatieKey); /* Contourtekening locatie */
|
||||
AttachDwg1 := cad_getContourtekening(LocatieKey); /* Contourtekening locatie */
|
||||
ELSE /* Ruimte of Werkplek */
|
||||
AttachDwg1 := cad_getVerdiepCntr_tekening(LocatieKey, Verdiepingkey); /* Contourtekening verdieping */
|
||||
END IF;
|
||||
IF AttachDwg1 IS NULL THEN
|
||||
AttachDwg1 := cad_MaakCadTekening('LPN_INS_DEEL', LPNKey, 'C');
|
||||
END IF;
|
||||
AttachDwg2 := SrcDwg;
|
||||
cad_SLNKstructinsertVALSTR(Session_Id,'SRCDWG', SeqNr, SrcDwg, 1);
|
||||
cad_SLNKstructinsertVALSTR(Session_Id,'LOADDWG', SeqNr, LoadDwg, 1);
|
||||
@@ -1318,9 +1403,15 @@ FUNCTION Bepaal_VolgnummerTxt(Omschrijving IN VARCHAR2) RETURN VARCHAR2 IS
|
||||
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LAYER', SeqNr, Layernaam, 1);
|
||||
SELECT alg_locatie_key INTO Locatiekey
|
||||
FROM alg_gebouw
|
||||
WHERE alg_gebouw_key = LPNKey;
|
||||
SrcDwg := cad_getContourtekening(LocatieKey);
|
||||
WHERE alg_gebouw_key = LPNKey;
|
||||
LoadDwg := cad_getPlattegrondtekening(LocatieKey);
|
||||
IF LoadDwg IS NULL THEN
|
||||
LoadDwg := cad_MaakCadTekening('LPN_ALG_GEBOUW', LPNKey, 'P');
|
||||
END IF;
|
||||
SrcDwg := cad_getContourtekening(LocatieKey);
|
||||
IF SrcDwg IS NULL THEN
|
||||
SrcDwg := cad_MaakCadTekening('LPN_ALG_GEBOUW', LPNKey, 'C');
|
||||
END IF;
|
||||
AttachDwg1 := SrcDwg;
|
||||
cad.cad_SLNKstructinsertVALSTR(Session_Id,'SRCDWG', 1, SrcDwg, 1);
|
||||
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LOADDWG', 1, LoadDwg, 1);
|
||||
@@ -1345,9 +1436,14 @@ FUNCTION Bepaal_VolgnummerTxt(Omschrijving IN VARCHAR2) RETURN VARCHAR2 IS
|
||||
INTO locatiekey, verdiepingkey
|
||||
FROM alg_v_ruimte_gegevens
|
||||
WHERE alg_ruimte_key = LPNKey;
|
||||
|
||||
SrcDwg := cad_getVerdiepCntr_tekening(Locatiekey, Verdiepingkey);
|
||||
LoadDwg := cad_getVerdiepPlgrnd_tekening(Locatiekey, Verdiepingkey);
|
||||
IF LoadDwg IS NULL THEN
|
||||
LoadDwg := cad_MaakCadTekening('LPN_ALG_RUIMTE', LPNKey, 'P');
|
||||
END IF;
|
||||
SrcDwg := cad_getVerdiepCntr_tekening(Locatiekey, Verdiepingkey);
|
||||
IF SrcDwg IS NULL THEN
|
||||
SrcDwg := cad_MaakCadTekening('LPN_ALG_RUIMTE', LPNKey, 'C');
|
||||
END IF;
|
||||
AttachDwg1 := SrcDwg;
|
||||
cad.cad_SLNKstructinsertVALSTR(Session_Id,'SRCDWG', SeqNr, SrcDwg, 1);
|
||||
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LOADDWG', SeqNr, LoadDwg, 1);
|
||||
@@ -1387,7 +1483,13 @@ FUNCTION Bepaal_VolgnummerTxt(Omschrijving IN VARCHAR2) RETURN VARCHAR2 IS
|
||||
(SELECT prs_alg_ruimte_key FROM prs_werkplek
|
||||
WHERE prs_werkplek_key = LPNKey);
|
||||
SrcDwg := cad_getVerdiepCntr_tekening(LocatieKey, Verdiepingkey); /* Contourtekening verdieping */
|
||||
IF SrcDwg IS NULL THEN
|
||||
SrcDwg := cad_MaakCadTekening('LPN_PRS_WERKPLEK', LPNKey, 'C');
|
||||
END IF;
|
||||
LoadDwg := cad_getVerdiepPlgrnd_tekening(LocatieKey, Verdiepingkey); /* Plattegrondtekening verdieping */
|
||||
IF LoadDwg IS NULL THEN
|
||||
LoadDwg := cad_MaakCadTekening('LPN_PRS_WERKPLEK', LPNKey, 'P');
|
||||
END IF;
|
||||
AttachDwg1 := SrcDwg;
|
||||
cad.cad_SLNKstructinsertVALSTR(Session_Id,'SRCDWG', SeqNr, SrcDwg, 1);
|
||||
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LOADDWG', SeqNr, LoadDwg, 1);
|
||||
@@ -1415,8 +1517,14 @@ FUNCTION Bepaal_VolgnummerTxt(Omschrijving IN VARCHAR2) RETURN VARCHAR2 IS
|
||||
SELECT alg_locatie_key INTO Locatiekey
|
||||
FROM alg_terreinsector
|
||||
WHERE alg_terreinsector_key = LPNKey;
|
||||
SrcDwg := cad_getContourtekening(LocatieKey);
|
||||
LoadDwg := cad_getPlattegrondtekening(LocatieKey);
|
||||
IF LoadDwg IS NULL THEN
|
||||
LoadDwg := cad_MaakCadTekening('LPN_ALG_TERREINSECTOR', LPNKey, 'P');
|
||||
END IF;
|
||||
SrcDwg := cad_getContourtekening(LocatieKey);
|
||||
IF SrcDwg IS NULL THEN
|
||||
SrcDwg := cad_MaakCadTekening('LPN_ALG_TERREINSECTOR', LPNKey, 'C');
|
||||
END IF;
|
||||
AttachDwg1 := SrcDwg;
|
||||
cad.cad_SLNKstructinsertVALSTR(Session_Id,'SRCDWG', 1, SrcDwg, 1);
|
||||
cad.cad_SLNKstructinsertVALSTR(Session_Id,'LOADDWG', 1, LoadDwg, 1);
|
||||
@@ -2016,7 +2124,6 @@ FUNCTION Bepaal_VolgnummerTxt(Omschrijving IN VARCHAR2) RETURN VARCHAR2 IS
|
||||
WHERE alg_locatie_code = LocatieCode;
|
||||
/* Bepaal verdieping -> bepaal eerst tekeningnaam zonder toevoeging Locatiecode... */
|
||||
TekeningNaam := cad_getTekeningNaam_LoadDwg(LoadDwg);
|
||||
TekeningNaam := TekeningNaam||'.DWG';
|
||||
BEGIN
|
||||
SELECT alg_verdieping_key INTO VerdiepingKey
|
||||
FROM cad_v_plattegrond
|
||||
|
||||
Reference in New Issue
Block a user