---
# System prepended metadata

title: '味丹專案的說明:'
tags: [味丹]

---

# 味丹專案的說明:
###### update on 2025/7/12
###### tags: `味丹`

## HW的規格
### Nise3800
CPU : I5 2.3GHz
RAM : 32 GB
OS : windows 10 X64 LTSC 1890

### 小黑
CPU : Celeron J1900 1.99GHz
RAM : 4 GB
OS : windows 10 X64 LTSC 21H2

### Touch
CPU : I5 2.7GHz
RAM : 4 GB
OS : windows 10 X64 LTSC 21H2


## 電力VPM的公式


## 如何跳到別台
### 我們在每一台電腦上有安裝TightVNC, 可在同一個網域下利用TightVNC來

## 程式和Port的分配
### 電力
| 程式名稱 |Port  |執行路徑|程式說明|
| ------  | ------ |--------|--------|
| Power前台| 5000 |D:\\_Project\Power\UI\ |現在是跑新的|
| Power後台| 5101 |D:\\_Project\Power\PowerBackend|新的|
| Power Setting||D:\\_Project\Power\Power_Setting|設定程式|
| 其它|||記得拿掉|

### 酸鹼廠
| 程式名稱 |Port  |執行路徑|程式說明|
| ------  | ------ |--------|--------|
| 前台&小AP| 5000 |C:\\_Project\L1\UI ||
| 後台| 5101 |C:\\_Project\L1\L1_Backend ||
| 輪播秀|  |C:\\_Project\L1\L1_Show ||
| 輪播秀設定|  |C:\\_Project\L1\L1_Carousel ||

### 淀粉廠
| 程式名稱 |Port  |執行路徑|程式說明|
| ------  | ------ |--------|--------|
| 前台| 5000 | ||
| 後台| 5101 | ||
| 小AP|  |放在個人電腦中 |有陳協理/高志文/課長/手工輸入的電腦中|

### 包裝廠
| 程式名稱 |Port  |執行路徑|程式說明|
| ------  | ------ |--------|--------|
| 前台| 5000 | ||
| 後台| 5101 | ||
| 小AP|  | |讓包裝人員輸入|


## IP的分配

| 電腦位置 |原本的IP1  |IP2 |電腦名稱|說明|
| ------  | ------ |-------- |-------- |-------- |
| DB | 192.168.200.12 |  |Nex-DB |DB:PWD Nexaiot|
| | |  | ||
| 電力後台  | 192.168.200.11 |  |P-Power |帳密:vedan06/pw:vedan06|
| 能源後台  | 192.168.200.31 |  | |Enger Server|
| | |  | ||
| 酸鹼廠後台     | 192.168.200.10 |  | |L1 Server|
| 酸鹼廠迎兵     | 192.168.200.51 |  | L1-Welcome |L1 Server|
| | |  | ||
| 包裝廠     | 192.168.200.13 | |J4-Server |J4 Server|
| 精致廠     | 192.168.2001.9 | | |J3 Server|
| | |  | ||
| L2後台     | 192.168.200.14 | |L2-Server ||
| L2稱重     | 192.168.200.52 | |L2-WeightPPC ||
| L2手動輸入  | 192.168.200.55 |pwd:0000 | ||
| L2看板  | 192.168.200.54 | |L2-Welcome ||
| L2小黑  | 192.168.200.8 | |L2-Siemens-PLC |讀PLC data|
| L1 PLC | 192.168.1.1 | |L1-Siemens-PLC |讀PLC Tank data|

### Gateway的安排
| GW Code| GW Name |IP|port|ID| Menu Name|
| ------  | ---- |----- |------ |----- |----|
| PM001  |#N1-214A2 |192.168.200.15 |502 |1 |N1 total之1|
| PM002  |#J1-CP12 |192.168.200.16 |502 |1 |醱酵二廠風車|
| PM003  |#J1-CP13 |192.168.200.16 |502 |2 |醱酵二廠風車|
| PM004  |#L206 |192.168.200.17 |502 |1 |L206-調味料廠|
| PM005  |#J4-MP |192.168.200.18 |502 |1 |J4-包裝廠|
| PM006  |#P2-SH-MCP |192.168.200.19 |502 |1 |Nước Thải Sinh Hoạt |
| PM007  |#P2-1-1500M3 |192.168.200.20 |502 |1 |Hệ thống số 02|
| PM008  |#P2-1-1800M3 |192.168.200.20 |502 |2 |Hệ thống số 01 |
| PM009  |#P2-1-3000M3 |192.168.200.20 |502 |3 |Hệ thống số 03|
| PM010  |#K2K3-PA |192.168.200.22 |502 |1 |K2/K3-機工儀電處|
| PM011  |#P2-3-MCP-1 |192.168.200.23 |502 |1 |Hệ thống số 08|
| PM012  |#P2-2-TOTAL |192.168.200.24 |502 |1 |Khu 2|
| PM015  |#P2-2-3500M3 |192.168.200.24 |502 |2 |Hệ thống số 07|
| PM013  |#P2-2-UASB |192.168.200.24 |502 |3 |Hệ thống số 04|
| PM014  |#P2-2-caocap2 |192.168.1.24 |502 |4 |Hệ thống số 06|
| PM016  |#P2-2-NITO |192.168.200.24 |502 |5 |Hệ thống số 05|
| PM017  |#K105-Gach |192.168.200.25 |502 |1 |K105-免燒磚|
| PM018  |#L207-PBGF1 |192.168.200.26 |502 |1 |預糊化|
| PM019  |#L207-PBGF2 |192.168.200.26 |502 |2 |預糊化|
| PM020  |#L406-MDB |192.168.200.27 |502 |1 |L208-麥芽糖2廠|
| PM021  |#L2-S-P-1A |192.168.200.28 |502 |1 |L208-麥芽糖1廠|
| PM022  |#L2-S-P-3A |192.168.200.28 |502 |2 |L209-米蛋白廠|
| PM023  |#L1-BITAC1-AC |192.168.200.29 |502 |1 |BITAC1-AC|
| PM024  |#L1-BITAC2-AC |192.168.200.29 |502 |2 |BITAC2-AC|
| PM025  |#E1+K2K3 |192.168.200.30 |502 |1 |E1+K2K3|
| PM026  |#12KV-111 |192.168.200.21 |2001 |1 |A6|
| PM027  |#12KV-110 |192.168.200.21 |2001 |2 |N1 total之1|
| PM028  |#12KV-108 |192.168.200.21 |2001 |3 |K4-II-固體碼頭|
| PM029  |#12KV-107 |192.168.200.21 |2001 |4 |Khu Bồn|
| PM030  |#12KV-106 |192.168.200.21 |2001 |5 |A-行政區|
| PM031  |#12KV-105 |192.168.200.21 |2001 |6 |澱粉|
| PM032  |#12KV-104 |192.168.200.21 |2001 |7 |J1 total之1|
| PM033  |#12KV-103 |192.168.200.21 |2001 |8 |J1 total之1|
| PM034  |#12KV-214 |192.168.200.21 |2002 |1 |小鍋爐|
| PM035  |#12KV-213 |192.168.200.21 |2002 |2 |液體碼頭|
| PM036  |#12KV-210 |192.168.200.21 |2002 |3 |Hồ 60000 M3|
| PM037  |#12KV-209 |192.168.200.21 |2002 |4 ||
| PM038  |#12KV-208 |192.168.200.21 |2002 |5 |TG1 Tự dùng|
| PM039  |#12KV-206 |192.168.200.21 |2002 |6 ||
| PM040  |#12KV-205 |192.168.200.21 |2002 |7 ||
| PM041  |#12KV-204 |192.168.200.21 |2002 |8 |Lò Hơi Nhỏ|
| PM042  |#12KV-203 |192.168.200.21 |2002 |9 |K4-I-液體碼頭|
| PM043  |#12KV-201 |192.168.200.21 |2002 |10|Trạm 110KV Tự dụng|
| PM044  |#12KV-303 |192.168.200.21 |2003 |1 |DCM-DC|
| PM045  |#12KV-304 |192.168.200.21 |2003 |2 |DCM-AC|
| PM046  |#12KV-604 |192.168.200.21 |2003 |3 |Bitac1-AC|
| PM047  |#12KV-809 |192.168.200.21 |2003 |4 |Khu 1 |
| PM048  |#12KV-808 |192.168.200.21 |2003 |5 |Bitac3-AC|
| PM049  |#12KV-801 |192.168.200.21 |2003 |6 |Bitac3-DC|
| PM050  |#12KV-601 |192.168.200.21 |2004 |1 |bitac1-DC|
| PM051  |#12KV-603 |192.168.2001.21 |2004 |2 |bitac2-DC|
| PM052  |#12KV-709 |192.168.200.21 |2004 |3 ||
| PM053  |#12KV-707 |192.168.200.21 |2004 |4 |N3-固肥廠5-8套|
| PM054  |#12KV-706 |192.168.200.21 |2004 |5 |
| PM055  |#12KV-705 |192.168.200.21 |2004 |6 |
| PM056  |#12KV-704 |192.168.200.21 |2004 |7 |
| PM057  |#12KV-703 |192.168.200.21 |2004 |8 |
| PM058  |#12KV-702 |192.168.200.21 |2004 |9 |N3-固肥廠1-4套
| PM059  |#12KV-701 |192.168.200.21 |2004 |10|
| VPM001 |J1-214 | | |||
  | VPM002 |J1-TOTAL | || |J1-醱酵一廠|
  | VPM003 |N1-110 | | |||
  | VPM004 |N1-TOTAL | || |N1-醱酵二廠|
  | VPM005 |J2-1-TOTAL || | ||
  | VPM006 |J2-2-TOTAL || | ||
  | VPM007 |J2_TOTAL | || |J2-回收廠|
  | VPM008 |J3-206 | | |||
  | VPM009 |J3-TOTAL | || ||
  | VPM010 |L1-TOTAL | || |L1-酸鹼廠|
  | VPM011 |L1_DCM | || |DCM|
  | VPM012 |L1_BITAC1 || | |BITAC-1|
  | VPM013 |L1_BITAC2 || | |BITAC-2|
  | VPM014 |L1_BITAC3 || | |BITAC-3|
  | VPM015 |L207-PBGH1_2| | | |L207-預糊化廠|
  | VPM016 |L2-bien tinh| | | |L205-變性澱粉廠|
  | VPM017 |P2_TOTAL || | |P2-汙水處理廠|
  | VPM018 |M1-701 | || |M1-PGA廠|
  | VPM019 |K4-108 | | |||
  | VPM020 |K1-210 | | |||
  | VPM021 |MSG | | |||
  | VPM022 |L2_Total | | |||
  | VPM023 |N3_TOTAL | | ||N3-固肥廠|
  | VPM024 |E1_TOTAL | | ||E1-實驗工廠|
  | VPM025 |B2_TOTAL | | ||B2-味精|
  | VPM026 |B3_TOTAL | | ||B3-澱粉|
  | VPM027 |B4_TOTAL | | |B4-特化|
  | VPM028 |OTHER_TOTAL | | ||Other_Total|
  | VPM029 |P-TongXuong| | ||P-TongXuong



---

## 資料庫的connect string

PostSQL:
```
User: postgres PW: Nexaiot
```

電力廠: 
```
"PostgreSQLConnection": "Server=192.168.200.12;Port=5432;Database=Power;User Id=Power_Owner;Password=Nexaiot"
```
J3廠: 
```
"PostgreSQLConnection": "Server=192.168.200.12;Port=5432;Username=Package_Owner;Password=Nexaiot;Database=Package"
```
淀粉廠:
```
"PostSQL": "Server=192.168.200.12;Port=5432;Username=L2_Owner;Password=Nexaiot;Database=L2",
```
酸鹼廠:
```
"ConnectString": "data source=.\\SQLExpress;initial catalog=L1;integrated security=true;",
```


## 資料庫的Data Schema
### 包裝廠 (Package)

```
CREATE TABLE IF NOT EXISTS public.j4product
(
    lotno text COLLATE pg_catalog."default" NOT NULL,
    j3time timestamp with time zone NOT NULL,
    rrdline text COLLATE pg_catalog."default" NOT NULL,
    j4time timestamp with time zone NOT NULL,
    shift text COLLATE pg_catalog."default" NOT NULL,
    size text COLLATE pg_catalog."default" NOT NULL,
    gross double precision NOT NULL,
    tare double precision NOT NULL,
    net double precision NOT NULL,
    machineno integer,
    unit text COLLATE pg_catalog."default",
    wrkline text COLLATE pg_catalog."default",
    phanloai text COLLATE pg_catalog."default",
    gate text COLLATE pg_catalog."default",
    vedantime timestamp with time zone NOT NULL,
    CONSTRAINT pk_j4product PRIMARY KEY (j3time, lotno)
)
```
### L2
#### OrderInfo
```
CREATE TABLE IF NOT EXISTS public."OrderInfo"
(
    ordername text COLLATE pg_catalog."default" NOT NULL,
    productid text COLLATE pg_catalog."default" NOT NULL,
    line text COLLATE pg_catalog."default" NOT NULL,
    sapid text COLLATE pg_catalog."default",
    productname text COLLATE pg_catalog."default",
    starttime timestamp without time zone NOT NULL,
    finishedtime timestamp without time zone,
    planweight integer,
    plantime double precision,
    firstpackagetime timestamp without time zone,
    endpackagetime timestamp without time zone,
    firststeam double precision,
    endsteam double precision,
    bfinished boolean,
    weight double precision,
    CONSTRAINT orderinfo_pkey PRIMARY KEY (starttime, ordername, productid, line)
)
```
#### ProductID
```
CREATE TABLE IF NOT EXISTS public."ProductID"
(
    productid text COLLATE pg_catalog."default" NOT NULL,
    sapid text COLLATE pg_catalog."default" NOT NULL,
    productname text COLLATE pg_catalog."default" NOT NULL,
    c_desc text COLLATE pg_catalog."default" NOT NULL,
    v_desc text COLLATE pg_catalog."default" NOT NULL,
    weight real NOT NULL,
    type_name text COLLATE pg_catalog."default",
    code text COLLATE pg_catalog."default",
    CONSTRAINT productid_pkey PRIMARY KEY (productid)
)
```

#### Steam
```
CREATE TABLE IF NOT EXISTS public."Steam"
(
    triggertime timestamp without time zone NOT NULL,
    line text COLLATE pg_catalog."default" NOT NULL,
    fq double precision,
    CONSTRAINT steam_pkey PRIMARY KEY (triggertime, line)
)
```
#### package
```
CREATE TABLE IF NOT EXISTS public."package"
(
    triggertime timestamp without time zone NOT NULL,
    ordername text COLLATE pg_catalog."default" NOT NULL,
    productid text COLLATE pg_catalog."default" NOT NULL,
    productline text COLLATE pg_catalog."default",
    productname text COLLATE pg_catalog."default" NOT NULL,
    sapid text COLLATE pg_catalog."default" NOT NULL,
    weight double precision NOT NULL,
    lonumber integer,
    madeby text COLLATE pg_catalog."default",
    vedantime timestamp without time zone NOT NULL,
    remark character varying(50) COLLATE pg_catalog."default",
    CONSTRAINT package_pkey PRIMARY KEY (triggertime, ordername)
)
```
## Power
### meter_alert
```
CREATE TABLE IF NOT EXISTS public.meter_alert
(
    "timestamp" timestamp without time zone NOT NULL,
    devicename character varying(20) COLLATE pg_catalog."default" NOT NULL,
    alertdesc character varying(50) COLLATE pg_catalog."default",
    CONSTRAINT pk_meter_alert PRIMARY KEY ("timestamp", devicename)
)
```

### meter_day
```
CREATE TABLE IF NOT EXISTS public.meter_day
(
    vedantime timestamp without time zone NOT NULL,
    devicename character varying(20) COLLATE pg_catalog."default" NOT NULL,
    peak character varying(1) COLLATE pg_catalog."default" NOT NULL,
    kwh integer,
    usedkwh integer,
    CONSTRAINT pk_meter_day PRIMARY KEY (vedantime, devicename, peak)
)
```

### meter_hour
```
CREATE TABLE IF NOT EXISTS public.meter_hour
(
    triggertime timestamp without time zone NOT NULL,
    vedantime timestamp without time zone NOT NULL,
    devicename character varying(20) COLLATE pg_catalog."default" NOT NULL,
    peak character varying(1) COLLATE pg_catalog."default" NOT NULL,
    maxkw double precision,
    kwh integer,
    usedkwh integer,
    vavg double precision,
    iavg double precision,
    pf double precision,
    errorcode integer,
    CONSTRAINT pk_meter_hour PRIMARY KEY (triggertime, devicename, peak)
)
```

### meter_min
```
CREATE TABLE IF NOT EXISTS public.meter_min
(
    triggertime timestamp without time zone NOT NULL,
    devicename character varying(20) COLLATE pg_catalog."default" NOT NULL,
    peak character varying(1) COLLATE pg_catalog."default",
    vavg double precision,
    iavg double precision,
    pin double precision,
    kw double precision,
    qsum double precision,
    ssum double precision,
    pf double precision,
    kwh integer,
    vab double precision,
    vbc double precision,
    vca double precision,
    ia double precision,
    ib double precision,
    ic double precision,
    error_code integer,
    CONSTRAINT pk_meter_min PRIMARY KEY (triggertime, devicename)
)
```

### meter_month
```
CREATE TABLE IF NOT EXISTS public.meter_month
(
    vedantime timestamp without time zone NOT NULL,
    devicename character varying(20) COLLATE pg_catalog."default" NOT NULL,
    kwh integer,
    usedkwh integer,
    CONSTRAINT pk_meter_month PRIMARY KEY (vedantime, devicename)
)
```

## EMS
### energy
```
CREATE TABLE IF NOT EXISTS public.energy
(
    "timestamp" timestamp without time zone NOT NULL,
    factory text COLLATE pg_catalog."default" NOT NULL,
    product double precision,
    used_kwh double precision,
    unit double precision,
    critical double precision,
    CONSTRAINT pk_energy PRIMARY KEY ("timestamp", factory)
)
```

### energy_critical_value
```
CREATE TABLE IF NOT EXISTS public.energy_critical_value
(
    factory text COLLATE pg_catalog."default" NOT NULL,
    f_type text COLLATE pg_catalog."default" NOT NULL,
    f_value double precision
)
```

## 小AP的功能做用
### 電力廠的設定AP
![PowerSetting](https://hackmd.io/_uploads/HkMYMP1Ule.jpg)

### 淀粉廠的AP

### 包裝廠的AP

### EMS的ap

### L1的AP


## History
### 20250321
Billy 想要我們提供一頁專門做電力節省的頁面，所以我必需要加
VPM002VPM004/VPM007VPM009/PM005/PM004/VPM010VPM023/VPM018VPM017/PM030PM036/PM010PM042/PM028/VPM024 這些電表的資料去做運算，如式如下:
![PowerSave](https://hackmd.io/_uploads/r1QtPrqhkl.png)




