예제 #1
0
 public void AddDatum(string name)
 {
     DeviceDatum datum = new DeviceDatum(name);
     data[name] = datum;
     adapter.addDatum(datum);
     datum.setValue("UNAVAILABLE");
 }
예제 #2
0
 /* Send a single value to the buffer. */
 void sendDatum(DeviceDatum aValue)
 {
     if (aValue.requiresFlush())
     {
         sendBuffer();
     }
     aValue.append(ref mBuffer);
     if (aValue.requiresFlush())
     {
         sendBuffer();
     }
 }
예제 #3
0
 public virtual void sendChangedData()
 {
     for (int i = 0; i < mDeviceData.Count; i++)
     {
         DeviceDatum value = mDeviceData[i];
         if (value.changed())
         {
             sendDatum(value);
         }
     }
     sendBuffer();
 }
예제 #4
0
        /* 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);
            }
        }
예제 #5
0
 /* Add a data value to the list of data values */
 public void addDatum(DeviceDatum aValue )
 {
     mDeviceData.Add(aValue);
 }
예제 #6
0
 /* Send a single value to the buffer. */
 void sendDatum(DeviceDatum aValue)
 {
     if (aValue.requiresFlush())
         sendBuffer();
     aValue.append(ref mBuffer);
     if (aValue.requiresFlush())
         sendBuffer();
 }
예제 #7
0
 /* Add a data value to the list of data values */
 public void addDatum(DeviceDatum aValue)
 {
     mDeviceData.Add(aValue);
 }