mirror of
https://github.com/developersu/ns-usbloader.git
synced 2025-05-14 07:04:50 -04:00
Refactor some old UI-related code. Rewrite LogPrinter to handle commandline. Add RCM-payload module into CLI interface: now it could be executed on system without graphical environment (x86/amd64 only).
E.g.: java -jar app.jar --rcm payload.bin
This commit is contained in:
parent
255c926184
commit
6b65c74c9d
23 changed files with 328 additions and 154 deletions
|
@ -26,10 +26,12 @@ import nsusbloader.Controllers.NSTableViewController;
|
|||
import nsusbloader.MediatorControl;
|
||||
import nsusbloader.NSLDataTypes.EFileStatus;
|
||||
import nsusbloader.NSLDataTypes.EModule;
|
||||
import nsusbloader.NSLDataTypes.EMsgType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
public class MessagesConsumer extends AnimationTimer {
|
||||
private final BlockingQueue<String> msgQueue;
|
||||
|
@ -41,9 +43,15 @@ public class MessagesConsumer extends AnimationTimer {
|
|||
private final NSTableViewController tableViewController;
|
||||
private final EModule appModuleType;
|
||||
|
||||
private AtomicBoolean oneLinerStatus;
|
||||
|
||||
private boolean isInterrupted;
|
||||
|
||||
MessagesConsumer(EModule appModuleType, BlockingQueue<String> msgQueue, BlockingQueue<Double> progressQueue, HashMap<String, EFileStatus> statusMap){
|
||||
MessagesConsumer(EModule appModuleType,
|
||||
BlockingQueue<String> msgQueue,
|
||||
BlockingQueue<Double> progressQueue,
|
||||
HashMap<String, EFileStatus> statusMap,
|
||||
AtomicBoolean oneLinerStatus) {
|
||||
this.appModuleType = appModuleType;
|
||||
this.isInterrupted = false;
|
||||
|
||||
|
@ -56,6 +64,8 @@ public class MessagesConsumer extends AnimationTimer {
|
|||
this.statusMap = statusMap;
|
||||
this.tableViewController = MediatorControl.getInstance().getContoller().FrontTabController.tableFilesListController;
|
||||
|
||||
this.oneLinerStatus = oneLinerStatus;
|
||||
|
||||
progressBar.setProgress(0.0);
|
||||
|
||||
progressBar.setProgress(ProgressIndicator.INDETERMINATE_PROGRESS);
|
||||
|
@ -84,9 +94,15 @@ public class MessagesConsumer extends AnimationTimer {
|
|||
MediatorControl.getInstance().setBgThreadActive(false, appModuleType);
|
||||
progressBar.setProgress(0.0);
|
||||
|
||||
if (statusMap.size() > 0)
|
||||
if (statusMap.size() > 0){
|
||||
for (String key : statusMap.keySet())
|
||||
tableViewController.setFileStatus(key, statusMap.get(key));
|
||||
}
|
||||
//TODO: rewrite
|
||||
if (appModuleType.equals(EModule.RCM)){
|
||||
MediatorControl.getInstance().getContoller().getRcmCtrlr().setOneLineStatus(oneLinerStatus.get());
|
||||
}
|
||||
|
||||
this.stop();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue