gregy - have got the two swift packages install...
have got the two swift packages installed from github into swift playgrounds (IOS) - good so far
now trying to edit /display - using your image on github as a guide … but seems i need a lot more swift playground tutorial watching:)
85 Replies
the code in the screenshot is in thr repo
things are really in flux right now
And I just realized I have broken things with Swift Playgrounds
I am working on that right now
ok ... i will keep doing the tutorils and ignore the wsk untill you givethe go ahead
ok, things are fixed now
there is an example at https://github.com/sbender9/WilhelmSKLibrary/tree/main/Demo%20Signal%20K.swiftpm
GitHub
WilhelmSKLibrary/Demo Signal K.swiftpm at main · sbender9/WilhelmSK...
Contribute to sbender9/WilhelmSKLibrary development by creating an account on GitHub.
let me see how to download that to an iPad...
ok, you can down this to your iPad and open it in Playgrounds
GitHub
WilhelmSKLibrary/Demo Signal K.swiftpm.zip at main · sbender9/Wilhe...
Contribute to sbender9/WilhelmSKLibrary development by creating an account on GitHub.
Hit the down load button on the right
Then go to the Files app, in Downloads
And tap the file to unzip it
Then tap the file to open in Playgrounds
i did find a way to download a "swift pakage" directly from github using its URL
it'd the down arrow on the right in my screenshot
second button after "Raw"
You may need to that link in Safari
not sure if the browser in Discord can handle it
in the swift playgrounds menu - i use the add swift package - then add the URL thats in the resource file - and its downlaods the complete package and all directories from githb (kinda like a GIT clone outcome)
That’s a package, not an app
oh maybe i buggerd up
Follow my instructions!
mea culpa
I can probably provide a direct download link…
https://github.com/sbender9/WilhelmSKLibrary/raw/refs/heads/main/Demo%20Signal%20K.swiftpm.zip
still finding my way around nuances of swift playgrounds .... working on it
success .
looking through the various "files" /packages - to find where/how to point it to my local rpi signalk server...
It's in the "MyApp" file
ah got it
i dont think it matters?
however i have an "app" the one you just sent ...
but also an earlier "app" - the one created when i downloaded the two githib packages
in other words
the two packages are in another "app" ...
but it seems happy
the Demo app has the packages already added
those are specific too each app
interestingly when i "shared" the zip file to "playgrounds" - it adds a new app (as expected)
butt when i open it
I see whilhelmskDummay Guages package has been added (but not the library)
the library is still in the earlier "app" i created
I'm not sure what you mean
oh, it's a dependency
so you don't see it
in the future just add the Dummy library only
yep - just see the dummy pkg - which was auto loaded from the zip file
yep, that's how it should be
ok
assuming i need to add rpi IP address - along with server credentials?
I don't have support for providing credentials yet
so it's read only
make sure you have "Read Only" access turned on in Security Settings for your sk server
noted
….. let host = “https:192.168.0.30” ?
needs the port probably
probably :3000
nope - i have mine set to 80
ok, then not needed
don't forget the slashes
I just added this to the demo app
read only enabled - check
slashes added - check
no data ... hmm
(i know ... i really need to go learn the swift syntax !)
not "https"
duh ... its working.!
yeah!
small steps !
If you download the latest demo app, you'll get that Electrical Overview gauge also
noted the new dummy guage type ...
See in MyApp where you will need to enter in the paths for your server
The Swift stuff is really new too me also, I have been puting it off too long, so I still have a lot to learn too!
yep already all over that 🙂
(& changing units to those used by the rest of the world:)
lol
?
when i select the electrical overview .. it still shows the wind guage in the right side preview window
There's some tabs above that
ah .. found the select button on top of preview panel
And you can edit MyApp, you'll see it commented out there
swift GUI familiarisation needed!
trust me, I did the same thing!
ah yep.
in myapp let guage config is setup for AWA guage
look down at the bottom
yours will look a little different
make yours look like mine, comment out ContentView, an uncomment ElectricalOverViewGauge
ah so i think that it "defaults" to the AWA guage .. untill you uncomment the abve?
yes
so
the config, setup paths etc are all in "myapp" file
and the guage definitions in the resepective files (eg elelctricalOverview) - which is where the graphical layout stuff hapens
right
then that code can be coppied to WilhelmSK
where the config part is handled in WilhelmSK
looking to see if swift has any version type control --- for when i bugger something up and need to go backwards?
I forget, was there an option to attach a github repository when creating an ??
nope
browing thru all the menus - dont find anything
That sucks
i think this might work
process in “working copy” (an IOS app i installed for github interaction)
click and hold the my app button in playgrounds - opens above menu (obviously need “wworking copy” installed first)
cool
looks like “working copy” allows push, fetch, sync etc al
*albeit needs a paid version of the app)
can you elaborate further on the mechanism for
“code can be copied to wsk”
does this add a new guage type? new widget?
.. and if latter …. can a widget be embedded into a wsk layout/page?
It will create a new gauge type
I'll create a new catagory there for "User Contributed Gauges"
They will look and work like any other gauge type in WilhelmSK
ok, next question… how to add “lines” or “connectors” that show electrical connections and/or power flows between boxs in the combo style guage?
.. is this additional code in playgrounds?
yes, I have not gone there yet
I will do it, so don't worry about for now
sorry … if im getting a bit ahead
I should be able to port my objc code over for that pretty easily
i will concentrate on getting “box” layout correct and the sk data into each respectively.. some days of work no doubt!
i will leave you in peace for a bit
I am coding not stop, so.... no wories
🙂
so am i?
clearly
not