Skip to content

Instantly share code, notes, and snippets.

@Raggles Raggles/SallDLL.java Secret
Created Oct 18, 2017

Embed
What would you like to do?
Original SallDLL
package au.com.invensys.scada.syscfg;
import au.com.invensys.scada.utils.Logger;
import au.com.invensys.scada.utils.Utils;
import java.io.File;
import java.io.IOException;
public class SallDLL
{
native void sallMain(String paramString1, String paramString2, String paramString3, String paramString4);
public void call(String firmware, String sallFilePath, String cFilePath, String errorFilePath)
{
String Path = Utils.concatenatePathStrings("CalcsRTU_SALL", firmware + File.separator + "buildsal\\sall.dll");
String Dllpath = Utils.concatenatePathStrings(System.getProperty("SYSCFG_UTILS", ""), Path);
String sallDllPath = Utils.concatenatePathStrings(System.getProperty("user.dir"), Dllpath);
Logger.instance().logError("Sall Compilation Path: " + sallDllPath);
System.load(sallDllPath);
firmware = changePartNumber(firmware);
Logger.instance().logError("firmware : " + firmware);
File cFile = new File(cFilePath);
try
{
if (cFile.exists())
{
cFile.delete();
Logger.instance().logError("file deleted");
}
boolean temp = cFile.createNewFile();
Logger.instance().logError("file created :" + temp);
}
catch (IOException e)
{
e.printStackTrace();
}
SallDLL salldll = new SallDLL();
salldll.sallMain(firmware, sallFilePath, cFilePath, errorFilePath);
}
public String changePartNumber(String firmware)
{
firmware = firmware.substring(firmware.indexOf("-") + 1, firmware.length()).replace("_", "-");
if (firmware.charAt(firmware.length() - 1) == '-')
{
firmware = firmware.concat("_");
return firmware;
}
return firmware;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.