#============================================================ # DeviceObject #============================================================ package DeviceObject; use Exporter; @ISA = qw(Exporter Common2); #公開したいサブルーチン @EXPORT = qw(); use strict; use Deps; #============================================================ # 一般関数 #============================================================ #============================================================ # コンストラクタ、デストラクタ #============================================================ sub new { my ($module, @args) = @_; my $this = {}; bless $this; return $this; } sub DESTROY { my $this = shift; } sub SetCommObject { my ($this, $comm) = @_; return $this->{CommObject} = $comm; } sub CommObject { return shift->{CommObject}; } sub GetId { return "Undefined"; } sub read { my ($this, @args) = @_; return $this->{CommObject}->read(@args); } sub print { my ($this, @args) = @_; return $this->{CommObject}->print(@args); } sub printf { my ($this, @args) = @_; return $this->{CommObject}->printf(@args); } sub MeasureAveraged { my ($this, $nAverage) = @_; my $avrI = 0.0; for(my $i = 0 ; $i < $nAverage ; $i++) { my $I = $this->Measure(); $avrI += $I; } return $avrI / $nAverage; } 1;