New Feature: Import/Export from human readable text file (markdown, json, or similar)
Quote from stefanolenzi on October 27, 2024, 8:14 pmHi All,
Any plan to create an import/export from text, it would be cool to use Markdown or any other human readble format.
Best regards,
Stefano
Hi All,
Any plan to create an import/export from text, it would be cool to use Markdown or any other human readble format.
Best regards,
Stefano
Quote from stefanolenzi on October 28, 2024, 8:40 pmHi @arcachofo
Thank you for the great software! Before answering I have checked the latest version and I have GOOD and BAD news:
GOOD: I realized that .sim1 are a sort of XML files, that could be enough for my purpose!
BAD: The parser used by SimulIDE is not a real XML parser in fact if I change the .sim1 by adding CR the parsing fails
This is the original files
<circuit version="1.1.0-SR1" rev="2005" stepSize="1000000" stepsPS="1000000" NLsteps="100000" reaStep="1000000" animate="0" > <item itemtype="MCU" CircId="mega328-1" mainComp="false" Show_id="true" Show_Val="false" Pos="-280,-236" rotation="0" hflip="1" vflip="1" label="mega328-1" idLabPos="0,-20" labelrot="0" valLabPos="-16,20" valLabRot="0" Frequency="16 MHz" Auto_Load="false" saveEepr="true" Logic_Symbol="false" Rst_enabled="false" Ext_Osc="false" Wdt_enabled="false" Clk_Out="false" MainMcu="true" SerialMon="-1" /> <item itemtype="Led" CircId="Led-2" mainComp="false" Show_id="false" Show_Val="false" Pos="-396,-124" rotation="-180" hflip="1" vflip="1" label="Led-2" idLabPos="-16,-24" labelrot="0" valLabPos="-16,20" valLabRot="0" Color="Yellow" Grounded="true" Threshold="2.4 V" MaxCurrent="30 mA" Resistance="0.6 Ω" /> <item itemtype="Resistor" CircId="Resistor-3" mainComp="false" ShowProp="Resistance" Show_id="false" Show_Val="true" Pos="-332,-124" rotation="0" hflip="1" vflip="1" label="Resistor-3" idLabPos="-16,-24" labelrot="0" valLabPos="-16,6" valLabRot="0" Resistance="100 Ω" /> <item itemtype="Connector" uid="Connector-3" startpinid="Resistor-3-lPin" endpinid="Led-2-lPin" pointList="-348,-124,-380,-124" /> <item itemtype="Connector" uid="Connector-7" startpinid="Resistor-3-rPin" endpinid="mega328-1-PORTB0" pointList="-316,-124,-288,-124" /> </circuit>
if I change it like this the parse FAILS
<circuit version="1.1.0-SR1" rev="2005" stepSize="1000000" stepsPS="1000000" NLsteps="100000" reaStep="1000000" animate="0" > <item itemtype="MCU" CircId="mega328-1" mainComp="false" Show_id="true" Show_Val="false" Pos="-280,-236" rotation="0" hflip="1" vflip="1" label="mega328-1" idLabPos="0,-20" labelrot="0" valLabPos="-16,20" valLabRot="0" Frequency="16 MHz" Auto_Load="false" saveEepr="true" Logic_Symbol="false" Rst_enabled="false" Ext_Osc="false" Wdt_enabled="false" Clk_Out="false" MainMcu="true" SerialMon="-1" /> <item itemtype="Led" CircId="Led-2" mainComp="false" Show_id="false" Show_Val="false" Pos="-396,-124" rotation="-180" hflip="1" vflip="1" label="Led-2" idLabPos="-16,-24" labelrot="0" valLabPos="-16,20" valLabRot="0" Color="Yellow" Grounded="true" Threshold="2.4 V" MaxCurrent="30 mA" Resistance="0.6 Ω" /> <item itemtype="Resistor" CircId="Resistor-3" mainComp="false" ShowProp="Resistance" Show_id="false" Show_Val="true" Pos="-332,-124" rotation="0" hflip="1" vflip="1" label="Resistor-3" idLabPos="-16,-24" labelrot="0" valLabPos="-16,6" valLabRot="0" Resistance="100 Ω" /> <item itemtype="Connector" uid="Connector-3" startpinid="Resistor-3-lPin" endpinid="Led-2-lPin" pointList="-348,-124,-380,-124" /> <item itemtype="Connector" uid="Connector-7" startpinid="Resistor-3-rPin" endpinid="mega328-1-PORTB0" pointList="-316,-124,-288,-124" /> </circuit>
Hi @arcachofo
Thank you for the great software! Before answering I have checked the latest version and I have GOOD and BAD news:
GOOD: I realized that .sim1 are a sort of XML files, that could be enough for my purpose!
BAD: The parser used by SimulIDE is not a real XML parser in fact if I change the .sim1 by adding CR the parsing fails
This is the original files
<circuit version="1.1.0-SR1" rev="2005" stepSize="1000000" stepsPS="1000000" NLsteps="100000" reaStep="1000000" animate="0" >
<item itemtype="MCU" CircId="mega328-1" mainComp="false" Show_id="true" Show_Val="false" Pos="-280,-236" rotation="0" hflip="1" vflip="1" label="mega328-1" idLabPos="0,-20" labelrot="0" valLabPos="-16,20" valLabRot="0" Frequency="16 MHz" Auto_Load="false" saveEepr="true" Logic_Symbol="false" Rst_enabled="false" Ext_Osc="false" Wdt_enabled="false" Clk_Out="false" MainMcu="true" SerialMon="-1" />
<item itemtype="Led" CircId="Led-2" mainComp="false" Show_id="false" Show_Val="false" Pos="-396,-124" rotation="-180" hflip="1" vflip="1" label="Led-2" idLabPos="-16,-24" labelrot="0" valLabPos="-16,20" valLabRot="0" Color="Yellow" Grounded="true" Threshold="2.4 V" MaxCurrent="30 mA" Resistance="0.6 Ω" />
<item itemtype="Resistor" CircId="Resistor-3" mainComp="false" ShowProp="Resistance" Show_id="false" Show_Val="true" Pos="-332,-124" rotation="0" hflip="1" vflip="1" label="Resistor-3" idLabPos="-16,-24" labelrot="0" valLabPos="-16,6" valLabRot="0" Resistance="100 Ω" />
<item itemtype="Connector" uid="Connector-3" startpinid="Resistor-3-lPin" endpinid="Led-2-lPin" pointList="-348,-124,-380,-124" />
<item itemtype="Connector" uid="Connector-7" startpinid="Resistor-3-rPin" endpinid="mega328-1-PORTB0" pointList="-316,-124,-288,-124" />
</circuit>
if I change it like this the parse FAILS
<circuit version="1.1.0-SR1" rev="2005" stepSize="1000000" stepsPS="1000000" NLsteps="100000" reaStep="1000000" animate="0" >
<item itemtype="MCU" CircId="mega328-1"
mainComp="false" Show_id="true" Show_Val="false" Pos="-280,-236" rotation="0" hflip="1" vflip="1" label="mega328-1" idLabPos="0,-20" labelrot="0" valLabPos="-16,20" valLabRot="0" Frequency="16 MHz" Auto_Load="false" saveEepr="true" Logic_Symbol="false" Rst_enabled="false" Ext_Osc="false" Wdt_enabled="false" Clk_Out="false" MainMcu="true" SerialMon="-1" />
<item itemtype="Led" CircId="Led-2" mainComp="false" Show_id="false" Show_Val="false" Pos="-396,-124" rotation="-180" hflip="1" vflip="1" label="Led-2" idLabPos="-16,-24" labelrot="0" valLabPos="-16,20" valLabRot="0" Color="Yellow" Grounded="true" Threshold="2.4 V" MaxCurrent="30 mA" Resistance="0.6 Ω" />
<item itemtype="Resistor" CircId="Resistor-3" mainComp="false" ShowProp="Resistance" Show_id="false" Show_Val="true" Pos="-332,-124" rotation="0" hflip="1" vflip="1" label="Resistor-3" idLabPos="-16,-24" labelrot="0" valLabPos="-16,6" valLabRot="0" Resistance="100 Ω" />
<item itemtype="Connector" uid="Connector-3" startpinid="Resistor-3-lPin" endpinid="Led-2-lPin" pointList="-348,-124,-380,-124" />
<item itemtype="Connector" uid="Connector-7" startpinid="Resistor-3-rPin" endpinid="mega328-1-PORTB0" pointList="-316,-124,-288,-124" />
</circuit>
Quote from arcachofo on October 29, 2024, 10:53 amHi.
You are right .sim1 files are xml, but it doesn't accept any xml file, each entry must be in one line.
I don't know what is your purpose, so no idea how can I help.
Hi.
You are right .sim1 files are xml, but it doesn't accept any xml file, each entry must be in one line.
I don't know what is your purpose, so no idea how can I help.
Quote from stefanolenzi on October 29, 2024, 2:54 pmThe idea is to let a human write a circuit with a texteditor so that:
1. I can open/import it from SimulIDE
2. excute SimulIDE from command line so that it generate a SVG/PDF/PNG image of the circuitIn particular, it would be great if the syntax is less verbose with rispect to the current "XML format". Can we omit the pointList? Which are the mandatory attribute to write down?
Stefano
The idea is to let a human write a circuit with a texteditor so that:
1. I can open/import it from SimulIDE
2. excute SimulIDE from command line so that it generate a SVG/PDF/PNG image of the circuit
In particular, it would be great if the syntax is less verbose with rispect to the current "XML format". Can we omit the pointList? Which are the mandatory attribute to write down?
Stefano
Quote from arcachofo on October 29, 2024, 7:48 pmI don't understand why would someone want to write a circuit file by hand.
In any case all the information in a .sim1 file is needed to create the circuit, specially the pointList.
If you just want an image you could omit some parameters related to the electric characteristics of some components.
I don't understand why would someone want to write a circuit file by hand.
In any case all the information in a .sim1 file is needed to create the circuit, specially the pointList.
If you just want an image you could omit some parameters related to the electric characteristics of some components.