Hallole allerseits,
ich habe einen RaspberryPi der mit meinem FPGA-Board ueber USB 'schwaetzt'. Auf dem RaspPi laueft 'http://www.makestuff.eu/wordpress/software/fpgalink/', ich kann also damit Register auf dem FPGA schreiben und lesen.
Nun moechte ich mir eine GUI zum komfortablen steuern des FPGA machen und bin dabei auf PERL und wxPerl gekommen. Und hier faengt nun mein Problem an.
Das PERL skript:
#!/usr/bin/perl -w
use Wx;
package MyDialog;
use strict;
use base qw(Wx::Dialog);
use Wx::Event qw(EVT_CLOSE EVT_BUTTON);
use Wx qw(wxDefaultSize wxDefaultValidator);
#
# Define our user interface and apply default values to the text-fields
#
sub new {
my ($class, $label) = @_;
my $this = $class->SUPER::new (undef, -1, $label, [-1, -1], [1100, 400]);
my $xstart = 20;
my $xinc = 80;
my $xcur;
my $yinc = 15;
my $ycur;
my $dummy;
$this->SetIcon( Wx::GetWxPerlIcon() );
#
# First and second line, SENT SETUP text and data, 0x10
#
$xcur = $xstart;
$ycur = 0;
$dummy = Wx::StaticText->new ($this, -1, 'FrameLen', [$xcur, $ycur], [$xinc-10, -1]);
$xcur += $xinc;
$dummy = Wx::StaticText->new ($this, -1, 'ClkPerTick', [$xcur, $ycur], [$xinc-10, -1]);
$xcur += $xinc;
$dummy = Wx::StaticText->new ($this, -1, 'WdInc', [$xcur, $ycur], [$xinc-10, -1]);
$ycur += $yinc;
$xcur = $xstart;
my $ssfl = $this->{sent_setup_frame_len} =
Wx::TextCtrl->new ($this, -1, '8', [$xcur, $ycur], [$xinc, -1]);
$xcur += $xinc;
my $sscpt = $this->{sent_setup_clk_per_tick} =
Wx::TextCtrl->new ($this, -1, '16383', [$xcur, $ycur], [$xinc, -1]);
$xcur += $xinc;
my $sswi = $this->{sent_setup_wd_inc} =
Wx::TextCtrl->new ($this, -1, '1', [$xcur, $ycur], [$xinc, -1]);
#
# Apply button
#
$xcur += $xstart + 300;
my $apply_b10 = Wx::Button->new( $this, -1, 'Apply', [$xstart+600, 15] );
EVT_BUTTON ($this, $apply_b10, \&Apply10);
EVT_CLOSE ($this, \&OnClose);
return $this;
}
#
# Action on 'Apply' button address 0x10
#
sub Apply10 {
my ($this, $event) = @_;
# my $output = qx (ls -l);
# print "$output";
my $frame_len = $this->sent_setup_frame_len->GetValue;
my $clk_per_tick = $this->sent_setup_clk_per_tick->GetValue;
my $wd_inc = $this->sent_setup_wd_inc->GetValue;
# print "FrameLen=$frame_len ClkPerTick=$clk_per_tick WdInc=$wd_inc\n";
my $output = sprintf ("FrameLen=%X ClkPerTick=%X WdInc=%X", $frame_len, $clk_per_tick, $wd_inc);
print "$output\n";
}
#
# Action when application is closed
#
sub OnClose {
my( $this, $event ) = @_;
$this->Destroy;
}
#
# Pass entered input parameters to the desired variables
#
sub sent_setup_frame_len {$_[0]->{sent_setup_frame_len}}
sub sent_setup_clk_per_tick {$_[0]->{sent_setup_clk_per_tick}}
sub sent_setup_wd_inc {$_[0]->{sent_setup_wd_inc}}
#
# Main program
#
package main;
my $app = Wx::SimpleApp->new;
my $dialog = MyDialog->new ("wxPerl Atlys SENT");
$dialog->Show;
$app->MainLoop;
Alles anzeigen
bringt mir eine schoene grafische Oberflaeche, die Funktion 'sub Apply10' liefert mir auch im Textoutput die gewuenschten Ergebnisse. Das kann ich dann auch per 'qx (...)' ausfuehren. Wenn ich jetzt aber anstatt der 'print' Anweisung ein 'qx (....)' ausfuehren will und dann die Ausgabe wieder auf eine PERL wx Oberflaeche ausgeben will, wie geht das? Ich braeuchte also so eine Art Textfeld, in das ich irgenwas 'reinpasten' kann. Und das ist mein Problem, ich habe keinen Plan wie das mit wxPERL geht...
Also, hat da jemand 'nen Tipp oder Link fuer mich? wxPERL ist fuer mich diesbzgl. ein Buch mit 7 SIegeln...