コード例 #1
0
	/**
	 * Set the object's metadata
	 */

	public override void setMetadata(Metadata mdata)
	{
	    if ( mobj != null )
	    {
	        mobj.setData(mdata);
	    }
	}
コード例 #2
0
		/**
		 * Create a Metadata object filled with default values for this object
		 * @return Metadata object with default values
		 */
		public override Metadata getDefaultMetadata() {
			Metadata metadata = new Metadata();
    		metadata.flags =
				(int)AccessMode.ACCESS_READWRITE << Metadata.UAVOBJ_ACCESS_SHIFT |
				(int)AccessMode.ACCESS_READWRITE << Metadata.UAVOBJ_GCS_ACCESS_SHIFT |
				0 << Metadata.UAVOBJ_TELEMETRY_ACKED_SHIFT |
				0 << Metadata.UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
				(int)UPDATEMODE.UPDATEMODE_ONCHANGE << Metadata.UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
				(int)UPDATEMODE.UPDATEMODE_MANUAL << Metadata.UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT;
    		metadata.flightTelemetryUpdatePeriod = 0;
    		metadata.gcsTelemetryUpdatePeriod = 0;
    		metadata.loggingUpdatePeriod = 1000;
 
			return metadata;
		}
コード例 #3
0
        public UAVMetaObject(long objID, String name, UAVDataObject parent) : base(objID, true, name) {
		    this.parent = parent;

		    ownMetadata = new Metadata();

		    ownMetadata.flags = 0; // TODO: Fix flags
		    ownMetadata.gcsTelemetryUpdatePeriod = 0;
		    ownMetadata.loggingUpdatePeriod = 0;


		    List<String> modesBitField = new List<String>();
		    modesBitField.Add("FlightReadOnly");
		    modesBitField.Add("GCSReadOnly");
		    modesBitField.Add("FlightTelemetryAcked");
		    modesBitField.Add("GCSTelemetryAcked");
		    modesBitField.Add("FlightUpdatePeriodic");
		    modesBitField.Add("FlightUpdateOnChange");
		    modesBitField.Add("GCSUpdatePeriodic");
		    modesBitField.Add("GCSUpdateOnChange");

            List<UAVObjectField> fields = new List<UAVObjectField>();
		    fields.Add( new UAVObjectField<bool>("Modes", "", 1, modesBitField, parent) );
            fields.Add(new UAVObjectField<UInt16>("Flight Telemetry Update Period", "ms", 1, null, parent));
            fields.Add(new UAVObjectField<UInt16>("GCS Telemetry Update Period", "ms", 1, null, parent));
            fields.Add(new UAVObjectField<UInt16>("Logging Update Period", "ms", 1, null, parent));

		    int numBytes = fields.Sum(j=>j.getNumBytes());
		    
		    // Initialize object

		    // Initialize parent
		    base.initialize(0);
		    initializeFields(fields, new ByteBuffer(numBytes), numBytes);

		    // Setup metadata of parent
		    parentMetadata = parent.getDefaultMetadata();
	    }
コード例 #4
0
 /**
  * Set the UAVObject metadata GCS access member
  * \param[in] mode The access mode
  */
 public void SetGcsAccess(Metadata metadata, AccessMode mode)
 {
     // Need to convert java enums which have no numeric value to bits
     SET_BITS(UAVOBJ_GCS_ACCESS_SHIFT, AccessModeNum(mode), 1);
 }
コード例 #5
0
	/**
	 * Abstract functions
	 */
	public abstract void setMetadata(Metadata mdata);
コード例 #6
0
	    /**
	     * Set the metadata held by the metaobject
	     */
	    public void setData(Metadata mdata)
	    {
		    //QMutexLocker locker(mutex);
		    parentMetadata = mdata;
		    // TODO: Callbacks
		    //	    emit objectUpdatedAuto(this); // trigger object updated event
		    //	    emit objectUpdated(this);
	    }
コード例 #7
0
	    /**
	     * Set the metadata of the metaobject, this function will
	     * do nothing since metaobjects have read-only metadata.
	     */
	    public override void setMetadata(Metadata mdata)
	    {
		    return; // can not update metaobject's metadata
	    }