public void AddDatum(string name) { DeviceDatum datum = new DeviceDatum(name); data[name] = datum; adapter.addDatum(datum); datum.setValue("UNAVAILABLE"); }
/* Send a single value to the buffer. */ void sendDatum(DeviceDatum aValue) { if (aValue.requiresFlush()) { sendBuffer(); } aValue.append(ref mBuffer); if (aValue.requiresFlush()) { sendBuffer(); } }
public virtual void sendChangedData() { for (int i = 0; i < mDeviceData.Count; i++) { DeviceDatum value = mDeviceData[i]; if (value.changed()) { sendDatum(value); } } sendBuffer(); }
/* Send the initial values to a client */ public void sendInitialData(Client aClient) { string buffer = String.Empty; gatherDeviceData(); for (int i = 0; i < mDeviceData.Count; i++) { DeviceDatum value = mDeviceData[i]; if (value.hasInitialValue()) { value.append(ref buffer); } } if (mBuffer.Count() > 0) { buffer = Utils.GetNowDateTime() + " " + mBuffer + "\n"; Logger.LogMessage(buffer, 3); mServer.sendToClient(aClient, buffer); } }
/* Add a data value to the list of data values */ public void addDatum(DeviceDatum aValue ) { mDeviceData.Add(aValue); }
/* Send a single value to the buffer. */ void sendDatum(DeviceDatum aValue) { if (aValue.requiresFlush()) sendBuffer(); aValue.append(ref mBuffer); if (aValue.requiresFlush()) sendBuffer(); }
/* Add a data value to the list of data values */ public void addDatum(DeviceDatum aValue) { mDeviceData.Add(aValue); }