Skip to content

Commit

Permalink
Add CI +semver-set:1.0.0+0
Browse files Browse the repository at this point in the history
  • Loading branch information
willson556 committed Jul 23, 2024
1 parent 1d2deb8 commit 55f27e3
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 233 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build_tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and Tag
on:
push:
branches: [master]
pull_request:
jobs:
build-exe:
strategy:
fail-fast: false
matrix:
python-version: [2.7]
os: [windows-latest, macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Determine Version
id: staflversion
uses: StaflSystems/CustomGithubActions/DetermineVersion@main
- name: Display Version
run: |
echo "Version: ${{steps.staflversion.outputs.full}}"
- name: Build Executable
if: runner.os == 'windows'
run: |
pyinstaller --clean example.spec
- name: Build Executable
if: runner.os != 'windows'
run: |
pyinstaller --clean example.spec
cd dist
find . -wholename "*${{ steps.staflversion.outputs.full }}*" -exec sh -c 'mv "$1" "$1_${{ matrix.os }}"' _ {} \;
cd ..
- name: Create a GitHub release
if: github.ref == 'refs/heads/main'
uses: ncipollo/release-action@v1
with:
artifacts: dist/*
tag: ${{ steps.staflversion.outputs.full }}
allowUpdates: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/*.egg-info
/*.egg
/build/
.vscode/
.vscode/
**/__pycache__
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.18
100 changes: 0 additions & 100 deletions .vscode/.ropeproject/config.py

This file was deleted.

Binary file removed .vscode/.ropeproject/objectdb
Binary file not shown.
107 changes: 0 additions & 107 deletions .vscode/launch.json

This file was deleted.

9 changes: 0 additions & 9 deletions .vscode/settings.json

This file was deleted.

55 changes: 39 additions & 16 deletions bin/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,31 @@
'''
import pprint
import time
import signal

from chamberconnectlibrary.watlowf4t import WatlowF4T
from chamberconnectlibrary.watlowf4 import WatlowF4
from chamberconnectlibrary.espec import Espec

LOOP_NAMES = ['Temperature', 'Humidity']

CONTROLLER = Espec(
interface='Serial',
serialport='//./COM10',
baudrate=19200,
loop_names=LOOP_NAMES
)
# CONTROLLER = Espec(
# interface='Serial',
# serialport='//./COM10',
# baudrate=19200,
# loop_names=LOOP_NAMES
# )
# CONTROLLER = WatlowF4(
# interface='RTU',
# serialport='//./COM7',
# baudrate=19200,
# loop_names=LOOP_NAMES
# )
# CONTROLLER = WatlowF4T(
# interface='TCP',
# host='10.30.100.138',
# loop_names=LOOP_NAMES
# )
CONTROLLER = WatlowF4T(
interface='TCP',
host='10.10.1.205',
loop_names=LOOP_NAMES
)
# CONTROLLER = WatlowF4T(
# interface='RTU',
# serialport='//./COM4',
Expand Down Expand Up @@ -57,14 +59,35 @@
# for i in range(8):
# print CONTROLLER.get_event(i+1)

for _ in range(100):
print '\nsample'
running = True



file = open('data.csv', 'w+', 0)
file.write('timestamp,temperature setpoint (C),temperature current (C),humidity setpoint (%RH),humidity current (%RH)\n')

def signal_handler(signal, frame):
global running
running = False

signal.signal(signal.SIGINT, signal_handler)

while running:
stm = time.time()
lookup = {'cascade':[], 'loop':[]}
lookup['loop'].append({'name':'Temperature', 'id': 1, 'number': 1})
lookup['loop'].append({'name':'Humidity', 'id': 2, 'number': 2})
params = {'get_loops':True, 'get_status':True, 'get_alarms':True, 'get_program_status':True, 'get_program_list':True, 'get_refrig':True}
params = {'get_loops':True, 'get_status':True, 'get_alarms':True, 'get_program_status':True, 'get_program_list':False, 'get_refrig':True}
params['get_events'] = [{'N':i+1, 'name':'TS#%d'%(i+1)} for i in range(8)]
smpl = CONTROLLER.sample(lookup, **params)
print("--- %s seconds ---" % (time.time() - stm))
print(smpl)

pprint.pprint(smpl)

if len(smpl['loops']) < 2:
continue

print(",")
file.write("%s,%s,%s,%s,%s\n" % (time.strftime('%Y-%m-%d %H:%M:%S'), smpl['loops'][0]['setpoint']['current'], smpl['loops'][0]['processvalue']['air'], smpl['loops'][1]['setpoint']['current'], smpl['loops'][1]['processvalue']['air']))

file.close()
CONTROLLER.close()
Loading

0 comments on commit 55f27e3

Please sign in to comment.