Announcement

Collapse
No announcement yet.

when statements

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • when statements

    <when year="XXXX" month="XX" day="XX" hour="XX" minute="30" second="XX">

    any way to substitute a variable?

    <when year="XXXX" month="XX" day="XX" hour="XX" minute="var" second="XX">

    or

    <when "var">

    and if that's possible, how do you concatenate strings?

    Thanks,
    GadgetBandit

  • #2
    <whens> look like this:
    Code:
            <boolean_operation type="and">
              <parameter1>
                <boolean_operation type="equal to">
                  <parameter1>
                    <variable do="get" name="mpp"></variable>
                  </parameter1>
                  <parameter2>
                    <number>1</number>
                  </parameter2>
                </boolean_operation>
              </parameter1>
              <parameter2>
                <boolean_operation type="less than">
                  <parameter1>
                    <analogue id="SWC" time="0"></analogue>
                  </parameter1>
                  <parameter2>
                    <number>0.2</number>
                  </parameter2>
                </boolean_operation>
              </parameter2>
            </boolean_operation>
    if mpp==1 && SWC < 0.2 then ...


    I'm definitely not the expert, but I don't think you'll be able to find things like date and string manipulation in the Fusion environment.

    I think a better way would be to do your logic in another program, then have it use the COM interface to trigger digital outputs or whatever it is you're after.

    Comment


    • #3
      Originally posted by GadgetBandit View Post
      <when year="XXXX" month="XX" day="XX" hour="XX" minute="30" second="XX">

      any way to substitute a variable?

      <when year="XXXX" month="XX" day="XX" hour="XX" minute="var" second="XX">

      or

      <when "var">

      and if that's possible, how do you concatenate strings?

      Thanks,
      GadgetBandit
      Your when is correct, and it works that way even with "3X" it will be at anything that starts with '3' and so on. As for using a variable, I suppose I could add that, I hadnt thought of it. Luckily I coded it very generically so it should be relatively easy.

      Only problem is the main source is currently broken. I am working on a huge under-the-hood improvement for USB communication, and that means the program is non-functional. Once I get it back up and running, I will add this easily.

      The when "var" wont be possible right now. It is possible, but it will take quite a bit of time, I will add it to the list.
      Fusion Brain Version 6 Released!
      1.9in x 2.9in -- 47mm x 73mm
      30 Digital Outputs -- Directly drive a relay
      15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
      Buy now in the MP3Car.com Store

      Comment

      Working...
      X