| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- import com.imt.intimamedia.model.ApplicationModelLocator;
- import com.imt.intimamedia.views.physician.measure.GeneralMeasureView;
- import com.imt.intimamedia.views.physician.measure.MeasureView;
- import com.imt.intimamedia.vo.DragAndDropVo;
- import com.imt.intimamedia.vo.MeasuresVo;
- import mx.collections.ArrayCollection;
- import mx.controls.dataGridClasses.DataGridColumn;
- import mx.resources.ResourceManager;
- /**
- * Référence sur le modèle
- */
- [Bindable]
- private var _model : ApplicationModelLocator = ApplicationModelLocator.getInstance();
- [Bindable]
- public var resultsCollection : ArrayCollection;
- /**
- * Affichage de la vue et création de la source de données
- */
- public function createCollection() : void
- {
- resultsCollection = new ArrayCollection();
-
- for each( var dragAndDropVo : DragAndDropVo in ( this.parentDocument.measures as MeasureView ).listImages.dataProvider )
- {
- if (_model.viewPatient)
- {
- // put scale and measure on dragAndDropVo
- for each (var measuresVo : MeasuresVo in ( this.parentDocument as GeneralMeasureView ).getMeasuresArray())
- {
- if (dragAndDropVo.id == measuresVo.imageId)
- {
- if (measuresVo.scale)
- dragAndDropVo.scale = measuresVo.scale;
- if (measuresVo.distance)
- dragAndDropVo.distance = measuresVo.distance;
- if (measuresVo.area)
- dragAndDropVo.area = measuresVo.area;
- if (measuresVo.fwImt)
- dragAndDropVo.fwImtResult = measuresVo.fwImt;
- if (measuresVo.nwImt)
- dragAndDropVo.nwImtResult = measuresVo.nwImt;
- }
- }
- }
- resultsCollection.addItem( dragAndDropVo );
- }
- }
- /**
- * Affichage des mesures
- */
- private function displayMeasures() : void
- {
- _model.measureViewFlip = true;
- ( this.parentDocument as GeneralMeasureView ).selectZone('measures');
- }
- /**
- * Formatage du tableau d'EIM
- */
- private function formatValue( item : Object, col : DataGridColumn ) : String
- {
- var value : String = "";
-
- switch( col.dataField )
- {
- case "mean":
- value = formatNumber.format( item.mean );
- break;
- case "max":
- value = formatNumber.format( item.max );
- break;
- case "standardDeviation":
- value = formatNumber.format( item.standardDeviation );
- break;
- case "qualityIndex":
- value = formatNumber.format( item.qualityIndex );
- break;
- case "distance":
- value = formatNumber.format( item.distance );
- break;
- case "numberOfPoints":
- value = formatInt.format( item.numberOfPoints );
- break;
- }
-
- return value;
- }
- /**
- * Formatage des types du tableau
- */
- private function formatType( item : Object, col : DataGridColumn ) : String
- {
- return ResourceManager.getInstance().getString( 'type', item.type );
- }
- /**
- * Formatage des collections du tableau
- */
- private function formatLocation( item : Object, col : DataGridColumn ) : String
- {
- return ResourceManager.getInstance().getString( 'location', item.collection );
- }
- /**
- * Formatage de l'échelle
- */
- private function formatScale( item : Object, col : DataGridColumn ) : String
- {
- var value : String = "-";
-
- if( item.scale && item.scale.value > 0 )
- value = formatNumber.format( item.scale.value ) + " mm";
-
- return value;
- }
- /**
- * Formatage de la surface
- */
- private function formatArea( item : Object, col : DataGridColumn ) : String
- {
- var value : String = "-";
-
- if( item.area && item.area.value > 0 )
- value = formatNumber.format( item.area.value ) + " mm²";
- if( item.area2 && item.area2.value > 0 )
- value += "\n" + formatNumber.format( item.area2.value ) + " mm²";
-
- return value;
- }
- /**
- * Formatage de la distance
- */
- private function formatDistance( item : Object, col : DataGridColumn ) : String
- {
- var value : String = "-";
-
- if( item.distance && item.distance.value > 0 )
- value = formatNumber.format( item.distance.value ) + " mm\n"
- + item.distance.getTypeText();
-
- return value;
- }
|