Ladder99 / fanuc-driver

Configurable Fanuc Focas data collector and post processor.
Apache License 2.0
74 stars 25 forks source link

Could you publish `fanuc-driver` on nuget.org? #40

Open tukusejssirs opened 3 years ago

tukusejssirs commented 3 years ago

It might be a good idea to publish fanuc-driver on nuget.org for easier installation.

At the same time, you might want to create GitHub Releases too. :wink:

MRIIOT commented 2 years ago

Would I be versioning the entire codebase?

tukusejssirs commented 2 years ago

Well, I’d version fanuc-driver itself.

However, now that I think about it, IMHO you created collectors/strategies/vendors/handlers (or at least some of them) as they could/should be configurable by fanuc-driver user. If that is the case, fanuc-driver they should be removed from the codebase.

Actually, even nlog.xml and config.yml should not be in the codebase (examples could be there, e.g. in an example/ folder or with .example extension).

I suggest to publish it on nuget.org so that we could simply install it without manually building it (unless we want to modify some code). Versioning would help us install a specific version (or even latest stable, dev, rc).

As I see it, fanuc-driver is an adaptor (it adapts all the different FOCAS libraries, as well as makes them working even on platforms not supported by Fanuc) and a microservice (it gathers, processes and provides some data from machines). Maybe the code should be split; although you already have base-driver, however I think the code should be split as follows:

Note that is how I’d like fanuc-driver to work. It does not talk about the implementation. You can dismissed it at will.

MRIIOT commented 2 years ago

I agree on all of the above.

tukusejssirs commented 2 years ago

Even MQTT should be removed from the adapter.

It should be used as an external library/package, but IMHO it should be utilised by the microservice (not fanuc-adaptor).

MRIIOT commented 2 years ago

Even MQTT should be removed from the adapter.

It should be used as an external library/package, but IMHO it should be utilised by the microservice (not fanuc-adaptor).

I was thinking about the different consumers of the data. Some people will want it in SQL, some will want an HTTP endpoint, some will want something else. I think MQTT, although external to the adapter, should be the primary mode of transmission of the data from fanuc-driver to another process.... unless a pattern is defined for 'output plugins'.

I reviewed the concepts of base-driver across the FactoryIO and OPCXMLDA drivers.

https://docs.ladder99.com/en/drivers/base-driver

I guess I meant for the handler to maintain the connection to an external system.

Even looking at the latest ThreeWay handler... it is the final touch point for the collected and transformed data. The handler is when Focas data leaves the driver.

https://github.com/Ladder99/fanuc-driver/blob/main/fanuc/handlers/ThreeWay.cs

So maybe the MQTT configuration should be moved the handler section in YML like here.

https://github.com/Ladder99/opcxmlda-driver/blob/8c13187a2e6ee4ef904f462e876a3c73dc1a0b24/opcxmlda/config.yml#L66-L79

This way, dependency on MQTT would be removed from the driver.

MRIIOT commented 2 years ago

Even MQTT should be removed from the adapter.

It should be used as an external library/package, but IMHO it should be utilised by the microservice (not fanuc-adaptor).

https://github.com/Ladder99/fanuc-driver/commit/b9679448a203f04f216bee73058bc99a3cbb6777

MRIIOT commented 2 years ago
  • it could include current base-driver, all FOCAS libraries;

https://www.lostindetails.com/articles/Native-Bindings-in-CSharp https://stackoverflow.com/questions/66669315/is-there-an-equivalent-of-adddlldirectory-in-linux-and-mac

I was looking at moving the Focas DLLs to a subfolder. Will need to test adding a search path on Linux.