Skip to content

Commit

Permalink
Merge pull request #333 from WesGilster/master
Browse files Browse the repository at this point in the history
GUI changes and bug fixes
  • Loading branch information
WesGilster authored Aug 6, 2017
2 parents 3ff6b16 + e39aadd commit 834a34b
Show file tree
Hide file tree
Showing 130 changed files with 6,373 additions and 1,838 deletions.
Binary file added host/bin/curl.zip
Binary file not shown.
104 changes: 103 additions & 1 deletion host/bin/start.bat
Original file line number Diff line number Diff line change
@@ -1 +1,103 @@
java -Dlog4j.configurationFile=log4j2.properties -Djava.library.path=os/win64 -cp lib/*;. org.area515.resinprinter.server.Main > log.out 2> log.err
@if (@CodeSection == @Batch) @then

@echo off
setlocal

rem TODO: Check if java is installed and if not install!

rem // Get repo version from config.properties
rem this is for when the code works properly on windows with updateRepo, watchout the 10 characters could be wrong!
rem for /F "delims=" %%a in ('findstr /I "updateRepo" %HOMEPATH%/3dPrinters/config.properties') do set "updateRepo=%%a"

for /F "delims=" %%a in ('findstr /I "printerProfileRepo" config.properties') do set "updateRepo=%%a"

IF NOT "%1"=="" (
set updateRepo=%1
) ELSE (
IF "%updateRepo%"=="" (
set updateRepo=area515/Photonic3D
) ELSE (
rem set updateRepo=%updateRepo:~10% when changing to updateREpo
set updateRepo=%updateRepo:~19%
)
)

echo %updateRepo%

rem // download dependencies (unzip and curl) **WARNING** bitsadmin.exe is deprecated but seems available from xp to win10 for now!
rem // Might break in future but windows has no proper alternative
rem // also it's extremely slow to start connecting! But hey it works(ish)
if NOT exist %CD%\unzip.exe (
echo installing unzip.exe
bitsadmin.exe /transfer "Unzip.exe" https://github.com/%updateRepo%/raw/master/host/bin/unzip.exe "%cd%\unzip.exe"
)

if NOT exist %CD%\curl\bin\curl.exe (
echo installing curl
IF NOT exist curl.zip (
bitsadmin.exe /transfer "Curl" https://github.com/%updateRepo%/raw/master/host/bin/curl.zip "%cd%\curl.zip"
unzip -o curl.zip
) ELSE (
unzip -o curl.zip
)
del -Q curl.zip
)

rem // Get latest release file from github
%CD%\curl\bin\curl -outf https://api.github.com/repos/%updateRepo%/releases/latest

rem // Set location of downloaded release file (json)
set "latestRelease=utf"

rem // Find current repoversion from build.number
for /F "delims=" %%a in ('findstr /I "repo.version" build.number') do set "repoVersion=%%a"

rem // Cut off repo.version !WARNING! when this changes it will break the code!
set repoVersion=%repoVersion:~13%

rem // Jscript call to parse JSON
for /f "delims=" %%I in ('cscript /nologo /e:JScript "%~f0" "%latestRelease%"') do set "%%~I"


echo Network TAG: %tag_name%
echo Local TAG : %repoVersion%

del -Q utf

rem // Determing if updating is needed
IF "%tag_name%"=="~13" (
echo Download URL = %browser_download_url%
%CD%\curl\bin\curl -L %browser_download_url% > Update.zip
unzip -o Update
java -Dlog4j.configurationFile=log4j2.properties -Djava.library.path=os/win64 -cp lib/*;. org.area515.resinprinter.server.Main > log.out 2> log.err
) ELSE (
IF "%tag_name%"=="%repoVersion%" (
echo No update needed
java -Dlog4j.configurationFile=log4j2.properties -Djava.library.path=os/win64 -cp lib/*;. org.area515.resinprinter.server.Main > log.out 2> log.err
) ELSE (
echo Download URL = %browser_download_url%
%CD%\curl\bin\curl -L %browser_download_url% > Update.zip
unzip -o Update
del -Q Update.zip
java -Dlog4j.configurationFile=log4j2.properties -Djava.library.path=os/win64 -cp lib/*;. org.area515.resinprinter.server.Main > log.out 2> log.err
)
)

goto :EOF

@end // end batch / begin JScript chimera

var fso = WSH.CreateObject('scripting.filesystemobject'),
latestRelease = fso.OpenTextFile(WSH.Arguments(0), 1);

eval('obj = ' + latestRelease.ReadAll());
latestRelease.Close();

function walk(tree) {
for (var i in tree) {
if (typeof tree[i] === 'object') walk(tree[i]);
else WSH.Echo(i + '=' + tree[i]);
}
}

walk(obj);
Binary file added host/bin/unzip.exe
Binary file not shown.
9 changes: 4 additions & 5 deletions host/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ dependencies {
exclude module: 'jsr311-api'
}

//compile 'org.slf4j:log4j-over-slf4j:1.7.22'
//compile 'org.slf4j:jul-to-slf4j:1.7.22'
compile 'commons-beanutils:commons-beanutils:1.9.3'
compile 'com.pi4j:pi4j-core:1.1'
compile 'net.java.dev.jna:jna:4.2.2'
compile 'org.apache.xmlgraphics:xmlgraphics-commons:1.5'
Expand Down Expand Up @@ -57,9 +56,9 @@ dependencies {

compile 'com.jcraft:jsch:0.1.53'
compile 'org.scream3r:jssc:2.8.0'
compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.8'
compile 'org.apache.logging.log4j:log4j-api:2.8'
compile 'org.apache.logging.log4j:log4j-core:2.8'
compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.8.2'
compile 'org.apache.logging.log4j:log4j-api:2.8.2'
compile 'org.apache.logging.log4j:log4j-core:2.8.2'

compile 'org.apache.james:apache-mime4j:0.6.1'

Expand Down
17 changes: 11 additions & 6 deletions host/conf/config.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
fakeserial=true
removeJobOnCompletion=false
printerHostPort=9091
#hostGUI=resources
#hostGUI=gui-prototypes/material-resin/app
#hostGUI=../../CWH-Reify3D/Customer/resources
hostGUI=resourcesnew
visibleCards=printers,printJobs,printables,settings
performedOneTimeInstall=false
limitLiveStreamToOneCPU=false
scriptEngineLanguage=js
forceCalibrationOnFirstUse=false

#hostGUI is no longer used, the "skins" key should be used instead
#hostGUI=resources
#hostGUI=gui-prototypes/material-resin/app
#hostGUI=../../CWH-Reify3D/Customer/resources
skins=[{"name":"Main skin", "welcomeFiles":["index.html"], "resourceBase": "resourcesnew", "active": true}]

feature.org.area515.resinprinter.discover.UPNPAdvertiser=true
feature.org.area515.resinprinter.usbimport.USBUploader=true
#feature.org.area515.resinprinter.util.cron.CronFeature=true
#featureSettings.org.area515.resinprinter.util.cron.CronFeature=[{"taskName":"Show directory listing in Windows every night at 1:15am", "taskClassName":"org.area515.resinprinter.actions.osscript.ExecuteNativeOSCommandRunnable", "cronString":"15 1 * * *", "taskSettings":{"shellCommands":["cmd", "/c", "dir"]}}]

#notify.org.area515.resinprinter.notification.EmailOnCompletionNotifier=true
#notify.org.area515.resinprinter.notification.PauseOnErrorNotifier=true
Expand All @@ -27,14 +31,15 @@ printFileProcessor.org.area515.resinprinter.minercube.MinerCubePrintFileProcesso
printFileProcessor.org.area515.resinprinter.printphoto.ImagePrintFileProcessor=true
printFileProcessor.org.area515.resinprinter.text.TextFilePrintFileProcessor=true
printFileProcessor.org.area515.resinprinter.printphoto.SVGImagePrintFileProcessor=true
printFileProcessor.org.area515.resinprinter.printphoto.micoin.CoinFileProcessor=true

displayDevice.org.area515.resinprinter.display.dispmanx.RaspberryPiMainLCDScreen=true
displayDevice.org.area515.resinprinter.display.dispmanx.RaspberryPiForceTVScreen=true
displayDevice.org.area515.resinprinter.display.LastAvailableDisplay=true
displayDevice.org.area515.resinprinter.display.SimulatedDisplay=true

#Only enable this when there is at least one admin user!!!
#useAuthentication=false
#useAuthentication=true
UserManagementFeatureImplementation=org.area515.resinprinter.security.keystore.KeystoreLoginService

#http://www.optoma.de/uploads/RS232/DS309-RS232-en.pdf
Expand Down Expand Up @@ -98,7 +103,7 @@ userKeystorePassword=usersKeystorePassword

#The following is an optional parameter.
#You only need to specify this parameter if you have a certificate signed by a CA.
#This certificate must be imported into into the keystore specified in the keystoreFilename above.
#This certificate must be imported into into the keystore specified in the "keystoreFilename" key in this property file.
#The certificate must be imported into the keystore using the alias specified below.
#This MUST also be the hostname that the certificate was issued to.
#*****************************************
Expand Down
4 changes: 2 additions & 2 deletions host/conf/eclipselog4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ appenders=console
appender.console.type=Console
appender.console.name=STDOUT
appender.console.layout.type=PatternLayout
appender.console.layout.pattern=[%t] %m%n
appender.console.layout.pattern=%d [%t] %m%n

loggers=hex,serial,printer,media,slicer,scan,customizer,stlfileprocessor,servlet
#loggers=customizer,stlfileprocessor
Expand All @@ -41,7 +41,7 @@ logger.printer.additivity=false
logger.printer.appenderRefs=consoleRef
logger.printer.appenderRef.consoleRef.ref=STDOUT
logger.slicer.name=org.area515.resinprinter.slice.ZSlicer
logger.slicer.level=info
logger.slicer.level=debug
logger.slicer.additivity=false
logger.slicer.appenderRefs=rolling
logger.slicer.appenderRef.rolling.ref=STDOUT
Expand Down
97 changes: 97 additions & 0 deletions host/conf/imaginglog4j2.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#For troubleshoot log4j2
status=error

#This is a properties configuration as opposed to json/XML...
name=PropertiesConfig

#Properties we can use elsewhere in this file
property.filename=cwh.log

#Creates all of the appenders that we need to configure later
appenders=console

#We only defined one appender above so now
appender.console.type=Console
appender.console.name=STDOUT
appender.console.layout.type=PatternLayout
appender.console.layout.pattern=%d [%t] %m%n

loggers=hex,serial,printer,media,slicer,scan,customizer,stlfileprocessor,servlet,displayframe,abstractprint,currentrender,platformrender,coinrenderer

#We need to define each of the loggers that we listed in the previous line
logger.media.name=org.area515.resinprinter.services.MediaService
logger.media.level=debug
logger.media.additivity=false
logger.media.appenderRefs=rolling
logger.media.appenderRef.rolling.ref=STDOUT
logger.hex.name=org.area515.resinprinter.projector.HexCodeBasedProjector
logger.hex.level=debug
logger.hex.additivity=false
logger.hex.appenderRefs=consoleRef
logger.hex.appenderRef.consoleRef.ref=STDOUT
logger.serial.name=org.area515.resinprinter.serial.SerialManager
logger.serial.level=debug
logger.serial.additivity=false
logger.serial.appenderRefs=consoleRef
logger.serial.appenderRef.consoleRef.ref=STDOUT
logger.printer.name=org.area515.resinprinter.printer.PrinterManager
logger.printer.level=debug
logger.printer.additivity=false
logger.printer.appenderRefs=consoleRef
logger.printer.appenderRef.consoleRef.ref=STDOUT
logger.slicer.name=org.area515.resinprinter.slice.ZSlicer
logger.slicer.level=info
logger.slicer.additivity=false
logger.slicer.appenderRefs=rolling
logger.slicer.appenderRef.rolling.ref=STDOUT
logger.scan.name=org.area515.resinprinter.slice.ScanlineFillPolygonWork
logger.scan.level=debug
logger.scan.additivity=false
logger.scan.appenderRefs=rolling
logger.scan.appenderRef.rolling.ref=STDOUT
logger.customizer.name=org.area515.resinprinter.services.CustomizerService
logger.customizer.level=debug
logger.customizer.additivity=false
logger.customizer.appenderRefs=consoleRef
logger.customizer.appenderRef.consoleRef.ref=STDOUT
logger.stlfileprocessor.name=org.area515.resinprinter.job.STLFileProcessor
logger.stlfileprocessor.level=debug
logger.stlfileprocessor.additivity=false
logger.stlfileprocessor.appenderRefs=consoleRef
logger.stlfileprocessor.appenderRef.consoleRef.ref=STDOUT
logger.servlet.name=org.eclipse.jetty.servlet.ServletHandler
logger.servlet.level=debug
logger.servlet.additivity=false
logger.servlet.appenderRefs=consoleRef
logger.servlet.appenderRef.rolling.ref=STDOUT
logger.abstractprint.name=org.area515.resinprinter.job.AbstractPrintFileProcessor
logger.abstractprint.level=TRACE
logger.abstractprint.additivity=false
logger.abstractprint.appenderRefs=consoleRef
logger.abstractprint.appenderRef.rolling.ref=STDOUT
logger.displayframe.name=org.area515.resinprinter.display.PrinterDisplayFrame
logger.displayframe.level=TRACE
logger.displayframe.additivity=false
logger.displayframe.appenderRefs=consoleRef
logger.displayframe.appenderRef.rolling.ref=STDOUT
logger.currentrender.name=org.area515.resinprinter.job.render.CurrentImageRenderer
logger.currentrender.level=TRACE
logger.currentrender.additivity=false
logger.currentrender.appenderRefs=consoleRef
logger.currentrender.appenderRef.rolling.ref=STDOUT
logger.platformrender.name=org.area515.resinprinter.twodim.PlatformImageRenderer
logger.platformrender.level=TRACE
logger.platformrender.additivity=false
logger.platformrender.appenderRefs=consoleRef
logger.platformrender.appenderRef.rolling.ref=STDOUT
logger.coinrenderer.name=org.area515.resinprinter.printphoto.micoin.CoinRenderer
logger.coinrenderer.level=TRACE
logger.coinrenderer.additivity=false
logger.coinrenderer.appenderRefs=consoleRef
logger.coinrenderer.appenderRef.rolling.ref=STDOUT


#Default logger
rootLogger.level=info
rootLogger.appenderRefs=consoleRef
rootLogger.appenderRef.consoleRef.ref=STDOUT
16 changes: 16 additions & 0 deletions host/launchers/Photonic 3D (ImagingDebug).launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/photonic3d/src/main/java/org/area515/resinprinter/server/Main.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.area515.resinprinter.server.Main"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="photonic3d"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx100M -Dlog4j.configurationFile=${workspace_loc:photonic3d\conf\imaginglog4j2.properties} -Djava.library.path=${workspace_loc:photonic3d\os\win64} -XX:+UnlockCommercialFeatures -XX:+FlightRecorder"/>
</launchConfiguration>
Loading

0 comments on commit 834a34b

Please sign in to comment.