Lines Matching +full:sub +full:- +full:group
41 # These are generally front-fault-led and rear-fault-led
48 # This group contains all the LEDs with the action Blink
52 my $targetObj = Targets->new;
55 $targetObj->{debug} = 1;
60 $targetObj->{force} = 1;
63 $targetObj->loadXML($serverwizFile);
71 $invHash{$item->{TARGET}} = $item->{OBMC_NAME};
84 foreach my $target (sort keys %{$targetObj->getAllTargets()})
87 if($targetObj->isBadAttribute($target, "MRW_TYPE"))
92 # Return true if not populated -or- not present
93 if("LED" eq $targetObj->getMrwType($target))
106 my $conns = $targetObj->findConnections($ledTarget, "LOGICAL_ASSOCIATION");
110 for my $conn (@{$conns->{CONN}})
112 my $destTarget = $conn->{DEST_PARENT};
114 # hand cook a group name. delete this value from the inventory
129 if($targetObj->isBadAttribute($ledTarget, "CONTROL_GROUPS"))
140 if($targetObj->getAttribute($ledTarget, "LED_PRIORITY") eq "ON")
146 my $name = $targetObj->getInstanceName($ledTarget);
148 # Get if this LED is a ENC-FAULT type.
149 if(!$targetObj->isBadAttribute($target, "LED_TYPE"))
151 if("ENC-FAULT" eq $targetObj->getAttribute($ledTarget, "LED_TYPE"))
158 my $controlGroup = $targetObj->getAttribute($ledTarget, "CONTROL_GROUPS");
189 # Need to update the LampTest group.
204 # mapped to some group, which will be named after this target name and the
205 # elements of the group are EnclosureFaults Front and Back
212 # For each of these device, the Group record would be this :
216 # Setup roll-up LEDs to the ones that are of type ENC-FAULT
243 #------------------------------------END OF MAIN-----------------------
247 sub getFruName
255 sub generateYamlFile
262 foreach my $group (sort keys %hashGroup)
264 if($group ne $groupCopy)
266 # If one of these is a default group, then delete it from the array
269 my $index = first {$defaultGroup[$_] eq $group} 0..$#defaultGroup;
279 foreach my $led (sort keys %{ $hashGroup{$group} })
281 foreach my $property (sort keys %{ $hashGroup{$group}{$led}})
283 if($group ne $groupCopy)
285 $groupCopy = $group;
286 print $fh "$group:\n";
297 print $fh " $hashGroup{$group}{$led}{$property}\n";
309 sub generateJSONFile
313 my $JSON = JSON->new->utf8->pretty(1);
314 $JSON->convert_blessed(1);
316 sub led
320 group => shift,
327 sub member
341 sub TO_JSON {
349 foreach my $group (sort keys %hashGroup)
352 foreach my $led (sort keys %{ $hashGroup{$group} })
359 if (exists $hashGroup{$group}{$led}{Action})
361 $action = $hashGroup{$group}{$led}{Action};
362 $action = substr($action, 1, length($action) - 2);
365 if (exists $hashGroup{$group}{$led}{DutyOn})
367 $dutyOn = $hashGroup{$group}{$led}{DutyOn};
370 if (exists $hashGroup{$group}{$led}{Period})
372 $period = $hashGroup{$group}{$led}{Period};
375 if (exists $hashGroup{$group}{$led}{Priority})
377 $priority = $hashGroup{$group}{$led}{Priority};
378 $priority = substr($priority, 1, length($priority) - 2);
384 my $l = led LEDGroups($group, \@members);
388 my $json = $JSON->canonical(1)->encode(\%ledJson);
394 sub printDebug
401 sub printUsage
404 $0 -i [XML filename] -o [Output filename] [OPTIONS]
406 -f = force output file creation even when errors
407 -d = debug mode
408 -v = verbose mode - for verbose o/p from Targets.pm
410 PS: mrw::Targets can be found in https://github.com/open-power/serverwiz/
411 mrw::Inventory can be found in https://github.com/openbmc/phosphor-mrw-tools/
415 #------------------------------------END OF SUB-----------------------