#============================================================ # ArcLamp #============================================================ package ArcLamp; use Device::DeviceObject; @ISA = qw(DeviceObject); #公開したいサブルーチン #@EXPORT = qw(); use strict; #use Deps; #============================================================ # コンストラクタ、デストラクタ #============================================================ BEGIN { } sub new { my ($module, @args) = @_; my $this = {}; bless $this; return $this; } sub DESTROY { my $this = shift; $this->Finish(); } #============================================================ # 変数取得関数 #============================================================ sub GetFunctions { return "|LightSource|"; } #============================================================ # 一般関数 #============================================================ sub Initialize { my ($this) = @_; } sub Finish { my ($this) = @_; } sub eof { my ($this) = @_; return $this->{CommObject}->eof(); } sub GetId { my ($this) = @_; # $this->print('IDN?' . "\n"); # return $this->read(); return "ArcLamp(fixed response from Perl.pm)"; } sub StartLamp { my ($this) = @_; $this->print('STAR' . "\n"); return $this->read(); } sub StopLamp { my ($this) = @_; $this->print('STOP' . "\n"); return $this->read(); } sub ResetPowerSupply { my ($this) = @_; $this->print('RST' . "\n"); return $this->read(); } sub ResetLampHour { my ($this) = @_; $this->print('RSTHRS' . "\n"); return $this->read(); } sub SetMode { my ($this, $status) = @_; $status = '1' if($status =~ /current/i); $status = '0' if($status =~ /power/i); $this->print("MODE= $status\n"); } sub SetCommPanel { my ($this, $status) = @_; $status = '1' if($status =~ /lockout/i); $status = '0' if($status =~ /unlock/i); $this->print("COMM= $status\n"); } sub PRESET { my ($this, $power) = @_; $this->{CommObject}->truncate(); $this->print("P-PRESET $power\n"); } 1;