public void setValues(bool enableAssoc, System.DateTime dateTime, int productID, NewWDS.Demo_applications.ShelfLabelDemo.DateMode dateMode, double price, NewWDS.Demo_applications.ShelfLabelDemo.Currency currency, NewWDS.Demo_applications.ShelfLabelDemo.DisplayMode displayMode, bool identifyTag) { lock (this._lockObj) { this._enableAssoc = enableAssoc; this._dateTime = dateTime; this._productID = productID; if (this._dateMode != dateMode) { this._dateModeChanged = true; } this._dateMode = dateMode; this._price = price; this._currency = currency; if (this._displayMode != displayMode) { this._displayModeChanged = true; } this._displayMode = displayMode; this._identifyTag = identifyTag; } }
private void initValues() { lock (this._lockObj) { this._displayModeChanged = false; this._dateModeChanged = false; this._enableAssoc = true; this._dateTime = System.DateTime.Now; this._productID = 0x1b198 + this._nodeId; this._dateMode = NewWDS.Demo_applications.ShelfLabelDemo.DateMode.Date; this._price = 479.95; this._currency = NewWDS.Demo_applications.ShelfLabelDemo.Currency.Dollar; this._displayMode = NewWDS.Demo_applications.ShelfLabelDemo.DisplayMode.Price; this._identifyTag = false; this._receivedDateTime = this._dateTime; this._receivedProductID = this._productID; this._receivedDateMode = this._dateMode; this._receivedPrice = this._price; this._receivedCurrency = this._currency; this._receivedDisplayMode = this._displayMode; this._receivedSlotState = 10; this._receivedRssi = 0; this._receivedBatteryVoltage = 0.0; this._receivedHumidity = 0.0; this._receivedTemperature = 0.0; } }
public void processReplyPayload(byte[] replyPayload, int replyPayloadLength) { lock (this._lockObj) { if (replyPayloadLength < 0x16) { _log.Error("SLD_DataStructures: replyLength=" + replyPayloadLength.ToString() + " too short"); } else if (replyPayload[0] != this._nodeId) { _log.Error("SLD_DataStructures: node data missmatch!"); } else { this._receivedDateTime = new System.DateTime(0x7d0 + replyPayload[1], replyPayload[2], replyPayload[3]); this._receivedDateTime = this._receivedDateTime.AddHours((double) replyPayload[4]); this._receivedDateTime = this._receivedDateTime.AddMinutes((double) replyPayload[5]); this._receivedDateTime = this._receivedDateTime.AddSeconds((double) replyPayload[6]); this._receivedProductID = ((0x10000 * replyPayload[7]) + (0x100 * replyPayload[8])) + replyPayload[9]; this._receivedDateMode = (NewWDS.Demo_applications.ShelfLabelDemo.DateMode) replyPayload[10]; if ((this._receivedDateMode == this._dateMode) && this._dateModeChanged) { this._dateModeChanged = false; } if ((this._receivedDateMode != this._dateMode) && !this._dateModeChanged) { this._dateMode = this._receivedDateMode; } this._receivedPrice = ((double) (((0x10000 * replyPayload[11]) + (0x100 * replyPayload[12])) + replyPayload[13])) / 100.0; this._receivedCurrency = (NewWDS.Demo_applications.ShelfLabelDemo.Currency) replyPayload[14]; this._receivedDisplayMode = (NewWDS.Demo_applications.ShelfLabelDemo.DisplayMode) replyPayload[15]; if ((this._receivedDisplayMode == this._displayMode) && this._displayModeChanged) { this._displayModeChanged = false; } if ((this._receivedDisplayMode != this._displayMode) && !this._displayModeChanged) { this._displayMode = this._receivedDisplayMode; } this._receivedSlotState = replyPayload[0x10]; this._receivedRssi = replyPayload[0x11]; this._receivedBatteryVoltage = ((double) (replyPayload[0x12] * 480)) / 25600.0; this._receivedHumidity = replyPayload[0x13]; this._receivedTemperature = (((double) (((replyPayload[20] * 0x100) + replyPayload[0x15]) - 0x8e1)) / 4.0) + 25.0; } } }