示例#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);
 }