#!/usr/bin/perl -T
#$Id: list_uninitialised_devices.pl,v 1.1 2015/02/24 12:14:20 sqko Exp $
use strict;
use warnings;
use RFC::Rig;
exit unless (@ARGV);
my $rig = RFC::Rig->new(shift);
$rig->check_run();
print "Listing all uninitialised devices for rig ".$rig->name."\n";
print "Note that uninitialised devices may be used for other states of the rig in question!\n";
foreach my $type ($rig->list_types())
{
    my @devs = $rig->list_devices($type);
    my @av = $rig->avaliable_devices($type);
    foreach my $avdev (@av)
    {
	next unless ($avdev);
	my $found = 0;
	foreach my $d (@devs)
	{
	    next unless ($d eq $avdev);
	    $found = 1;
	    last;
	}
	next if ($found);
	print "Type: $type: Device $avdev\n";
    }
}
