public void readNodeKeys(int[] value) { // setContentView(R.layout.Rz_nodes); TabHost node_host = (TabHost) findViewById(R.id.tabhost); node_host.setup(); TabSpec nodeTab = node_host.newTabSpec("node_tabs"); nodeTab.setIndicator(getResources().getString(R.string.node_information), getResources().getDrawable(android.R.drawable.star_on)); nodeTab.setContent(R.id.node_ScrollView2); node_host.addTab(nodeTab); node_host.setCurrentTabByTag("node_tabs"); TableLayout list_table = (TableLayout) findViewById(R.id.node_TableLayout2); initializeHeaderRow(list_table); try { processList(list_table, value); } catch (Exception e) { Log.e(DEBUG_TAG, "Failed to load list status data", e); } } public void initializeHeaderRow(TableLayout statusTable) { // Create the Table header row TableRow headerRow = new TableRow(this); int textColor = getResources().getColor(R.color.Rz_logo_color); float textSize = getResources().getDimension(R.dimen.Rz_nodelist_text_size_6); addTextToRowWithValues(headerRow, getResources().getString(R.string.Rz_nodelist_node), textColor, textSize); addTextToRowWithValues(headerRow, getResources().getString(R.string.Rz_nodelist_data_index), textColor, textSize); addTextToRowWithValues(headerRow, getResources().getString(R.string.Rz_nodelist_zone_A), textColor, textSize); addTextToRowWithValues(headerRow, getResources().getString(R.string.Rz_nodelist_zone_B), textColor, textSize); addTextToRowWithValues(headerRow, getResources().getString(R.string.Rz_nodelist_zone_C), textColor, textSize); addTextToRowWithValues(headerRow, getResources().getString(R.string.Rz_nodelist_module_type), textColor, textSize); statusTable.addView(headerRow); } public void addTextToRowWithValues(final TableRow tableRow, String text, int textColor, float textSize) { Rz_Node_Key_Values RNKV = new Rz_Node_Key_Values(); TextView textView = new TextView(this); textView.setTextSize(textSize); textView.setTextColor(textColor); textView.setText(text); tableRow.setId(RNKV.Node_add); tableRow.setClickable(true); tableRow.setOnClickListener(tableRowOnClickListener); tableRow.addView(textView); } public OnClickListener tableRowOnClickListener = new OnClickListener () { public void onClick(View v) { status(v); } }; public void status(View v) { int index; mRz_Node_Number = mRzPrefs.getString(Rz_PREFERENCES_NODE, ""); index = Integer.valueOf(mRz_Node_Number, 16); mProgressCounter = 0; index = v.getId(); Editor editor = mRzPrefs.edit(); editor.putString(Rz_PREFERENCES_NODE, Integer.toHexString(index)); editor.commit(); mProgressCounter++; myInt[4] = 0x0C; myInt[13] = index >>> 8 ; myInt[12] = index - (myInt[13] * 256); myInt[9] = 0x02 ; Rz_Configuration_Activity.this .setProgressBarIndeterminateVisibility(true); configDownloader = new ConfigDownloaderTask(); configDownloader.execute(); } public void processList(final TableLayout statusTable, int[] value) throws IOException { int counter = 0; for (counter = 0; counter < mRz_Node_Count; counter++) { Rz_Node_Key_Values RNKV = new Rz_Node_Key_Values(); offset = 0x10; while (value[(counter * offset)+18] != 0xff) { int eventType = -1; boolean bFoundScores = false; // Find list nodelist[counter][0] = value[(counter * offset)+18]; nodelist[counter][1] = value[(counter * offset)+19]; nodelist[counter][2] = value[(counter * offset)+20]; nodelist[counter][3] = value[(counter * offset)+21]; nodelist[counter][4] = value[(counter * offset)+22]; nodelist[counter][5] = value[(counter * offset)+23]; nodelist[counter][6] = value[(counter * offset)+24]; nodelist[counter][7] = value[(counter * offset)+25]; nodelist[counter][8] = value[(counter * offset)+26]; nodelist[counter][9] = value[(counter * offset)+27]; nodelist[counter][10] = value[(counter * offset)+28]; nodelist[counter][11] = value[(counter * offset)+29]; nodelist[counter][12] = value[(counter * offset)+30]; nodelist[counter][13] = value[(counter * offset)+31]; nodelist[counter][14] = value[(counter * offset)+32]; nodelist[counter][15] = value[(counter * offset)+33]; RNKV.Node_add = nodelist[counter][1] * 0x100 + nodelist[counter][0]; RNKV.Code_Control = nodelist[counter][3] * 0x100 + nodelist[counter][2]; RNKV.Data_index = nodelist[counter][5] * 0x100 + nodelist[counter][4]; RNKV.Zone_A = nodelist[counter][7] * 0x100 + nodelist[counter][6]; RNKV.Zone_B = nodelist[counter][9] * 0x100 + nodelist[counter][8]; RNKV.Zone_C = nodelist[counter][11] * 0x100 + nodelist[counter][10]; RNKV.Module_type = nodelist[counter][12]; Module_Type module_str; module_str = (module_type_str[RNKV.Module_type]); String module_string; module_string = module_str.toString(); bFoundScores = true; String node = Integer.toHexString(RNKV.Node_add); String data_index = Integer.toHexString(RNKV.Data_index); String Zone_A = Integer.toString(RNKV.Zone_A); String Zone_B = Integer.toString(RNKV.Zone_B); String Zone_C = Integer.toString(RNKV.Zone_C); String module_type = module_string; insertStatusRow(statusTable, node, data_index, Zone_A, Zone_B, Zone_C, module_type); // Handle no scores available if (bFoundScores == false) { final TableRow newRow = new TableRow(this); TextView noResults = new TextView(this); noResults.setText(getResources().getString(R.string.Rz_no_data)); newRow.addView(noResults); statusTable.addView(newRow); } counter = counter + 1; } } } public void insertStatusRow(final TableLayout statusTable, String node, String data_index, String Zone_A, String Zone_B, String Zone_C, String module_type) { final TableRow newRow = new TableRow(this); int node_addr = 0; int textColor = getResources().getColor(R.color.blue); float textSize = getResources().getDimension(R.dimen.Rz_nodelist_text_size_6); addTextToRowWithValues(newRow, node, textColor, textSize); addTextToRowWithValues(newRow, data_index, textColor, textSize); addTextToRowWithValues(newRow, Zone_A, textColor, textSize); addTextToRowWithValues(newRow, Zone_B, textColor, textSize); addTextToRowWithValues(newRow, Zone_C, textColor, textSize); addTextToRowWithValues(newRow, module_type, textColor, textSize); statusTable.addView(newRow); if (node != "node") { node_addr = Integer.valueOf(node, 16); } newRow.setId(node_addr); }