Changeset 911
- Timestamp:
- Jul 31, 2021, 12:26:16 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/UpdateTrace.php
r909 r911 2170 2170 $Manager->Execute('ALTER TABLE `Member` ADD KEY (`AddressPlace`);'); 2171 2171 $Manager->Execute('ALTER TABLE `Member` ADD FOREIGN KEY (`AddressPlace`) REFERENCES `AddressPlace`(`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT;'); 2172 } 2173 2174 function UpdateTo911(UpdateManager $Manager): void 2175 { 2176 $Manager->Execute('ALTER TABLE `NetworkSignal` ADD `Remote` INT NOT NULL DEFAULT "0" AFTER `Device`;'); 2172 2177 } 2173 2178 … … 2278 2283 885 => array('Revision' => 901, 'Function' => 'UpdateTo901'), 2279 2284 901 => array('Revision' => 907, 'Function' => 'UpdateTo907'), 2285 907 => array('Revision' => 911, 'Function' => 'UpdateTo911'), 2280 2286 ); 2281 2287 } -
trunk/Application/Version.php
r907 r911 1 1 <?php 2 2 3 $Revision = 9 07; // Subversion revision4 $DatabaseRevision = 9 07; // SQL structure revision5 $ReleaseTime = strtotime('2021-0 3-24');3 $Revision = 911; // Subversion revision 4 $DatabaseRevision = 911; // SQL structure revision 5 $ReleaseTime = strtotime('2021-07-31'); -
trunk/Modules/FinanceBankAPI/FioAPI.php
r888 r911 1 1 <?php 2 2 3 // Specifikace API: http ://www.fio.cz/docs/cz/API_Bankovnictvi.pdf3 // Specifikace API: https://www.fio.cz/docs/cz/API_Bankovnictvi.pdf 4 4 5 5 include('GPC.php'); -
trunk/Modules/Network/Network.php
r909 r911 383 383 'Interface' => array('Type' => 'TNetworkInterface', 'Caption' => 'Rozhraní', 'Default' => '', 'Null' => true), 384 384 'Value' => array('Type' => 'Integer', 'Caption' => 'Signál', 'Default' => '0', 'Suffix' => 'dBm'), 385 'Remote' => array('Type' => 'Integer', 'Caption' => 'Vzdálený signál', 'Default' => '0', 'Suffix' => 'dBm'), 385 386 'RateRx' => array('Type' => 'Integer', 'Caption' => 'Rychlost Rx', 'Default' => '0', 'Suffix' => 'MHz'), 386 387 'RateTx' => array('Type' => 'Integer', 'Caption' => 'Rychlost Tx', 'Default' => '0', 'Suffix' => 'MHz'), -
trunk/Modules/Network/NetworkModels.php
r899 r911 195 195 $Desc->AddReference('Interface', NetworkInterface::GetClassName()); 196 196 $Desc->AddInteger('Value'); 197 $Desc->AddInteger('Remote'); 197 198 $Desc->AddInteger('RateRx'); 198 199 $Desc->AddInteger('RateTx'); -
trunk/Modules/NetworkConfigAirOS/Generators/Signal.php
r887 r911 21 21 if (count($Result) > 0) 22 22 { 23 //print_r($Result); 24 $Array = json_decode(implode("\n", $Result), true); 25 //print_r($Array); 26 echo('-'); 27 foreach ($Array as $Properties) 28 { 29 $DbResult = $this->Database->select('NetworkInterface', 'Id', '`MAC`="'.$Properties['mac'].'"'); 30 if ($DbResult->num_rows > 0) 23 //print_r($Result); 24 $Array = json_decode(implode("\n", $Result), true); 25 //print_r($Array); 26 echo('-'); 27 foreach ($Array as $Properties) 31 28 { 32 $DbRow = $DbResult->fetch_assoc(); 33 $Interface = $DbRow['Id']; 34 } else $Interface = null; 29 $DbResult = $this->Database->select('NetworkInterface', 'Id', '`MAC`="'.$Properties['mac'].'"'); 30 if ($DbResult->num_rows > 0) 31 { 32 $DbRow = $DbResult->fetch_assoc(); 33 $Interface = $DbRow['Id']; 34 } else $Interface = null; 35 35 36 $Strength = $Properties['signal']; 37 $RateRx = $Properties['rx']; 38 $RateTx = $Properties['tx']; 39 $this->Database->insert('NetworkSignal', array('MAC' => $Properties['mac'], 40 'Value' => $Strength, 'RateRx' => $RateRx, 'RateTx' => $RateTx, 41 'Time' => TimeToMysqlDateTime($Time), 'Interface' => $Interface, 'Device' => $Device['Id'])); 42 echo('.'); 43 } 44 echo("\n"); 36 $Strength = $Properties['signal']; 37 $RemoteSignal = $Properties['remote']['signal']; 38 $RateRx = $Properties['rx']; 39 $RateTx = $Properties['tx']; 40 $this->Database->insert('NetworkSignal', array('MAC' => $Properties['mac'], 41 'Value' => $Strength, 'Remote' => $RemoteSignal, 'RateRx' => $RateRx, 'RateTx' => $RateTx, 42 'Time' => TimeToMysqlDateTime($Time), 'Interface' => $Interface, 'Device' => $Device['Id'])); 43 echo('.'); 44 } 45 echo("\n"); 45 46 } else echo("Empty response\n"); 46 47 } -
trunk/Modules/NetworkConfigRouterOS/Generators/Signal.php
r887 r911 21 21 if (!$Routerboard->Connected) continue; 22 22 $Routerboard->Write('/interface/wireless/registration-table/getall', false); 23 $Routerboard->Write('=.proplist=signal-strength, mac-address,rx-rate,tx-rate', false);23 $Routerboard->Write('=.proplist=signal-strength,tx-signal-strength,mac-address,rx-rate,tx-rate', false); 24 24 $Routerboard->Write('=stats='); 25 25 $Read = $Routerboard->Read(false); … … 37 37 { 38 38 $Strength = $Properties['signal-strength']; 39 } else { 39 } else 40 { 40 41 $Parts = explode('@', $Properties['signal-strength']); 41 42 if (substr($Parts[0], -3) == 'dBm') … … 43 44 else $Strength = $Parts[0]; 44 45 } 46 47 if (array_key_exists('tx-signal-strength', $Properties)) 48 { 49 if (strpos($Properties['tx-signal-strength'], '@') === false) 50 { 51 $RemoteSignal = $Properties['tx-signal-strength']; 52 } else 53 { 54 $Parts = explode('@', $Properties['tx-signal-strength']); 55 if (substr($Parts[0], -3) == 'dBm') 56 $RemoteSignal = substr($Parts[0], 0, -3); // without dBm 57 else $RemoteSignal = $Parts[0]; 58 } 59 } else $RemoteSignal = 0; 60 45 61 $RateRx = $this->StripUnits($Properties['rx-rate']); 46 62 $RateTx = $this->StripUnits($Properties['tx-rate']); 47 $Queries[] = 'INSERT INTO `NetworkSignal` (`MAC`, `Value`, `R ateRx`, `RateTx`, `Time`, `Interface`, `Device`) VALUES '.48 '("'.$Properties['mac-address'].'", '.$Strength.', '.$R ateRx.', '.$RateTx.', "'.63 $Queries[] = 'INSERT INTO `NetworkSignal` (`MAC`, `Value`, `Remote`, `RateRx`, `RateTx`, `Time`, `Interface`, `Device`) VALUES '. 64 '("'.$Properties['mac-address'].'", '.$Strength.', '.$RemoteSignal.', '.$RateRx.', '.$RateTx.', "'. 49 65 TimeToMysqlDateTime($Time).'", '.$Interface.', '.$Device['Id'].')'; 50 66 /*
Note:
See TracChangeset
for help on using the changeset viewer.