Skip to content
Snippets Groups Projects
Commit f157261d authored by Thorsten Kracht's avatar Thorsten Kracht
Browse files

Tagging the Release_1_1 of the DGG2 project.

parent 4fdff9fb
No related branches found
Tags Release_1_1@14061
No related merge requests found
......@@ -149,9 +149,8 @@ void DGG2::init_device()
if(debug_sim) cout << "Running in simulation mode" << endl;
vme = NULL;
}
set_state(Tango::ON);
set_state(Tango::ON);
}
//+----------------------------------------------------------------------------
......@@ -308,46 +307,49 @@ Tango::DevLong DGG2::start()
struct timezone time_zone = { 0, 0};
if(!simulationMode){
if(!simulationMode)
{
vme->read( (u_int32_t) A24D16, (u_int32_t) (base + off + 0x12), &temp_ul);
if( 0xffff & temp_ul)
{
fprintf( stderr, " START_TIMER: timer is busy\n");
argout = 0;
goto finish;
}
{
fprintf( stderr, " START_TIMER: timer is busy\n");
argout = 0;
goto finish;
}
musec_ui = (int)(1000000. * attr_SampleTime_write);
/*
store low & high word
store low & high word
*/
vme->write( A24D16, base + off + 0, (u_int16_t) (musec_ui & 0xffff));
vme->write( A24D16, base + off + 2, (u_int16_t) (musec_ui >> 16));
/*
load
load
*/
vme->write( A24D16, base + off + 0x0c, 0);
vme->write( A24D16, base + off + 0x0c, 1);
vme->write( A24D16, base + off + 0x0c, 0);
/*
internal clock
internal clock
*/
vme->write( A24D16, base + off + 0x10, 1);
/*
divider to 0, 1 MHz
divider to 0, 1 MHz
*/
vme->write( A24D16, base + off + 0x14, (u_int16_t) 0);
/*
start
start
*/
vme->write( A24D16, base + off + 0x08, 0);
vme->write( A24D16, base + off + 0x08, 1);
vme->write( A24D16, base + off + 0x08, 0);
} else {
}
else
{
gettimeofday( &current_time, &time_zone);
start_time = current_time.tv_sec + current_time.tv_usec*1.0e-6 - ref_time;
end_time = start_time + attr_SampleTime_write;
}
}
set_state(Tango::MOVING);
argout = 1;
......@@ -377,23 +379,26 @@ Tango::DevLong DGG2::stop()
struct timeval current_time;
struct timezone time_zone = { 0, 0};
if(!simulationMode){
if(!simulationMode)
{
/*
stop
stop
*/
vme->write( A24D16, base + off + 0x0a, 0);
vme->write( A24D16, base + off + 0x0a, 1);
vme->write( A24D16, base + off + 0x0a, 0);
/*
clear
clear
*/
vme->write( A24D16, base + off + 0xe, 0);
vme->write( A24D16, base + off + 0xe, 1);
vme->write( A24D16, base + off + 0xe, 0);
}else{
}
else
{
gettimeofday( &current_time, &time_zone);
end_time = current_time.tv_sec + current_time.tv_usec*1.0e-6 - ref_time;
}
}
set_state(Tango::ON);
......@@ -424,19 +429,22 @@ Tango::DevLong DGG2::check()
u_int32_t off = channel * 0x20 + 0x20;
if(!simulationMode){
if(!simulationMode)
{
vme->read( A24D16, base + off + 0x12, &temp_ul);
argout = (Tango::DevLong) temp_ul;
}else{
}
else
{
gettimeofday( &current_time, &time_zone);
time_tmp = current_time.tv_sec + current_time.tv_usec*1.0e-6 - ref_time;
if(debug_sim) cout << "Teresa:check time_tmp " << time_tmp << " end_time " << end_time << endl;
if(( !end_time || (time_tmp > end_time))){
argout = 0;
if(debug_sim) cout << " Teresa: check seting argout to 0 " << endl;
argout = 0;
if(debug_sim) cout << " Teresa: check seting argout to 0 " << endl;
} else {
argout =1;
if(debug_sim) cout << " Teresa: check seting argout to 1 " << endl;
argout =1;
if(debug_sim) cout << " Teresa: check seting argout to 1 " << endl;
}
}
......@@ -526,32 +534,39 @@ Tango::DevLong DGG2::read()
float time_rem;
if(get_state() == Tango::MOVING){
if(!simulationMode){
long off = channel * 0x20 + 0x20;
vme->read( (u_int32_t) A24D16, (u_int32_t) (base + off + 0x04), &temp);
temp1_us = temp & 0xffff;
vme->read( (u_int32_t) A24D16, (u_int32_t) (base + off + 0x06), &temp);
temp2_us = temp & 0xffff;
argout = (Tango::DevLong) (temp1_us + (temp2_us << 16));
if(argout < 0){
set_state(Tango::ON);
argout =0;
}
} else {
gettimeofday( &current_time, &time_zone);
time_tmp = current_time.tv_sec + current_time.tv_usec*1.0e-6 - ref_time;
time_rem = (end_time - time_tmp)*1.0e6;
if(debug_sim) cout << "Teresa: read end_time " << end_time << " time_tmp " << time_tmp << " time_rem " << time_rem << endl;
if(time_rem < 0) {
set_state(Tango::ON);
argout = 0;
}else{
argout = (Tango::DevLong) time_rem;
}
}
} else {
argout = 0;
if(get_state() == Tango::MOVING)
{
if(!simulationMode)
{
long off = channel * 0x20 + 0x20;
vme->read( (u_int32_t) A24D16, (u_int32_t) (base + off + 0x04), &temp);
temp1_us = temp & 0xffff;
vme->read( (u_int32_t) A24D16, (u_int32_t) (base + off + 0x06), &temp);
temp2_us = temp & 0xffff;
argout = (Tango::DevLong) (temp1_us + (temp2_us << 16));
if(argout < 0){
set_state(Tango::ON);
argout =0;
}
}
else
{
gettimeofday( &current_time, &time_zone);
time_tmp = current_time.tv_sec + current_time.tv_usec*1.0e-6 - ref_time;
time_rem = (end_time - time_tmp)*1.0e6;
if(debug_sim) cout << "Teresa: read end_time " << end_time << " time_tmp " << time_tmp << " time_rem " << time_rem << endl;
if(time_rem < 0)
{
set_state(Tango::ON);
argout = 0;
}
else
{
argout = (Tango::DevLong) time_rem;
}
}
} else {
argout = 0;
}
if(debug_sim) cout << " Teresa: read argout " << argout << endl;
......@@ -584,41 +599,44 @@ Tango::DevLong DGG2::start_preset()
struct timezone time_zone = { 0, 0};
if(!simulationMode){
vme->read( (u_int32_t) A24D16, (u_int32_t) (base + off + 0x12), &temp_ul);
if( 0xffff & temp_ul)
{
fprintf( stderr, " START_TIMER: timer is busy\n");
argout = 0;
goto finish;
}
musec_ui = (int)(1000000. * attr_SampleTime_write);
/*
store low & high word
*/
vme->write( A24D16, base + off + 0, (u_int16_t) (musec_ui & 0xffff));
vme->write( A24D16, base + off + 2, (u_int16_t) (musec_ui >> 16));
/*
load
*/
vme->write( A24D16, base + off + 0x0c, 0);
vme->write( A24D16, base + off + 0x0c, 1);
vme->write( A24D16, base + off + 0x0c, 0);
/*
internal clock
*/
vme->write( A24D16, base + off + 0x10, 0);
/*
start
*/
vme->write( A24D16, base + off + 0x08, 0);
vme->write( A24D16, base + off + 0x08, 1);
vme->write( A24D16, base + off + 0x08, 0);
} else {
gettimeofday( &current_time, &time_zone);
start_time = current_time.tv_sec + current_time.tv_usec*1.0e-6 - ref_time;
end_time = start_time + attr_SampleTime_write;
}
if(!simulationMode)
{
vme->read( (u_int32_t) A24D16, (u_int32_t) (base + off + 0x12), &temp_ul);
if( 0xffff & temp_ul)
{
fprintf( stderr, " START_TIMER: timer is busy\n");
argout = 0;
goto finish;
}
musec_ui = (int)(1000000. * attr_SampleTime_write);
/*
store low & high word
*/
vme->write( A24D16, base + off + 0, (u_int16_t) (musec_ui & 0xffff));
vme->write( A24D16, base + off + 2, (u_int16_t) (musec_ui >> 16));
/*
load
*/
vme->write( A24D16, base + off + 0x0c, 0);
vme->write( A24D16, base + off + 0x0c, 1);
vme->write( A24D16, base + off + 0x0c, 0);
/*
external clock
*/
vme->write( A24D16, base + off + 0x10, 0);
/*
start
*/
vme->write( A24D16, base + off + 0x08, 0);
vme->write( A24D16, base + off + 0x08, 1);
vme->write( A24D16, base + off + 0x08, 0);
}
else
{
gettimeofday( &current_time, &time_zone);
start_time = current_time.tv_sec + current_time.tv_usec*1.0e-6 - ref_time;
end_time = start_time + attr_SampleTime_write;
}
set_state(Tango::MOVING);
......
#!/usr/bin/env perl
#
# usage: ./Do.pl [node]
#
# if node is specified, the server image is copied into
# the remove /usr/local/bin/server directory
#
use strict;
my $dir = $ENV{ PWD};
$dir =~ /.*\/(.+)/;
$dir =~ /.*\/(.+)\/trunk/;
my $clss = $1;
if( system( "make linux=1"))
......@@ -12,7 +17,26 @@ if( system( "make linux=1"))
print " 'make linux=1' returned an error \n";
goto finish;
}
#
# scp to remote node or cp to local /usr/local/bin/server
#
if( scalar( @ARGV))
{
if( system( "ping -c 1 -w 1 -q $ARGV[0] 1>/dev/null 2>&1"))
{
print "\n $ARGV[0] is offline \n";
goto finish;
}
print "\nssh -l root $ARGV[0] \"mv /usr/local/bin/server/${clss} /usr/local/bin/server/${clss}PrevVer\" \n";
system( "ssh -l root $ARGV[0] \"mv /usr/local/bin/server/${clss} /usr/local/bin/server/${clss}PrevVer\"");
print "\nscp ./bin/$clss root\@$ARGV[0]:/usr/local/bin/server \n";
system( "scp ./bin/$clss root\@$ARGV[0]:/usr/local/bin/server");
}
else
{
system( "mv -v /usr/local/bin/server/${clss} /usr/local/bin/server/${clss}PrevVer ");
system( "cp -v ./bin/$clss /usr/local/bin/server");
}
system( "cp -v ./bin/$clss /usr/local/bin/server");
finish:
......@@ -25,7 +25,7 @@
CLASS = DGG2
MAJOR_VERS = 1
MINOR_VERS = 0
MINOR_VERS = 1
RELEASE = Release_$(MAJOR_VERS)_$(MINOR_VERS)
#-----------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment