echo commands
-
Good morning to all,
I would like to request a new function for echo commands.
Currently echo>> writes to a new line of the specified file, but I would like to be able to write to the end of the last line for example using echo>>>, this way I would have no problem writing longer lines and I think it would consume less resources than increasing the number of characters allowed in a single line.
This could be used to write comments or in my case to generate a superlicer profile automatically from the machine.
By the way I love the new features of the M291.
Best regards
Aitor -
-
Good morning @T3P3Tony,
Thanks for moving the conversation, I didn't see that this title existed.
I guess this is something that @DC42 should see, can you tell me if this is a good idea and if you see it possible for 3.5beta2? I have to go planning a route of changes in our machines for 2023 and knowing if this could be implemented would help me a lot.
Greetings and happy new year to all the DUET3D team.
Aitor
-
@Aitor since the newline is added at the end of the string added by
echo >>
we would need to do it the other way round, i.e. have a variant of the echo command that does not add the newline at the end, on the assumption that you will follow it eventually with an echo command that does add the newline.How long is the string that you need to write as a single line?
-
Good morning @DC42,
I think I have not understood well what you say, possibly the translator is confusing me a bit, so I'll explain better what I want to achieve.
These are some of the lines of code I have to generate with which I have the problem:
start_gcode = M190 S{first_layer_bed_temperature}\nG10 P0 S{first_layer_temperature[0]} R{temperature[0]}\nG10 P1 S{first_layer_temperature[1]} R{temperature[1]}\nM98 P"ginicioMIRROR.g" compatible_printers = "NX PRO HR-HR_Left_Left Only"; "NX PRO HR-HR_Right Only"; "NX PRO HR-HR_Dual"; "NX PRO HR-HR_Copy"; "NX PRO HR-HR_Mirror" output_filename_format = {input_filename_base}_T0_{filament_type[0]}_{nozzle_diameter[0]}_T1_{filament_type[1]}_{nozzle_diameter[1]}.gcode
my idea to be able to write this in a single line, without having the problem of number of characters, would be something like this:
echo >>"ini" "start_gcode = M190 S{first_layer_bed_temperature}" echo >>>"ini" "\nG10 P0 S{first_layer_bed_temperature[0]} R{temperature[0]}" echo >>>"ini" "\nG10 P1 S{first_layer_temperature[1]} R{temperature[1]}" echo >>>"ini" "\nM98 P""ginicioMIRROR.g"""
to output as a single line:
start_gcode = M190 S{first_layer_bed_temperature}\nG10 P0 S{first_layer_temperature[0]} R{temperature[0]}\nG10 P1 S{first_layer_temperature[1]} R{temperature[1]}\nM98 P"ginicioMIRROR.g"
If you don't understand something let me know
Best regards
Aitor -
@Aitor whats the reason fro embedding the new line characters into a single line?
-
@T3P3Tony I recall that some slicers expect a single line with the literal character sequence "\n" (not newline) between commands.
-
Good morning @T3P3Tony
It is as @DC42 says, superlicer that is this case, does not allow me to separate lines, I am also preparing the profiles of S3D-V5 and the same thing happens to me, in V4 I had no problem in separating the lines that now does not allow me to separate, although this I have landazo the consultation to S3D also, but seen what seen I do not know how long it will take.
Is it clear what is the new functionality of the echo command that I propose? Did I explain myself correctly?
I hope you had a good holiday season and I wish you great achievements for this new year.
Best regards
Aitor -
Good morning @DC42,
Sorry for the insistence, can you tell me if you see possible to implement this function of the echo command in a near version?
Or if it will be possible to do it?
Or if it is something impossible to do?I would like to know, as we have many types of printers and I need to know if I should look for another alternative.
Best regards
Aitor -
@Aitor I have implemented this in the RRF 3.5 source code. So it should be available in RRF 3.5beta2. The use of
echo >>>file ...
will append to the file and not add a terminating newline, so you can use further echo commands to append to the same line. The final one should useecho >>file ...
so as to include a newline. -
Good morning @DC42,
Thank you very much, you don't know how glad I am to hear it, I'm looking forward to try beta2, I'll be preparing my codes to test it.
It's really wonderful to work with you
Best regards
Aitor