Example #1
0
 public function __construct()
 {
     $this->construct_command();
     $this->connected_device = Connected::find(1);
     $this->process = new Process($this->cmd_path . $this->connected_device['ip_address']);
     // dd($this->process);
 }
Example #2
0
 /**
  * Here is the inicialization of the tad object depending
  * on the connected table state.
  */
 public function __construct()
 {
     $this->connected_device = Connected::find(1);
     if ($this->connected_device['connected'] == 1) {
         $tadf = new TADFactory(['ip' => $this->connected_device['ip_address']]);
         $this->tad = $tadf->get_instance();
     } else {
         $this->tad = null;
     }
 }
Example #3
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $devices = Device::all();
     $connected_device = Device::find(1);
     if (Connected::find(1) == null) {
         $connected_device = Connected::Create(['ip_address' => '127.0.0.1', 'device_id' => 0, 'connected' => 0]);
     }
     $connected_device = Connected::find(1);
     return view('pages.home', compact('devices', 'connected_device'));
     // ->with(['devices' => $devices, 'conne']);
 }
Example #4
0
 public function connectToIp($ip = '127.0.0.1')
 {
     $tadf = new TADFactory(['ip' => $ip]);
     $this->tad = $tadf->get_instance();
     $status = $this->tad->is_alive();
     $device = Device::where('ip_address', $ip)->first();
     $connected_device = Connected::find(1);
     $connected_device->ip_address = $ip;
     $connected_device->device_id = $device->id;
     if ($status) {
         $connected_device->connected = 1;
     } else {
         $connected_device->connected = 0;
     }
     $connected_device->save();
     return array($status);
 }
Example #5
0
 public function __construct($machineNumber = 1)
 {
     $this->zkcom = new COM("zkemkeeper.ZKEM");
     $this->connected_device = Connected::find(1);
 }
Example #6
0
 /**
  * Here is the inicialization of the tad object depending
  * on the connected table state.
  */
 public function __construct()
 {
     $this->connected_device = Connected::find(1);
 }