Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
The approach of what this code does and the conversion module are similar in function but a differ on maintenance and flexibility. 1. The conversion module's bytearray to value methods work, but th...

The approach of what this code does and the conversion module are similar in function but a differ on maintenance and flexibility.
1. The conversion module's bytearray to value methods work, but they require manual logistic around the indexing. It's the user's responsibility to handle where the reading starts and you need to code the handler for that (previous approach with MsgFieldPositions), It's inflating the method. I worked hard to remove the need for indexing where the value starts. Instead of the previous struct.unpack approach, where you needed to maintain the type, you will be needing to maintain the conversion methods that are being called, so it would be the same as before, you still need to mind the indexing, which was the main reason of changing from this approach.

2. In the current approach, you declare the type and pass it to a processor that dynamically handling the unpack type (based on the set datatype) and the indexing for that. This works much better and easier to maintain, as you can just insert a new value when it's added to the FW, and don't need to adjust all your indexes for the reading.

Example #1, changing build type from U16 to U08:

  • with the conversion approach, you need to change the function used, and update the starting index for all the following methods.
  • with the current approach you change the Datatype.U16 to Datatype.U08 and that's all you need to do.


Example #2: adding a new variable fpga_micro after fpga_minor, with U08 type:

  • with the conversion approach, you add the bytearray_to_byte, update the indexes for all the following reads.
  • with the current approach you insert an element after the fpga_minor with a value ('fpga_micro', Datatype.U08), and nothing more needed
fixed. thanks!

fixed. thanks!

fixed. thanks

fixed. thanks

Add uncompensated conductivity to the init too

Add uncompensated conductivity to the init too

Add uncompensated conductivity to the init too

Add uncompensated conductivity to the init too

RESOLVED for now.

RESOLVED for now.

I would not do that because the function names and messages for each project should be different to avoid confusion. I think that is fine for now. RESOLVED.

I would not do that because the function names and messages for each project should be different to avoid confusion.
I think that is fine for now.

RESOLVED.

So the same channels are used for both the Leahi and Denali? I am not talking about how collisions are handled; that is handled by the CAN driver, not the FW or SW. My point is that the CAN Channel...

So the same channels are used for both the Leahi and Denali?
I am not talking about how collisions are handled; that is handled by the CAN driver, not the FW or SW.
My point is that the CAN Channels by themselves do not have the meaning we want; they are only a priority.
As we defined them, we gave them a meaning as a category; therefore, it is better to name them the Denali/Leahi Channels rather than the CAN Channels.

RESOLVED.

RESOLVED.

def fp_versions(self, major: int, minor: int, micro: int, build: int, fpga_id: int, fpga_major: int, fpga_minor: int, fpga_lab: int, compatibility_rev: int...
def fp_versions(self, major: int, minor: int, micro: int, build: int,
                     fpga_id: int, fpga_major: int, fpga_minor: int, fpga_lab: int,
                     compatibility_rev: int):
     """
     Broadcasts the current dd Version Data (Msg ID: 0x0F, 15)
     Args:
         @param major: (uint) - Major version number
         @param minor: (uint) - Minor version number
         @param micro: (uint) - Micro version number
         @param build: (uint) - Build version number
         @param fpga_id: (int) - FPGA id version number
         @param fpga_major: (int) - FPGA Major version number
         @param fpga_minor: (int) - FPGA Minor version number
         @param fpga_lab: (int) - FPGA Lab version number
         @param compatibility_rev: (uint) - The FWs/UI compatibility revision
     @return: None
     """
     if not self.can_enabled:
         raise ValueError("CAN Interface is not enabled")

     payload =  conversions.unsigned_byte_to_bytearray   (major            )
     payload += conversions.unsigned_byte_to_bytearray   (minor            )
     payload += conversions.unsigned_byte_to_bytearray   (micro            )
     payload += conversions.unsigned_short_to_bytearray  (build            )
     payload += conversions.unsigned_byte_to_bytearray   (fpga_id          )
     payload += conversions.unsigned_byte_to_bytearray   (fpga_major       )
     payload += conversions.unsigned_byte_to_bytearray   (fpga_minor       )
     payload += conversions.unsigned_byte_to_bytearray   (fpga_lab         )
     payload += conversions.unsigned_integer_to_bytearray(compatibility_rev)

     message = CAN.CanMessage.build_message(
                                         channel_id=CAN.CanChannels.fp_sync_broadcast_ch_id,
                                         message_id=msg_ids.MsgIds.MSG_ID_FP_VERSION_RESPONSE.value,
                                         payload=payload)

     self.can_interface.send(message, 0)
LEAHI-DIALIN-LDT-4734_Water Treatment and Degassing - FW Iteration - 5/4:
LEAHI-DIALIN-LDT-4734_Water Treatment and Degassing - FW Iteration - 5/4:
Being generic is the whole point of it. It was renamed because this is a dialin dedicated to Leahi unit and calling the messages DenaliMessage is misleading. It was renamed to CanMessage for 2 reas...

Being generic is the whole point of it.
It was renamed because this is a dialin dedicated to Leahi unit and calling the messages DenaliMessage is misleading.
It was renamed to CanMessage for 2 reason:
1. This is a Leahi only dialin, so there is no need to differentiate between different type of Can Messages as there would be only 1 type
2. Calling it CanMessage will make it more future compatible when the dialin get copied over for a new unit development (unlikely in the foreseeable future but possible), removing the need to rename it again

There is no Leahi or Denali CANChannels. There are CAN channels and the naming is what that channel is being used for. The collision occurs in the FW and the FW handles it before sending out a mess...

There is no Leahi or Denali CANChannels.
There are CAN channels and the naming is what that channel is being used for.
The collision occurs in the FW and the FW handles it before sending out a message.
When reading a CAN, there are no collisions, so there are no priorities. So I have no clue what you want here.

done

done

I have no idea what you are referring to as the link is not working. The need to define the type and the name of the data being read is necessary, so if it's not here it will be somewhere else, tha...

I have no idea what you are referring to as the link is not working.
The need to define the type and the name of the data being read is necessary, so if it's not here it will be somewhere else, that we can't escape.
Exporting that to different files won't serve a purpose and will only increase complexity as when debugging you will need to reference a separate file.
For the defs it made sense as they are used multiple places, but what a message contains is a single use place, so storing it separately is meaningless as it won't have any use outside of this single function.

LEAHI-DIALIN-LDT-4410_Dialysate Composition (Mixing) - FW Implementation - 3/1:
LEAHI-DIALIN-LDT-4410_Dialysate Composition (Mixing) - FW Implementation - 3/1:
I am happy to see that this old code is improving. I would recommend using the Conversion module instead of strings and DataTypes, as it handles everything automatically. Examples can be found in t...

I am happy to see that this old code is improving.
I would recommend using the Conversion module instead of strings and DataTypes, as it handles everything automatically.
Examples can be found in the following file in this CR:
https://devapps.diality.us/cru/#LEAHI-DIALIN-LDT-4484-1CFR-84688

Please add a docstring for the function. including the intention and parameters with their intentions.

Please add a docstring for the function.
including the intention and parameters with their intentions.

Same for CanChannels. The Channels we are referring to here are Leahi's or Denali's. Channels mainly have no meaning beyond their priorities when a collision occurs.

Same for CanChannels.
The Channels we are referring to here are Leahi's or Denali's.
Channels mainly have no meaning beyond their priorities when a collision occurs.

I recommend DenaliMessage or LeahiMessage, as CanMessage is generic, whereas Leahi/Denali indicate that the protocol is also implemented in the message we are sending. I'm not sure why the name was...

I recommend DenaliMessage or LeahiMessage, as CanMessage is generic, whereas Leahi/Denali indicate that the protocol is also implemented in the message we are sending.
I'm not sure why the name was changed, as it is a lot of change.
Also, there is no CAN Message.
There is a CAN Frame and a Leahi/Denali Message.

LEAHI-DIALIN-LDT-4733_(Request) Add variables to capture AC/DC heater electrical data
LEAHI-DIALIN-LDT-4733_(Request) Add variables to capture AC/DC heater electrical data
Update the name.

Update the name.

updated

updated

Remove extra spaces before comment

Remove extra spaces before comment