Exemplo n.º 1
0
        /// <summary>
        /// Return a string representation of the given firmware status.
        /// </summary>
        /// <param name="FirmwareStatus">A firmware status.</param>
        public static String AsText(this FirmwareStatus FirmwareStatus)
        {
            switch (FirmwareStatus)
            {
            case FirmwareStatus.Downloaded:
                return("Downloaded");

            case FirmwareStatus.DownloadFailed:
                return("DownloadFailed");

            case FirmwareStatus.Downloading:
                return("Downloading");

            case FirmwareStatus.Idle:
                return("Idle");

            case FirmwareStatus.InstallationFailed:
                return("InstallationFailed");

            case FirmwareStatus.Installed:
                return("Installed");

            case FirmwareStatus.Installing:
                return("Installing");


            default:
                return("unknown");
            }
        }
 public static XElement FirmwareStatusNotificationRequestXML(String ChargeBoxIdentity,
                                                             FirmwareStatus Status)
 {
     return(SOAP.Encapsulation(SOAPHeaders: new XElement[] { new XElement(OCPPNS.OCPPv1_5_CS + "chargeBoxIdentity", ChargeBoxIdentity) },
                               SOAPBody:   new XElement(OCPPNS.OCPPv1_5_CS + "firmwareStatusNotificationRequest",
                                                        new XElement(OCPPNS.OCPPv1_5_CS + "status", Status)
                                                        )));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (Label != null)
         {
             hashCode = hashCode * 59 + Label.GetHashCode();
         }
         if (BridgeUID != null)
         {
             hashCode = hashCode * 59 + BridgeUID.GetHashCode();
         }
         if (Configuration != null)
         {
             hashCode = hashCode * 59 + Configuration.GetHashCode();
         }
         if (Properties != null)
         {
             hashCode = hashCode * 59 + Properties.GetHashCode();
         }
         if (UID != null)
         {
             hashCode = hashCode * 59 + UID.GetHashCode();
         }
         if (ThingTypeUID != null)
         {
             hashCode = hashCode * 59 + ThingTypeUID.GetHashCode();
         }
         if (Channels != null)
         {
             hashCode = hashCode * 59 + Channels.GetHashCode();
         }
         if (Location != null)
         {
             hashCode = hashCode * 59 + Location.GetHashCode();
         }
         if (StatusInfo != null)
         {
             hashCode = hashCode * 59 + StatusInfo.GetHashCode();
         }
         if (FirmwareStatus != null)
         {
             hashCode = hashCode * 59 + FirmwareStatus.GetHashCode();
         }
         if (Editable != null)
         {
             hashCode = hashCode * 59 + Editable.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// Create a new FirmwareStatusNotification request.
        /// </summary>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="Status">The status of the diagnostics upload.</param>
        ///
        /// <param name="RequestId">An optional request identification.</param>
        /// <param name="RequestTimestamp">An optional request timestamp.</param>
        public FirmwareStatusNotificationRequest(ChargeBox_Id ChargeBoxId,
                                                 FirmwareStatus Status,

                                                 Request_Id?RequestId      = null,
                                                 DateTime?RequestTimestamp = null)

            : base(ChargeBoxId,
                   "FirmwareStatusNotification",
                   RequestId,
                   RequestTimestamp)

        {
            this.Status = Status;
        }
Exemplo n.º 5
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Label != null?Label.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (BridgeUid != null ? BridgeUid.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Configuration != null ? Configuration.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Properties != null ? Properties.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Uid != null ? Uid.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (ThingTypeUid != null ? ThingTypeUid.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Channels != null ? Channels.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Location != null ? Location.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (StatusInfo != null ? StatusInfo.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (FirmwareStatus != null ? FirmwareStatus.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ Editable.GetHashCode();
                return(hashCode);
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Returns true if EnrichedThingDTO instances are equal
        /// </summary>
        /// <param name="input">Instance of EnrichedThingDTO to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(EnrichedThingDTO input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Label == input.Label ||
                     (Label != null &&
                      Label.Equals(input.Label))
                     ) &&
                 (
                     BridgeUID == input.BridgeUID ||
                     (BridgeUID != null &&
                      BridgeUID.Equals(input.BridgeUID))
                 ) &&
                 (
                     Configuration == input.Configuration ||
                     Configuration != null &&
                     Configuration.SequenceEqual(input.Configuration)
                 ) &&
                 (
                     Properties == input.Properties ||
                     Properties != null &&
                     Properties.SequenceEqual(input.Properties)
                 ) &&
                 (
                     UID == input.UID ||
                     (UID != null &&
                      UID.Equals(input.UID))
                 ) &&
                 (
                     ThingTypeUID == input.ThingTypeUID ||
                     (ThingTypeUID != null &&
                      ThingTypeUID.Equals(input.ThingTypeUID))
                 ) &&
                 (
                     Channels == input.Channels ||
                     Channels != null &&
                     Channels.SequenceEqual(input.Channels)
                 ) &&
                 (
                     Location == input.Location ||
                     (Location != null &&
                      Location.Equals(input.Location))
                 ) &&
                 (
                     StatusInfo == input.StatusInfo ||
                     (StatusInfo != null &&
                      StatusInfo.Equals(input.StatusInfo))
                 ) &&
                 (
                     FirmwareStatus == input.FirmwareStatus ||
                     (FirmwareStatus != null &&
                      FirmwareStatus.Equals(input.FirmwareStatus))
                 ) &&
                 (
                     Editable == input.Editable ||
                     (Editable != null &&
                      Editable.Equals(input.Editable))
                 ));
        }
        void ReleaseDesignerOutlets()
        {
            if (NetworkUpdateButton != null)
            {
                NetworkUpdateButton.Dispose();
                NetworkUpdateButton = null;
            }

            if (Authentication != null)
            {
                Authentication.Dispose();
                Authentication = null;
            }

            if (BootFileLabel != null)
            {
                BootFileLabel.Dispose();
                BootFileLabel = null;
            }

            if (ConfigFileLabel != null)
            {
                ConfigFileLabel.Dispose();
                ConfigFileLabel = null;
            }

            if (DefaultGateway != null)
            {
                DefaultGateway.Dispose();
                DefaultGateway = null;
            }

            if (DeployButton != null)
            {
                DeployButton.Dispose();
                DeployButton = null;
            }

            if (DeviceType != null)
            {
                DeviceType.Dispose();
                DeviceType = null;
            }

            if (EnableDHCP != null)
            {
                EnableDHCP.Dispose();
                EnableDHCP = null;
            }

            if (EncryptConfig != null)
            {
                EncryptConfig.Dispose();
                EncryptConfig = null;
            }

            if (Encryption != null)
            {
                Encryption.Dispose();
                Encryption = null;
            }

            if (FirmwareStatus != null)
            {
                FirmwareStatus.Dispose();
                FirmwareStatus = null;
            }

            if (FlashFileLabel != null)
            {
                FlashFileLabel.Dispose();
                FlashFileLabel = null;
            }

            if (FreeSlots != null)
            {
                FreeSlots.Dispose();
                FreeSlots = null;
            }

            if (MacAddress != null)
            {
                MacAddress.Dispose();
                MacAddress = null;
            }

            if (NetworkKey != null)
            {
                NetworkKey.Dispose();
                NetworkKey = null;
            }

            if (NetworkMacAddress != null)
            {
                NetworkMacAddress.Dispose();
                NetworkMacAddress = null;
            }

            if (NetworkValue != null)
            {
                NetworkValue.Dispose();
                NetworkValue = null;
            }

            if (Output != null)
            {
                Output.Dispose();
                Output = null;
            }

            if (Passphrase != null)
            {
                Passphrase.Dispose();
                Passphrase = null;
            }

            if (PrimaryDNS != null)
            {
                PrimaryDNS.Dispose();
                PrimaryDNS = null;
            }

            if (RadioA != null)
            {
                RadioA.Dispose();
                RadioA = null;
            }

            if (RadioB != null)
            {
                RadioB.Dispose();
                RadioB = null;
            }

            if (RadioG != null)
            {
                RadioG.Dispose();
                RadioG = null;
            }

            if (RadioN != null)
            {
                RadioN.Dispose();
                RadioN = null;
            }

            if (ReKeyInternal != null)
            {
                ReKeyInternal.Dispose();
                ReKeyInternal = null;
            }

            if (SaveConfigurationButton != null)
            {
                SaveConfigurationButton.Dispose();
                SaveConfigurationButton = null;
            }

            if (SecondaryDNS != null)
            {
                SecondaryDNS.Dispose();
                SecondaryDNS = null;
            }

            if (SSID != null)
            {
                SSID.Dispose();
                SSID = null;
            }

            if (StaticIPAddress != null)
            {
                StaticIPAddress.Dispose();
                StaticIPAddress = null;
            }

            if (SubnetMask != null)
            {
                SubnetMask.Dispose();
                SubnetMask = null;
            }

            if (UpdateFirmwareButton != null)
            {
                UpdateFirmwareButton.Dispose();
                UpdateFirmwareButton = null;
            }
        }
Exemplo n.º 8
0
 /// <summary>
 /// Create a firmware status notification request.
 /// </summary>
 /// <param name="Status">The status of the diagnostics upload.</param>
 public FirmwareStatusNotificationRequest(FirmwareStatus Status)
 {
     this.Status = Status;
 }
Exemplo n.º 9
0
 /// <remarks/>
 public void FirmwareStatusNotificationAsync(FirmwareStatus status, object userState)
 {
     if ((this.FirmwareStatusNotificationOperationCompleted == null)) {
         this.FirmwareStatusNotificationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnFirmwareStatusNotificationOperationCompleted);
     }
     this.InvokeAsync("FirmwareStatusNotification", new object[] {
                 status}, this.FirmwareStatusNotificationOperationCompleted, userState);
 }
Exemplo n.º 10
0
 /// <remarks/>
 public void FirmwareStatusNotificationAsync(FirmwareStatus status)
 {
     this.FirmwareStatusNotificationAsync(status, null);
 }
Exemplo n.º 11
0
 public void FirmwareStatusNotification(FirmwareStatus status)
 {
     this.Invoke("FirmwareStatusNotification", new object[] {
                 status});
 }
Exemplo n.º 12
0
 /// <remarks/>
 public System.IAsyncResult BeginFirmwareStatusNotification(FirmwareStatus status, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("FirmwareStatusNotification", new object[] {
                 status}, callback, asyncState);
 }