JoaoLopesF / SerialDebug

Improved serial debug and simple software debugger to Arduino. With debug levels, see/change global variables, call functions, watches, and more.
MIT License
244 stars 39 forks source link

strings corrections #5

Open ivannunyadambiz opened 5 years ago

ivannunyadambiz commented 5 years ago

hi there, i like this project! i'd like to offer doing some proofreading, there's a couple of typos (especially in the app). if you're interested, tell me!

JoaoLopesF commented 5 years ago

Hi, @lpdunwell. Yes, help is always great. Thank you for the offer to collaborate. This is the best that open source offers. In App, as it is not open source, please send me that needs be changed. Thanks a lot.

harshitc commented 5 years ago

I found this app today and it seems to be a good one. Haven't tried it yet but I found a typo in the app(version 0.9.4) under the settings tab. The apply is spelled as "aplly". I will surely give this app a try whenever I get the time to be on Arduino IDE.

Thanks Hc

ivannunyadambiz commented 5 years ago

the thing is, i can't seem to find the source to the app itself, and digging through what i can download yields no real starting point. so if you tell me where to begin, i'd do this in like a day tops. cheers, luke

ivannunyadambiz commented 5 years ago

if you want to leave it closed, send me a complete list of strings, i'll return them corrected.

JoaoLopesF commented 5 years ago

HI, @lpdunwell

I flitered strings in all codes:

                                        serialDebugAppUI.exibirPopupAlerta("<html>Detected possible serial baud mistake,<br>please disconnect and correct this.</html>", 10);
        ret += " " + ((enabled)?"(enabled)":"(disabled)") + ((triggered)?" (triggered)":"");
        serialDebugAppUI.exibirPopupAlerta("Text sended to clipboard.", 3);
            serialDebugAppUI.exibirPopupAlerta("File saved at: " + arquivo, 5);
            fcArquivo.setDialogTitle("Save text file");
                serialDebugAppUI.btnFiltrar.setText("Cancel");
            serialDebugAppUI.btnFiltrar.setText("Filter");
                serialDebugAppUI.exibirPopupAlerta("No serial ports detected", 3);
                serialDebugAppUI.exibirPopupAlerta("No serial speed (bauds) selected", 3);
                serialDebugAppUI.exibirPopupAlerta("Invalid serial speed (bauds) - not numeric", 5);
                serialDebugAppUI.exibirPopupAlerta("Invalid serial speed (bauds) - not positive numeric", 5);
                        adicionarNaLista("* *** Connected on serial port USB: " + ultPortaSerial, true);
                        adicionarNaLista("* Discarting buffer from serial", true);
                        adicionarNaLista("* Done", true);
            serialDebugAppUI.exibirPopupAlerta("Not possible to connect in " + serialPort.getPortName(), 5);
                    adicionarNaLista("* *** Desconnected from serial port USB", true);
                serialDebugAppUI.exibirPopupAlerta("The serial port USB not is connected", 5);
                serialDebugAppUI.exibirPopupAlerta("Not possible send data to serial port", 5);
            serialDebugAppUI.exibirPopupAlerta("Exception on send data to serial port", 5);
            serialDebugAppUI.btnNonStop.setText("W.nonstop");
            serialDebugAppUI.btnNonStop.setToolTipText("To watchs non stop");
            serialDebugAppUI.btnNonStop.setText("W.stop");
            serialDebugAppUI.btnNonStop.setToolTipText("To watchs stop");
                    serialDebugAppUI.popUpUpdate.lblUpdateTitulo.setText("Checking for updates ...");
                        serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugApp.setText(" App.: checking ...");
                        serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugLib.setText(" Lib.: checking ...");
                                    serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugApp.setText(" App.: " + versaoAppInternet + "(latest) " +
                                                                                                 SerialDebugApp.VERSAO_MAIOR + "." +
                                                                                                 SerialDebugApp.VERSAO_MENOR + "." + 
                                                                                                 "(installed) ");
                                            serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugApp.setText(serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugApp.getText() + "(needs update)");
                                            serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugApp.setText(serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugApp.getText() + "(ok)");
                                    serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugLib.setText(" Lib.: " + versaoLibInternet + "(latest) ");
                                                                                                        serialDebugAppUI.lblInfoLibVersao.getText() +  "(on board) ");
                                                serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugLib.setText(serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugLib.getText() + "(needs update)");
                                                serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugLib.setText(serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugLib.getText() + "(ok)");
                                serialDebugAppUI.popUpUpdate.esconder("Versions checked", 7);
                                serialDebugAppUI.popUpUpdate.lblUpdateTitulo.setText("Versions checked");
                            serialDebugAppUI.popUpUpdate.esconder("Connection not possible", 5);
    static String[] colunas = new String[]{"Number", "Name", "Type", "Value", "Description"};
    static String[] colunas = new String[] { "Number", "Name", "Arg.type", "Last arg.", "Description" };
    public final String titulo = "End User License Agreement (EULA)";
        btnAceita = new JButton("Accept");
        JButton btnNotAccept = new JButton("Not accept");
        textArea.setToolTipText("SERIALDEBUGAPP FREEWARE LICENSE AGREEMENT");
                "SERIALDEBUGAPP FREEWARE LICENSE AGREEMENT\n--------------------------------------\nExcept otherwise noted, all of the documentation and software included\nin the SerialDebugApp distribution is copyrighted \nby Joao Clovis Lopes Filho, developer knowed as JoaoLopesF.\nShould you have any questions regarding this license or the software included,\nplease email contact@joaolopesf.net\n\n\nImportant - Read Carefully\n--------------------------\nThis license agreement is a legal agreement between you (either an\nindividual or a single entity) and JoaoLopesF, regarding the use of\nthe SerialDebugApp distribution. By installing, copying, or otherwise using\nthe software, you agree to be bound by the terms of this agreement. If\nyou do not agree to the terms of this agreement, do not install or use\nthe software.\n\n\nFREEWARE LICENSE\n----------------\nThis software is being distributed as Freeware. It may be freely used,\ncopied and distributed as long as it is not sold, and all original\nfiles are included in their original form, including this license. You\nare NOT allowed to make a charge for distributing this software\n(either for profit or merely to recover your media and distribution\ncosts) whether as a stand-alone product, or as part of a compilation\nor anthology, without explicit prior written permission. By using this\nsoftware, you agree to these terms and the terms of the Disclaimer\nbelow:\n\nDisclaimer of Warranty\n---------------------------------------------------------------- \nTHIS SOFTWARE IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND\nEXPRESSED, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\nWARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.");
    public final String titulo = "Watch for global";
        lblWatch.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Watch", TitledBorder.LEADING, TitledBorder.TOP, null,
        checkBoxCross = new JCheckBox("Is cross ?");
        checkBoxCross.setToolTipText("Is between 2 globals ?");
                    lblCross.setText("Note: only for globals w/ same type");
        checkBoxCross.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Between 2 globals", TitledBorder.LEADING,
        lblCross = new JLabel("");
                new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Global 1", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        cmbOper.setModel(new DefaultComboBoxModel(new String[] { "", "change", "==", "!=", "<", "<=", ">", ">=" }));
        cmbOper.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Oper.", TitledBorder.LEADING, TitledBorder.TOP, null,
        bordaPanelValue = new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Value", TitledBorder.LEADING, TitledBorder.TOP, null, null);
        rdbTrue = new JRadioButton("True");
        rdbFalse = new JRadioButton("False");
        toolbarOptions.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Options", TitledBorder.LEADING, TitledBorder.TOP,
        checkBoxEnabled = new JCheckBox("Enabled ?");
                    exibirMensagem("done", 5);
        checkBoxEnabled.setToolTipText("This watch is enabled ?");
                    exibirMensagem("done", 3);
        checkBoxAlwaysStop = new JCheckBox("AlwaysStop ?");
        checkBoxAlwaysStop.setToolTipText("This watch always stop ?");
                    exibirMensagem("done", 3);
        checkBoxHighlight = new JCheckBox("Highlight");
        checkBoxHighlight.setToolTipText("Highlight  this whatch is triggered on/off ?\n");
                    exibirMensagem("done", 3);
        toolbarActions.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Actions for this watch", TitledBorder.LEADING,
        btnAplly = new JButton("Aplly");
        btnAplly.setIcon(new ImageIcon(DbgGlobalPanel.class.getResource("/net/joaolopesf/serialdebugapp/imagens/salvar_v2.png")));
        btnDelete = new JButton("Delete");
                    exibirMensagem("please double click to delete this", 5);
                        exibirMensagem("done", 5);
        toolbarActionAll.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Actions for all watches", TitledBorder.LEADING,
        btnNew = new JButton("New");
        btnNew.setIcon(new ImageIcon(DbgWatchPanel.class.getResource("/net/joaolopesf/serialdebugapp/imagens/adicionar.png")));
        btnEnableAll = new JButton("Enable all ");
        btnEnableAll.setIcon(new ImageIcon(DbgWatchPanel.class.getResource("/net/joaolopesf/serialdebugapp/imagens/enabled.png")));
        btnDisableAll = new JButton("Disable all");
        btnDisableAll.setIcon(new ImageIcon(DbgWatchPanel.class.getResource("/net/joaolopesf/serialdebugapp/imagens/disabled.png")));
        btnDeleteAll = new JButton("Delete all");
        btnDeleteAll.setIcon(new ImageIcon(DbgWatchPanel.class.getResource("/net/joaolopesf/serialdebugapp/imagens/limpar.png")));
                    exibirMensagem("please double click to delete all", 5);
                    exibirMensagem("done", 5);
            exibirMensagem("global 1 not informed", 5);
            exibirMensagem("operation not informed", 5);
                    exibirMensagem("global 2 not informed", 5);
                    exibirMensagem("value not valid", 5);
            lblCross.setText("Note: only for globals w/ same type");
                bordaPanelValue.setTitle("Global 2");
                bordaPanelValue.setTitle("Value");
            exibirMensagem("value updated from MCU (device)", 5);
        lblMensagem = new JLabel(" Starting the app, please wait ....");
    static String[] colunas = new String[]{" ", "Number", "Global", "Oper.", "Value/Global2"};
                    UtilSwing.alerta("This App needs screen resolution with width at least 1024", true);
        frame.setTitle("SerialDebugApp - version " + serialDebugApp.VERSAO_MAIOR + "." + serialDebugApp.VERSAO_MENOR + "."
        lblImgSerialDebugApp.setToolTipText("Click to acess github page");
        lblInfoPlaca = new JLabel("Board connected:");
        lblInfoMemoria = new JLabel("Free memory:");
        btnRefreshMemory.setToolTipText("Refresh to see memory free on board connected");
        lblInfoLib = new JLabel("SerialDebug lib.:");
        lblInfoLibVersao = new JLabel("...");
        lblInfoFuncoes = new JLabel("Features:");
        lblInfoImgFuncoes = new JLabel("");
        cmbPortaSerial.setToolTipText("Select serial port  to connect");
        JButton btnRefresh = new JButton("Refresh");
        btnRefresh.setToolTipText("To refresh list of serial ports available");
        cmbPortaSerialBauds.setToolTipText("To set serial speed in bauds");
        JButton btnConectar = new JButton("Connect");
        btnConectar.setToolTipText("To connect in serial port ");
        lblPortaConectada.setToolTipText("Serial port connected");
        chkAutodisconect = new JCheckBox("Auto-disconnection");
        chkAutodisconect.setToolTipText("To disconnect when app is in deactivate state, usefull to upload new program");
        btnDesconectar = new JButton("Disconnect");
        btnDesconectar.setToolTipText("To disconnect from serial port");
                .setBorder(new TitledBorder(new LineBorder(corTable), "Watches", TitledBorder.LEADING, TitledBorder.TOP, null, corTable));
                .setBorder(new TitledBorder(new LineBorder(corTable), "Functions", TitledBorder.LEADING, TitledBorder.TOP, null, corTable));
        lblBufferInicio = new JLabel("Buffer > ");
        btnAutoScroll = new JButton("Auto scroll");
        btnSilence = new JButton("Silence");
        btnSilence.setToolTipText("Silente mode - no debug outputs - good for analisis");
        btnDebugger = new JButton("Debugger");
        btnDebugger.setToolTipText("Enable/disable the simple software debugger of SerialDebug lib.");
        btnLevelVerbose = new JButton("V-Verbose");
        btnLevelVerbose.setToolTipText("Set debug level to verbose");
        btnLevelDebug = new JButton("D-Debug");
        btnLevelDebug.setToolTipText("Set debug level to debug");
        btnLevelInfo = new JButton("I-Info. ");
        btnLevelInfo.setToolTipText("Set debug level to informations");
        btnLevelWarning = new JButton("W-Warning");
        btnLevelWarning.setToolTipText("Set debug level to warning");
        btnLevelError = new JButton("E-Error");
        btnLevelError.setToolTipText("Set debug level to error");
        btnLevelNone = new JButton("N-None");
        btnLevelNone.setToolTipText("Set debug level to none (no debug)");
        JButton btnContinue = new JButton("Continue");
        btnContinue.setToolTipText("Continue");
        btnNonStop = new JButton("W.nonstop");
        btnNonStop.setToolTipText("To watchs non stop");
                if (btnNonStop.getText().equals("W.nonstop")) {
        JButton btnReset = new JButton("Reset");
        btnReset.setToolTipText("Reset the board connected");
        btnFunctions = new JButton("Functions");
        btnFunctions.setToolTipText("List functions available");
        btnHelp = new JButton("Help");
        btnHelp.setToolTipText("Show help with SerialDebug commands");
        btnGlobals = new JButton("Globals");
        btnGlobals.setToolTipText("List global variables available");
        btnWatches = new JButton("Watches");
        btnWatches.setToolTipText("List watches available");
        JButton btnYes = new JButton("Yes");
        btnYes.setToolTipText("Confirm with yes");
        JButton btnNo = new JButton("No");
        btnNo.setToolTipText("Confirm with no");
        cmbEnviar.setToolTipText("To send commands");
        btnEnviar = new JButton("Send");
        btnEnviar.setToolTipText("To send command");
        txtPesquisarFiltrar.setToolTipText("To find or filter data");
        btnPesquisar = new JButton("Find");
        btnPesquisar.setToolTipText("To find data");
        btnFiltrar = new JButton("Filter");
        btnFiltrar.setToolTipText("To filter data");
        JButton btnFonteMais = new JButton("A+");
        btnFonteMais.setToolTipText("To increase font size of data");
        JButton btnFonteMenos = new JButton("A-");
        btnFonteMenos.setToolTipText("To decrease font size of data");
        btnClear = new JButton("Clear");
        btnClipBoard = new JButton("Clipboard");
        btnClipBoard.setToolTipText("To send data to clipboard");
        btnSalvar = new JButton("Save");
        btnSalvar.setToolTipText("To save data into a text file");
        btnSettings = new JButton("Settings");
        btnSettings.setToolTipText("To show app settings");
        btnConverter = new JButton("Conv.");
        btnConverter.setToolTipText("Convert Arduino code to use SerialDebug library.");
        lblPopUpTitulo = new JLabel("Loading ...");
        lblPopUpTitulo = new JLabel("Loading ...");
        listModel.addElement("#");
        listModel.addElement("# " + frame.getTitle());
        listModel.addElement("#");
        listModel.addElement("# Keyboard shortcuts:");
        listModel.addElement("#");
        String tecla = (Utilitarios.isMacOS()) ? "Cmd-" : "Ctrl-";
        listModel.addElement("# " + tecla + "K - connect/disconnect on selected serial port and speed");
            listModel.addElement("# ");
        listModel.addElement("# " + tecla + "R - refresh serial port list");
            listModel.addElement("# ");
        listModel.addElement("# " + tecla + "E - erase (clear serial screen)");
            listModel.addElement("# ");
        listModel.addElement("# " + tecla + "F - Find");
            listModel.addElement("# ");
        listModel.addElement("# " + tecla + "G - Next find");
            listModel.addElement("# ");
        listModel.addElement("# " + tecla + "C - copy to clipboard");
        listModel.addElement("#");
        listModel.addElement("# If board program is with SerialDebug library:");
        listModel.addElement("#");
        listModel.addElement("# " + tecla + "0 - Silence on/off (no outputs)");
            listModel.addElement("# ");
        listModel.addElement("# " + tecla + "1 - Set debug level to V-verbose");
            listModel.addElement("# ");
        listModel.addElement("# " + tecla + "2 - Set debug level to D-debug");
            listModel.addElement("# ");
        listModel.addElement("# " + tecla + "3 - Set debug level to I-info");
            listModel.addElement("# ");
        listModel.addElement("# " + tecla + "4 - Set debug level to W-earning");
            listModel.addElement("# ");
        listModel.addElement("# " + tecla + "5 - Set debug level to E-error");
            listModel.addElement("# ");
        listModel.addElement("# " + tecla + "6 - Set debug level to N-none (no debug outputs)");
            listModel.addElement("# ");
        listModel.addElement("# " + tecla + "7 - Toggle simple software debugger on/off");
            listModel.addElement("# ");
        listModel.addElement("# " + tecla + "8 - To nonstop on watches");
        listModel.addElement("# ");
                .setText((serialDebugApp.serialConectada) ? ("(Connected on " + serialDebugApp.ultPortaSerial + ")") : "(Not connected)");
    public final String titulo = "Function";
        lblFunction.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Function (debug)", TitledBorder.LEADING,
                new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Arg. type", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        panelValue.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Arg. value", TitledBorder.LEADING, TitledBorder.TOP,
        rdbTrue = new JRadioButton("True");
        rdbFalse = new JRadioButton("False");
        btnExecutar = new JButton("Execute");
        btnClose = new JButton("Ok (close)");
            btnClose.setText("Close (" + tempoApagar + ")");
                        btnClose.setText("Close (" + tempo + ")");
            btnClose.setText("Close");
    public final String titulo = "Settings";
        lblTheme = new JLabel("Theme:");
        lblUI = new JLabel("U.I.:");
                new String[] { "Light", "Light (w/ eye saver)", "Dark black", "Dark red", "Dark green", "Dark blue", "Dark mojave", }));
//              new String[] { "Light", "Light (w/ eye saver)", "Dark black", "Dark red", "Dark green", "Dark blue" }));
        btnEditTheme = new JButton("Edit theme");
        lblSerialConsole = new JLabel("Serial console:");
                new String[] { "Light", "Light (w/ eye saver)", "Dark black", "Dark red", "Dark green", "Dark blue", "Dark mojave", }));
        button = new JButton("Edit theme");
        lblAutoconnection = new JLabel("Auto-connection:");
        chckbxAutoconnection = new JCheckBox("Auto-connection");
        chckbxAutoconnection.setToolTipText("If enabled, try connect with last port serial");
        lblOnConnect = new JLabel("On connect:");
        chckbxEnableDebugger = new JCheckBox("Enable debugger");
        chckbxDisableWatchesStop = new JCheckBox("Disable watches stop");
        lblAutodisconnection = new JLabel("Auto-disconnection:");
        chckbxAutodisconnection = new JCheckBox("Auto-disconnection");
        chckbxAutodisconnection.setToolTipText("If enabled, disconnect on lost focus on app, it is good to new upload ");
        lblOnDisconnect = new JLabel("On disconnect:");
        chckbxResetOnDisconnect = new JCheckBox("Reset the board");
        chckbxResetOnDisconnect.setToolTipText("If, enabled, reset the board before disconnect, it is good to restore to inactive status");
        lblDuringConnection = new JLabel("During connection:");
        lblSerialConsoleFont = new JLabel("Console font size:");
        lblInactivity = new JLabel("Inactivity:");
                .setModel(new DefaultComboBoxModel(new String[] { "disabled", "5 minutdes", "10 minutes", "15 minutes", "30 minutes" }));
        btnSalvar = new JButton("Ok");
        btnAplly = new JButton("Aplly");
        btnCancel = new JButton("Cancel");
        btnReset = new JButton("Reset");
        lblMensagem = new JLabel("");
    public final String titulo = "Checking updates ...";
        lblUpdateTitulo = new JLabel("Checking for updates ...");
        lblUpdateSerialDebugApp = new JLabel("App.: checking ...");
        lblUpdateSerialDebugLib = new JLabel("Lib.: checking ...");
        btnWebApp = new JButton("click to access download page");
        btnWebLib = new JButton("click to access download page");
        labelImgWeb = new JLabel("");
            lblUpdateTitulo.setText(mensagem + ". closing (" + tempoApagar + ")");
                        lblUpdateTitulo.setText(mensagem + ". closing (" + tempo + ")");
    public final String titulo = "Global variable";
        btnAddWatch = new JButton("Add watch");
        btnAddWatch.setToolTipText("Add a new watch for this variable");
        rdbTrue = new JRadioButton("True");
        rdbFalse = new JRadioButton("False");
        lblValueMin = new JLabel("0");
        lblValueMax = new JLabel("0");
        lblChanges = new JLabel("0");
        lblChanges.setToolTipText("Total of changes in this variable. In next versions can be access the history");
        checkBoxWatchesEnabled = new JCheckBox("Watch enabled");
                    exibirMensagem("done");
        checkBoxWatchesEnabled.setToolTipText("Watch(es) for this global is enabled ?");
        checkBoxHighlight = new JCheckBox("Highlight");
                    exibirMensagem("done");
        checkBoxHighlight.setToolTipText("Highlight  this variable on changes ?");
        lblMensagem = new JLabel("");
        btnAplly = new JButton("Aplly");
                new TitledBorder(new LineBorder(corLabels), "Global var.", TitledBorder.LEADING, TitledBorder.TOP, null, corLabels));
        lblType.setBorder(new TitledBorder(new LineBorder(corLabels), "Type", TitledBorder.LEADING, TitledBorder.TOP, null, corLabels));
        panelValue.setBorder(new TitledBorder(new LineBorder(corLabels), "Value", TitledBorder.LEADING, TitledBorder.TOP, null, corLabels));
        lblValueMin.setBorder(new TitledBorder(new LineBorder(corLabels), "Min.", TitledBorder.LEADING, TitledBorder.TOP, null, corLabels));
        lblValueMax.setBorder(new TitledBorder(new LineBorder(corLabels), "Max.", TitledBorder.LEADING, TitledBorder.TOP, null, corLabels));
                .setBorder(new TitledBorder(new LineBorder(corLabels), "Changes", TitledBorder.LEADING, TitledBorder.TOP, null, corLabels));
//                    "Error: Please enter number bigger than 0", "Error Massage",
            value = (rdbTrue.isSelected() ? "true" : "false");
                lblMensagem.setText("value is read-only");
            exibirMensagem("value updated from MCU (device)");
    public final String titulo = "Convert Arduino code to SerialDebug";
        btnNext = new JButton("Next");
        JButton btnClose = new JButton("Close");
        JButton btnOpenInoFile = new JButton("Open Arduino souce file (ino)");
        btnAnalyze = new JButton("Analyze the source code");
        tabbedPane.addTab("Options", null, panelOptions, null);
        JLabel lblFile = new JLabel("File:");
        JLabel labelLines = new JLabel("Lines:");
        JLabel lblGlobalVariablesDetected = new JLabel("Global variables detected:");
        JLabel lblTotalOfSerialprint = new JLabel("Total of Serial.print*:");
        JLabel lblDebugLevelTo = new JLabel("Debug level to generate:");
        cmbDebugLevel.setModel(new DefaultComboBoxModel(new String[] { "Verbose", "Debug" }));
        JLabel lblNoteInThis = new JLabel("(Note: arrays is ignored. You can do it manually)");
        JLabel labelAutoFunc = new JLabel("Auto function on debug:\n");
        cmbAutoFunc.setModel(new DefaultComboBoxModel(new String[] { "Yes", "No" }));
        JLabel lblDebuugerEnabled = new JLabel("Debugger enabled:");
        cmbDebugger.setModel(new DefaultComboBoxModel(new String[] { "Yes", "No" }));
        JLabel lblUseFlashF = new JLabel("Use flash F() ?:");
        cmbUseFlash.setModel(new DefaultComboBoxModel(new String[] { "Yes", "No" }));
        JLabel lblNoteSetIt = new JLabel("Note: set it if You want use SerialDebug in boards with low memory, as UNO.");
        JLabel lblClickInNext = new JLabel("Click in Next to convert");
        tabbedPane.addTab("Convert", null, panelConvert, null);
        JButton btnConvert = new JButton("Click to convert code");
            FileNameExtensionFilter filter = new FileNameExtensionFilter("Arduino source files (*.ino)", "ino");
            fcFile.setDialogTitle("Open source file Arduino");
            lblConversion.setText("Note: A directory with _Dbg suffix will be created to save the converted code.");
            lblAnalyze.setText("Analyzing the source code ...");
                                lblAnalyze.setText("This source file already using SerialDebug Library");
            lblAnalyze.setText("File analyzed with success. Click in next");
            lblConversion.setText("Converting the source code ...");
                        printWriter.println("// SerialDebug Library");
                        printWriter.println("");
                        printWriter.println("// Disable all debug ? Good to release builds (production)");
                        printWriter.println("// as nothing of SerialDebug is compiled, zero overhead :-)");
                        printWriter.println("// For it just uncomment the DEBUG_DISABLED");
                        printWriter.println("//#define DEBUG_DISABLED true");
                        printWriter.println("");
                        printWriter.println("// Disable SerialDebug debugger ? No more commands and features as functions and globals");
                        printWriter.println("// Uncomment this to disable it ");
                            printWriter.print("//");
                        printWriter.println("#define DEBUG_DISABLE_DEBUGGER true");
                        printWriter.println("");
                        printWriter.println("// Define the initial debug level here (uncomment to do it)");
                        printWriter.println("//#define DEBUG_INITIAL_LEVEL DEBUG_LEVEL_VERBOSE");
                        printWriter.println("");
                        printWriter.println("// Disable auto function name (good if your debug yet contains it)");
                            printWriter.print("//");
                        printWriter.println("#define DEBUG_AUTO_FUNC_DISABLED true");
                        printWriter.println("");
                        printWriter.println("// Include SerialDebug");
                        printWriter.println("");
                        printWriter.println("#include \"SerialDebug.h\" //https://github.com/JoaoLopesF/SerialDebug");
                        printWriter.println("");
                            printWriter.println("");
                            printWriter.println("#ifndef DEBUG_DISABLE_DEBUGGER");
                            printWriter.println("");
                            printWriter.println("  // Add Functions and global variables to SerialDebug");
                            printWriter.println("");
                            printWriter.println("  // Add functions that can called from SerialDebug");
                            printWriter.println("");
                                        "  //debugAddFunctionVoid(F(\"function\"), &function); // Example for function without args");
                                        "  //debugAddFunctionStr(F(\"function\"), &function); // Example for function with one String arg");
                                        "  //debugAddFunctionInt(F(\"function\"), &function); // Example for function with one int arg");
                                        .println("  //debugAddFunctionVoid(\"function\", &function); // Example for function without args");
                                        "  //debugAddFunctionStr(\"function\", &function); // Example for function with one String arg");
                                        "  //debugAddFunctionInt(\"function\", &function); // Example for function with one int arg");
                            printWriter.println("");
                            printWriter.println("  // Add global variables that can showed/changed from SerialDebug");
                            printWriter.println("  // Note: Only global, if pass local for SerialDebug, can be dangerous");
                            printWriter.println("");
                                printWriter.print("  debugAddGlobal" + varTypesSerialDebug[global.getPosType()] + "(");
                                    printWriter.print("F(\"" + global.getName() + "\"), ");
                                    printWriter.print("\"" + global.getName() + "\", ");
                                printWriter.println("&" + global.getName() + ");");
                            printWriter.println("");
                            printWriter.println("#endif // DEBUG_DISABLE_DEBUGGER");
                            printWriter.println("");
                        // Generate SerialDebug handle");
                        printWriter.println("");
                        printWriter.println("  // SerialDebug handle");
                        printWriter.println("  // Notes: if in inactive mode (until receive anything from serial),");
                        printWriter.println("  // it show only messages of always or errors level type");
                        printWriter.println("  // And the overhead during inactive mode is very low");
                        printWriter.println("  // Only if not DEBUG_DISABLED");
                        printWriter.println("");
                        printWriter.println("  debugHandle();");
                        printWriter.println("");
            lblConversion.setText("File converted with success.");
ivannunyadambiz commented 5 years ago

got it, working on it! cheers

ivannunyadambiz commented 5 years ago

ok i'm not entirely sure about a few of them, here's the lot as of now. i'll go over it again, trying to figure out the ones i'm uncertain about and probably catch what i missed. i copied what you sent me, replaced ";" with ";\n" and removed leading spaces before doing anything. i hope this doesn't make things too messy on your side. if anything i did doesn't make sense whatsoever, just tell me :D cheers

//snip

serialDebugAppUI.exibirPopupAlerta("Detected possible serial baud error,
please disconnect and correct this.", 10); ret += " " + ((enabled)?"(enabled)":"(disabled)") + ((triggered)?" (triggered)":""); serialDebugAppUI.exibirPopupAlerta("Text sent to clipboard.", 3); serialDebugAppUI.exibirPopupAlerta("File saved at: " + arquivo, 5); fcArquivo.setDialogTitle("Save text file"); serialDebugAppUI.btnFiltrar.setText("Cancel"); serialDebugAppUI.btnFiltrar.setText("Filter"); serialDebugAppUI.exibirPopupAlerta("No serial ports detected", 3); serialDebugAppUI.exibirPopupAlerta("No serial speed (baudrate) selected", 3); serialDebugAppUI.exibirPopupAlerta("Invalid serial speed (baudrate) - non numeric", 5); serialDebugAppUI.exibirPopupAlerta("Invalid serial speed (baudrate) - not positive numeric", 5); adicionarNaLista("* * Connected to serial port USB: " + ultPortaSerial, true); adicionarNaLista(" Discarding buffer from serial", true); adicionarNaLista(" Done", true); serialDebugAppUI.exibirPopupAlerta("Not possible to connect to " + serialPort.getPortName(), 5); adicionarNaLista(" Disconnected from serial port USB", true); serialDebugAppUI.exibirPopupAlerta("The serial port USB not is connected", 5); serialDebugAppUI.exibirPopupAlerta("Not possible to send data to serial port", 5); serialDebugAppUI.exibirPopupAlerta("Exception on send data to serial port", 5); serialDebugAppUI.btnNonStop.setText("W.nonstop"); serialDebugAppUI.btnNonStop.setToolTipText("To watch non stop"); serialDebugAppUI.btnNonStop.setText("W.stop"); serialDebugAppUI.btnNonStop.setToolTipText("To watch stop"); serialDebugAppUI.popUpUpdate.lblUpdateTitulo.setText("Checking for updates ..."); serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugApp.setText(" App.: checking ..."); serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugLib.setText(" Lib.: checking ..."); serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugApp.setText(" App.: " + versaoAppInternet + "(latest) " + SerialDebugApp.VERSAO_MAIOR + "." + SerialDebugApp.VERSAO_MENOR + "." + "(installed) "); serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugApp.setText(serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugApp.getText() + "(needs update)"); serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugApp.setText(serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugApp.getText() + "(ok)"); serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugLib.setText(" Lib.: " + versaoLibInternet + "(latest) "); serialDebugAppUI.lblInfoLibVersao.getText() + "(on board) "); serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugLib.setText(serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugLib.getText() + "(needs update)"); serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugLib.setText(serialDebugAppUI.popUpUpdate.lblUpdateSerialDebugLib.getText() + "(ok)"); serialDebugAppUI.popUpUpdate.esconder("Versions checked", 7); serialDebugAppUI.popUpUpdate.lblUpdateTitulo.setText("Versions checked"); serialDebugAppUI.popUpUpdate.esconder("Connection not possible", 5); static String[] colunas = new String[]{"Number", "Name", "Type", "Value", "Description"}; static String[] colunas = new String[] { "Number", "Name", "Arg.type", "Last arg.", "Description" }; public final String titulo = "End User License Agreement (EULA)"; btnAceita = new JButton("Accept"); JButton btnNotAccept = new JButton("Do not accept"); textArea.setToolTipText("SERIALDEBUGAPP FREEWARE LICENSE AGREEMENT"); "SERIALDEBUGAPP FREEWARE LICENSE AGREEMENT\n--------------------------------------\nExcept otherwise noted, all of the documentation and software included\nin the SerialDebugApp distribution is copyrighted \nby Joao Clovis Lopes Filho, developer known as JoaoLopesF.\nShould you have any questions regarding this license or the software included,\nplease email contact@joaolopesf.net\n\n\nImportant - Read Carefully\n--------------------------\nThis license agreement is a legal agreement between you (either an\nindividual or a single entity) and JoaoLopesF, regarding the use of\nthe SerialDebugApp distribution. By installing, copying, or otherwise using\nthe software, you agree to be bound by the terms of this agreement. If\nyou do not agree to the terms of this agreement, do not install or use\nthe software.\n\n\nFREEWARE LICENSE\n----------------\nThis software is being distributed as Freeware. It may be freely used,\ncopied and distributed as long as it is not sold, and all original\nfiles are included in their original form, including this license. You\nare NOT allowed to make a charge for distributing this software\n(either for profit or merely to recover your media and distribution\ncosts) whether as a stand-alone product, or as part of a compilation\nor anthology, without explicit prior written permission. By using this\nsoftware, you agree to these terms and the terms of the Disclaimer\nbelow:\n\nDisclaimer of Warranty\n---------------------------------------------------------------- \nTHIS SOFTWARE IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND\nEXPRESSED, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\nWARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE."); public final String titulo = "Watch for global"; lblWatch.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Watch", TitledBorder.LEADING, TitledBorder.TOP, null, checkBoxCross = new JCheckBox("Is cross ?"); checkBoxCross.setToolTipText("Is between 2 globals ?"); lblCross.setText("Note: only for globals of same type"); checkBoxCross.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Between 2 globals", TitledBorder.LEADING, lblCross = new JLabel(""); new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Global 1", TitledBorder.LEADING, TitledBorder.TOP, null, null)); cmbOper.setModel(new DefaultComboBoxModel(new String[] { "", "change", "==", "!=", "<", "<=", ">", ">=" })); cmbOper.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Oper.", TitledBorder.LEADING, TitledBorder.TOP, null, bordaPanelValue = new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Value", TitledBorder.LEADING, TitledBorder.TOP, null, null); rdbTrue = new JRadioButton("True"); rdbFalse = new JRadioButton("False"); toolbarOptions.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Options", TitledBorder.LEADING, TitledBorder.TOP, checkBoxEnabled = new JCheckBox("Enabled ?"); exibirMensagem("done", 5); checkBoxEnabled.setToolTipText("This watch is enabled ?"); exibirMensagem("done", 3); checkBoxAlwaysStop = new JCheckBox("AlwaysStop ?"); checkBoxAlwaysStop.setToolTipText("This watch always stop ?"); exibirMensagem("done", 3); checkBoxHighlight = new JCheckBox("Highlight"); checkBoxHighlight.setToolTipText("Highlight this whatch is triggered on/off ?\n"); exibirMensagem("done", 3); toolbarActions.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Actions for this watch", TitledBorder.LEADING, btnAplly = new JButton("Apply"); btnAplly.setIcon(new ImageIcon(DbgGlobalPanel.class.getResource("/net/joaolopesf/serialdebugapp/imagens/salvar_v2.png"))); btnDelete = new JButton("Delete"); exibirMensagem("please double click to delete this", 5); exibirMensagem("done", 5); toolbarActionAll.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Actions for all watches", TitledBorder.LEADING, btnNew = new JButton("New"); btnNew.setIcon(new ImageIcon(DbgWatchPanel.class.getResource("/net/joaolopesf/serialdebugapp/imagens/adicionar.png"))); btnEnableAll = new JButton("Enable all "); btnEnableAll.setIcon(new ImageIcon(DbgWatchPanel.class.getResource("/net/joaolopesf/serialdebugapp/imagens/enabled.png"))); btnDisableAll = new JButton("Disable all"); btnDisableAll.setIcon(new ImageIcon(DbgWatchPanel.class.getResource("/net/joaolopesf/serialdebugapp/imagens/disabled.png"))); btnDeleteAll = new JButton("Delete all"); btnDeleteAll.setIcon(new ImageIcon(DbgWatchPanel.class.getResource("/net/joaolopesf/serialdebugapp/imagens/limpar.png"))); exibirMensagem("please double click to delete all", 5); exibirMensagem("done", 5); exibirMensagem("global 1 not informed", 5); exibirMensagem("operation not informed", 5); exibirMensagem("global 2 not informed", 5); exibirMensagem("value not valid", 5); lblCross.setText("Note: only for globals of same type"); bordaPanelValue.setTitle("Global 2"); bordaPanelValue.setTitle("Value"); exibirMensagem("value updated from MCU (device)", 5); lblMensagem = new JLabel(" Starting the app, please wait ...."); static String[] colunas = new String[]{" ", "Number", "Global", "Oper.", "Value/Global2"}; UtilSwing.alerta("This App needs screen resolution with width of at least 1024", true); frame.setTitle("SerialDebugApp - version " + serialDebugApp.VERSAO_MAIOR + "." + serialDebugApp.VERSAO_MENOR + "." lblImgSerialDebugApp.setToolTipText("Click to access github page"); lblInfoPlaca = new JLabel("Board connected:"); lblInfoMemoria = new JLabel("Free memory:"); btnRefreshMemory.setToolTipText("Refresh to see memory free on board connected"); lblInfoLib = new JLabel("SerialDebug lib.:"); lblInfoLibVersao = new JLabel("..."); lblInfoFuncoes = new JLabel("Features:"); lblInfoImgFuncoes = new JLabel(""); cmbPortaSerial.setToolTipText("Select serial port to connect"); JButton btnRefresh = new JButton("Refresh"); btnRefresh.setToolTipText("To refresh list of serial ports available"); cmbPortaSerialBauds.setToolTipText("To set serial baudrate"); JButton btnConectar = new JButton("Connect"); btnConectar.setToolTipText("To connect to serial port "); lblPortaConectada.setToolTipText("Serial port connected"); chkAutodisconect = new JCheckBox("Auto-disconnect"); chkAutodisconect.setToolTipText("To disconnect when app is in inactive state, useful to upload new program"); btnDesconectar = new JButton("Disconnect"); btnDesconectar.setToolTipText("To disconnect from serial port"); .setBorder(new TitledBorder(new LineBorder(corTable), "Watches", TitledBorder.LEADING, TitledBorder.TOP, null, corTable)); .setBorder(new TitledBorder(new LineBorder(corTable), "Functions", TitledBorder.LEADING, TitledBorder.TOP, null, corTable)); lblBufferInicio = new JLabel("Buffer > "); btnAutoScroll = new JButton("Auto scroll"); btnSilence = new JButton("Silence"); btnSilence.setToolTipText("Silent mode - no debug output - good for analysis"); btnDebugger = new JButton("Debugger"); btnDebugger.setToolTipText("Enable/disable the simple software debugger of SerialDebug lib."); btnLevelVerbose = new JButton("V-Verbose"); btnLevelVerbose.setToolTipText("Set debug level to verbose"); btnLevelDebug = new JButton("D-Debug"); btnLevelDebug.setToolTipText("Set debug level to debug"); btnLevelInfo = new JButton("I-Info. "); btnLevelInfo.setToolTipText("Set debug level to information"); btnLevelWarning = new JButton("W-Warning"); btnLevelWarning.setToolTipText("Set debug level to warning"); btnLevelError = new JButton("E-Error"); btnLevelError.setToolTipText("Set debug level to error"); btnLevelNone = new JButton("N-None"); btnLevelNone.setToolTipText("Set debug level to none (no debug)"); JButton btnContinue = new JButton("Continue"); btnContinue.setToolTipText("Continue"); btnNonStop = new JButton("W.nonstop"); btnNonStop.setToolTipText("To watchs non stop"); if (btnNonStop.getText().equals("W.nonstop")) { JButton btnReset = new JButton("Reset"); btnReset.setToolTipText("Reset the board connected"); btnFunctions = new JButton("Functions"); btnFunctions.setToolTipText("List functions available"); btnHelp = new JButton("Help"); btnHelp.setToolTipText("Show help for SerialDebug commands"); btnGlobals = new JButton("Globals"); btnGlobals.setToolTipText("List global variables available"); btnWatches = new JButton("Watches"); btnWatches.setToolTipText("List of watches available"); JButton btnYes = new JButton("Yes"); btnYes.setToolTipText("Confirm with yes"); JButton btnNo = new JButton("No"); btnNo.setToolTipText("Confirm with no"); cmbEnviar.setToolTipText("To send commands"); btnEnviar = new JButton("Send"); btnEnviar.setToolTipText("To send command"); txtPesquisarFiltrar.setToolTipText("To find or filter data"); btnPesquisar = new JButton("Find"); btnPesquisar.setToolTipText("To find data"); btnFiltrar = new JButton("Filter"); btnFiltrar.setToolTipText("To filter data"); JButton btnFonteMais = new JButton("A+"); btnFonteMais.setToolTipText("To increase font size of data"); JButton btnFonteMenos = new JButton("A-"); btnFonteMenos.setToolTipText("To decrease font size of data"); btnClear = new JButton("Clear"); btnClipBoard = new JButton("Clipboard"); btnClipBoard.setToolTipText("To send data to clipboard"); btnSalvar = new JButton("Save"); btnSalvar.setToolTipText("To save data to a text file"); btnSettings = new JButton("Settings"); btnSettings.setToolTipText("To show app settings"); btnConverter = new JButton("Conv."); btnConverter.setToolTipText("Convert Arduino code to use SerialDebug library."); lblPopUpTitulo = new JLabel("Loading ..."); lblPopUpTitulo = new JLabel("Loading ..."); listModel.addElement("#"); listModel.addElement("# " + frame.getTitle()); listModel.addElement("#"); listModel.addElement("# Keyboard shortcuts:"); listModel.addElement("#"); String tecla = (Utilitarios.isMacOS()) ? "Cmd-" : "Ctrl-"; listModel.addElement("# " + tecla + "K - connect/disconnect to selected serial port and speed"); listModel.addElement("# "); listModel.addElement("# " + tecla + "R - refresh serial port list"); listModel.addElement("# "); listModel.addElement("# " + tecla + "E - erase (clear serial screen)"); listModel.addElement("# "); listModel.addElement("# " + tecla + "F - Find"); listModel.addElement("# "); listModel.addElement("# " + tecla + "G - Next find"); listModel.addElement("# "); listModel.addElement("# " + tecla + "C - copy to clipboard"); listModel.addElement("#"); listModel.addElement("# If board program is using SerialDebug library:"); listModel.addElement("#"); listModel.addElement("# " + tecla + "0 - Silent on/off (no outputs)"); listModel.addElement("# "); listModel.addElement("# " + tecla + "1 - Set debug level to V-verbose"); listModel.addElement("# "); listModel.addElement("# " + tecla + "2 - Set debug level to D-debug"); listModel.addElement("# "); listModel.addElement("# " + tecla + "3 - Set debug level to I-info"); listModel.addElement("# "); listModel.addElement("# " + tecla + "4 - Set debug level to W-warning"); listModel.addElement("# "); listModel.addElement("# " + tecla + "5 - Set debug level to E-error"); listModel.addElement("# "); listModel.addElement("# " + tecla + "6 - Set debug level to N-none (no debug outputs)"); listModel.addElement("# "); listModel.addElement("# " + tecla + "7 - Toggle simple software debugger on/off"); listModel.addElement("# "); listModel.addElement("# " + tecla + "8 - For constant update on watches"); listModel.addElement("# "); .setText((serialDebugApp.serialConectada) ? ("(Connected to " + serialDebugApp.ultPortaSerial + ")") : "(Not connected)"); public final String titulo = "Function"; lblFunction.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Function (debug)", TitledBorder.LEADING, new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Arg. type", TitledBorder.LEADING, TitledBorder.TOP, null, null)); panelValue.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Arg. value", TitledBorder.LEADING, TitledBorder.TOP, rdbTrue = new JRadioButton("True"); rdbFalse = new JRadioButton("False"); btnExecutar = new JButton("Execute"); btnClose = new JButton("Ok (close)"); btnClose.setText("Close (" + tempoApagar + ")"); btnClose.setText("Close (" + tempo + ")"); btnClose.setText("Close"); public final String titulo = "Settings"; lblTheme = new JLabel("Theme:"); lblUI = new JLabel("U.I.:"); new String[] { "Light", "Light (w/ eye saver)", "Dark black", "Dark red", "Dark green", "Dark blue", "Dark mojave", })); // new String[] { "Light", "Light (w/ eye saver)", "Dark black", "Dark red", "Dark green", "Dark blue" })); btnEditTheme = new JButton("Edit theme"); lblSerialConsole = new JLabel("Serial console:"); new String[] { "Light", "Light (w/ eye saver)", "Dark black", "Dark red", "Dark green", "Dark blue", "Dark mojave", })); button = new JButton("Edit theme"); lblAutoconnection = new JLabel("Auto-connect:"); chckbxAutoconnection = new JCheckBox("Auto-connect"); chckbxAutoconnection.setToolTipText("If enabled, try to connect with last used serial port"); lblOnConnect = new JLabel("On connect:"); chckbxEnableDebugger = new JCheckBox("Enable debugger"); chckbxDisableWatchesStop = new JCheckBox("Disable watches stop"); lblAutodisconnection = new JLabel("Auto-disconnect:"); chckbxAutodisconnection = new JCheckBox("Auto-disconnect"); chckbxAutodisconnection.setToolTipText("If enabled, disconnect on lost focus on app. This is useful for uploading new software."); lblOnDisconnect = new JLabel("On disconnect:"); chckbxResetOnDisconnect = new JCheckBox("Reset the board"); chckbxResetOnDisconnect.setToolTipText("If, enabled, reset the board before disconnect. This is useful for restoring inactive status"); lblDuringConnection = new JLabel("During connection:"); lblSerialConsoleFont = new JLabel("Console font size:"); lblInactivity = new JLabel("Inactivity:"); .setModel(new DefaultComboBoxModel(new String[] { "disabled", "5 minutes", "10 minutes", "15 minutes", "30 minutes" })); btnSalvar = new JButton("Ok"); btnAplly = new JButton("Apply"); btnCancel = new JButton("Cancel"); btnReset = new JButton("Reset"); lblMensagem = new JLabel(""); public final String titulo = "Checking for updates ..."; lblUpdateTitulo = new JLabel("Checking for updates ..."); lblUpdateSerialDebugApp = new JLabel("App.: checking ..."); lblUpdateSerialDebugLib = new JLabel("Lib.: checking ..."); btnWebApp = new JButton("click to access download page"); btnWebLib = new JButton("click to access download page"); labelImgWeb = new JLabel(""); lblUpdateTitulo.setText(mensagem + ". closing (" + tempoApagar + ")"); lblUpdateTitulo.setText(mensagem + ". closing (" + tempo + ")"); public final String titulo = "Global variable"; btnAddWatch = new JButton("Add watch"); btnAddWatch.setToolTipText("Add a new watch for this variable"); rdbTrue = new JRadioButton("True"); rdbFalse = new JRadioButton("False"); lblValueMin = new JLabel("0"); lblValueMax = new JLabel("0"); lblChanges = new JLabel("0"); lblChanges.setToolTipText("Total of changes in this variable. In next versions history can be accessed."); checkBoxWatchesEnabled = new JCheckBox("Watch enabled"); exibirMensagem("done"); checkBoxWatchesEnabled.setToolTipText("Watch(es) for this global variable is enabled ?"); checkBoxHighlight = new JCheckBox("Highlight"); exibirMensagem("done"); checkBoxHighlight.setToolTipText("Highlight this variable on changes ?"); lblMensagem = new JLabel(""); btnAplly = new JButton("Apply"); new TitledBorder(new LineBorder(corLabels), "Global var.", TitledBorder.LEADING, TitledBorder.TOP, null, corLabels)); lblType.setBorder(new TitledBorder(new LineBorder(corLabels), "Type", TitledBorder.LEADING, TitledBorder.TOP, null, corLabels)); panelValue.setBorder(new TitledBorder(new LineBorder(corLabels), "Value", TitledBorder.LEADING, TitledBorder.TOP, null, corLabels)); lblValueMin.setBorder(new TitledBorder(new LineBorder(corLabels), "Min.", TitledBorder.LEADING, TitledBorder.TOP, null, corLabels)); lblValueMax.setBorder(new TitledBorder(new LineBorder(corLabels), "Max.", TitledBorder.LEADING, TitledBorder.TOP, null, corLabels)); .setBorder(new TitledBorder(new LineBorder(corLabels), "Changes", TitledBorder.LEADING, TitledBorder.TOP, null, corLabels)); // "Error: Please enter number bigger than 0", "Error Massage", value = (rdbTrue.isSelected() ? "true" : "false"); lblMensagem.setText("value is read-only"); exibirMensagem("value updated from MCU (device)"); public final String titulo = "Convert Arduino code to SerialDebug"; btnNext = new JButton("Next"); JButton btnClose = new JButton("Close"); JButton btnOpenInoFile = new JButton("Open Arduino souce file (ino)"); btnAnalyze = new JButton("Analyze the source code"); tabbedPane.addTab("Options", null, panelOptions, null); JLabel lblFile = new JLabel("File:"); JLabel labelLines = new JLabel("Lines:"); JLabel lblGlobalVariablesDetected = new JLabel("Global variables detected:"); JLabel lblTotalOfSerialprint = new JLabel("Total of Serial.print:"); JLabel lblDebugLevelTo = new JLabel("Debug level to generate:"); cmbDebugLevel.setModel(new DefaultComboBoxModel(new String[] { "Verbose", "Debug" })); JLabel lblNoteInThis = new JLabel("(Note: arrays is ignored. You can do this manually)"); JLabel labelAutoFunc = new JLabel("Auto function on debug:\n"); cmbAutoFunc.setModel(new DefaultComboBoxModel(new String[] { "Yes", "No" })); JLabel lblDebuugerEnabled = new JLabel("Debugger enabled:"); cmbDebugger.setModel(new DefaultComboBoxModel(new String[] { "Yes", "No" })); JLabel lblUseFlashF = new JLabel("Use flash F() ?:"); cmbUseFlash.setModel(new DefaultComboBoxModel(new String[] { "Yes", "No" })); JLabel lblNoteSetIt = new JLabel("Note: set it if You want use SerialDebug on boards with low memory, like UNO."); JLabel lblClickInNext = new JLabel("Click Next to convert"); tabbedPane.addTab("Convert", null, panelConvert, null); JButton btnConvert = new JButton("Click to convert code"); FileNameExtensionFilter filter = new FileNameExtensionFilter("Arduino source files (.ino)", "ino"); fcFile.setDialogTitle("Open Arduino source file"); lblConversion.setText("Note: A directory with _Dbg suffix will be created to save the converted code."); lblAnalyze.setText("Analyzing the source code ..."); lblAnalyze.setText("This source file already uses the SerialDebug Library"); lblAnalyze.setText("File analyzed successfully. Click Next"); lblConversion.setText("Converting the source code ..."); printWriter.println("// SerialDebug Library"); printWriter.println(""); printWriter.println("// Disable all debug ? Good for release builds (production)"); printWriter.println("// as nothing of SerialDebug is compiled, zero overhead :-)"); printWriter.println("// For this, just uncomment the DEBUG_DISABLED line"); printWriter.println("//#define DEBUG_DISABLED true"); printWriter.println(""); printWriter.println("// Disable SerialDebug debugger ? No more commands and features like functions and globals"); printWriter.println("// Uncomment this to disable it "); printWriter.print("//"); printWriter.println("#define DEBUG_DISABLE_DEBUGGER true"); printWriter.println(""); printWriter.println("// Define the initial debug level here (uncomment to use it)"); printWriter.println("//#define DEBUG_INITIAL_LEVEL DEBUG_LEVEL_VERBOSE"); printWriter.println(""); printWriter.println("// Disable auto function name (good if your debug already contains it)"); printWriter.print("//"); printWriter.println("#define DEBUG_AUTO_FUNC_DISABLED true"); printWriter.println(""); printWriter.println("// Include SerialDebug"); printWriter.println(""); printWriter.println("#include \"SerialDebug.h\" //https://github.com/JoaoLopesF/SerialDebug"); printWriter.println(""); printWriter.println(""); printWriter.println("#ifndef DEBUG_DISABLE_DEBUGGER"); printWriter.println(""); printWriter.println(" // Add Functions and global variables to SerialDebug"); printWriter.println(""); printWriter.println(" // Add functions that can be called from SerialDebug"); printWriter.println(""); " //debugAddFunctionVoid(F(\"function\"), &function); // Example for function without args"); " //debugAddFunctionStr(F(\"function\"), &function); // Example for function with one String arg"); " //debugAddFunctionInt(F(\"function\"), &function); // Example for function with one int arg"); .println(" //debugAddFunctionVoid(\"function\", &function); // Example for function without args"); " //debugAddFunctionStr(\"function\", &function); // Example for function with one String arg"); " //debugAddFunctionInt(\"function\", &function); // Example for function with one int arg"); printWriter.println(""); printWriter.println(" // Add global variables that can be shown/changed from SerialDebug"); printWriter.println(" // Note: Only global, if you pass local for SerialDebug, that can be dangerous"); printWriter.println(""); printWriter.print(" debugAddGlobal" + varTypesSerialDebug[global.getPosType()] + "("); printWriter.print("F(\"" + global.getName() + "\"), "); printWriter.print("\"" + global.getName() + "\", "); printWriter.println("&" + global.getName() + "); "); printWriter.println(""); printWriter.println("#endif // DEBUG_DISABLE_DEBUGGER"); printWriter.println(""); // Generate SerialDebug handle"); printWriter.println(""); printWriter.println(" // SerialDebug handle"); printWriter.println(" // Note: if in inactive mode (until anything received from serial),"); printWriter.println(" // it shows only messages of 'always' or 'error' levels type"); printWriter.println(" // and the overhead during inactive mode is very low"); printWriter.println(" // Only if not DEBUG_DISABLED"); printWriter.println(""); printWriter.println(" debugHandle(); "); printWriter.println(""); lblConversion.setText("File converted successfully.");