Changeset 887 for trunk/Modules/NetworkConfigRouterOS/Generators/Queue.php
- Timestamp:
- Nov 20, 2020, 12:08:12 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigRouterOS/Generators/Queue.php
r873 r887 14 14 } 15 15 16 function Print() 16 function Print(): string 17 17 { 18 18 $Output = '(Min: '.$this->Min.' Max: '.$this->Max; … … 46 46 } 47 47 48 function CheckName($Name, &$UsedNames) 48 function CheckName($Name, &$UsedNames): void 49 49 { 50 50 if (in_array($Name, $UsedNames)) die("\n".'Duplicate name: '.$Name); … … 52 52 } 53 53 54 function GetCommands(&$UsedNames = null) 54 function GetCommands(&$UsedNames = null): array 55 55 { 56 56 if ($UsedNames == null) $UsedNames = array(); … … 72 72 } 73 73 74 function GetParentName(string $Suffix) 74 function GetParentName(string $Suffix): string 75 75 { 76 76 if ($this->Parent != null) return $this->Parent->Name.$Suffix; … … 78 78 } 79 79 80 function UpdateMinSpeeds() 80 function UpdateMinSpeeds(): void 81 81 { 82 82 if (($this->LimitIn->Min == 0) or ($this->LimitOut->Min == 0)) … … 100 100 class SpeedLimitItems extends GenericList 101 101 { 102 function AddNew(string $Name, SpeedLimitItem $Parent = null) 102 function AddNew(string $Name, SpeedLimitItem $Parent = null): SpeedLimitItem 103 103 { 104 104 $Item = new SpeedLimitItem($Name, $Parent); 105 $Item->LimitIn = new SpeedLimit( );106 $Item->LimitOut = new SpeedLimit( );105 $Item->LimitIn = new SpeedLimit(0, 0); 106 $Item->LimitOut = new SpeedLimit(0, 0); 107 107 $this->Items[] = $Item; 108 108 return $Item; … … 119 119 } 120 120 121 function GetCommands(&$UsedNames) 121 function GetCommands(&$UsedNames): array 122 122 { 123 123 $Output = array(); … … 137 137 var $SpeedLimits; 138 138 139 function Run() 139 function Run(): void 140 140 { 141 141 $PathQueue = array('queue', 'tree'); … … 149 149 $this->UsedNames = array(); 150 150 151 $Finance = & $this->System->Modules['Finance'];151 $Finance = &ModuleFinance::Cast($this->System->GetModule('Finance'))->Finance; 152 152 $Finance->LoadMonthParameters(0); 153 153 … … 280 280 } 281 281 282 function BuildSpeedLimit(&$SpeedLimit, $TopSpeedLimitItem) 282 function BuildSpeedLimit(&$SpeedLimit, $TopSpeedLimitItem): void 283 283 { 284 284 $SpeedLimitName = $SpeedLimit['Name'].'-grp'; … … 297 297 } 298 298 299 function LoadSpeedLimits($SpeedLimitItem) 299 function LoadSpeedLimits($SpeedLimitItem): void 300 300 { 301 301 echo('Limit groups: '); … … 326 326 } 327 327 328 function UpdateMinSpeed($DeviceId) 328 function UpdateMinSpeed($DeviceId): void 329 329 { 330 330 $MinSpeed = 0; … … 340 340 341 341 // Calculate maximum real speed available for each network device Start with main router and continue with adjecement nodes. 342 function BuildTree($RootDeviceId, $BaseSpeed) 342 function BuildTree($RootDeviceId, $BaseSpeed): void 343 343 { 344 344 // Load network devices … … 438 438 } 439 439 440 function BuildQueueItems($DeviceId, $SpeedLimitParent) 440 function BuildQueueItems($DeviceId, $SpeedLimitParent): void 441 441 { 442 442 $Device = $this->Devices[$DeviceId]; … … 475 475 } 476 476 477 function RunTopology() 477 function RunTopology(): void 478 478 { 479 479 $PathQueue = array('queue', 'tree'); … … 487 487 $this->UsedNames = array(); 488 488 489 $Finance = & $this->System->Modules['Finance'];489 $Finance = &ModuleFinance::Cast($this->System->GetModule('Finance'))->Finance; 490 490 $Finance->LoadMonthParameters(0); 491 491
Note:
See TracChangeset
for help on using the changeset viewer.