Skip to content

Commit

Permalink
STG2 full update
Browse files Browse the repository at this point in the history
1 year + of updates.
  • Loading branch information
Igordalessandro committed Mar 6, 2024
1 parent 78926af commit 5eda17f
Show file tree
Hide file tree
Showing 34 changed files with 2,836 additions and 448 deletions.
Binary file added Releases/DDMSTG2.jar
Binary file not shown.
Binary file added out/artifacts/STG2/DDMSTG2.jar
Binary file not shown.
Binary file added src/ConsoleIconAmber.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions src/DDMConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class DDMConfig {
public boolean demoModoRapido = true;
public int demoModoRapidoReScaleX = 300;
public int demoModoRapidoReScaleY = 300;
public boolean calibrationOutPutToSubFolder = false;
public boolean calibrationOutPutToSub = false;
public boolean DividirModoRapido = false;
public int DividirModoRapidoReScaleX = 300;
public int DividirModoRapidoReScaleY = 300;
Expand All @@ -34,6 +34,10 @@ public class DDMConfig {
public boolean naoFazerComparacoesNoProprioMes = true;
public int porcentagemDasComparacoesDIferencaDeTamanhoAceitavel = 5;
public int porcentagemDasComparacoesMinimaDeSimilaridade = 90;
public int dMMSTG2CalibrationX = 0;
public int dMMSTG2CalibrationY = 0;
public int dMMSTG2CalibrationWeight = 1;
public int dMMSTG2CalibrationHeight = 1;

//Técnico
//Interval é o tempo minimo entre download das imagens (usar somente no caso de imagens sendo baixadas faltando pedaços)
Expand All @@ -44,5 +48,4 @@ public class DDMConfig {
public int areaMinimaEmPixels = 0; //default is 57 for low resolution, 1300 for 1280x1548
// zero = automático!
public int demoBarSize = 0;

}
108 changes: 105 additions & 3 deletions src/DDMCore.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
Expand All @@ -24,6 +25,10 @@ public class DDMCore {
private static DDMFileDownloader dmmFileDownloader;
private static String programPath;
private static DDMSaveLoad saveLoad;
private static DDMSTG2Calibration STG2Calibrator;

private static DDMFolderProbe folderProbe;
private static DDMSTG2ImageSplitter splitter;
//Done

public static void main(String[] args) throws IOException, InterruptedException, URISyntaxException {
Expand Down Expand Up @@ -53,12 +58,14 @@ public static void main(String[] args) throws IOException, InterruptedException,

public static void requests() throws IOException, InterruptedException {
do {

//green

if (CoreCallsRequests.contains(0)) {
CoreCallsRequests.remove((Integer) 0);
DDMGUI.butZero = 1;
sleep(1001);
ddmgui.removeButton0();
ddmgui.removeButton99();
ddmgui.ExtraToGreen();
ddmgui.reset();
ddmgui.resetDisplay();
ddmgui.ToggleButtons(true);
Expand Down Expand Up @@ -104,7 +111,10 @@ public static void requests() throws IOException, InterruptedException {
if (CoreCallsRequests.contains(6)) {
CoreCallsRequests.remove((Integer) 6);
DDMImageDivider1.DividerReload(loadedConfig);
loadedConfig = DDMImageDivider1.LinkDataFolder();
if(folderProbe == null){
folderProbe = new DDMFolderProbe(loadedConfig);
}
loadedConfig = folderProbe.LinkDataFolder();
ddmgui.ToggleButtons(true);
}
if (CoreCallsRequests.contains(7)) {
Expand All @@ -128,6 +138,98 @@ public static void requests() throws IOException, InterruptedException {
ddmgui.resetDisplay();
ddmgui.ToggleButtons(true);
}

if (CoreCallsRequests.contains(10)) {
CoreCallsRequests.remove((Integer) 10);
File jsonInput = new File(programPath, "config.json");
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
String cmd = "rundll32 url.dll,FileProtocolHandler " + jsonInput.getCanonicalPath();
Runtime.getRuntime().exec(cmd);
}
else {
try {
Desktop.getDesktop().edit(jsonInput);
} catch (Exception ignore){
try {
Runtime.getRuntime().exec(loadedConfig.diretorio+"/"+" -c xdg-open config.json");
} catch (Exception ignore2){
ddmgui.ConsoleText("Erro com duas possibilidades:");
ddmgui.ConsoleText("Local: "+ loadedConfig.diretorio+"/Config.json");
ddmgui.ConsoleText("Ou nao funciona para o sistema: "+ System.getProperty("os.name").toLowerCase() + " ou falta permissao para abrir o arquivo");

//Runtime.getRuntime().exec("/bin/bash -c your_command");
}
//Runtime.getRuntime().exec("/bin/bash -c your_command");
}

}
ddmgui.resetDisplay();
ddmgui.ToggleButtons(true);
}

//AMBER
if (CoreCallsRequests.contains(61)) {
CoreCallsRequests.remove((Integer) 61);
if(folderProbe == null){
folderProbe = new DDMFolderProbe(loadedConfig);
}
if(splitter == null){
splitter = new DDMSTG2ImageSplitter(loadedConfig);
} else {
splitter.reload(loadedConfig);
}
splitter.split();
ddmgui.ConsoleText("Operacao de recorde concluida. ");
ddmgui.resetDisplay();
sleep(1000);
ddmgui.ToggleButtonsAmber(true);
ddmgui.resetDisplay();
}
if (CoreCallsRequests.contains(41)) {
CoreCallsRequests.remove((Integer) 41);
if (folderProbe == null) {
folderProbe = new DDMFolderProbe(loadedConfig);
}
folderProbe.LinkDataFolderSTG2();
ddmgui.ToggleButtonsAmber(true);
}
if (CoreCallsRequests.contains(31)) {
CoreCallsRequests.remove((Integer) 31);
if (folderProbe == null) {
folderProbe = new DDMFolderProbe(loadedConfig);
}
DDMSTG2ImageCompare compareSTG2 = new DDMSTG2ImageCompare(loadedConfig);
folderProbe.LinkDataFolderSTG2();
compareSTG2.LinkDataFolder();
ddmgui.resetDisplay();
ddmgui.ToggleButtonsAmber(true);
}
if (CoreCallsRequests.contains(21)) {
CoreCallsRequests.remove((Integer) 21);
if (folderProbe == null) {
folderProbe = new DDMFolderProbe(loadedConfig);
}
DDMSTG2ImageCompareOnce compare = new DDMSTG2ImageCompareOnce(loadedConfig);
folderProbe.LinkDataFolderSTG2();
compare.LinkDataFolder();
ddmgui.resetDisplay();
ddmgui.ToggleButtonsAmber(true);
}
if (CoreCallsRequests.contains(71)) {
CoreCallsRequests.remove((Integer) 71);
new DDMSTG2Loader(loadedConfig,true);
ddmgui.resetDisplay();
ddmgui.ToggleButtonsAmber(true);
}
if (CoreCallsRequests.contains(81)) {
CoreCallsRequests.remove((Integer) 81);
if(STG2Calibrator == null){
STG2Calibrator = new DDMSTG2Calibration(loadedConfig,saveLoad);
}
ddmgui.RemoveButtonsAmber();
ddmgui.CreateAmberExtra();
STG2Calibrator.makeARun();
}
try {
sleep(1000);
} catch (InterruptedException e) {
Expand Down
4 changes: 2 additions & 2 deletions src/DDMFileDownloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ public DDMFileDownloader(DDMInternalConfigFile inputConfig) {
public void reloadConfig(DDMInternalConfigFile inputConfig) {
diretorio = DDMInternalConfigFile.diretorio + "/data";
milisecInterval = DDMInternalConfigFile.interval;
ddmgui = DDMInternalConfigFile.dmmgui;
ddmgui = DDMInternalConfigFile.ddmgui;
CoreRequests = DDMInternalConfigFile.CoreRequests;
recortarImagem = DDMInternalConfigFile.recortarImagem;
xInicialDaNovaImagem = DDMInternalConfigFile.xInicialDaNovaImagem;
yInicialDaNovaImagem = DDMInternalConfigFile.yInicialDaNovaImagem;
xPlusWidth = DDMInternalConfigFile.xPlusWidth;
yPlusHeight = DDMInternalConfigFile.yPlusHeight;
ddmgui = DDMInternalConfigFile.dmmgui;
ddmgui = DDMInternalConfigFile.ddmgui;
}

public void startDownloads() throws IOException, InterruptedException {
Expand Down
Loading

0 comments on commit 5eda17f

Please sign in to comment.