/// <summary>
 /// Notify sample
 ///http://127.0.0.1:15000/weatherforecast/line1_dis
 ///http://127.0.0.1:15000/weatherforecast/loop_dis
 ///http://127.0.0.1:15000/weatherforecast/agv_dis
 /// </summary>
 /// <param name="lineName"></param>
 public void CarrierLongStay()
 {
     try
     {
         string[] action_targets = new string[]
         {
             "weatherforecast"
         };
         string[] param = new string[]
         {
             CARRIER_LONG_STAY_CONST,
         };
         foreach (string notify_url in notify_urls)
         {
             string result = webClientManager.GetInfoFromServer(notify_url, action_targets, param);
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }
Exemplo n.º 2
0
        public int getMapInfoFromHttp(SCAppConstants.SystemExcuteInfoType dataType)
        {
            string result = string.Empty;

            string[] action_targets = new string[]
            {
                "SystemExcuteInfo"
            };
            StringBuilder sb = new StringBuilder();

            //sb.Append($"{nameof(SCAppConstants.MapInfoDataType)}={dataType}");
            sb.Append(dataType);
            result = webClientManager.GetInfoFromServer(WebClientManager.OHxC_CONTROL_URI, action_targets, sb.ToString());
            int.TryParse(result, out int iresult);
            return(iresult);
        }
            public bool canExcuteUnloadTransferToAGVStation(IAGVStationType agvStation, int unfinishCmdCount, bool isEmergency)
            {
                //if (DebugParameter.CanUnloadToAGVStationTest)
                //    return true;
                //else
                //    return false;
                string result = "";
                string url    = "";

                try
                {
                    string agv_url = agvStation.RemoveURI;
                    url = SCUtility.Trim(agv_url, true);
                    string   agv_station_id = agvStation.getAGVStationID();
                    string[] action_targets = new string[]
                    {
                        "TransferManagement",
                        "TransferCheck",
                        "AGVStation"
                    };
                    string[] param = new string[]
                    {
                        agv_station_id,
                        $"?{nameof(unfinishCmdCount)}={unfinishCmdCount}",
                        $"&{nameof(isEmergency)}={isEmergency}",
                    };
                    LogHelper.Log(logger: logger, LogLevel: LogLevel.Info, Class: nameof(TransferBLL), Device: "AGVC",
                                  Data: $"Try to reserve agv station to unload,uri:{agv_url} station id:{agv_station_id} unfinishCmdCount:{unfinishCmdCount} isEmergency:{isEmergency}...");
                    result = webClientManager.GetInfoFromServer(agv_url, action_targets, param);
                    LogHelper.Log(logger: logger, LogLevel: LogLevel.Info, Class: nameof(TransferBLL), Device: "AGVC",
                                  Data: $"Try to reserve agv station to unload,uri:{agv_url} station id:{agv_station_id} unfinishCmdCount:{unfinishCmdCount} isEmergency:{isEmergency},result:{result}");
                    result = result.ToUpper();
                    agvStation.LastAskTime = DateTime.Now;
                }
                catch (Exception ex)
                {
                    logger.Error(ex, $"Exception:{url}");
                    throw ex;
                }
                //return SCUtility.isMatche(result, UNLOAD_CHECK_RESULT_OK);
                return(result.Contains(UNLOAD_CHECK_RESULT_OK));
            }