예제 #1
0
        /// <summary>
        /// Create a new acknowledgement.
        /// </summary>
        /// <param name="Result">The result of the operation.</param>
        /// <param name="Description">An optional description of the result code.</param>
        /// <param name="Warnings">Warnings or additional information.</param>
        /// <param name="Runtime">The runtime of the request.</param>
        private PushChargingStationDataResult(IId Id,
                                              ISendData ISendData,
                                              PushDataResultTypes Result,
                                              IEnumerable <PushSingleChargingStationDataResult> RejectedEVSEs = null,
                                              String Description             = null,
                                              IEnumerable <Warning> Warnings = null,
                                              TimeSpan?Runtime = null)
        {
            this.Id = Id;

            this.ISendData = ISendData;

            this.Result = Result;

            this.RejectedEVSEs = RejectedEVSEs ?? new PushSingleChargingStationDataResult[0];

            this.Description = Description.IsNotNullOrEmpty()
                                      ? Description.Trim()
                                      : null;

            this.Warnings = Warnings != null
                                      ? Warnings.Where(warning => warning.IsNotNullOrEmpty())
                                      : new Warning[0];

            this.Runtime = Runtime;
        }
        //根据命令 获得对应的通讯数据
        public byte[] GetSerialSendData(byte comd)    //要点1
        {
            SendDataType sendDataType = (SendDataType)(comd);

            byte[]      serialDatas  = null;
            ISendData   getSendDatas = null;
            DataInfoSet dataInfoSet  = null;

            String[] dataBaseValues = null;
            switch (sendDataType)
            {
            case SendDataType.NormalSerialData:    //0x20
                serialDatas = GetNormalDatas();    //
                break;

            case SendDataType.DesignParam:    //0x21指令
                serialDatas = GetDesignParam();
                break;

            case SendDataType.TestSerialData:    //0x23
                serialDatas = GetTestDatas();
                break;

            case SendDataType.ClearComdSerailData:    //0x24
                serialDatas = GetClearWorkNumberDatas();
                break;

            case SendDataType.MachineSerialData:    //0x25
                getSendDatas   = new MachineInfoSendData();
                dataInfoSet    = MouldDataFactory.CreateDataInfo(DataTypeName.BaseDataTable);
                dataBaseValues = BaseDateModel.GetDataBaseModel().DataBaseValues;
                break;

            case SendDataType.ShouldPadPointsData:    //0x27
                serialDatas = GetShouldPadPoints();
                break;

            case SendDataType.SingleStepSerialData:    //0x28
                serialDatas = GetSingleStepDatas();
                break;

            case SendDataType.LockStaSerialData:    //0X29
                serialDatas = GetLockStaSerialDatas();
                break;

            case SendDataType.UnLockSerialData:    //0x2a
                serialDatas = GetUnLockSerialData();
                break;
            }
            if (getSendDatas != null)
            {
                serialDatas = getSendDatas.GetSendDatas(dataBaseValues, dataInfoSet);
            }
            return(serialDatas);
        }
예제 #3
0
        NoOperation(IId AuthId,
                    ISendData ISendData,
                    String Description             = null,
                    IEnumerable <Warning> Warnings = null,
                    TimeSpan?Runtime = null)

        => new PushChargingStationDataResult(AuthId,
                                             ISendData,
                                             PushDataResultTypes.NoOperation,
                                             new PushSingleChargingStationDataResult[0],
                                             Description,
                                             Warnings,
                                             Runtime);
예제 #4
0
        NoOperation(IId AuthId,
                    ISendData ISendData,
                    String Description             = null,
                    IEnumerable <Warning> Warnings = null,
                    TimeSpan?Runtime = null)

        => new PushEVSEDataResult(AuthId,
                                  ISendData,
                                  PushDataResultTypes.NoOperation,
                                  Description,
                                  new EVSE[0],
                                  Warnings,
                                  Runtime);
 public SelectLevelWindow(int levelCompleted, ISendData mainWindow)
 {
     InitializeComponent();
     foreach (object btn in selectLevelGrid.Children)
     {
         if (btn is Button)
         {
             _buttonList.Add(int.Parse((btn as Button).Content.ToString()), btn as Button);
         }
     }
     SetButtonEnability(levelCompleted + 1);
     _mainWindow = mainWindow;
 }
예제 #6
0
        Error(IId AuthId,
              ISendData ISendData,
              IEnumerable <PushSingleChargingStationDataResult> RejectedEVSEs = null,
              String Description             = null,
              IEnumerable <Warning> Warnings = null,
              TimeSpan?Runtime = null)

        => new PushChargingStationDataResult(AuthId,
                                             ISendData,
                                             PushDataResultTypes.Error,
                                             RejectedEVSEs,
                                             Description,
                                             Warnings,
                                             Runtime);
예제 #7
0
        Error(IId AuthId,
              ISendData ISendData,
              IEnumerable <EVSE> RejectedEVSEs = null,
              String Description             = null,
              IEnumerable <Warning> Warnings = null,
              TimeSpan?Runtime = null)

        => new PushEVSEDataResult(AuthId,
                                  ISendData,
                                  PushDataResultTypes.Error,
                                  Description,
                                  RejectedEVSEs,
                                  Warnings,
                                  Runtime);
예제 #8
0
        /// <summary>
        /// Create a new PushEVSEData result.
        /// </summary>
        /// <param name="AuthId">The unqiue identification of the authenticator.</param>
        /// <param name="ISendData">An object implementing ISendData.</param>
        /// <param name="Result">The result of the operation.</param>
        /// <param name="Description">An optional description of the result code.</param>
        /// <param name="RejectedEVSEs">An enumeration of rejected EVSEs.</param>
        /// <param name="Warnings">Warnings or additional information.</param>
        /// <param name="Runtime">The runtime of the request.</param>
        internal PushEVSEDataResult(IId AuthId,
                                    ISendData ISendData,
                                    PushDataResultTypes Result,
                                    String Description = null,
                                    IEnumerable <EVSE> RejectedEVSEs = null,
                                    IEnumerable <Warning> Warnings   = null,
                                    TimeSpan?Runtime = null)

            : this(AuthId,
                   Result,
                   Description,
                   RejectedEVSEs,
                   Warnings,
                   Runtime)

        {
            this.ISendData = ISendData;
        }
예제 #9
0
        AddStaticData(ISendData Sender,
                      EVSE EVSE,

                      DateTime?Timestamp,
                      CancellationToken?CancellationToken,
                      EventTracking_Id EventTrackingId,
                      TimeSpan?RequestTimeout)

        {
            #region Initial checks

            if (EVSE == null)
            {
                return(PushEVSEDataResult.NoOperation(Id,
                                                      Sender));
            }

            if (DisablePushData)
            {
                return(PushEVSEDataResult.AdminDown(Id,
                                                    Sender,
                                                    new EVSE[] { EVSE }));
            }

            #endregion

            #region Send OnEnqueueSendCDRRequest event

            //try
            //{

            //    OnEnqueueSendCDRRequest?.Invoke(StartTime,
            //                                    Timestamp.Value,
            //                                    this,
            //                                    EventTrackingId,
            //                                    RoamingNetwork.Id,
            //                                    ChargeDetailRecord,
            //                                    RequestTimeout);

            //}
            //catch (Exception e)
            //{
            //    e.Log(nameof(WWCPCPOAdapter) + "." + nameof(OnSendCDRRequest));
            //}

            #endregion

            await DataAndStatusLock.WaitAsync();

            try
            {
                if (_IncludeEVSEs == null ||
                    (_IncludeEVSEs != null && _IncludeEVSEs(EVSE)))
                {
                    EVSEsToAddQueue.Add(EVSE);

                    FlushEVSEDataAndStatusTimer.Change(FlushEVSEDataAndStatusEvery, TimeSpan.FromMilliseconds(-1));
                }
            }
            finally
            {
                DataAndStatusLock.Release();
            }

            return(PushEVSEDataResult.Enqueued(Id, Sender));
        }
예제 #10
0
        /// <summary>
        /// Create a new WWCP wrapper for the OICP roaming client for Charging Station Operators/CPOs.
        /// </summary>
        /// <param name="Id">The unique identification of the roaming provider.</param>
        /// <param name="Name">The offical (multi-language) name of the roaming provider.</param>
        /// <param name="Description">An optional (multi-language) description of the charging station operator roaming provider.</param>
        /// <param name="RoamingNetwork">A WWCP roaming network.</param>
        ///
        /// <param name="IncludeEVSEIds">Only include the EVSE matching the given delegate.</param>
        /// <param name="IncludeEVSEs">Only include the EVSEs matching the given delegate.</param>
        ///
        /// <param name="FlushEVSEDataAndStatusEvery">The service check intervall.</param>
        /// <param name="FlushEVSEFastStatusEvery">The status check intervall.</param>
        /// <param name="FlushChargeDetailRecordsEvery">The charge detail record intervall.</param>
        ///
        /// <param name="DisablePushData">This service can be disabled, e.g. for debugging reasons.</param>
        /// <param name="DisablePushStatus">This service can be disabled, e.g. for debugging reasons.</param>
        /// <param name="DisableAuthentication">This service can be disabled, e.g. for debugging reasons.</param>
        /// <param name="DisableSendChargeDetailRecords">This service can be disabled, e.g. for debugging reasons.</param>
        ///
        /// <param name="DNSClient">The attached DNS service.</param>
        protected AWWCPCSOAdapter(CSORoamingProvider_Id Id,
                                  I18NString Name,
                                  I18NString Description,
                                  RoamingNetwork RoamingNetwork,

                                  IncludeEVSEIdDelegate IncludeEVSEIds = null,
                                  IncludeEVSEDelegate IncludeEVSEs     = null,

                                  TimeSpan?FlushEVSEDataAndStatusEvery   = null,
                                  TimeSpan?FlushEVSEFastStatusEvery      = null,
                                  TimeSpan?FlushChargeDetailRecordsEvery = null,

                                  Boolean DisablePushData                = false,
                                  Boolean DisablePushStatus              = false,
                                  Boolean DisableAuthentication          = false,
                                  Boolean DisableSendChargeDetailRecords = false,

                                  String EllipticCurve = "P-256",
                                  ECPrivateKeyParameters PrivateKey           = null,
                                  PublicKeyCertificates PublicKeyCertificates = null,

                                  DNSClient DNSClient = null)

            : base(Id,
                   RoamingNetwork,
                   EllipticCurve,
                   PrivateKey,
                   PublicKeyCertificates)

        {
            this.Name        = Name;
            this.Description = Description;

            this._ISendData   = this as ISendData;
            this._ISendStatus = this as ISendStatus;

            this._IncludeEVSEIds = IncludeEVSEIds ?? (evseid => true);
            this._IncludeEVSEs   = IncludeEVSEs ?? (evse => true);

            this.DisablePushData                = DisablePushData;
            this.DisablePushStatus              = DisablePushStatus;
            this.DisableAuthentication          = DisableAuthentication;
            this.DisableSendChargeDetailRecords = DisableSendChargeDetailRecords;

            this.FlushEVSEDataAndStatusEvery   = FlushEVSEDataAndStatusEvery ?? DefaultFlushEVSEDataAndStatusEvery;
            this.FlushEVSEFastStatusEvery      = FlushEVSEFastStatusEvery ?? DefaultFlushEVSEFastStatusEvery;
            this.FlushChargeDetailRecordsEvery = FlushChargeDetailRecordsEvery ?? DefaultFlushChargeDetailRecordsEvery;

            this.FlushEVSEDataAndStatusTimer   = new Timer(FlushEVSEDataAndStatus);
            this.FlushEVSEFastStatusTimer      = new Timer(FlushEVSEFastStatus);
            this.FlushChargeDetailRecordsTimer = new Timer(FlushChargeDetailRecords);

            this.EVSEsUpdateLog            = new Dictionary <EVSE, List <PropertyUpdateInfos> >();
            this.ChargingStationsUpdateLog = new Dictionary <ChargingStation, List <PropertyUpdateInfos> >();
            this.ChargingPoolsUpdateLog    = new Dictionary <ChargingPool, List <PropertyUpdateInfos> >();

            this.DNSClient = DNSClient;

            this.EVSEsToAddQueue    = new HashSet <EVSE>();
            this.EVSEsToUpdateQueue = new HashSet <EVSE>();
            this.EVSEsToRemoveQueue = new HashSet <EVSE>();
            this.EVSEAdminStatusChangesFastQueue    = new List <EVSEAdminStatusUpdate>();
            this.EVSEAdminStatusChangesDelayedQueue = new List <EVSEAdminStatusUpdate>();
            this.EVSEStatusChangesFastQueue         = new List <EVSEStatusUpdate>();
            this.EVSEStatusChangesDelayedQueue      = new List <EVSEStatusUpdate>();
        }
예제 #11
0
 public Switch(ISendDataEmail email, ISendDataTelegram telegram, ISendDataAmo amo)
 {
     _email    = email;
     _telegram = telegram;
     _amo      = amo;
 }
예제 #12
0
        ISendData sendData;                                                                 //interfaccia per inviare i contatti scelti

        //Costruttore
        public ListCreationPage(List <String> nomi, ISendData sendData)
        {
            InitializeComponent();
            this.nomi     = nomi;
            this.sendData = sendData;
        }