Permalink
Browse files

further work on importing the default configuration from file.

possibility to overrule settings from  command line aprameters still pending
  • Loading branch information...
1 parent ea25a17 commit 006ecf36015518e2d346c17c969b2376ab64d302 @rkoeppl rkoeppl committed May 1, 2016
Showing with 7 additions and 8 deletions.
  1. +0 −1 modules/printengine.cfg
  2. +7 −7 modules/printengine.pl
View
@@ -1,4 +1,3 @@
-#!/usr/bin/perl
#Configuration file for printengine.pl to be called by SLAcer.js and other printer services
#Copyright 2016 Robert Koeppl, Fablab Leoben robert.koeppl@fablab-leoben.at
#http://www.fablab-leoben.at
View
@@ -56,33 +56,33 @@
my $pin_vat_presence=$cfg->param("pin_vat_presence");
-#checked for used controller board type according to configuration.
#activate logging to logfile
if ($logging_enabled eq "TRUE")
{
open my $log_fh, ">", $log_file;
}
-if ($controllerboard eq "BBB")
+#basic sanity checks to determine whether or not the configuration is complete and makes at least some sense
+if ($controllerboard eq "BBB") #if the Board is set to be a Beagle Bone Black, we need to check if it actually is one
{
-
+say "Beagle Bone Black selected, checking board type! - check command still missing";
}
else {
say "unknows printer type $controllerboard , please review your configuration, get in touch with developers or fork the code on Github and contribute the code to use the new printer"
;
die "unknown board in configuration!\n";
}
-if ($display_software eq "fbi")
+if ($display_software eq "fbi") #ckeck for configured Software to send Pictures to the projector
{
-open(whichfile,"which $display_software |") || die "Failed: $!\n";
+open(whichfile,"which $display_software |") || die "Failed: $!\n"; #find path to the binary
while ( <whichfile> )
{
my $display_software_path=$!;
}
}
-else {
+else { #if the configured Display software matches none of the supported packages, die
say "unknows display software $display_software , please review your configuration, get in touch with developers or fork the code on Github and contribute the code to use the new printer"
;
die "unknown display software in configuration!\n";
-}
+}

0 comments on commit 006ecf3

Please sign in to comment.