#
# A GTK based console program
#
-# Copyright (c) 2001 Dirk Koopman G1TLH
+# Copyright (c) 2001-6 Dirk Koopman G1TLH
#
# $Id$
#
use DXVars;
use DXUtil;
use IO::Socket::INET;
-use Text;
-use DebugHandler;
#
# main initialisation
die "You cannot connect as your cluster callsign ($main::mycall)\n" if $call eq $main::mycall;
-my $host = 'localhost';
-my $port = 7301;
+my $host = 'gb7djk.dxcluster.net';
+my $port = 7300;
my $sock = IO::Socket::INET->new(PeerAddr=>$host, PeerPort=>$port);
die "Cannot connect to $host/$port ($!)\n" unless $sock;
#
# main window
my $main = new Gtk2::Window('toplevel');
-$main->set_default_size(600, 600);
+my $scr = $main->get_screen;
+my $scr_width = $scr->get_width;
+my $scr_height = $scr->get_height;
+$main->set_default_size($scr_width, $scr_height/2);
$main->signal_connect('delete_event', sub { Gtk2->main_quit; });
$main->set_title("gtkconsole - The DXSpider Console - $call");
$bhbox->pack_end($rhvbox, 1, 1, 5);
# first add a column type for the QRG
-my $font = 'monospace 10';
+my $font = 'monospace 9';
my $oddbg = 'light blue';
my $evenbg = 'white';
attr => sub {
my ($treecol, $cell, $model, $iter, $col_num) = @_;
my $info = $model->get ($iter, $col_num);
- $cell->set(text => sprintf("%.1f", $info), font => $font);
+ $cell->set(text => sprintf("%.1f", $info), font => $font, xalign => 1.0);
}
);
'Grid' => 'tt',
'TxTime' => 'tt',
);
+$dxlist->set_rules_hint(1);
my $dxscroll = Gtk2::ScrolledWindow->new (undef, undef);
$dxscroll->set_shadow_type ('etched-out');
$dxscroll->set_policy ('never', 'automatic');
To => 'tt',
Announcement => 'tt',
);
+$annlist->set_rules_hint(1);
my $annscroll = Gtk2::ScrolledWindow->new (undef, undef);
$annscroll->set_shadow_type ('etched-out');
$annscroll->set_policy ('automatic', 'automatic');
#$annscroll->set_size_request (700, 400);
$annscroll->add($annlist);
$annscroll->set_border_width(5);
-$rhvbox->pack_start($annscroll, 0, 1, 0);
+$rhvbox->pack_start($annscroll, 1, 1, 0);
# The wwv list
my $wwvlist = Gtk2::SimpleList->new(
Remarks => 'tt',
Hour => 'tt'
);
+$wwvlist->set_rules_hint(1);
my $wwvscroll = Gtk2::ScrolledWindow->new (undef, undef);
$wwvscroll->set_shadow_type ('etched-out');
$wwvscroll->set_policy ('never', 'automatic');
#$wwvscroll->set_size_request (700, 200);
$wwvscroll->add($wwvlist);
$wwvscroll->set_border_width(5);
-$rhvbox->pack_start($wwvscroll, 1, 1, 0);
+$rhvbox->pack_start($wwvscroll, 0, 1, 0);
# The wcy list
my $wcylist = Gtk2::SimpleList->new(
SA => 'tt',
GMF => 'tt',
Aurora => 'tt',
- Time => 'tt'
+ Hour => 'tt'
);
+$wcylist->set_rules_hint(1);
my $wcyscroll = Gtk2::ScrolledWindow->new (undef, undef);
$wcyscroll->set_shadow_type ('etched-out');
$wcyscroll->set_policy ('never', 'automatic');
#$wcyscroll->set_size_request (700, 200);
$wcyscroll->add($wcylist);
$wcyscroll->set_border_width(5);
-$rhvbox->pack_start($wcyscroll, 1, 1, 0);
+$rhvbox->pack_start($wcyscroll, 0, 1, 0);
my $sock_helper = Gtk2::Helper->add_watch($sock->fileno, 'in', \&tophandler, $sock);
if (__PACKAGE__->can($handle)) {
__PACKAGE__->$handle($list);
} else {
- push @$list, $cmd;
+ unshift @$list, $cmd;
__PACKAGE__->handle_def($list);
}
}
my $s;
$s = ref $ref ? join ', ',@$ref : $ref;
- if (exists $cmdlist->{lasttime} != $t) {
+ if (($cmdscroll->{lasttime}||0) != $t) {
$ts = tim($t);
- $cmdlist->{lasttime} = $t;
+ $cmdscroll->{lasttime} = $t;
}
chomp $s;
$s = ref $ref ? join ', ',@$ref : $ref;
my ($t, $ts) = (time, '');
- if (exists $cmdlist->{lasttime} != $t) {
+ if (($cmdscroll->{lasttime}||0) != $t) {
$ts = tim($t);
- $cmdlist->{lasttime} = $t;
+ $cmdscroll->{lasttime} = $t;
}
chomp $s;
my $ref = shift;
my ($t, $ts) = (time, '');
- if (exists $dxlist->{lasttime} != $t) {
+ if (($dxscroll->{lasttime}||0) != $t) {
$ts = tim($t);
- $dxlist->{lasttime} = $t;
+ $dxscroll->{lasttime} = $t;
}
push @{$dxlist->{data}}, [$ts, @$ref[0,1,15,3,4,16], stim($ref->[2]) ];
my $s;
$s = ref $ref ? join ', ',@$ref : $ref;
- if (exists $cmdlist->{lasttime} != $t) {
+ if (($annscroll->{lasttime}||0) != $t) {
$ts = tim($t);
- $cmdlist->{lasttime} = $t;
+ $annscroll->{lasttime} = $t;
}
chomp $s;
- push @{$cmdlist->{data}}, [$ts, @$ref[0,1,2]];
+ push @{$annlist->{data}}, [$ts, @$ref[3,1,2]];
}
sub handle_wcy
$s = ref $ref ? join ', ',@$ref : $ref;
chomp $s;
- push @{$cmdlist->{data}}, [tim(), @$ref[10,4,5,3,6,2,7,8,9,1] ];
+ push @{$wcylist->{data}}, [tim(), @$ref[10,4,5,3,6,2,7,8,9,1] ];
}
sub handle_wwv
$s = ref $ref ? join ', ',@$ref : $ref;
chomp $s;
- push @{$cmdlist->{data}}, [tim(), @$ref[6,2,3,4,5,1] ];
+ push @{$wwvlist->{data}}, [tim(), @$ref[6,2,3,4,5,1] ];
}
#