|
54 | 54 | from odxtools.parentref import ParentRef
|
55 | 55 | from odxtools.physicaldimension import PhysicalDimension
|
56 | 56 | from odxtools.physicaltype import PhysicalType
|
| 57 | +from odxtools.preconditionstateref import PreConditionStateRef |
57 | 58 | from odxtools.progcode import ProgCode
|
58 | 59 | from odxtools.relateddoc import RelatedDoc
|
59 | 60 | from odxtools.request import Request
|
60 | 61 | from odxtools.response import Response, ResponseType
|
61 | 62 | from odxtools.singleecujob import SingleEcuJob
|
62 | 63 | from odxtools.standardlengthtype import StandardLengthType
|
| 64 | +from odxtools.state import State |
| 65 | +from odxtools.statechart import StateChart |
| 66 | +from odxtools.statetransition import StateTransition |
| 67 | +from odxtools.statetransitionref import StateTransitionRef |
63 | 68 | from odxtools.structure import Structure
|
64 | 69 | from odxtools.table import Table
|
65 | 70 | from odxtools.tablerow import TableRow
|
@@ -1518,6 +1523,19 @@ class SomersaultSID(IntEnum):
|
1518 | 1523 | bit_position=None,
|
1519 | 1524 | sdgs=[],
|
1520 | 1525 | ),
|
| 1526 | + ValueParameter( |
| 1527 | + oid=None, |
| 1528 | + short_name="bribe", |
| 1529 | + long_name=None, |
| 1530 | + semantic=None, |
| 1531 | + description=None, |
| 1532 | + physical_default_value_raw="0", |
| 1533 | + byte_position=2, |
| 1534 | + dop_ref=OdxLinkRef("somersault.DOP.uint8", doc_frags), |
| 1535 | + dop_snref=None, |
| 1536 | + bit_position=None, |
| 1537 | + sdgs=[], |
| 1538 | + ), |
1521 | 1539 | ],
|
1522 | 1540 | ),
|
1523 | 1541 | "stop_session":
|
@@ -1821,8 +1839,48 @@ class SomersaultSID(IntEnum):
|
1821 | 1839 | addressing_raw=None,
|
1822 | 1840 | transmission_mode_raw=None,
|
1823 | 1841 | audience=None,
|
1824 |
| - pre_condition_state_refs=[], |
1825 |
| - state_transition_refs=[], |
| 1842 | + pre_condition_state_refs=[ |
| 1843 | + PreConditionStateRef( |
| 1844 | + ref_id="charts.annoyed.states.in_bed", |
| 1845 | + ref_docs=doc_frags, |
| 1846 | + value=None, |
| 1847 | + in_param_if_snref=None, |
| 1848 | + in_param_if_snpathref=None, |
| 1849 | + ), |
| 1850 | + # note that the standard does not allow to specify |
| 1851 | + # relations other than equivalence for the specified |
| 1852 | + # value (larger-than would be more appropriate here...) |
| 1853 | + PreConditionStateRef( |
| 1854 | + ref_id="charts.angry.states.in_bed", |
| 1855 | + ref_docs=doc_frags, |
| 1856 | + value="1", |
| 1857 | + in_param_if_snref="bribe", |
| 1858 | + in_param_if_snpathref=None, |
| 1859 | + ), |
| 1860 | + ], |
| 1861 | + state_transition_refs=[ |
| 1862 | + StateTransitionRef( |
| 1863 | + ref_id="charts.annoyed.transitions.get_up", |
| 1864 | + ref_docs=doc_frags, |
| 1865 | + value="false", |
| 1866 | + in_param_if_snref="can_do_backward_flips", |
| 1867 | + in_param_if_snpathref=None, |
| 1868 | + ), |
| 1869 | + StateTransitionRef( |
| 1870 | + ref_id="charts.annoyed.transitions.get_up_to_park", |
| 1871 | + ref_docs=doc_frags, |
| 1872 | + value="true", |
| 1873 | + in_param_if_snref="can_do_backward_flips", |
| 1874 | + in_param_if_snpathref=None, |
| 1875 | + ), |
| 1876 | + StateTransitionRef( |
| 1877 | + ref_id="charts.angry.transitions.get_up", |
| 1878 | + ref_docs=doc_frags, |
| 1879 | + value=None, |
| 1880 | + in_param_if_snref=None, |
| 1881 | + in_param_if_snpathref=None, |
| 1882 | + ), |
| 1883 | + ], |
1826 | 1884 | request_ref=OdxLinkRef.from_id(somersault_requests["start_session"].odx_id),
|
1827 | 1885 | semantic="SESSION",
|
1828 | 1886 | pos_response_refs=[
|
@@ -1858,7 +1916,22 @@ class SomersaultSID(IntEnum):
|
1858 | 1916 | transmission_mode_raw=None,
|
1859 | 1917 | audience=None,
|
1860 | 1918 | pre_condition_state_refs=[],
|
1861 |
| - state_transition_refs=[], |
| 1919 | + state_transition_refs=[ |
| 1920 | + StateTransitionRef( |
| 1921 | + ref_id="charts.angry.transitions.go_to_bed", |
| 1922 | + ref_docs=doc_frags, |
| 1923 | + value=None, |
| 1924 | + in_param_if_snref=None, |
| 1925 | + in_param_if_snpathref=None, |
| 1926 | + ), |
| 1927 | + StateTransitionRef( |
| 1928 | + ref_id="charts.annoyed.transitions.go_to_bed", |
| 1929 | + ref_docs=doc_frags, |
| 1930 | + value=None, |
| 1931 | + in_param_if_snref=None, |
| 1932 | + in_param_if_snpathref=None, |
| 1933 | + ), |
| 1934 | + ], |
1862 | 1935 | semantic="SESSION",
|
1863 | 1936 | request_ref=OdxLinkRef.from_id(somersault_requests["stop_session"].odx_id),
|
1864 | 1937 | pos_response_refs=[
|
@@ -2445,7 +2518,212 @@ class SomersaultSID(IntEnum):
|
2445 | 2518 | negative_responses=NamedItemList(),
|
2446 | 2519 | global_negative_responses=NamedItemList(),
|
2447 | 2520 | import_refs=[],
|
2448 |
| - state_charts=NamedItemList(), |
| 2521 | + state_charts=NamedItemList([ |
| 2522 | + StateChart( |
| 2523 | + semantic="annoyed", |
| 2524 | + odx_id=OdxLinkId("charts.annoyed.chart", doc_frags), |
| 2525 | + oid=None, |
| 2526 | + short_name="annoyed_chart", |
| 2527 | + long_name=None, |
| 2528 | + description=Description( |
| 2529 | + "<p>State chart for a day where the ECU is grumpy</p>", |
| 2530 | + external_docs=[], |
| 2531 | + text_identifier=None), |
| 2532 | + states=NamedItemList([ |
| 2533 | + State( |
| 2534 | + odx_id=OdxLinkId("charts.annoyed.states.in_bed", doc_frags), |
| 2535 | + oid=None, |
| 2536 | + short_name="in_bed", |
| 2537 | + long_name=None, |
| 2538 | + description=None, |
| 2539 | + ), |
| 2540 | + State( |
| 2541 | + odx_id=OdxLinkId("charts.annoyed.states.on_street", doc_frags), |
| 2542 | + oid=None, |
| 2543 | + short_name="on_street", |
| 2544 | + long_name=None, |
| 2545 | + description=None, |
| 2546 | + ), |
| 2547 | + State( |
| 2548 | + odx_id=OdxLinkId("charts.annoyed.states.in_park", doc_frags), |
| 2549 | + oid=None, |
| 2550 | + short_name="in_park", |
| 2551 | + long_name=None, |
| 2552 | + description=None, |
| 2553 | + ), |
| 2554 | + State( |
| 2555 | + odx_id=OdxLinkId("charts.annoyed.states.at_lunch", doc_frags), |
| 2556 | + oid=None, |
| 2557 | + short_name="at_lunch", |
| 2558 | + long_name=None, |
| 2559 | + description=None, |
| 2560 | + ), |
| 2561 | + ]), |
| 2562 | + start_state_snref="in_bed", |
| 2563 | + state_transitions=[ |
| 2564 | + StateTransition( |
| 2565 | + odx_id=OdxLinkId("charts.annoyed.transitions.get_up", doc_frags), |
| 2566 | + oid=None, |
| 2567 | + short_name="get_up", |
| 2568 | + long_name=None, |
| 2569 | + description=None, |
| 2570 | + source_snref="in_bed", |
| 2571 | + target_snref="on_street", |
| 2572 | + external_access_method=None, |
| 2573 | + ), |
| 2574 | + StateTransition( |
| 2575 | + odx_id=OdxLinkId("charts.annoyed.transitions.get_up_to_park", doc_frags), |
| 2576 | + oid=None, |
| 2577 | + short_name="get_up_to_park", |
| 2578 | + long_name=None, |
| 2579 | + description=None, |
| 2580 | + source_snref="in_bed", |
| 2581 | + target_snref="in_park", |
| 2582 | + external_access_method=None, |
| 2583 | + ), |
| 2584 | + StateTransition( |
| 2585 | + odx_id=OdxLinkId("charts.annoyed.transitions.go_to_bed", doc_frags), |
| 2586 | + oid=None, |
| 2587 | + short_name="go_to_bed", |
| 2588 | + long_name=None, |
| 2589 | + description=None, |
| 2590 | + source_snref="on_street", |
| 2591 | + target_snref="in_bed", |
| 2592 | + external_access_method=None, |
| 2593 | + ), |
| 2594 | + StateTransition( |
| 2595 | + odx_id=OdxLinkId("charts.annoyed.transitions.move", doc_frags), |
| 2596 | + oid=None, |
| 2597 | + short_name="move", |
| 2598 | + long_name=None, |
| 2599 | + description=None, |
| 2600 | + source_snref="on_street", |
| 2601 | + target_snref="in_park", |
| 2602 | + external_access_method=None, |
| 2603 | + ), |
| 2604 | + StateTransition( |
| 2605 | + odx_id=OdxLinkId("charts.annoyed.transitions.stumble", doc_frags), |
| 2606 | + oid=None, |
| 2607 | + short_name="stumble", |
| 2608 | + long_name=None, |
| 2609 | + description=None, |
| 2610 | + source_snref="on_street", |
| 2611 | + target_snref="at_lunch", |
| 2612 | + external_access_method=None, |
| 2613 | + ), |
| 2614 | + StateTransition( |
| 2615 | + odx_id=OdxLinkId("charts.annoyed.transitions.caffeinated", doc_frags), |
| 2616 | + oid=None, |
| 2617 | + short_name="caffeinated", |
| 2618 | + long_name=None, |
| 2619 | + description=None, |
| 2620 | + source_snref="at_lunch", |
| 2621 | + target_snref="in_park", |
| 2622 | + external_access_method=None, |
| 2623 | + ), |
| 2624 | + ]), |
| 2625 | + StateChart( |
| 2626 | + semantic="angry", |
| 2627 | + odx_id=OdxLinkId("charts.angry.chart", doc_frags), |
| 2628 | + oid=None, |
| 2629 | + short_name="angry_chart", |
| 2630 | + long_name=None, |
| 2631 | + description=Description( |
| 2632 | + "<p>State chart for a day where the ECU has a hissy fit</p>", |
| 2633 | + external_docs=[], |
| 2634 | + text_identifier=None), |
| 2635 | + states=NamedItemList([ |
| 2636 | + State( |
| 2637 | + odx_id=OdxLinkId("charts.angry.states.in_bed", doc_frags), |
| 2638 | + oid=None, |
| 2639 | + short_name="in_bed", |
| 2640 | + long_name=None, |
| 2641 | + description=None, |
| 2642 | + ), |
| 2643 | + State( |
| 2644 | + odx_id=OdxLinkId("charts.angry.states.on_street", doc_frags), |
| 2645 | + oid=None, |
| 2646 | + short_name="on_street", |
| 2647 | + long_name=None, |
| 2648 | + description=None, |
| 2649 | + ), |
| 2650 | + State( |
| 2651 | + odx_id=OdxLinkId("charts.angry.states.in_park", doc_frags), |
| 2652 | + oid=None, |
| 2653 | + short_name="in_park", |
| 2654 | + long_name=None, |
| 2655 | + description=None, |
| 2656 | + ), |
| 2657 | + State( |
| 2658 | + odx_id=OdxLinkId("charts.angry.states.at_lunch", doc_frags), |
| 2659 | + oid=None, |
| 2660 | + short_name="at_lunch", |
| 2661 | + long_name=None, |
| 2662 | + description=None, |
| 2663 | + ), |
| 2664 | + State( |
| 2665 | + odx_id=OdxLinkId("charts.angry.states.in_hospital", doc_frags), |
| 2666 | + oid=None, |
| 2667 | + short_name="in_hospital", |
| 2668 | + long_name=None, |
| 2669 | + description=None, |
| 2670 | + ), |
| 2671 | + ]), |
| 2672 | + start_state_snref="in_bed", |
| 2673 | + state_transitions=[ |
| 2674 | + StateTransition( |
| 2675 | + odx_id=OdxLinkId("charts.angry.transitions.get_up", doc_frags), |
| 2676 | + oid=None, |
| 2677 | + short_name="get_up", |
| 2678 | + long_name=None, |
| 2679 | + description=None, |
| 2680 | + source_snref="in_bed", |
| 2681 | + target_snref="on_street", |
| 2682 | + external_access_method=None, |
| 2683 | + ), |
| 2684 | + StateTransition( |
| 2685 | + odx_id=OdxLinkId("charts.angry.transitions.go_to_bed", doc_frags), |
| 2686 | + oid=None, |
| 2687 | + short_name="go_to_bed", |
| 2688 | + long_name=None, |
| 2689 | + description=None, |
| 2690 | + source_snref="on_street", |
| 2691 | + target_snref="in_bed", |
| 2692 | + external_access_method=None, |
| 2693 | + ), |
| 2694 | + StateTransition( |
| 2695 | + odx_id=OdxLinkId("charts.angry.transitions.move", doc_frags), |
| 2696 | + oid=None, |
| 2697 | + short_name="move", |
| 2698 | + long_name=None, |
| 2699 | + description=None, |
| 2700 | + source_snref="on_street", |
| 2701 | + target_snref="in_park", |
| 2702 | + external_access_method=None, |
| 2703 | + ), |
| 2704 | + StateTransition( |
| 2705 | + odx_id=OdxLinkId("charts.angry.transitions.stumble", doc_frags), |
| 2706 | + oid=None, |
| 2707 | + short_name="stumble", |
| 2708 | + long_name=None, |
| 2709 | + description=None, |
| 2710 | + source_snref="on_street", |
| 2711 | + target_snref="at_lunch", |
| 2712 | + external_access_method=None, |
| 2713 | + ), |
| 2714 | + StateTransition( |
| 2715 | + odx_id=OdxLinkId("charts.angry.transitions.caffeinated", doc_frags), |
| 2716 | + oid=None, |
| 2717 | + short_name="caffeinated", |
| 2718 | + long_name=None, |
| 2719 | + description=None, |
| 2720 | + source_snref="at_lunch", |
| 2721 | + target_snref="in_park", |
| 2722 | + external_access_method=None, |
| 2723 | + ), |
| 2724 | + ], |
| 2725 | + ), |
| 2726 | + ]), |
2449 | 2727 | additional_audiences=NamedItemList(),
|
2450 | 2728 | sdgs=[],
|
2451 | 2729 | parent_refs=[
|
|
0 commit comments