Pārlūkot izejas kodu

2022.10.18 / Shayne Lo

    Actions:
    1. add MajorType DL
	2. add SystemID Loose Parse

    Files:
    1. As follow commit history

    Image version: 1.0.23.0
    Image checksum: XXXXXXXX

    Hardware PWB P/N : XXXXXXX
    Hardware Version : XXXXXXX
Robert 2 gadi atpakaļ
vecāks
revīzija
619aed6f75

+ 4 - 4
20200327.txt

@@ -1,13 +1,13 @@
-    2022.10.17 / Shayne Lo
+    2022.10.18 / Shayne Lo
 
     Actions:
-    1. Update Generation Naming
-	2. add Generation G~Z
+    1. add MajorType DL
+	2. add SystemID Loose Parse
 
     Files:
     1. As follow commit history 
 
-    Image version: 1.0.22.0
+    Image version: 1.0.23.0
     Image checksum: XXXXXXXX
 
     Hardware PWB P/N : XXXXXXX

BIN
bin/Firmware Header Builder.exe


BIN
bin/Firmware Header Builder.zip


BIN
release/Firmware Header Builder V1.0.23.0/Firmware Header Builder.exe


+ 259 - 0
release/Firmware Header Builder V1.0.23.0/Release Notes.html

@@ -0,0 +1,259 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+    <title>Release Note</title>
+	<style type="text/css">
+		body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {margin:0;padding:0;}
+		table {border-collapse:collapse;border-spacing:0;}
+		fieldset,img {border:0;}
+		address,caption,cite,code,dfn,em,strong,th,var {font-style:normal;font-weight:normal;}
+		ol,ul {list-style:none;}
+		caption,th {text-align:left;}
+		h1,h2,h3,h4,h5,h6 {font-size:100%;font-weight:normal;}
+		q:before,q:after {content:'';}
+		abbr,acronym {border:0;}
+		html, body{margin:0; height: 100%;}
+		body{margin: 0; padding: 0;	color:#000;	font-size:15px;	font-family:arial, helvetica, clean, sans-serif,微軟正黑體;	background: #326990;}
+		ul, li { display: block;}
+		a { text-decoration: none; color:blue;  }
+		a:hover{ text-decoration: none; }
+
+		/*-select-*/
+		select,input{ padding: 5px; margin: 2px; border-radius: 20px; border:0; background: #edf1f3; }
+		input { padding:7px;}
+		/*-table-*/
+		.table{ width: 100%; word-break: break-all;}
+		.table thead th { background: #f4f9fc; border-bottom: 2px solid #e9f0f4; font-size: 15px; font-weight: bold; text-align: center; line-height: 40px;}
+		.table tbody td { padding:8px 3px; border-bottom:1px solid #ddd; border-bottom: 1px solid #e9f0f4;}
+		.table .tr{ background: #f4fafd;}
+		.table tr:hover { background-color: #FFFEEC;}
+		.txtR{ text-align: right;}
+		.txtC{text-align: center;}
+		.txtL{text-align: left;}
+		/*---all----*/
+		#wrapper { width:1000px; margin:0 auto; height: 100%;}
+		#content { background:#fff; color:#385263;  margin-bottom: 20px;}
+		#content .Top { height:5px; background: #68a3c9;}
+			#content #title { height:65px; font-size: 24px;font-weight: bold; line-height: 60px; background: #f4f9fc; padding: 10px; }
+			#content #rightContent { padding: 10px 10px 30px; }
+	</style>
+
+
+</head>
+
+<body>
+	<div id="wrapper">
+
+		<div id="content">
+				<div class="Top"></div>
+				<div id="title">Firmware Header Builder</div>
+				<div id="rightContent">
+					<table class="table">
+						<thead>
+							<tr>
+								<th width="150px">Version</th>
+								<th width="150px">Release Date</th>
+								<th width="150px">Owner</th>
+								<th>Updated Items</th>
+							</tr>
+						</thead>
+						<tbody>
+							<tr>
+								<td class="txtC">0.0.1.0</td>
+								<td class="txtC">2019.07.09</td>
+								<td class="txtC">Jimmy</td>
+								<td class="txtL">
+									1. [新版] 協定實作。<p>
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.2.0</td>
+								<td class="txtC">2019.07.30</td>
+								<td class="txtC">Jimmy</td>
+								<td class="txtL">
+									1. [新增] 副檔名選擇功能。<p>
+									2. [新增] 映像檔選擇自動對應副檔名選擇功能。
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.3.0</td>
+								<td class="txtC">2019.09.23</td>
+								<td class="txtC">Jimmy</td>
+								<td class="txtL">
+									1. [修改] 將輸入的module name改成依據命名規則選擇的方式。<p>
+									2. [新增] 檔頭資訊是否已經存在的判斷。
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.4.0</td>
+								<td class="txtC">2019.12.25</td>
+								<td class="txtC">Jimmy</td>
+								<td class="txtL">
+									1. [修改] 修正 AC cord set controller 與 AC wall-mount (low-end) controller的 image type 錯誤。<p>
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.5.0</td>
+								<td class="txtC">2020.1.3</td>
+								<td class="txtC">Jimmy</td>
+								<td class="txtL">
+									1. [修改] 修正判斷檔頭已存在的邏輯(加入CRC檢查)。<p>
+									2. [修改] 額定功率改成手動輸入。
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.6.0</td>
+								<td class="txtC">2020.1.20</td>
+								<td class="txtC">Jimmy</td>
+								<td class="txtL">
+									1. [修改] 修正無副檔名時發生創建失敗的問題。<p>
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.7.0</td>
+								<td class="txtC">2020.6.5</td>
+								<td class="txtC">Shayne</td>
+								<td class="txtL">									
+									1. [修改] 新增 Image Type 選項,LED 版 MCU。<p>									
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.8.0</td>
+								<td class="txtC">2020.6.11</td>
+								<td class="txtC">Shayne</td>
+								<td class="txtL">									
+									1. [修改] 新增 Image Type 選項,F750 PSU primary & secondary controller。<p>									
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.9.0</td>
+								<td class="txtC">2020.6.19</td>
+								<td class="txtC">Shayne</td>
+								<td class="txtL">									
+									1. [修改] 新增網路選項。<p>
+									2. [新增] 合併檔案名稱加上 Model name。<p>
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.10.0</td>
+								<td class="txtC">2020.11.13</td>
+								<td class="txtC">Shayne</td>
+								<td class="txtL">
+									1. [修改] 新增 AC input 選項。<p>
+									2. [修改] 新增網路選項。<p>
+									3. [新增] 新增 Model name 長度檢查邏輯。<p>
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.11.0</td>
+								<td class="txtC">2020.11.13</td>
+								<td class="txtC">Folus Wen</td>
+								<td class="txtL">
+									1. [修改] 新增槍線選項。<p>
+									2. [修正] 修正 Model name 長度檢查邏輯。<p>
+									3. [新增] 新增儲存最後一次 Merge 選項。<p>
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.13.0</td>
+								<td class="txtC">2021.03.08</td>
+								<td class="txtC">Shayne</td>
+								<td class="txtL">
+									1. [新增] 新增主要種類選項DK和DX。<p>
+									2. [新增] 新增充電槍種類7,8,T,D,K,M,N,P,R,C和W。<p>
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.14.0</td>
+								<td class="txtC">2021.08.30</td>
+								<td class="txtC">Shayne</td>
+								<td class="txtL">
+									1. [新增] 新增充電槍種類B,H和A。<p>
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.15.0</td>
+								<td class="txtC">2021.11.12</td>
+								<td class="txtC">Shayne</td>
+								<td class="txtL">
+									1. [新增] 新增主機種種類DB。<p>
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.16.0</td>
+								<td class="txtC">2022.01.20</td>
+								<td class="txtC">Shayne</td>
+								<td class="txtL">
+									1. [新增] 新增Generation數量至16個。<p>
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.17.0</td>
+								<td class="txtC">2022.03.09</td>
+								<td class="txtC">Shayne</td>
+								<td class="txtL">
+									1. [新增] 新增Type,PH:CSU3.0 簡易版。<p>
+									1. [新增] 新增ConnectorType,L: CHAdeMO 80A。<p>
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.18.0</td>
+								<td class="txtC">2022.06.22</td>
+								<td class="txtC">Shayne</td>
+								<td class="txtL">
+									1. [更新] 更新至EVSE Model Name Naming Rule_20220616。<p>
+									2. [新增] 新增ConnectorType,Y: CCS1 150A。<p>
+									3. [新增] 新增ConnectorType,Z: CCS2 150A。<p>
+									4. [新增] 新增ConnectorType,S: CHAdeMO 125A Boost Mode。<p>
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.19.0</td>
+								<td class="txtC">2022.08.08</td>
+								<td class="txtC">Shayne</td>
+								<td class="txtL">
+									1. [更新] 更新至EVSE Model Name Naming Rule_20220806。<p>
+									2. [新增] 新增ConnectorType,I: CCS1 300A Boost mode。<p>
+									3. [新增] 新增ConnectorType,Q: CCS2 300A Boost mode。<p>
+									4. [新增] 新增Safety Regulation,W: CNS / Taiwan Manufacture。<p>
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.21.0</td>
+								<td class="txtC">2022.09.08</td>
+								<td class="txtC">Shayne</td>
+								<td class="txtL">
+									1. [更新] 更新至EVSE Model Name Naming Rule_20220908。<p>
+									2. [新增] 新增ConnectorType,O: CHA 200A boost 350A。<p>
+									3. [更新] 更新ConnectorType,更新標註名稱。<p>
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.22.0</td>
+								<td class="txtC">2022.10.17</td>
+								<td class="txtC">Shayne</td>
+								<td class="txtL">
+									1. [更新] 更新Generation命名。<p>
+									2. [新增] 新增Generation G~Z。<p>
+								</td>
+							</tr>
+							<tr>
+								<td class="txtC">1.0.23.0</td>
+								<td class="txtC">2022.10.18</td>
+								<td class="txtC">Shayne</td>
+								<td class="txtL">
+									1. [新增] 新增MajorType DL。<p>
+									2. [新增] 新增SystemID Loose Parse。<p>
+								</td>
+							</tr>
+						</tbody>
+					</table>	
+
+				</div><!--end of rightContent-->
+		</div><!-- end of content-->		
+	</div><!--end of wrapper-->
+</body>
+</html>

+ 8 - 2
src/library/PhihongEv.Lib/Model/ConnectorType.cs

@@ -10,6 +10,8 @@ namespace PhihongEv.Lib.Model
 
     public sealed partial class ConnectorType : ModelNameCodeModel
     {
+        public static ConnectorType Unknown = new ConnectorType("Unknown", "Unknown", addRegister: false);
+
         public static ConnectorType None = new ConnectorType("0", "None");
 
         public static ConnectorType N1 = new ConnectorType("1", "IEC 62196-2 Type 1/SAE J1772 Plug)");
@@ -85,14 +87,18 @@ namespace PhihongEv.Lib.Model
 
         private static List<ConnectorType> _List { get; set; }
 
-        internal ConnectorType(string code, string description) : base(code, description)
+        internal ConnectorType(string code, string description, bool addRegister = true) : base(code, description)
         {
-
             if (_List == null)
             {
                 _List = new List<ConnectorType>();
             }
 
+            if (!addRegister)
+            {
+                return;
+            }
+
             _List.Add(this);
         }
     }

+ 8 - 2
src/library/PhihongEv.Lib/Model/Generation.cs

@@ -7,6 +7,8 @@ namespace PhihongEv.Lib.Model
 {
     public sealed partial class Generation : ModelNameCodeModel
     {
+        public static Generation Unknown = new Generation("Unknown", "Unknown", addRegister: false);
+
         public static Generation N0 = new Generation("0", "Generation 0");
 
         public static Generation N1 = new Generation("1", "Generation 1");
@@ -86,14 +88,18 @@ namespace PhihongEv.Lib.Model
 
         private static List<Generation> _List { get; set; }
 
-        internal Generation(string code, string description) : base(code, description)
+        internal Generation(string code, string description, bool addRegister = true) : base(code, description)
         {
-
             if (_List == null)
             {
                 _List = new List<Generation>();
             }
 
+            if (!addRegister)
+            {
+                return;
+            }
+
             _List.Add(this);
         }
     }

+ 7 - 1
src/library/PhihongEv.Lib/Model/InputConfig.cs

@@ -10,6 +10,7 @@ namespace PhihongEv.Lib.Model
 
     public sealed partial class InputConfig : ModelNameCodeModel
     {
+        public static InputConfig Unknown = new InputConfig("Unknown", "Unknown", addRegister: false);
 
         public static InputConfig Y = new InputConfig("Y", "3 phase wyi-connection 4 wires + PE, 380 - 415Vac, 50Hz/60Hz");
 
@@ -54,7 +55,7 @@ namespace PhihongEv.Lib.Model
 
         private static List<InputConfig> _List { get; set; }
 
-        internal InputConfig(string code, string description) : base(code, description)
+        internal InputConfig(string code, string description, bool addRegister = true) : base(code, description)
         {
 
             if (_List == null)
@@ -62,6 +63,11 @@ namespace PhihongEv.Lib.Model
                 _List = new List<InputConfig>();
             }
 
+            if (!addRegister)
+            {
+                return;
+            }
+
             _List.Add(this);
         }
     }

+ 10 - 2
src/library/PhihongEv.Lib/Model/MajorType.cs

@@ -18,6 +18,8 @@ namespace PhihongEv.Lib.Model
 
     public sealed partial class MajorType : ModelNameCodeModel
     {
+        public static readonly MajorType Unknown = new MajorType("Unknown", "Unknown", addRegister:false);
+
         public static readonly MajorType AC = new MajorType("AC", "Ac EVse Cordset");
 
         public static readonly MajorType AW = new MajorType("AW", "Ac EVse Wallmount");
@@ -47,6 +49,8 @@ namespace PhihongEv.Lib.Model
         public static readonly MajorType DB = new MajorType("DB", "Dc to Dc EVSE Output power cabinet");
 
         public static readonly MajorType DH = new MajorType("DH", "Simplified CSU3.0");
+
+        public static readonly MajorType DL = new MajorType("DL", "DC EVse Liquid cooling Power Cabinet");
     }
 
     public sealed partial class MajorType : ModelNameCodeModel
@@ -55,14 +59,18 @@ namespace PhihongEv.Lib.Model
 
         private static List<MajorType> _List { get; set; }
 
-        internal MajorType(string code, string description) : base(code, description)
+        internal MajorType(string code, string description, bool addRegister = true) : base(code, description)
         {
-
             if (_List == null)
             {
                 _List = new List<MajorType>();
             }
 
+            if (!addRegister)
+            {
+                return;
+            }
+
             _List.Add(this);
         }
     }

+ 9 - 1
src/library/PhihongEv.Lib/Model/NetworkOption.cs

@@ -18,6 +18,8 @@ namespace PhihongEv.Lib.Model
 
     public sealed partial class NetworkOption : ModelNameCodeModel
     {
+        public static NetworkOption Unknown = new NetworkOption("Unknown", "Unknown", addRegister: false);
+
         public static NetworkOption None = new NetworkOption("0", "None");
 
         public static NetworkOption Ethernet = new NetworkOption(
@@ -66,7 +68,8 @@ namespace PhihongEv.Lib.Model
 
         internal NetworkOption(string code, string description,
             bool supportEthernet = false, bool supportWiFi = false,
-            bool supportTelecom = false, bool supportBluetooth = false) : base(code, description)
+            bool supportTelecom = false, bool supportBluetooth = false, 
+            bool addRegister = true) : base(code, description)
         {
             SupportEthernet = supportEthernet;
             SupportWiFi = supportWiFi;
@@ -78,6 +81,11 @@ namespace PhihongEv.Lib.Model
                 _List = new List<NetworkOption>();
             }
 
+            if (!addRegister)
+            {
+                return;
+            }
+
             _List.Add(this);
         }
     }

+ 8 - 1
src/library/PhihongEv.Lib/Model/SafetyRegulation.cs

@@ -24,6 +24,8 @@ namespace PhihongEv.Lib.Model
 
     public sealed partial class SafetyRegulation : ModelNameCodeModel
     {
+        public static SafetyRegulation Unknown = new SafetyRegulation("Unknown", "Unknown", addRegister: false);
+
         public static SafetyRegulation E = new SafetyRegulation("E", "CE / European Market");
 
         public static SafetyRegulation U = new SafetyRegulation("U", "UL / North America Market");
@@ -61,7 +63,7 @@ namespace PhihongEv.Lib.Model
 
         private static List<SafetyRegulation> _List { get; set; }
 
-        internal SafetyRegulation(string code, string description) : base(code, description)
+        internal SafetyRegulation(string code, string description, bool addRegister = true) : base(code, description)
         {
 
             if (_List == null)
@@ -69,6 +71,11 @@ namespace PhihongEv.Lib.Model
                 _List = new List<SafetyRegulation>();
             }
 
+            if (!addRegister)
+            {
+                return;
+            }
+
             _List.Add(this);
         }
     }

+ 94 - 0
src/library/PhihongEv.Lib/ModelName.cs

@@ -82,6 +82,10 @@ namespace PhihongEv.Lib
 
             var ratedPowerStr = modeNameString.Substring(4, 3);
             model.RatedPower = GetRatedPowerFromStr(ratedPowerStr);
+            if (model.RatedPower == -1)
+            {
+                return false;
+            }
 
             model.ConnectorTypes = new ConnectorType[3];
             var connectorListStr = modeNameString.Substring(7, 3);
@@ -121,6 +125,96 @@ namespace PhihongEv.Lib
             return true;
         }
 
+        public static bool TryLooseParse(byte[] modeNameByte, out ModelName modelName)
+        {
+            modelName = null;
+            string modelNameString;
+            try
+            {
+                modelNameString = Encoding.UTF8.GetString(modeNameByte, 0, modeNameByte.Length);
+            }
+            catch
+            {
+                return false;
+            }
+
+            if (modelNameString.Length != 14)
+                return false;
+            return TryLooseParse(modelNameString, out modelName);
+        }
+
+        public static bool TryLooseParse(string modeNameString, out ModelName modelName)
+        {
+            modelName = null;
+            ModelName model = new ModelName();
+
+            if (modeNameString == null || modeNameString.Length != 14)
+                return false;
+
+            var typeString = modeNameString.Substring(0, 2);
+            model.Type = typeString.ToMajorType();
+            if (model.Type == null)
+            {
+                model.Type = MajorType.Unknown;
+            }
+
+            var inputConfigChr = modeNameString.Substring(2, 1);
+            model.InputConfig = inputConfigChr.ToInputConfig();
+            if (model.InputConfig == null)
+            {
+                model.InputConfig = InputConfig.Unknown;
+            }
+
+            var safeRegChr = modeNameString.Substring(3, 1);
+            model.SafetyReg = safeRegChr.ToSafetyRegulation();
+            if (model.SafetyReg == null)
+            {
+                model.SafetyReg = SafetyRegulation.Unknown;
+            }
+
+            var ratedPowerStr = modeNameString.Substring(4, 3);
+            model.RatedPower = GetRatedPowerFromStr(ratedPowerStr);
+
+            model.ConnectorTypes = new ConnectorType[3];
+            var connectorListStr = modeNameString.Substring(7, 3);
+            /*
+            model.ConnectorTypes.Add(ConnectorType.CHadeMO);
+            model.ConnectorTypes.Add(ConnectorType.CCS);
+            model.ConnectorTypes.Add(ConnectorType.IEC);
+            */
+            for (int index = 0; index < 3; index++)
+            {
+                var connectorStr = connectorListStr.Substring(index, 1);
+
+                model.ConnectorTypes[index] = connectorStr.ToConnectorType();
+
+                if (model.ConnectorTypes[index] == null)
+                {
+                    model.ConnectorTypes[index] = ConnectorType.Unknown;
+                }
+            }
+
+            var networkOpChr = modeNameString.Substring(10, 1);
+            model.Network = networkOpChr.ToNetworkOption();
+            if (model.Network == null)
+            {
+                model.Network = NetworkOption.Unknown;
+            }
+
+            var genStr = modeNameString.Substring(11, 1);
+            model.Generation = genStr.ToGeneration();
+            if (model.Generation == null)
+            {
+                model.Generation = Generation.Unknown;
+            }
+
+            model.CustomCode = modeNameString.Substring(12, 2);
+            model._modelNameString = modeNameString;
+
+            modelName = model;
+            return true;
+        }
+
         public override string ToString()
         {
             return modelNameString;

+ 1 - 1
src/library/PhihongEv.Lib/PhihongEv.Lib.csproj

@@ -3,7 +3,7 @@
   <PropertyGroup>
     <TargetFrameworks>netstandard2.0;net40</TargetFrameworks>
     <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
-    <Version>1.0.9</Version>
+    <Version>1.0.12</Version>
   </PropertyGroup>
 
   <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.0|AnyCPU'">

+ 25 - 0
src/library/PhihongEv.Lib/SystemID.cs

@@ -45,6 +45,7 @@ namespace PhihongEv.Lib
 
             if (!ModelName.TryParse(tmp.sourceString.Substring(0, 14), out var model))
                 return false;
+
             tmp.ModelName = model;
             tmp.SerialNumber = tmp.sourceString.Substring(14);
             connectInfo = tmp;
@@ -52,6 +53,30 @@ namespace PhihongEv.Lib
             return true;
         }
 
+        public static bool TryLooseParse(string byteString, out SystemID connectInfo)
+        {
+            connectInfo = null;
+
+            SystemID tmp = new SystemID();
+
+            tmp.sourceString = byteString;
+
+            if (tmp.sourceString.Length < 14)
+                return false;
+
+            if (!ModelName.TryLooseParse(tmp.sourceString.Substring(0, 14), out var model))
+            {
+                return false;
+            }
+
+            tmp.ModelName = model;
+            tmp.SerialNumber = tmp.sourceString.Substring(14);
+
+            connectInfo = tmp;
+
+            return true;
+        }
+
         public string ToWifiPwd()
         {
             return SerialNumber + ModelName.ToString();

+ 2 - 2
src/main/FirmwareHeaderBuilder/Properties/AssemblyInfo.cs

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
 // 您可以指定所有的值,或將組建編號或修訂編號設為預設值
 // 指定為預設值: 
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.22.0")]
-[assembly: AssemblyFileVersion("1.0.22.0")]
+[assembly: AssemblyVersion("1.0.23.0")]
+[assembly: AssemblyFileVersion("1.0.23.0")]