Program Stanley Alpha
Summit has recently published a simple API that will program Stanley Alpha, Generation 4, controllers from 3rd party application code.
The simple API will allow for real-time backup and restore of the parameters currently inside the controller. The library is cross compatible with the backup XML that comes off the controller as well, allowing the use of the backups that are saved to USB sticks. However, with this automation library, we hope to remove the necessity of pulling these backups manually by giving facility staff a tool that can be automated to do the same task.
The API also allows to write job parameters on the fly. The tool can then be programmed via parameters that may be stored inside a database, or some other data-store.
Examples
C#
Create a Simple Job
//Define the job
Job job = new Job();
job.setJobName("Simple Job");
job.setDisableReverseOnJobComplete(java.lang.Boolean.FALSE);
//Define a task
//Task is a reserved word... so we have to reference it directly.
com.summit.torquejobs.alpha.structs.Task task = new com.summit.torquejobs.alpha.structs.Task();
task.setTaskName("Simple Task");
task.setLimitRejects(java.lang.Boolean.TRUE);
//Add the task to the job (these are interpreted "in order")
job.getTasks().add(task);
Step step = new Step();
step.setStepName("Simple Step");
step.setHighTorque(new java.math.BigDecimal(15.0));
//Add the step to the task (these are interpreted "in order")
task.getSteps().add(step); Boolean completed = false;
//Get a handle to the jobService
AlphaJobXmlService jobService = AlphaJobXmlServiceFactory.getAlphaJobXmlServiceInstance();
//Push the job, record its success in the "completed" variable
completed = jobService.pushJobToAlpha(hostName, job);
Save Alpha configuration to File
String hostName = "validHostNameOrIp";
String saveXmlFilePath = "validFileOrUncPath";
//get a handle to the jobService
AlphaJobXmlService jobService = AlphaJobXmlServiceFactory.getAlphaJobXmlServiceInstance();
//Create a java file handle, and save ONLY the job and IO information to the file path.
jobService.saveSystemBackupToFile(hostName, new java.io.File(saveXmlFilePath), etAPIConfigurationParts.__Fields.JOB_AND_IO_ONLY);
Push a Configuration File
String hostName = "validHostNameOrIp";
String saveXmlFilePath = "validFileOrUncPath";
//get a handle to the jobService
AlphaJobXmlService jobService = AlphaJobXmlServiceFactory.getAlphaJobXmlServiceInstance();
//Create a java file handle, and push ONLY the job and IO information to the controller.
jobService.pushSystemBackupFromFile(hostName, new java.io.File(sendXmlFilePath), etAPIConfigurationParts.__Fields.JOB_AND_IO_ONLY);
All code samples are provided ‘as-is’ and without warranty, of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or dealings in the software.
Unless otherwise noted, all code samples are provided under the Apache v2 license.