Skip to content
Snippets Groups Projects
Commit 0c39c545 authored by David Bühler's avatar David Bühler
Browse files

[ivette] Values panel: orders table rows according to the full callstacks.

parent 655f69e3
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ import * as States from 'frama-c/states'; ...@@ -7,6 +7,7 @@ import * as States from 'frama-c/states';
import * as Json from 'dome/data/json'; import * as Json from 'dome/data/json';
import * as Eva from 'api/plugins/eva/values'; import * as Eva from 'api/plugins/eva/values';
import * as Ast from 'api/kernel/ast'; import * as Ast from 'api/kernel/ast';
import * as Compare from 'dome/data/compare';
import { Table, Column } from 'dome/table/views'; import { Table, Column } from 'dome/table/views';
import { ArrayModel } from 'dome/table/arrays'; import { ArrayModel } from 'dome/table/arrays';
...@@ -47,17 +48,23 @@ const ColumnAlarm = (props: { visible: boolean }) => Column({ ...@@ -47,17 +48,23 @@ const ColumnAlarm = (props: { visible: boolean }) => Column({
render: AlarmRenderer, render: AlarmRenderer,
}); });
const byValues: Compare.ByFields<Eva.valuesData> =
{ callstack: Compare.defined(Compare.byFields({ full: Compare.string })) };
class ValuesModel extends ArrayModel<Json.key<'#values'>, Eva.valuesData> {
constructor() {
super();
this.setOrderingByFields(byValues);
}
}
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// --- Values Panel // --- Values Panel
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
const Values = () => { const Values = () => {
const model = React.useMemo( const model = React.useMemo(() => new ValuesModel(), []);
() => new ArrayModel<Json.key<'#values'>, Eva.valuesData>(),
[],
);
const evaValues = States.useSyncArray(Eva.values).getArray(); const evaValues = States.useSyncArray(Eva.values).getArray();
const selectMarker = States.useSelection()[0]?.current?.marker; const selectMarker = States.useSelection()[0]?.current?.marker;
const markerInfo = States.useSyncArray(Ast.markerInfo).getArray(); const markerInfo = States.useSyncArray(Ast.markerInfo).getArray();
......
...@@ -135,7 +135,7 @@ module CallStack = struct ...@@ -135,7 +135,7 @@ module CallStack = struct
let jtype = R.jtype let jtype = R.jtype
let pp_callstack ~short = function let pp_callstack ~short = function
| None -> "all" | None -> if short then "all" else ""
| Some callstack -> | Some callstack ->
let pp_text = let pp_text =
if short if short
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment