Show pageOld revisionsBacklinksExport to PDFODT exportBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== OEE Shift Manager Library ====== La libreria ha l'obiettivo di gestire: - la registrazione del codice turno sui movimenti (tabella movimag) - restituire informazioni sul turno corrente, turno precedente, turno successivo e turno del tm richiesto - chiedere la registrazione dell'informazione sul turno all'agente DataOEE {{:cli:franke:nis-shift-manager.png?1000|}} ==== AgentShiftStorage ==== Questo agente ha il compito di registrare il turno su una riga della tabella movimag, se gli viene richiesto tramite la tell save. La tell prende in ingresso il codice di movimag, il tm ed il codubi, fa una ask (time2shift) all'agente AgentShiftManager per ottenere il codice del turno; poi crea un rec(movimag.codice,codturno) e fa una download su movimag per registrare il codice del turno associato a quella riga. ==== AgentShiftManager ==== Questo agente ha il compito di restituire informazione sui turni legati alle ubicazioni. Espone 4 ask: - currentshift(codubi) restituisce il turno corrente, tmin e tmfi del turno - nextshift(codubi) restituisce il turno successivo, tmin e tmfi del turno - prevshift(codubi) restituisce il turno precedente, tmin e tmfi del turno - time2shift(codubi,tm) restituisce il turno legato al tm e al codubi passato come paramentro ==== AgentDataOEE ==== Per questo agente viene creata una nuova funzione loadshifts(ubicaz.saveshift==1) che carica le ubicazioni per cui va fatta la registrazione dell'OEE per turno. Se non è stata ancora registrato, lo registra. ==== Tabella ubicaz ==== aggiungere campo per stabilire quali per quali ubicazioni può essere calcolato l'OEE del turno <code sql> ALTER TABLE ubicaz ADD COLUMN saveoeeshift integer; </code> ==== Tabelle turni e turnidet ==== <code sql> ALTER TABLE turnidet DROP CONSTRAINT pk_turnidet; alter table turnidet add column codice varchar(11); COMMENT on column turnidet.codice is 'Chiave primaria per la tabella in base a codturno+descrizio'; update turnidet set codice = codturno||descrizio; ALTER TABLE turnidet ADD CONSTRAINT pk_turnidet PRIMARY KEY (codice); ALTER TABLE turnidet ADD CONSTRAINT uq_turnidet_codturno_descrizio UNIQUE (codturno, descrizio); </code> cli/franke/shift-manager.txt Last modified: 2018/08/03 10:42by f.zoppini