Răsfoiți Sursa

2020/02/21 Jessica

Actions:
1.DLL 替換成04817db的檔案
2.測試工具 新增可取得N個Configurations
3.新增拒絕卡號 & Debug WriteMachineLog Exception問題
Jessica.Tseng 5 ani în urmă
părinte
comite
7e06af3a19

BIN
EVCB_OCPP.WSServer/DLL/EVCB_OCPP.Domain.dll


BIN
EVCB_OCPP.WSServer/DLL/EVCB_OCPP.Packet.dll


+ 4 - 3
EVCB_OCPP.WSServer/Message/CoreProfileHandler.cs

@@ -21,7 +21,7 @@ namespace EVCB_OCPP.WSServer.Message
 
     internal partial class ProfileHandler
     {
-        private List<string> idtag_RejecttionList = new List<string>() { "AC5CDC3D", "48C4CBD9257A" };
+        private List<string> idtag_RejecttionList = new List<string>() { "AC5CDC3D", "48C4CBD9257A","3DDC5CAC" };
         int counnter = 0;
         internal MessageResult ExecuteCoreRequest(Actions action, ClientData session, IRequest request)
         {
@@ -172,6 +172,7 @@ namespace EVCB_OCPP.WSServer.Message
                                 {
                                     foreach (var sampleVaule in item.sampledValue)
                                     {
+                                        decimal value = Convert.ToDecimal(sampleVaule.value);
 
                                         string sp = "[dbo].[uspInsertMeterValueRecord] @ChargeBoxId," +
                      "@ConnectorId,@Value,@CreatedOn,@ContextId,@FormatId,@MeasurandId,@PhaseId,@LocationId,@UnitId,@TransactionId";
@@ -180,7 +181,7 @@ namespace EVCB_OCPP.WSServer.Message
                                         {
                                               new SqlParameter("ChargeBoxId",session.ChargeBoxId),
                                               new SqlParameter("ConnectorId",  (byte)_request.connectorId),
-                                              new SqlParameter("Value",sampleVaule.value),
+                                              new SqlParameter("Value",value),
                                               new SqlParameter("CreatedOn",item.timestamp),
                                               new SqlParameter("ContextId",sampleVaule.context.HasValue ? (int)sampleVaule.context : 0),
                                               new SqlParameter("FormatId",sampleVaule.format.HasValue ? (int)sampleVaule.format : 0),
@@ -207,7 +208,7 @@ namespace EVCB_OCPP.WSServer.Message
                     {
                         StartTransactionRequest _request = request as StartTransactionRequest;
                         long _pastTime = DateTimeOffset.Now.AddYears(-20).ToUnixTimeSeconds();
-                        int _tranId = (int)(_pastTime % 100000000) * 10 + 1;
+                        int _tranId = (int)(_pastTime % 100000000) * 10 + _request.connectorId;
 
 
                         //需處理StopTransactionOnInvalidId 情境,時間若和當前時間差距10秒,發動Authorize詢問後在回覆

+ 1 - 1
EVCB_OCPP.WSServer/ProtalServer.cs

@@ -1099,7 +1099,7 @@ namespace EVCB_OCPP.WSServer
                       new SqlParameter("Msg",errorMsg.Replace("'","''")),
                       new  SqlParameter("IsSent",isSent),
                       new  SqlParameter("EVSEEndPoint",clientData.RemoteEndPoint==null?"123":clientData.RemoteEndPoint.ToString()),
-                      new  SqlParameter("Session",clientData.SessionID)
+                      new  SqlParameter("Session",clientData.SessionID==null?"123":clientData.SessionID)
                };
 
                     db.Database.ExecuteSqlCommand(sp, parameter);

BIN
TestTool.RemoteTriggerAPP/DLL/EVCB_OCPP.Domain.dll


BIN
TestTool.RemoteTriggerAPP/DLL/EVCB_OCPP.Packet.dll


+ 1 - 1
TestTool.RemoteTriggerAPP/MainWindow.xaml

@@ -5,7 +5,7 @@
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:local="clr-namespace:TestTool.RemoteTriggerAPP"      
         mc:Ignorable="d"
-        Title="下發測試用工具(公司內網) V1.1.3(20200218)" Height="450" Width="670">
+        Title="下發測試用工具(公司內網) V1.1.4(20200221)" Height="450" Width="670">
     <Grid Margin="0,2,0,-2">
         <Label Content="Charge Box Id:" HorizontalAlignment="Left" Height="27" Margin="69,23,0,0" VerticalAlignment="Top" Width="91"/>
         <Label Content="Connector Id:" HorizontalAlignment="Left" Height="27" Margin="336,23,0,0" VerticalAlignment="Top" Width="92"/>

+ 8 - 7
TestTool.RemoteTriggerAPP/MainWindow.xaml.cs

@@ -307,20 +307,20 @@ namespace TestTool.RemoteTriggerAPP
             {
                 try
                 {
-                     expiryTime = Convert.ToDateTime(uxExpiryTimeTb.Text);
-                    if(expiryTime <DateTime.Now.AddSeconds(60))
+                    expiryTime = Convert.ToDateTime(uxExpiryTimeTb.Text);
+                    if (expiryTime < DateTime.Now.AddSeconds(60))
                     {
                         isError = true;
                         uxMsgTb.Text = string.Format("ExpiryTime is too close or too early to the current time (60 seconds).");
                     }
-                 
+
                 }
                 catch (Exception ex)
                 {
                     if (ex is FormatException)
                     {
                         isError = true;
-                        uxMsgTb.Text = string.Format("ExpiryTime's Format is wrong Example:{0}",DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"));
+                        uxMsgTb.Text = string.Format("ExpiryTime's Format is wrong Example:{0}", DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"));
                     }
                 }
                 if (!isError)
@@ -456,11 +456,11 @@ namespace TestTool.RemoteTriggerAPP
         private void SetGetConfiguration()
         {
             try
-            {
-                var uuid = Guid.NewGuid().ToString();
+            {           
+                string uuid = Guid.NewGuid().ToString();
                 var request = new GetConfigurationRequest()
                 {
-                    key = new List<string>() { uxConfigKeyTb.Text }
+                    key = uxConfigKeyTb.Text.Split('/').ToList()
                 };
 
                 WritetoDB(uuid, request);
@@ -728,6 +728,7 @@ namespace TestTool.RemoteTriggerAPP
                     EVSE_Status = 0,
                     Status = 0,
                     RequestType = 1,
+                    Action = request.Action.ToString()
 
                 });