|
@@ -8,7 +8,7 @@
|
|
|
namespace Modules\Dimatec;
|
|
namespace Modules\Dimatec;
|
|
|
|
|
|
|
|
use OpenMind\FindBox\FindBoxCoreSystem;
|
|
use OpenMind\FindBox\FindBoxCoreSystem;
|
|
|
-use OpenMind\FindBox\LedAlive;
|
|
|
|
|
|
|
+use OpenMind\FindBox\QueueCommand;
|
|
|
use OpenMind\FindBox\SmartESL;
|
|
use OpenMind\FindBox\SmartESL;
|
|
|
use OpenMind\System\QueueSystem;
|
|
use OpenMind\System\QueueSystem;
|
|
|
use OpenMind\Web\Controller;
|
|
use OpenMind\Web\Controller;
|
|
@@ -25,6 +25,37 @@ class Pages extends Controller
|
|
|
$this->findBoxCore = new FindBoxCoreSystem(...array_values($this->CORE_SETTINGS));
|
|
$this->findBoxCore = new FindBoxCoreSystem(...array_values($this->CORE_SETTINGS));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Send QueueSystem command for all labels associated
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param $distinta
|
|
|
|
|
+ * @param array $commesse
|
|
|
|
|
+ */
|
|
|
|
|
+ private function sendLabelMsg($distinta, array $commesse)
|
|
|
|
|
+ {
|
|
|
|
|
+ global $f3;
|
|
|
|
|
+ foreach($commesse as $commessa) {
|
|
|
|
|
+ $labelid = $distinta->GetLabelIdFromBarcode($commessa['commessa']);
|
|
|
|
|
+ if ($labelid == null) {
|
|
|
|
|
+ $f3->set('INFOTEXT', "Alcune etichette non accenderano il led in quanto non associate.");
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $msgBlink = new QueueCommand($labelid);
|
|
|
|
|
+ $msgSaveP = new QueueCommand($labelid);
|
|
|
|
|
+
|
|
|
|
|
+ $msgBlink->setLeds(2, 1, 1000, 16);
|
|
|
|
|
+ $msgSaveP->saveProducts($commessa['descrizione'], [
|
|
|
|
|
+ 'Q.ta' => $commessa['qta_prelevare'],
|
|
|
|
|
+ 'Commessa' => $commessa['commessa']
|
|
|
|
|
+ ]);
|
|
|
|
|
+
|
|
|
|
|
+ $qm = new QueueSystem('FindBoxService');
|
|
|
|
|
+ $qm->send($msgBlink);
|
|
|
|
|
+ $qm->send($msgSaveP);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function Pick2Light(object $f3, array $args)
|
|
public function Pick2Light(object $f3, array $args)
|
|
|
{
|
|
{
|
|
|
$stepValues = array_map('strtoupper', $this->getSanitizedPostRequest());
|
|
$stepValues = array_map('strtoupper', $this->getSanitizedPostRequest());
|
|
@@ -46,6 +77,10 @@ class Pages extends Controller
|
|
|
$f3->set('NEXTSTEP', 1);
|
|
$f3->set('NEXTSTEP', 1);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // Send blink to all labels associated to barcode
|
|
|
|
|
+ $this->sendLabelMsg($distinta, $commesse);
|
|
|
|
|
+
|
|
|
$distinta->SendToIcamStorage($commesse);
|
|
$distinta->SendToIcamStorage($commesse);
|
|
|
|
|
|
|
|
$f3->set('SESSION.barcode_mv', $stepValues['barcode_mv']);
|
|
$f3->set('SESSION.barcode_mv', $stepValues['barcode_mv']);
|
|
@@ -55,20 +90,18 @@ class Pages extends Controller
|
|
|
case 2:
|
|
case 2:
|
|
|
$f3->set('NEXTSTEP', 2);
|
|
$f3->set('NEXTSTEP', 2);
|
|
|
if (isset($stepValues['commessa'])) {
|
|
if (isset($stepValues['commessa'])) {
|
|
|
- $ok = $distinta->isCommessaPresent($stepValues['commessa']);
|
|
|
|
|
- if (!$ok) {
|
|
|
|
|
|
|
+ if (!$distinta->isCommessaPresent($stepValues['commessa'])) {
|
|
|
$f3->set('INFOTEXT', "Codice cesta non corretto");
|
|
$f3->set('INFOTEXT', "Codice cesta non corretto");
|
|
|
} else {
|
|
} else {
|
|
|
$labelid = $distinta->GetLabelIdFromBarcode($stepValues['commessa']);
|
|
$labelid = $distinta->GetLabelIdFromBarcode($stepValues['commessa']);
|
|
|
if ($labelid != null) {
|
|
if ($labelid != null) {
|
|
|
// Send BlinkOFF
|
|
// Send BlinkOFF
|
|
|
- $obj = new LedAlive($labelid);
|
|
|
|
|
|
|
+ $obj = new QueueCommand($labelid);
|
|
|
$obj->setToBlinkOff();
|
|
$obj->setToBlinkOff();
|
|
|
|
|
|
|
|
// Send command to queue
|
|
// Send command to queue
|
|
|
$qm = new QueueSystem('FindBoxService');
|
|
$qm = new QueueSystem('FindBoxService');
|
|
|
$qm->send($obj);
|
|
$qm->send($obj);
|
|
|
- //$f3->get('DB')->exec('UPDATE label_bindings SET isBlinking=0 WHERE label_id=?', $labelid);
|
|
|
|
|
|
|
|
|
|
$distinta->DeleteCommessa($stepValues['commessa']);
|
|
$distinta->DeleteCommessa($stepValues['commessa']);
|
|
|
}
|
|
}
|
|
@@ -79,24 +112,14 @@ class Pages extends Controller
|
|
|
$f3->set('INFOTEXT', "Ventilazione terminata");
|
|
$f3->set('INFOTEXT', "Ventilazione terminata");
|
|
|
$f3->set('RESTART_VENTILAZIONE', TRUE);
|
|
$f3->set('RESTART_VENTILAZIONE', TRUE);
|
|
|
}
|
|
}
|
|
|
- foreach($commesse as $commessa) {
|
|
|
|
|
- $labelid = $distinta->GetLabelIdFromBarcode($commessa['commessa']);
|
|
|
|
|
- if ($labelid == null) {
|
|
|
|
|
- $f3->set('INFOTEXT', "Alcune etichette non accenderano il led in quanto non associate.");
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- $obj = new LedAlive($labelid);
|
|
|
|
|
- $obj->setToBlink();
|
|
|
|
|
- $obj->SetLeds($commessa['descrizione'], 2, 1, 1000, 1);
|
|
|
|
|
- $obj->setDataFields([
|
|
|
|
|
- 'Q.ta' => $commessa['qta_prelevare'],
|
|
|
|
|
- 'Commessa' => $commessa['commessa']
|
|
|
|
|
- ]);
|
|
|
|
|
-
|
|
|
|
|
- $qm = new QueueSystem('FindBoxService');
|
|
|
|
|
- $qm->send($obj);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /* foreach($commesse as $commessa) {
|
|
|
|
|
+ $labelid = $distinta->GetLabelIdFromBarcode($commessa['commessa']);
|
|
|
|
|
+ if ($labelid == null) {
|
|
|
|
|
+ $f3->set('INFOTEXT', "Alcune etichette non accenderano il led in quanto non associate.");
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }*/
|
|
|
$f3->set('COMMESSE', $commesse);
|
|
$f3->set('COMMESSE', $commesse);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|