156 views
in GUI Development by
Hi Team,

I have a requirement to display some measured values within a screen as single display/dual display/triple display according to the user selection. In detail the end device has 3 channels, each channel can have 3 different modules like module A, Module B, Module C and each modules have different number of modes. modules, modes, and channel combinations have defined as enums. The end device will feed the data about channels i.e. channel 1 / channel 2/ channel 3 is connected along with module name and corresponding mode. Example case scenario: Module A is connected to channel 1, and Module B is connected to channel 2. Module A has mode x, module B has mode y. the user wants to see measured values for channel 1 and channel 2 separately and then combination of channel 1 and channel 2 readings within one frame. channel combination enum has defined like CH_!, CH_2, CH_3, CH_12, CH_13, CH_23, CH_123. So now the user wants the CH_1, CH_2, CH_12 display formats. To achieve that GUI should have classes to get the channel detail along with module and mode. After that the root object will have a timer, when timer expires, the on timer will triggered to check the channel combination one by one which is selected by the user. within that function need to check corresponding module and mode and then update the values.

work flow as flows:

Under On Timer event :

if(Continos||Timed||Auto)
{
    Switch(Ch_CombinationOption)
    {

    Case CH_1:

        switch(CH[1].Module)
        {
        case MODULE_A:
            switch(CH[1].Mode)
            {
            case x:
            Get_UpdateMeasurePH(CHANNEL1, DISPLAY1, CH_1);
            case u:
            case p:

            }
        case MODULE_B:
            switch(CH[1].Mode)
            {
            case y:
            Get_UpdateMeasurePH(CHANNEL1, DISPLAY1, CH_1);
            case v:
            case q:

            }
        case MODULE_C:

    }

    case CH_2:
    case CH_3:
    case CH_12://Dual Channels
    case CH_21:

    Case CH_13://Dual Channels

        switch(CH[1].Module)
        {
        case MODULE_A:
            switch(CH[1].Mode)
            {
            case x:
            Get_UpdateMeasurePH(CHANNEL1, DISPLAY1, CH_13);
            case u:
            case p:

            }
        case MODULE_B:
            switch(CH[1].Mode)
            {
            case y:
            Get_UpdateMeasurePH(CHANNEL1, DISPLAY1, CH_13);
            case v:
            case q:

            }
        case MODULE_C:
            {
            }
        }

        switch(CH[3].Module)
        {
        case MODULE_A:
            switch(CH[3].Mode)
            {
            case x:
            Get_UpdateMeasurePH(CHANNEL3, DISPLAY2, CH_13);
            case u:
            case p:

            }
        case MODULE_B:
            switch(CH[3].Mode)
            {
            case y:
            Get_UpdateMeasurePH(CHANNEL3, DISPLAY2, CH_13);
            case v:
            case q:

            }
        case MODULE_C:
            {
            }

        }

    Case CH_234://Triple

    Case CH_NC:

}
Please explain the sequential implementation of the classes and functions deeply.

 

Regards,

Sazna.

1 Answer

0 votes
by
Hi Sazna,

it is not clear to me how we could help you.

If the user selection is that complex (modes, modules, channels,..) you have to implement the mapping between user selection and corresponding data source.

Maybe you can put the parameters like channel, display, module in variables and pass them directly to Get_UpdateMeasurePH() then it is not necessary to make such a huge switch/case tree. But I am too far away from the data model of your application so that I cannot comment more detailed.

Best regards,

Manfred,

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...