當前位置: 首頁>>代碼示例>>Java>>正文


Java Diagnostic類代碼示例

本文整理匯總了Java中org.opengts.db.dmtp.Diagnostic的典型用法代碼示例。如果您正苦於以下問題:Java Diagnostic類的具體用法?Java Diagnostic怎麽用?Java Diagnostic使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Diagnostic類屬於org.opengts.db.dmtp包,在下文中一共展示了Diagnostic類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getBodyDataIterator

import org.opengts.db.dmtp.Diagnostic; //導入依賴的package包/類
/**
*** Creates and returns an iterator for the row data displayed in the body of this report.
*** @return The body row data iterator
**/
public DBDataIterator getBodyDataIterator()
{
    
    /* init */
    this.rowData = new Vector<FieldData>();
    
    /* loop through properties */
    String accountID = this.getAccountID();
    String deviceID  = this.getFirstDeviceID();
    long   timeStart = this.getTimeStart();
    long   timeEnd   = this.getTimeEnd();
    try {
        Account account = this.getAccount();
        Device  device  = this.getDevice(deviceID);
        if ((account != null) && (device != null)) {
            TimeZone tz = account.getTimeZone(null);
            Diagnostic diags[] = Diagnostic.getDiagnostics(accountID, deviceID, timeStart, timeEnd);
            if (diags != null) {
                for (int i = 0; i < diags.length; i++) {
                    diags[i].setDevice(device);
                    FieldData fd = new FieldData();
                    fd.setDevice(device);
                    fd.setString( FieldLayout.DATA_DEVICE_ID       , deviceID);
                    fd.setLong(   FieldLayout.DATA_TIMESTAMP       , diags[i].getTimestamp());
                    fd.setBoolean(FieldLayout.DATA_DIAGNOSTIC_ERROR, diags[i].isError());
                    fd.setLong(   FieldLayout.DATA_DIAGNOSTIC_KEY  , (long)diags[i].getCodeKey());
                    fd.setString( FieldLayout.DATA_DIAGNOSTIC_DESC , diags[i].getDescription());
                    fd.setString( FieldLayout.DATA_DIAGNOSTIC_VALUE, diags[i].getValueAsString(tz));
                    this.rowData.add(fd);
                }
            }
        } else {
            // should never occur
            Print.logError("Returned DeviceList 'Device' is null: " + deviceID);
        }
    } catch (DBException dbe) {
        Print.logError("Error retrieving Device: " + deviceID);
    }

    /* return data iterator */
    return new ListDataIterator(this.rowData);
    
}
 
開發者ID:Jebasuthan,項目名稱:vehiclegps,代碼行數:48,代碼來源:DiagnosticReport.java


注:本文中的org.opengts.db.dmtp.Diagnostic類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。