Help needed - on determining individual watch to specify layout

I currently use width / height a lot in my code and I also use if round / rectangle / semi octagon, but how do i do something specific for an individual watch type?

Unique ID is no good as it includes the persons watch info

partNumber could be used with a subString but seems like I would miss out on Asian parts etc.. and seems cumbersome

Can I use productId (getProductInfo(identifier)? If so I haven't worked out how to, so help needed please - I've hunted this forum 

For those that want more info (and quite rightly so) my thoughts are for the Instinct2 Crossover to not use the same layout as a 176 (yes I could use: getsubScreen) but I also thought about radial text and the nuances around that, so wondered if I can use:

if (width==390) {
      if (prodId == fr165) {
          use / do whatever;
      } else {
          do whatever is standard that I want to do;
} else if {width == 416) { .........
Helps and hints required please, and apologies if this is really simple and I have missed something
  • source-common/Foo.mc

    source-subscreen/Foo.mc

    source-analoghands/Foo.mc

    And you'll need to set up the respective devices to use relevant directory in monkey.jungle:

    base.sourcePath=source;source-common

    instinct2.sourcePath=source;source-subscreen

    instinctcrossover.sourcePath=source;source-analoghands

    Or instead of multiple sources you can keep it in source/Foo.mc only and use similar logic with excludeAnnotations

  • Or instead of multiple sources you can keep it in source/Foo.mc only and use similar logic with excludeAnnotations

    This is what I do but tbh excludeAnnotations are a huge pain when you have multiple "dimensions" of exclusion (e.g. screen size, screen shape, presence of touchscreen, CIQ version, font family, etc.)

    For every product (family) and every exclusion dimension, you have to specify all the things you *don't* want, which is annoying and somewhat counterintuitive.

    e.g. Suppose I have two dimensions of exclusion: screen shape and CIQ version (this is a fairly contrived example).

    screen shape annotations: round, semiround, rectangular, semioctagon

    ciq version annotations: ciq1, ciq2, ciq3, ciq4

    The exclude annotations jungle entry for fr230 (a semiround CIQ1 device) will look like this:

    fr230.excludeAnnotations = round;rectangular;semioctagon;ciq2;ciq3;ciq4

    My real code for some projects has a few more exclusion dimensions, so it's a lot messier than that.

    The only saving grace of this approach is that if you actually do have different versions of certain functions for a given dimension (or combination of dimensions), then the compiler will complain if you happen to forget to add one of the exclusions to a given product (because you'll have multiple definitions of the symbol). So at least there's a kind of compile-time check to avoid certain kinds of mistakes.

  • It would be great if you could subtract exclude annotations on a per product basis. That way every product could have the full set of exclusions by default, and the excludeAnnotations (or should I say, includeAnnotations) entry for each product would only have to subtract the annotations which it wants to include.

    This would be a lot more readable and maintainable but c'est la vie.

  • This is true. I generate the jungle file with my python script, so it looks ugly but managable this way. However it's still a problem in the monkey c side:

    (:no_bar, :no_foo) const X = 0;
    (:bar, :foo) const X = 2;
    (:bar, :no_foo) const X = 1;
    (:no_bar, :foo) const X = 1;

    Imagine that it's not a 1 line const but some function... Ideally I would like to be able to do something like:


    (:bar, :no_foo) (:no_bar, :foo) const X = 1;