diff --git a/src/main/java/ESPlorer/ESPlorer.java b/src/main/java/ESPlorer/ESPlorer.java index f91e84f..79a3d41 100644 --- a/src/main/java/ESPlorer/ESPlorer.java +++ b/src/main/java/ESPlorer/ESPlorer.java @@ -6045,7 +6045,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { RightBigPaneLayout.setVerticalGroup( RightBigPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(RightBigPaneLayout.createSequentialGroup() - .addComponent(RightFilesSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE) + .addComponent(RightFilesSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 813, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(RightSnippetsPane, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)) ); @@ -7705,8 +7705,9 @@ public void serialEvent(SerialPortEvent event) { log("FileManager: File list found! Do parsing..."); try { // parsing answer + rx_data = rx_data.replaceAll("\r?\n", "\n"); int start = rx_data.indexOf("~~~File list START~~~"); - rx_data = rx_data.substring(start + 23, rx_data.indexOf("~~~File list END~~~")); + rx_data = rx_data.substring(start + 22, rx_data.indexOf("~~~File list END~~~")); //log(rx_data.replaceAll("\r?\n", "\r\n")); s = rx_data.split("\r?\n"); Arrays.sort(s); @@ -12695,6 +12696,10 @@ private void UploadFilesStart() { log("Uploader: loaded fail!"); return; } + if (mFile.get(mFileIndex).length() == 0) { + TerminalAdd("\r\nUploader: ERROR! " + UploadFileName + " has zero size.\r\n"); + return; + } int lastPacketSize = SplitDataToPackets(); if (lastPacketSize < 0) { log("Uploader: SplitDataToPackets fail!"); @@ -12702,6 +12707,9 @@ private void UploadFilesStart() { } log("sendPackets=" + Integer.toString(sendPackets.size())); String cmd = "_up=function(n,l,ll)\n" + + " if node.chipmodel then\n" + + " uart.start(0)\n" + + " end\n" + " local cs = 0\n" + " local i = 0\n" + " local open = file.open or io.open\n" @@ -12724,6 +12732,9 @@ private void UploadFilesStart() { + " end\n" + " end,0)\n" + "end\n" + + "if node.chipmodel then\n" + + " uart.stop(0)\n" + + "end\n" + "file.remove(\"" + UploadFileName + "\")\n"; sendBuf = cmdPrep(cmd); int startPackets;