@@ -32,12 +32,12 @@ QVariant ChipDbTableModel::data(const QModelIndex &index, int role) const
32
32
switch (column)
33
33
{
34
34
case CHIP_PARAM_NAME:
35
- return (* chipDb)[ index.row ()]-> name ;
35
+ return chipDb-> getChipName ( index.row ()) ;
36
36
case CHIP_PARAM_PAGE_SIZE:
37
37
case CHIP_PARAM_BLOCK_SIZE:
38
38
case CHIP_PARAM_TOTAL_SIZE:
39
39
case CHIP_PARAM_SPARE_SIZE:
40
- chipDb->getHexStringFromParam ((* chipDb)[ index.row ()]-> params [ column] ,
40
+ chipDb->getHexStringFromParam (chipDb-> getChipParam ( index.row (), column) ,
41
41
paramStr);
42
42
return paramStr;
43
43
case CHIP_PARAM_T_CS:
@@ -57,21 +57,21 @@ QVariant ChipDbTableModel::data(const QModelIndex &index, int role) const
57
57
case CHIP_PARAM_ROW_CYCLES:
58
58
case CHIP_PARAM_COL_CYCLES:
59
59
case CHIP_PARAM_BB_MARK_OFF:
60
- return (* chipDb)[ index.row ()]-> params [ column] ;
60
+ return chipDb-> getChipParam ( index.row (), column) ;
61
61
case CHIP_PARAM_READ1_CMD:
62
62
case CHIP_PARAM_READ_ID_CMD:
63
63
case CHIP_PARAM_RESET_CMD:
64
64
case CHIP_PARAM_WRITE1_CMD:
65
65
case CHIP_PARAM_ERASE1_CMD:
66
66
case CHIP_PARAM_STATUS_CMD:
67
- chipDb->getHexStringFromParam ((* chipDb)[ index.row ()]-> params [ column] ,
67
+ chipDb->getHexStringFromParam (chipDb-> getChipParam ( index.row (), column) ,
68
68
paramStr);
69
69
return paramStr;
70
70
case CHIP_PARAM_READ2_CMD:
71
71
case CHIP_PARAM_WRITE2_CMD:
72
72
case CHIP_PARAM_ERASE2_CMD:
73
- chipDb->getHexStringFromOptParam ((* chipDb)[ index.row ()]-> params [column] ,
74
- paramStr);
73
+ chipDb->getHexStringFromOptParam (chipDb-> getChipParam ( index.row (),
74
+ column), paramStr);
75
75
return paramStr;
76
76
}
77
77
@@ -209,15 +209,15 @@ bool ChipDbTableModel::setData(const QModelIndex &index, const QVariant &value,
209
209
switch (index.column ())
210
210
{
211
211
case CHIP_PARAM_NAME:
212
- (* chipDb)[ index.row ()]-> name = value.toString ();
212
+ chipDb-> setChipName ( index.row (), value.toString () );
213
213
return true ;
214
214
case CHIP_PARAM_PAGE_SIZE:
215
215
case CHIP_PARAM_BLOCK_SIZE:
216
216
case CHIP_PARAM_TOTAL_SIZE:
217
217
case CHIP_PARAM_SPARE_SIZE:
218
218
if (chipDb->getParamFromHexString (value.toString (), paramVal))
219
219
return false ;
220
- (* chipDb)[ index.row ()]-> params [ index.column ()] = paramVal;
220
+ chipDb-> setChipParam ( index.row (), index.column (), paramVal) ;
221
221
return true ;
222
222
case CHIP_PARAM_T_CS:
223
223
case CHIP_PARAM_T_CLS:
@@ -236,7 +236,7 @@ bool ChipDbTableModel::setData(const QModelIndex &index, const QVariant &value,
236
236
case CHIP_PARAM_BB_MARK_OFF:
237
237
if (chipDb->getParamFromString (value.toString (), paramVal))
238
238
return false ;
239
- (* chipDb)[ index.row ()]-> params [ index.column ()] = paramVal;
239
+ chipDb-> setChipParam ( index.row (), index.column (), paramVal) ;
240
240
return true ;
241
241
case CHIP_PARAM_ROW_CYCLES:
242
242
case CHIP_PARAM_COL_CYCLES:
@@ -247,7 +247,7 @@ bool ChipDbTableModel::setData(const QModelIndex &index, const QVariant &value,
247
247
{
248
248
return false ;
249
249
}
250
- (* chipDb)[ index.row ()]-> params [ index.column ()] = paramVal;
250
+ chipDb-> setChipParam ( index.row (), index.column (), paramVal) ;
251
251
return true ;
252
252
case CHIP_PARAM_READ1_CMD:
253
253
case CHIP_PARAM_READ_ID_CMD:
@@ -259,7 +259,7 @@ bool ChipDbTableModel::setData(const QModelIndex &index, const QVariant &value,
259
259
return false ;
260
260
if (!chipDb->isParamValid (paramVal, 0x00 , 0xFF ))
261
261
return false ;
262
- (* chipDb)[ index.row ()]-> params [ index.column ()] = paramVal;
262
+ chipDb-> setChipParam ( index.row (), index.column (), paramVal) ;
263
263
return true ;
264
264
case CHIP_PARAM_READ2_CMD:
265
265
case CHIP_PARAM_WRITE2_CMD:
@@ -268,7 +268,7 @@ bool ChipDbTableModel::setData(const QModelIndex &index, const QVariant &value,
268
268
return false ;
269
269
if (!chipDb->isOptParamValid (paramVal, 0x00 , 0xFF ))
270
270
return false ;
271
- (* chipDb)[ index.row ()]-> params [ index.column ()] = paramVal;
271
+ chipDb-> setChipParam ( index.row (), index.column (), paramVal) ;
272
272
return true ;
273
273
}
274
274
0 commit comments