<?xml version="1.0" encoding="UTF-8"?>
<Config>
   <Defs>
      <Set Header="SIM-ARM" Desc = "ARM Simulator" >
         <Section Header="General" Desc = "Miscellaneous" Comment="Configure miscellaneous simulator settings." >
            <Property Header="Explore" Desc= "Code Exploration" Comment="Explore the whole code on Startup. The whole program memory will be disassembled upon eentering a debug session." Type="PT_CHOICE" Value = "No">
               <Enum Header="Yes" Value="Yes"/>
               <Enum Header="No"  Value="No"/>
               <![CDATA[
                  var explore  = Project.GetPropertyValue("SIM-ARM", "General", "Explore");
                  var dbi      = Project.GetSelectedDBI();
                  Project.WriteIniValue("Debug","Explore",explore, dbi);
               ]]>
            </Property>
            <Property Header="Record" Desc= "Value Record" Comment="Defines which information should be recorded while tracing a program." Type="PT_CHOICE" Value = "No">
               <Enum Header="No information" Value="No" />
               <Enum Header="SP"  Value="SP"/>
               <Enum Header="Expression"  Value="Expression"/>
               <![CDATA[
               var dbi    = Project.GetSelectedDBI();
               var value  = Project.GetPropertyValue("SIM-ARM", "General", "Record");
               if (value == "Expression")
                  {
                  Project.WriteIniValue("Debug","InfoSP","0", dbi);
                  Project.EnableProperty("SIM-ARM", "General", "Expression", 1);
                  Project.WriteIniValue("Debug","Information","1", dbi);
                  }
               else if (value == "SP")
                  {
                  Project.EnableProperty("SIM-ARM", "General", "Expression", 0);
                  Project.WriteIniValue("Debug","InfoSP","1", dbi);
                  Project.WriteIniValue("Debug","InfoExpr","", dbi);
                  Project.WriteIniValue("Debug","Information","1", dbi);
                  }
               else
                  {
                  Project.EnableProperty("SIM-ARM", "General", "Expression", 0);
                  Project.WriteIniValue("Debug","Information","0", dbi);
                  }
               ]]>
            </Property>
            <Property Header="Expression" Desc= "Expression" Comment="Enter the expression to be evaluated." Type="PT_STRING" >
            <![CDATA[
               var value  = Project.GetPropertyValue("SIM-ARM", "General", "Expression");
               var dbi    = Project.GetSelectedDBI();
               Project.WriteIniValue("Debug","InfoExpr",value, dbi);
            ]]>
            </Property>
         </Section>
         <Section Header="Advanced" Desc = "Advanced" >
            <Property Header="Crystal" Desc= "Crystal Frequency" Comment="Frequency in MHz" Type="PT_STRING" Value = "8.000">
               <![CDATA[
               var value  = Project.GetPropertyValue("SIM-ARM", "Advanced", "Crystal");
               var dbi    = Project.GetSelectedDBI();
               Project.WriteIniValue("SIM-ARM","Crystal",value, dbi);
               ]]>
            </Property>
         </Section>
        <Section Header="Trace" Desc="Trace execution">
            <Property Header="Mode" Desc="Trace mode" Comment="Selects the way the program execution should traced" Type="PT_CHOICE" Default="0">
              <Enum Header="Off" Value="0"/>
              <Enum Header="Continue" Value="1"/>
              <Enum Header="Toggling" Value="2"/>
              <Enum Header="Flash" Value="3"/>              
              <![CDATA[
                {
                var value = Project.GetPropertyValue("SIM-ARM", "Trace", "Mode");
                var dbi = Project.GetSelectedDBI();
                Project.WriteIniValue("Trace","Mode",value, dbi);
                }
              ]]>
            </Property>
            <Property Header="AnalyzeLevel" Desc="Display only disassembly instructions" Comment="Shows only the list of disassembly instructions" Type="PT_CHOICE" Default="0">
              <Enum Header="No" Value="0"/>
              <Enum Header="Yes" Value="1"/>
              <![CDATA[
                {
                var value = Project.GetPropertyValue("SIM-ARM", "Trace", "AnalyzeLevel");
                var dbi = Project.GetSelectedDBI();
                Project.WriteIniValue("Trace","AssemblyMode",value, dbi);
                }
              ]]>
            </Property>
      
            <Property Header="RecordNum" Desc="Record number" Type="PT_STRING" Default="1000" Comment="Set the maximum number of trace records. Increasing this number could slow down the execution of the program.">
              <![CDATA[
                {
                var value  = Project.GetPropertyValue("SIM-ARM", "Trace", "RecordNum");
                var dbi    = Project.GetSelectedDBI();
                Project.WriteIniValue("Trace","NbRecords",value, dbi);
                }
              ]]>
            </Property>
            <Property Header="GraphVisible" Desc="Show graph" Type="PT_CHOICE" Default="1" Comment="Select 'No' if you don't want to see the graphical trace.">
              <Enum Header="Yes" Value="1"/>
              <Enum Header="No" Value="0"/>
              <![CDATA[
                {
                var value  = Project.GetPropertyValue("SIM-ARM", "Trace", "GraphVisible");
                var dbi    = Project.GetSelectedDBI();
                Project.WriteIniValue("Trace","Graph",value, dbi);
                }
              ]]>
            </Property>
         </Section>         

      </Set>
   </Defs>
</Config>
