It is currently Tue, 18-09-18, 21:31 GMT

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: About the "code" textbox
PostPosted: Sat, 28-11-09, 11:23 GMT 
Offline
User avatar

Joined: Mon, 03-09-07, 23:01 GMT
Posts: 418
Location: Tuscany, Tyrrhenian Sea
Hi There! Yesterday I wished to post a new Perl code based upon the extants and for this with the same lenght and format, surprisingly the code textbox did trunk it the lengthwidth. Being even of the same width of the other, I wonder whether there are "problems" with the code box or whatelse. Indeed I've no problem to post it as file link, but I was just courios. :wink:


Top
 Profile  
 
 Post subject:
PostPosted: Sat, 28-11-09, 11:48 GMT 
Offline
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4576
Location: Hamburg, Germany
Hmm,

there are no known problems with
Code:
...


Perhaps you had some /cr or other unwanted control characters embedded into the Perl script??

Fridger

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Sat, 28-11-09, 12:41 GMT 
Offline
User avatar

Joined: Mon, 03-09-07, 23:01 GMT
Posts: 418
Location: Tuscany, Tyrrhenian Sea
t00fri wrote:
Hmm,

there are no known problems with
Code:
...


Perhaps you had some /cr or other unwanted control characters embedded into the Perl script??

Fridger


Nope. (/cr mean carriage returns?) just the usual "#" as comments that are put as new line when long. The strange fact is that the script is vertically "cutted off" in the middle, across letters, as one would cut in the middle a paper with some words in it. Boh! I can post it for visuals ( yesterday I did deleted it because was unpresentable and unreadable).


Top
 Profile  
 
 Post subject:
PostPosted: Sat, 28-11-09, 14:34 GMT 
Offline
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4576
Location: Hamburg, Germany
Yes, why don't you post an example? We can delete it thereafter...

Fridger


Last edited by t00fri on Sat, 28-11-09, 19:28 GMT, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sat, 28-11-09, 19:18 GMT 
Offline
User avatar

Joined: Mon, 03-09-07, 23:01 GMT
Posts: 418
Location: Tuscany, Tyrrhenian Sea
Ok, Fridger. Sorry for the delay but another time the email advertisement still doesn't work. I've not received your messages.

_________________
Never at rest.
Massimo


Top
 Profile  
 
 Post subject:
PostPosted: Sat, 28-11-09, 19:20 GMT 
Offline
User avatar

Joined: Mon, 03-09-07, 23:01 GMT
Posts: 418
Location: Tuscany, Tyrrhenian Sea
I try to post

Code:
#    Author Fenerit <fenerit@interfree.it>
#    Version 1.0, 14.11.2009
#    This script build a structured Celestia's SSC definition file from a LongLat table.
#   Such coordinates will be assigned to an extant 3D SurfaceObject,
#   (see below how to do whether you have LatLong instead).
#   Acknowledgements: Dr. Fridger Schrempp <www.celestialmatters.org> for its basic routines.

#   USAGE:
#   1) Script and coordinates' text files must be in the same folder;
#   2) Run the script. A new file called "my_surface_features_model.ssc" will be created in the same folder;

   print STDOUT "\n -- Start process... --\n";
   
   open(SSC, " > my_surface_features_model.ssc") || die "Can not create my_surface_features_model.ssc\n";
   
###################### set the data for the SurfaceFeature object (edit below for your own) ######################

   my $name      = "your_surfaceobject_name";   # set the global name for 3d object;
   my $locs      = "Sol/Earth";               # set the location for 3d object;
   
   my $class       = "surfacefeature";            # set the class;
   my $visible    = "true";                   # set the visibility;
   
   my $mesh       = "your_3d_model.cmod";         # set the mesh (CMOD or 3Ds format);
   my $orientation = "[ 90 1 0 0 ]";             # set the orientation (based upon 3D modeler workspace);
#   my $radius       = 10;                     # set the radius;
   
   my $divisor      = 1000;                     # set the value of divisor;
   
   my $elevation   = 0.0;                     # set the planetographics elevation;
   my $heading    = 0.0;                    # set the FixedAttitude Heading;

##################################################################################################################

   $l = 0;

   while (<>)

{
   next if ($. == 1);                        # skip the first line (usually "LONGITUDE LATITUDE" text;      
   next if (/^$/);                           # trim input white spaces at init and at end of file;
   next if ++$seen{$_} > 1;                  # skip duplicate values;
   
   s/\b(,)\b/./g;                           # convert commas to dots;

   ($value,$long,$lat) = split (" ",$_);
      
      $value[$l] = $value;
      $long[$l] = $long;
      $lat[$l] = $lat;

   $l++;
}

   $longlatcount = $l;

   for ($index=0; $index < $longlatcount; $index++)
   
{
   printf SSC "SurfaceObject \"$name\" \"$locs\"\n";
   printf SSC "{\n";
   printf SSC "     Class \"$class\"\n";
   printf SSC "     Visible $visible\n\n";
   printf SSC "     Mesh \"$mesh\"\n";
   printf SSC "     Radius %5.1f\n",$value[$index]/$divisor;
   printf SSC "     Orientation $orientation\n";
   printf SSC "\n";
   printf SSC "     FixedPosition { Planetographic [ %8.8f %8.8f $elevation ] }\n", $long[$index],$lat[$index]; # invert $long $lat whether you have LatLong;
   printf SSC "     FexedAttitude { Heading $heading }\n";
   printf SSC "}\n\n";
;}

   print STDOUT "\n -- Finished! ", $longlatcount, " resulting SurfaceFeature(s) for", " ", $name, " --\n";


As you can see it doesn't go on multilines


Top
 Profile  
 
 Post subject:
PostPosted: Sat, 28-11-09, 19:27 GMT 
Offline
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4576
Location: Hamburg, Germany
fenerit wrote:
Ok, Fridger. Sorry for the delay but another time the email advertisement still doesn't work. I've not received your messages.


What do you mean? I didn't send you any messages by email???

Fridger


Top
 Profile  
 
 Post subject:
PostPosted: Sat, 28-11-09, 19:35 GMT 
Offline
User avatar

Joined: Mon, 03-09-07, 23:01 GMT
Posts: 418
Location: Tuscany, Tyrrhenian Sea
t00fri wrote:
fenerit wrote:
Ok, Fridger. Sorry for the delay but another time the email advertisement still doesn't work. I've not received your messages.


What do you mean? I didn't send you any messages by email???

Fridger


Sorry my imprecision: I intend the CelestialMatters email notifier that advise when one post into topics.

For what concern the script as you can see, if you try to copy it and than paste it in a editor ALL ir right, the text "there is".


Top
 Profile  
 
 Post subject:
PostPosted: Sat, 28-11-09, 19:36 GMT 
Offline
User avatar

Joined: Mon, 03-09-07, 23:01 GMT
Posts: 418
Location: Tuscany, Tyrrhenian Sea
For example NOW you PM is arrived. But the advertisement that you had post in this topic not.

_________________
Never at rest.
Massimo


Top
 Profile  
 
 Post subject:
PostPosted: Sun, 29-11-09, 0:02 GMT 
Offline
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4576
Location: Hamburg, Germany
fenerit wrote:
For example NOW you PM is arrived. But the advertisement that you had post in this topic not.


You are talking about the yellow dot on the left hand side, don't you?

It's the first time that I hear this after writing 1835 posts in this forum!

Fridger


Top
 Profile  
 
 Post subject:
PostPosted: Sun, 29-11-09, 0:06 GMT 
Offline
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4576
Location: Hamburg, Germany
fenerit wrote:
t00fri wrote:
fenerit wrote:
Ok, Fridger. Sorry for the delay but another time the email advertisement still doesn't work. I've not received your messages.


What do you mean? I didn't send you any messages by email???

Fridger


Sorry my imprecision: I intend the CelestialMatters email notifier that advise when one post into topics.

For what concern the script as you can see, if you try to copy it and than paste it in a editor ALL ir right, the text "there is".


What I suggested was that you send your script to me per normal email. This is a procedure that is entirely independent of possible bugs in this CM forum. Then I can take it like you did and paste it here. This gives me better possibilities for investigating.

Thanks,
Fridger


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group